togai_client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +61 -0
  4. data/Rakefile +10 -0
  5. data/docs/Account.md +24 -0
  6. data/docs/AccountAliases.md +20 -0
  7. data/docs/AccountPaginatedResponse.md +22 -0
  8. data/docs/AccountsApi.md +595 -0
  9. data/docs/AddAccountAliasesRequest.md +18 -0
  10. data/docs/AssociatePricePlanRequest.md +24 -0
  11. data/docs/AssociatePricePlanResponse.md +22 -0
  12. data/docs/BaseSuccessResponse.md +18 -0
  13. data/docs/BundleStrategy.md +24 -0
  14. data/docs/BundleStrategyUsageMetersValue.md +18 -0
  15. data/docs/Computation.md +31 -0
  16. data/docs/CreateAccountRequest.md +22 -0
  17. data/docs/CreateCustomerRequest.md +26 -0
  18. data/docs/CreateCustomerResponse.md +26 -0
  19. data/docs/CreateEventSchemaRequest.md +24 -0
  20. data/docs/CreatePricePlanRequest.md +24 -0
  21. data/docs/CreateUsageMeterRequest.md +26 -0
  22. data/docs/Customer.md +30 -0
  23. data/docs/CustomerPaginatedResponse.md +22 -0
  24. data/docs/CustomersApi.md +363 -0
  25. data/docs/DimensionsSchema.md +18 -0
  26. data/docs/ErrorResponse.md +18 -0
  27. data/docs/Event.md +28 -0
  28. data/docs/EventAttribute.md +22 -0
  29. data/docs/EventAttributeSchema.md +20 -0
  30. data/docs/EventIngestionApi.md +146 -0
  31. data/docs/EventManagementApi.md +159 -0
  32. data/docs/EventPipelineInfo.md +26 -0
  33. data/docs/EventPipelineInfoAccount.md +20 -0
  34. data/docs/EventPipelineInfoCustomer.md +20 -0
  35. data/docs/EventPipelineInfoEventSchema.md +20 -0
  36. data/docs/EventPipelineInfoPricePlansInner.md +26 -0
  37. data/docs/EventPipelineInfoUsageMetersInner.md +24 -0
  38. data/docs/EventSchema.md +32 -0
  39. data/docs/EventSchemaListData.md +34 -0
  40. data/docs/EventSchemaListDataAllOf.md +18 -0
  41. data/docs/EventSchemaListPaginatedResponse.md +22 -0
  42. data/docs/EventSchemaVersionsResponse.md +18 -0
  43. data/docs/EventSchemasApi.md +581 -0
  44. data/docs/EventWithStatus.md +20 -0
  45. data/docs/EventWithStatusAndEventPipelineInfo.md +22 -0
  46. data/docs/EventWithStatusAndEventPipelineInfoAllOf.md +18 -0
  47. data/docs/GetEventResponse.md +18 -0
  48. data/docs/GetEventsResponse.md +20 -0
  49. data/docs/GetMetricsRequest.md +22 -0
  50. data/docs/GetMetricsResponse.md +18 -0
  51. data/docs/IngestBatchEventRequest.md +18 -0
  52. data/docs/IngestBatchEventResponse.md +18 -0
  53. data/docs/IngestError.md +20 -0
  54. data/docs/IngestEventRequest.md +18 -0
  55. data/docs/IngestEventResponse.md +18 -0
  56. data/docs/IngestionStatus.md +20 -0
  57. data/docs/MetricDataPoints.md +22 -0
  58. data/docs/MetricDataPointsGroupedBy.md +20 -0
  59. data/docs/MetricName.md +15 -0
  60. data/docs/MetricQuery.md +26 -0
  61. data/docs/MetricQueryFilterEntry.md +20 -0
  62. data/docs/MetricQueryResponse.md +22 -0
  63. data/docs/MetricsApi.md +79 -0
  64. data/docs/PaginationOptions.md +20 -0
  65. data/docs/PlanOverride.md +24 -0
  66. data/docs/PricePlan.md +26 -0
  67. data/docs/PricePlanListData.md +32 -0
  68. data/docs/PricePlanPaginatedResponse.md +22 -0
  69. data/docs/PricePlansApi.md +363 -0
  70. data/docs/PricingCycle.md +24 -0
  71. data/docs/PricingCycleStartOffset.md +20 -0
  72. data/docs/PricingSchedule.md +22 -0
  73. data/docs/RateCard.md +22 -0
  74. data/docs/RateCardBundle.md +22 -0
  75. data/docs/RateCardUsageValue.md +24 -0
  76. data/docs/RemoveAccountAliasesRequest.md +18 -0
  77. data/docs/SignupRequest.md +22 -0
  78. data/docs/SignupResponse.md +20 -0
  79. data/docs/StatusResponse.md +24 -0
  80. data/docs/StatusResponseHeaders.md +18 -0
  81. data/docs/UpdateAccountRequest.md +18 -0
  82. data/docs/UpdateCustomerRequest.md +22 -0
  83. data/docs/UpdateEventSchemaRequest.md +22 -0
  84. data/docs/UpdatePricePlanRequest.md +22 -0
  85. data/docs/UpdateUsageMeterRequest.md +24 -0
  86. data/docs/UsageMeter.md +34 -0
  87. data/docs/UsageMeterPaginatedResponse.md +22 -0
  88. data/docs/UsageMetersApi.md +521 -0
  89. data/docs/UsageStrategy.md +22 -0
  90. data/docs/UserDetails.md +26 -0
  91. data/git_push.sh +57 -0
  92. data/lib/togai_client/api/accounts_api.rb +679 -0
  93. data/lib/togai_client/api/customers_api.rb +365 -0
  94. data/lib/togai_client/api/event_ingestion_api.rb +158 -0
  95. data/lib/togai_client/api/event_management_api.rb +164 -0
  96. data/lib/togai_client/api/event_schemas_api.rb +579 -0
  97. data/lib/togai_client/api/metrics_api.rb +86 -0
  98. data/lib/togai_client/api/price_plans_api.rb +365 -0
  99. data/lib/togai_client/api/usage_meters_api.rb +572 -0
  100. data/lib/togai_client/api_client.rb +392 -0
  101. data/lib/togai_client/api_error.rb +57 -0
  102. data/lib/togai_client/configuration.rb +287 -0
  103. data/lib/togai_client/models/account.rb +373 -0
  104. data/lib/togai_client/models/account_aliases.rb +277 -0
  105. data/lib/togai_client/models/account_paginated_response.rb +239 -0
  106. data/lib/togai_client/models/add_account_aliases_request.rb +247 -0
  107. data/lib/togai_client/models/associate_price_plan_request.rb +274 -0
  108. data/lib/togai_client/models/associate_price_plan_response.rb +275 -0
  109. data/lib/togai_client/models/base_success_response.rb +224 -0
  110. data/lib/togai_client/models/bundle_strategy.rb +325 -0
  111. data/lib/togai_client/models/bundle_strategy_usage_meters_value.rb +224 -0
  112. data/lib/togai_client/models/computation.rb +294 -0
  113. data/lib/togai_client/models/create_account_request.rb +324 -0
  114. data/lib/togai_client/models/create_customer_request.rb +374 -0
  115. data/lib/togai_client/models/create_customer_response.rb +373 -0
  116. data/lib/togai_client/models/create_event_schema_request.rb +351 -0
  117. data/lib/togai_client/models/create_price_plan_request.rb +298 -0
  118. data/lib/togai_client/models/create_usage_meter_request.rb +368 -0
  119. data/lib/togai_client/models/customer.rb +442 -0
  120. data/lib/togai_client/models/customer_paginated_response.rb +239 -0
  121. data/lib/togai_client/models/dimensions_schema.rb +256 -0
  122. data/lib/togai_client/models/error_response.rb +244 -0
  123. data/lib/togai_client/models/event.rb +379 -0
  124. data/lib/togai_client/models/event_attribute.rb +304 -0
  125. data/lib/togai_client/models/event_attribute_schema.rb +281 -0
  126. data/lib/togai_client/models/event_pipeline_info.rb +260 -0
  127. data/lib/togai_client/models/event_pipeline_info_account.rb +238 -0
  128. data/lib/togai_client/models/event_pipeline_info_customer.rb +238 -0
  129. data/lib/togai_client/models/event_pipeline_info_event_schema.rb +238 -0
  130. data/lib/togai_client/models/event_pipeline_info_price_plans_inner.rb +283 -0
  131. data/lib/togai_client/models/event_pipeline_info_usage_meters_inner.rb +295 -0
  132. data/lib/togai_client/models/event_schema.rb +438 -0
  133. data/lib/togai_client/models/event_schema_list_data.rb +456 -0
  134. data/lib/togai_client/models/event_schema_list_data_all_of.rb +221 -0
  135. data/lib/togai_client/models/event_schema_list_paginated_response.rb +239 -0
  136. data/lib/togai_client/models/event_schema_versions_response.rb +227 -0
  137. data/lib/togai_client/models/event_with_status.rb +239 -0
  138. data/lib/togai_client/models/event_with_status_and_event_pipeline_info.rb +255 -0
  139. data/lib/togai_client/models/event_with_status_and_event_pipeline_info_all_of.rb +219 -0
  140. data/lib/togai_client/models/get_event_response.rb +222 -0
  141. data/lib/togai_client/models/get_events_response.rb +279 -0
  142. data/lib/togai_client/models/get_metrics_request.rb +265 -0
  143. data/lib/togai_client/models/get_metrics_response.rb +227 -0
  144. data/lib/togai_client/models/ingest_batch_event_request.rb +255 -0
  145. data/lib/togai_client/models/ingest_batch_event_response.rb +245 -0
  146. data/lib/togai_client/models/ingest_error.rb +229 -0
  147. data/lib/togai_client/models/ingest_event_request.rb +220 -0
  148. data/lib/togai_client/models/ingest_event_response.rb +244 -0
  149. data/lib/togai_client/models/ingestion_status.rb +284 -0
  150. data/lib/togai_client/models/metric_data_points.rb +289 -0
  151. data/lib/togai_client/models/metric_data_points_grouped_by.rb +238 -0
  152. data/lib/togai_client/models/metric_name.rb +38 -0
  153. data/lib/togai_client/models/metric_query.rb +331 -0
  154. data/lib/togai_client/models/metric_query_filter_entry.rb +241 -0
  155. data/lib/togai_client/models/metric_query_response.rb +255 -0
  156. data/lib/togai_client/models/pagination_options.rb +262 -0
  157. data/lib/togai_client/models/plan_override.rb +262 -0
  158. data/lib/togai_client/models/price_plan.rb +349 -0
  159. data/lib/togai_client/models/price_plan_list_data.rb +393 -0
  160. data/lib/togai_client/models/price_plan_paginated_response.rb +239 -0
  161. data/lib/togai_client/models/pricing_cycle.rb +313 -0
  162. data/lib/togai_client/models/pricing_cycle_start_offset.rb +241 -0
  163. data/lib/togai_client/models/pricing_schedule.rb +248 -0
  164. data/lib/togai_client/models/rate_card.rb +279 -0
  165. data/lib/togai_client/models/rate_card_bundle.rb +328 -0
  166. data/lib/togai_client/models/rate_card_usage_value.rb +343 -0
  167. data/lib/togai_client/models/remove_account_aliases_request.rb +247 -0
  168. data/lib/togai_client/models/signup_request.rb +293 -0
  169. data/lib/togai_client/models/signup_response.rb +260 -0
  170. data/lib/togai_client/models/status_response.rb +246 -0
  171. data/lib/togai_client/models/status_response_headers.rb +219 -0
  172. data/lib/togai_client/models/update_account_request.rb +245 -0
  173. data/lib/togai_client/models/update_customer_request.rb +304 -0
  174. data/lib/togai_client/models/update_event_schema_request.rb +306 -0
  175. data/lib/togai_client/models/update_price_plan_request.rb +254 -0
  176. data/lib/togai_client/models/update_usage_meter_request.rb +323 -0
  177. data/lib/togai_client/models/usage_meter.rb +440 -0
  178. data/lib/togai_client/models/usage_meter_paginated_response.rb +239 -0
  179. data/lib/togai_client/models/usage_strategy.rb +281 -0
  180. data/lib/togai_client/models/user_details.rb +380 -0
  181. data/lib/togai_client/version.rb +15 -0
  182. data/lib/togai_client.rb +125 -0
  183. data/spec/api_client_spec.rb +226 -0
  184. data/spec/configuration_spec.rb +42 -0
  185. data/spec/spec_helper.rb +111 -0
  186. data/togai_client.gemspec +38 -0
  187. metadata +271 -0
@@ -0,0 +1,374 @@
1
+ =begin
2
+ #Togai Apis
3
+
4
+ #APIs for Togai App
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: engg@togai.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.1.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TogaiClient
17
+ # Payload to create customer
18
+ class CreateCustomerRequest
19
+ # Customer identifier
20
+ attr_accessor :id
21
+
22
+ # Name of the customer
23
+ attr_accessor :name
24
+
25
+ # Primary email of the customer
26
+ attr_accessor :primary_email
27
+
28
+ # billing address of the customer
29
+ attr_accessor :billing_address
30
+
31
+ attr_accessor :account
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'id' => :'id',
37
+ :'name' => :'name',
38
+ :'primary_email' => :'primaryEmail',
39
+ :'billing_address' => :'billingAddress',
40
+ :'account' => :'account'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'id' => :'String',
53
+ :'name' => :'String',
54
+ :'primary_email' => :'String',
55
+ :'billing_address' => :'String',
56
+ :'account' => :'CreateAccountRequest'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TogaiClient::CreateCustomerRequest` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TogaiClient::CreateCustomerRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'id')
82
+ self.id = attributes[:'id']
83
+ end
84
+
85
+ if attributes.key?(:'name')
86
+ self.name = attributes[:'name']
87
+ end
88
+
89
+ if attributes.key?(:'primary_email')
90
+ self.primary_email = attributes[:'primary_email']
91
+ end
92
+
93
+ if attributes.key?(:'billing_address')
94
+ self.billing_address = attributes[:'billing_address']
95
+ end
96
+
97
+ if attributes.key?(:'account')
98
+ self.account = attributes[:'account']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ if @id.nil?
107
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
108
+ end
109
+
110
+ if @id.to_s.length > 50
111
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 50.')
112
+ end
113
+
114
+ if @name.nil?
115
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
116
+ end
117
+
118
+ if @name.to_s.length > 255
119
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
120
+ end
121
+
122
+ if @name.to_s.length < 3
123
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 3.')
124
+ end
125
+
126
+ if @primary_email.nil?
127
+ invalid_properties.push('invalid value for "primary_email", primary_email cannot be nil.')
128
+ end
129
+
130
+ if @primary_email.to_s.length > 255
131
+ invalid_properties.push('invalid value for "primary_email", the character length must be smaller than or equal to 255.')
132
+ end
133
+
134
+ if @billing_address.nil?
135
+ invalid_properties.push('invalid value for "billing_address", billing_address cannot be nil.')
136
+ end
137
+
138
+ if @billing_address.to_s.length > 1000
139
+ invalid_properties.push('invalid value for "billing_address", the character length must be smaller than or equal to 1000.')
140
+ end
141
+
142
+ if @billing_address.to_s.length < 50
143
+ invalid_properties.push('invalid value for "billing_address", the character length must be great than or equal to 50.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ return false if @id.nil?
153
+ return false if @id.to_s.length > 50
154
+ return false if @name.nil?
155
+ return false if @name.to_s.length > 255
156
+ return false if @name.to_s.length < 3
157
+ return false if @primary_email.nil?
158
+ return false if @primary_email.to_s.length > 255
159
+ return false if @billing_address.nil?
160
+ return false if @billing_address.to_s.length > 1000
161
+ return false if @billing_address.to_s.length < 50
162
+ true
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] id Value to be assigned
167
+ def id=(id)
168
+ if id.nil?
169
+ fail ArgumentError, 'id cannot be nil'
170
+ end
171
+
172
+ if id.to_s.length > 50
173
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 50.'
174
+ end
175
+
176
+ @id = id
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] name Value to be assigned
181
+ def name=(name)
182
+ if name.nil?
183
+ fail ArgumentError, 'name cannot be nil'
184
+ end
185
+
186
+ if name.to_s.length > 255
187
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
188
+ end
189
+
190
+ if name.to_s.length < 3
191
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 3.'
192
+ end
193
+
194
+ @name = name
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] primary_email Value to be assigned
199
+ def primary_email=(primary_email)
200
+ if primary_email.nil?
201
+ fail ArgumentError, 'primary_email cannot be nil'
202
+ end
203
+
204
+ if primary_email.to_s.length > 255
205
+ fail ArgumentError, 'invalid value for "primary_email", the character length must be smaller than or equal to 255.'
206
+ end
207
+
208
+ @primary_email = primary_email
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] billing_address Value to be assigned
213
+ def billing_address=(billing_address)
214
+ if billing_address.nil?
215
+ fail ArgumentError, 'billing_address cannot be nil'
216
+ end
217
+
218
+ if billing_address.to_s.length > 1000
219
+ fail ArgumentError, 'invalid value for "billing_address", the character length must be smaller than or equal to 1000.'
220
+ end
221
+
222
+ if billing_address.to_s.length < 50
223
+ fail ArgumentError, 'invalid value for "billing_address", the character length must be great than or equal to 50.'
224
+ end
225
+
226
+ @billing_address = billing_address
227
+ end
228
+
229
+ # Checks equality by comparing each attribute.
230
+ # @param [Object] Object to be compared
231
+ def ==(o)
232
+ return true if self.equal?(o)
233
+ self.class == o.class &&
234
+ id == o.id &&
235
+ name == o.name &&
236
+ primary_email == o.primary_email &&
237
+ billing_address == o.billing_address &&
238
+ account == o.account
239
+ end
240
+
241
+ # @see the `==` method
242
+ # @param [Object] Object to be compared
243
+ def eql?(o)
244
+ self == o
245
+ end
246
+
247
+ # Calculates hash code according to all attributes.
248
+ # @return [Integer] Hash code
249
+ def hash
250
+ [id, name, primary_email, billing_address, account].hash
251
+ end
252
+
253
+ # Builds the object from hash
254
+ # @param [Hash] attributes Model attributes in the form of hash
255
+ # @return [Object] Returns the model itself
256
+ def self.build_from_hash(attributes)
257
+ new.build_from_hash(attributes)
258
+ end
259
+
260
+ # Builds the object from hash
261
+ # @param [Hash] attributes Model attributes in the form of hash
262
+ # @return [Object] Returns the model itself
263
+ def build_from_hash(attributes)
264
+ return nil unless attributes.is_a?(Hash)
265
+ attributes = attributes.transform_keys(&:to_sym)
266
+ self.class.openapi_types.each_pair do |key, type|
267
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
268
+ self.send("#{key}=", nil)
269
+ elsif type =~ /\AArray<(.*)>/i
270
+ # check to ensure the input is an array given that the attribute
271
+ # is documented as an array but the input is not
272
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
273
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
274
+ end
275
+ elsif !attributes[self.class.attribute_map[key]].nil?
276
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
277
+ end
278
+ end
279
+
280
+ self
281
+ end
282
+
283
+ # Deserializes the data based on type
284
+ # @param string type Data type
285
+ # @param string value Value to be deserialized
286
+ # @return [Object] Deserialized data
287
+ def _deserialize(type, value)
288
+ case type.to_sym
289
+ when :Time
290
+ Time.parse(value)
291
+ when :Date
292
+ Date.parse(value)
293
+ when :String
294
+ value.to_s
295
+ when :Integer
296
+ value.to_i
297
+ when :Float
298
+ value.to_f
299
+ when :Boolean
300
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
301
+ true
302
+ else
303
+ false
304
+ end
305
+ when :Object
306
+ # generic object (usually a Hash), return directly
307
+ value
308
+ when /\AArray<(?<inner_type>.+)>\z/
309
+ inner_type = Regexp.last_match[:inner_type]
310
+ value.map { |v| _deserialize(inner_type, v) }
311
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
312
+ k_type = Regexp.last_match[:k_type]
313
+ v_type = Regexp.last_match[:v_type]
314
+ {}.tap do |hash|
315
+ value.each do |k, v|
316
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
317
+ end
318
+ end
319
+ else # model
320
+ # models (e.g. Pet) or oneOf
321
+ klass = TogaiClient.const_get(type)
322
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
323
+ end
324
+ end
325
+
326
+ # Returns the string representation of the object
327
+ # @return [String] String presentation of the object
328
+ def to_s
329
+ to_hash.to_s
330
+ end
331
+
332
+ # to_body is an alias to to_hash (backward compatibility)
333
+ # @return [Hash] Returns the object in the form of hash
334
+ def to_body
335
+ to_hash
336
+ end
337
+
338
+ # Returns the object in the form of hash
339
+ # @return [Hash] Returns the object in the form of hash
340
+ def to_hash
341
+ hash = {}
342
+ self.class.attribute_map.each_pair do |attr, param|
343
+ value = self.send(attr)
344
+ if value.nil?
345
+ is_nullable = self.class.openapi_nullable.include?(attr)
346
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
347
+ end
348
+
349
+ hash[param] = _to_hash(value)
350
+ end
351
+ hash
352
+ end
353
+
354
+ # Outputs non-array value in the form of hash
355
+ # For object, use to_hash. Otherwise, just return the value
356
+ # @param [Object] value Any valid value
357
+ # @return [Hash] Returns the value in the form of hash
358
+ def _to_hash(value)
359
+ if value.is_a?(Array)
360
+ value.compact.map { |v| _to_hash(v) }
361
+ elsif value.is_a?(Hash)
362
+ {}.tap do |hash|
363
+ value.each { |k, v| hash[k] = _to_hash(v) }
364
+ end
365
+ elsif value.respond_to? :to_hash
366
+ value.to_hash
367
+ else
368
+ value
369
+ end
370
+ end
371
+
372
+ end
373
+
374
+ end