ultracart_api 4.1.80 → 4.1.83

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -2
  3. data/docs/AgentSummary.md +30 -0
  4. data/docs/AutoOrderItemCancelRequest.md +3 -1
  5. data/docs/ConversationAgentCallEvent.md +30 -0
  6. data/docs/ConversationAgentChatEvent.md +26 -0
  7. data/docs/ConversationAgentStatusConfig.md +42 -0
  8. data/docs/ConversationAgentStatusConfigResponse.md +26 -0
  9. data/docs/ConversationAgentStatusConfigsResponse.md +26 -0
  10. data/docs/ConversationAgentStatusEvent.md +50 -0
  11. data/docs/ConversationAgentStatusHeatmapRequest.md +24 -0
  12. data/docs/ConversationAgentStatusHeatmapResponse.md +30 -0
  13. data/docs/ConversationAgentStatusHistorySearchRequest.md +28 -0
  14. data/docs/ConversationAgentStatusHistorySearchResponse.md +28 -0
  15. data/docs/ConversationAgentStatusRollup.md +38 -0
  16. data/docs/ConversationAgentStatusRollupSearchRequest.md +24 -0
  17. data/docs/ConversationAgentStatusRollupSearchResponse.md +26 -0
  18. data/docs/ConversationAgentStatusSummaryResponse.md +32 -0
  19. data/docs/ConversationAgentStatusTimelineResponse.md +32 -0
  20. data/docs/ConversationApi.md +600 -0
  21. data/docs/ConversationPbxCallAgent.md +2 -0
  22. data/docs/ConversationPbxDefaultTimezoneResponse.md +26 -0
  23. data/docs/ConversationPbxDefaultTimezoneUpdateRequest.md +18 -0
  24. data/docs/ConversationWebchatQueueStatusAgent.md +6 -0
  25. data/docs/ConversationWebchatQueueStatusUpdateRequest.md +5 -1
  26. data/docs/TimelineSummary.md +26 -0
  27. data/lib/ultracart_api/api/conversation_api.rb +766 -2
  28. data/lib/ultracart_api/models/agent_summary.rb +279 -0
  29. data/lib/ultracart_api/models/auto_order_item_cancel_request.rb +14 -2
  30. data/lib/ultracart_api/models/conversation_agent_call_event.rb +314 -0
  31. data/lib/ultracart_api/models/conversation_agent_chat_event.rb +260 -0
  32. data/lib/ultracart_api/models/conversation_agent_status_config.rb +461 -0
  33. data/lib/ultracart_api/models/conversation_agent_status_config_response.rb +256 -0
  34. data/lib/ultracart_api/models/conversation_agent_status_configs_response.rb +259 -0
  35. data/lib/ultracart_api/models/conversation_agent_status_event.rb +522 -0
  36. data/lib/ultracart_api/models/conversation_agent_status_heatmap_request.rb +296 -0
  37. data/lib/ultracart_api/models/conversation_agent_status_heatmap_response.rb +283 -0
  38. data/lib/ultracart_api/models/conversation_agent_status_history_search_request.rb +316 -0
  39. data/lib/ultracart_api/models/conversation_agent_status_history_search_response.rb +269 -0
  40. data/lib/ultracart_api/models/conversation_agent_status_rollup.rb +353 -0
  41. data/lib/ultracart_api/models/conversation_agent_status_rollup_search_request.rb +284 -0
  42. data/lib/ultracart_api/models/conversation_agent_status_rollup_search_response.rb +259 -0
  43. data/lib/ultracart_api/models/conversation_agent_status_summary_response.rb +288 -0
  44. data/lib/ultracart_api/models/conversation_agent_status_timeline_response.rb +292 -0
  45. data/lib/ultracart_api/models/conversation_pbx_call_agent.rb +11 -1
  46. data/lib/ultracart_api/models/conversation_pbx_default_timezone_response.rb +272 -0
  47. data/lib/ultracart_api/models/conversation_pbx_default_timezone_update_request.rb +235 -0
  48. data/lib/ultracart_api/models/conversation_webchat_queue_status_agent.rb +31 -1
  49. data/lib/ultracart_api/models/conversation_webchat_queue_status_update_request.rb +24 -4
  50. data/lib/ultracart_api/models/timeline_summary.rb +260 -0
  51. data/lib/ultracart_api/version.rb +1 -1
  52. data/lib/ultracart_api.rb +19 -0
  53. metadata +40 -2
@@ -0,0 +1,522 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationAgentStatusEvent
18
+ # Agent identifier — voice_identity for PBX (e.g. 'client:login'), participant_arn for chat, synthetic 'ai:<user_id>' for AI flag events. Stable across an agent's events; participates in DDB pk and GSI1 sk.
19
+ attr_accessor :agent_identifier
20
+
21
+ # Agent display name at the time of the event
22
+ attr_accessor :agent_name
23
+
24
+ # Agent type
25
+ attr_accessor :agent_type
26
+
27
+ # Agent user id (links across channels)
28
+ attr_accessor :agent_user_id
29
+
30
+ # Channel
31
+ attr_accessor :channel
32
+
33
+ # Custom status name (when applicable)
34
+ attr_accessor :custom_status_name
35
+
36
+ # Custom status uuid (when applicable)
37
+ attr_accessor :custom_status_uuid
38
+
39
+ # Time spent in the previous status, in seconds
40
+ attr_accessor :duration_in_previous_seconds
41
+
42
+ # Event timestamp (ISO 8601)
43
+ attr_accessor :event_dts
44
+
45
+ # Event UUID (natural key for ES + BQ)
46
+ attr_accessor :event_uuid
47
+
48
+ # Merchant Id
49
+ attr_accessor :merchant_id
50
+
51
+ # Canonical new routing semantic
52
+ attr_accessor :new_routing_effect
53
+
54
+ # Channel-native new status name
55
+ attr_accessor :new_status
56
+
57
+ # Parent merchant id (denormalized for ES routing parity)
58
+ attr_accessor :parent_merchant_id
59
+
60
+ # Canonical previous routing semantic
61
+ attr_accessor :previous_routing_effect
62
+
63
+ # Channel-native previous status name
64
+ attr_accessor :previous_status
65
+
66
+ # What triggered the transition
67
+ attr_accessor :trigger
68
+
69
+ class EnumAttributeValidator
70
+ attr_reader :datatype
71
+ attr_reader :allowable_values
72
+
73
+ def initialize(datatype, allowable_values)
74
+ @allowable_values = allowable_values.map do |value|
75
+ case datatype.to_s
76
+ when /Integer/i
77
+ value.to_i
78
+ when /Float/i
79
+ value.to_f
80
+ else
81
+ value
82
+ end
83
+ end
84
+ end
85
+
86
+ def valid?(value)
87
+ !value || allowable_values.include?(value)
88
+ end
89
+ end
90
+
91
+ # Attribute mapping from ruby-style variable name to JSON key.
92
+ def self.attribute_map
93
+ {
94
+ :'agent_identifier' => :'agent_identifier',
95
+ :'agent_name' => :'agent_name',
96
+ :'agent_type' => :'agent_type',
97
+ :'agent_user_id' => :'agent_user_id',
98
+ :'channel' => :'channel',
99
+ :'custom_status_name' => :'custom_status_name',
100
+ :'custom_status_uuid' => :'custom_status_uuid',
101
+ :'duration_in_previous_seconds' => :'duration_in_previous_seconds',
102
+ :'event_dts' => :'event_dts',
103
+ :'event_uuid' => :'event_uuid',
104
+ :'merchant_id' => :'merchant_id',
105
+ :'new_routing_effect' => :'new_routing_effect',
106
+ :'new_status' => :'new_status',
107
+ :'parent_merchant_id' => :'parent_merchant_id',
108
+ :'previous_routing_effect' => :'previous_routing_effect',
109
+ :'previous_status' => :'previous_status',
110
+ :'trigger' => :'trigger'
111
+ }
112
+ end
113
+
114
+ # Returns all the JSON keys this model knows about
115
+ def self.acceptable_attributes
116
+ attribute_map.values
117
+ end
118
+
119
+ # Attribute type mapping.
120
+ def self.openapi_types
121
+ {
122
+ :'agent_identifier' => :'String',
123
+ :'agent_name' => :'String',
124
+ :'agent_type' => :'String',
125
+ :'agent_user_id' => :'String',
126
+ :'channel' => :'String',
127
+ :'custom_status_name' => :'String',
128
+ :'custom_status_uuid' => :'String',
129
+ :'duration_in_previous_seconds' => :'Integer',
130
+ :'event_dts' => :'String',
131
+ :'event_uuid' => :'String',
132
+ :'merchant_id' => :'String',
133
+ :'new_routing_effect' => :'String',
134
+ :'new_status' => :'String',
135
+ :'parent_merchant_id' => :'String',
136
+ :'previous_routing_effect' => :'String',
137
+ :'previous_status' => :'String',
138
+ :'trigger' => :'String'
139
+ }
140
+ end
141
+
142
+ # List of attributes with nullable: true
143
+ def self.openapi_nullable
144
+ Set.new([
145
+ ])
146
+ end
147
+
148
+ # Initializes the object
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ def initialize(attributes = {})
151
+ if (!attributes.is_a?(Hash))
152
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationAgentStatusEvent` initialize method"
153
+ end
154
+
155
+ # check to see if the attribute exists and convert string to symbol for hash key
156
+ attributes = attributes.each_with_object({}) { |(k, v), h|
157
+ if (!self.class.attribute_map.key?(k.to_sym))
158
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationAgentStatusEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
159
+ end
160
+ h[k.to_sym] = v
161
+ }
162
+
163
+ if attributes.key?(:'agent_identifier')
164
+ self.agent_identifier = attributes[:'agent_identifier']
165
+ end
166
+
167
+ if attributes.key?(:'agent_name')
168
+ self.agent_name = attributes[:'agent_name']
169
+ end
170
+
171
+ if attributes.key?(:'agent_type')
172
+ self.agent_type = attributes[:'agent_type']
173
+ end
174
+
175
+ if attributes.key?(:'agent_user_id')
176
+ self.agent_user_id = attributes[:'agent_user_id']
177
+ end
178
+
179
+ if attributes.key?(:'channel')
180
+ self.channel = attributes[:'channel']
181
+ end
182
+
183
+ if attributes.key?(:'custom_status_name')
184
+ self.custom_status_name = attributes[:'custom_status_name']
185
+ end
186
+
187
+ if attributes.key?(:'custom_status_uuid')
188
+ self.custom_status_uuid = attributes[:'custom_status_uuid']
189
+ end
190
+
191
+ if attributes.key?(:'duration_in_previous_seconds')
192
+ self.duration_in_previous_seconds = attributes[:'duration_in_previous_seconds']
193
+ end
194
+
195
+ if attributes.key?(:'event_dts')
196
+ self.event_dts = attributes[:'event_dts']
197
+ end
198
+
199
+ if attributes.key?(:'event_uuid')
200
+ self.event_uuid = attributes[:'event_uuid']
201
+ end
202
+
203
+ if attributes.key?(:'merchant_id')
204
+ self.merchant_id = attributes[:'merchant_id']
205
+ end
206
+
207
+ if attributes.key?(:'new_routing_effect')
208
+ self.new_routing_effect = attributes[:'new_routing_effect']
209
+ end
210
+
211
+ if attributes.key?(:'new_status')
212
+ self.new_status = attributes[:'new_status']
213
+ end
214
+
215
+ if attributes.key?(:'parent_merchant_id')
216
+ self.parent_merchant_id = attributes[:'parent_merchant_id']
217
+ end
218
+
219
+ if attributes.key?(:'previous_routing_effect')
220
+ self.previous_routing_effect = attributes[:'previous_routing_effect']
221
+ end
222
+
223
+ if attributes.key?(:'previous_status')
224
+ self.previous_status = attributes[:'previous_status']
225
+ end
226
+
227
+ if attributes.key?(:'trigger')
228
+ self.trigger = attributes[:'trigger']
229
+ end
230
+ end
231
+
232
+ # Show invalid properties with the reasons. Usually used together with valid?
233
+ # @return Array for valid properties with the reasons
234
+ def list_invalid_properties
235
+ invalid_properties = Array.new
236
+ if !@custom_status_uuid.nil? && @custom_status_uuid.to_s.length > 50
237
+ invalid_properties.push('invalid value for "custom_status_uuid", the character length must be smaller than or equal to 50.')
238
+ end
239
+
240
+ if !@event_uuid.nil? && @event_uuid.to_s.length > 36
241
+ invalid_properties.push('invalid value for "event_uuid", the character length must be smaller than or equal to 36.')
242
+ end
243
+
244
+ if !@merchant_id.nil? && @merchant_id.to_s.length > 5
245
+ invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
246
+ end
247
+
248
+ if !@parent_merchant_id.nil? && @parent_merchant_id.to_s.length > 5
249
+ invalid_properties.push('invalid value for "parent_merchant_id", the character length must be smaller than or equal to 5.')
250
+ end
251
+
252
+ invalid_properties
253
+ end
254
+
255
+ # Check to see if the all the properties in the model are valid
256
+ # @return true if the model is valid
257
+ def valid?
258
+ agent_type_validator = EnumAttributeValidator.new('String', ["human", "ai"])
259
+ return false unless agent_type_validator.valid?(@agent_type)
260
+ channel_validator = EnumAttributeValidator.new('String', ["pbx", "chat"])
261
+ return false unless channel_validator.valid?(@channel)
262
+ return false if !@custom_status_uuid.nil? && @custom_status_uuid.to_s.length > 50
263
+ return false if !@event_uuid.nil? && @event_uuid.to_s.length > 36
264
+ return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
265
+ new_routing_effect_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
266
+ return false unless new_routing_effect_validator.valid?(@new_routing_effect)
267
+ return false if !@parent_merchant_id.nil? && @parent_merchant_id.to_s.length > 5
268
+ previous_routing_effect_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
269
+ return false unless previous_routing_effect_validator.valid?(@previous_routing_effect)
270
+ trigger_validator = EnumAttributeValidator.new('String', ["manual", "system", "auto_disconnect"])
271
+ return false unless trigger_validator.valid?(@trigger)
272
+ true
273
+ end
274
+
275
+ # Custom attribute writer method checking allowed values (enum).
276
+ # @param [Object] agent_type Object to be assigned
277
+ def agent_type=(agent_type)
278
+ validator = EnumAttributeValidator.new('String', ["human", "ai"])
279
+ unless validator.valid?(agent_type)
280
+ fail ArgumentError, "invalid value for \"agent_type\", must be one of #{validator.allowable_values}."
281
+ end
282
+ @agent_type = agent_type
283
+ end
284
+
285
+ # Custom attribute writer method checking allowed values (enum).
286
+ # @param [Object] channel Object to be assigned
287
+ def channel=(channel)
288
+ validator = EnumAttributeValidator.new('String', ["pbx", "chat"])
289
+ unless validator.valid?(channel)
290
+ fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
291
+ end
292
+ @channel = channel
293
+ end
294
+
295
+ # Custom attribute writer method with validation
296
+ # @param [Object] custom_status_uuid Value to be assigned
297
+ def custom_status_uuid=(custom_status_uuid)
298
+ if !custom_status_uuid.nil? && custom_status_uuid.to_s.length > 50
299
+ fail ArgumentError, 'invalid value for "custom_status_uuid", the character length must be smaller than or equal to 50.'
300
+ end
301
+
302
+ @custom_status_uuid = custom_status_uuid
303
+ end
304
+
305
+ # Custom attribute writer method with validation
306
+ # @param [Object] event_uuid Value to be assigned
307
+ def event_uuid=(event_uuid)
308
+ if !event_uuid.nil? && event_uuid.to_s.length > 36
309
+ fail ArgumentError, 'invalid value for "event_uuid", the character length must be smaller than or equal to 36.'
310
+ end
311
+
312
+ @event_uuid = event_uuid
313
+ end
314
+
315
+ # Custom attribute writer method with validation
316
+ # @param [Object] merchant_id Value to be assigned
317
+ def merchant_id=(merchant_id)
318
+ if !merchant_id.nil? && merchant_id.to_s.length > 5
319
+ fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
320
+ end
321
+
322
+ @merchant_id = merchant_id
323
+ end
324
+
325
+ # Custom attribute writer method checking allowed values (enum).
326
+ # @param [Object] new_routing_effect Object to be assigned
327
+ def new_routing_effect=(new_routing_effect)
328
+ validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
329
+ unless validator.valid?(new_routing_effect)
330
+ fail ArgumentError, "invalid value for \"new_routing_effect\", must be one of #{validator.allowable_values}."
331
+ end
332
+ @new_routing_effect = new_routing_effect
333
+ end
334
+
335
+ # Custom attribute writer method with validation
336
+ # @param [Object] parent_merchant_id Value to be assigned
337
+ def parent_merchant_id=(parent_merchant_id)
338
+ if !parent_merchant_id.nil? && parent_merchant_id.to_s.length > 5
339
+ fail ArgumentError, 'invalid value for "parent_merchant_id", the character length must be smaller than or equal to 5.'
340
+ end
341
+
342
+ @parent_merchant_id = parent_merchant_id
343
+ end
344
+
345
+ # Custom attribute writer method checking allowed values (enum).
346
+ # @param [Object] previous_routing_effect Object to be assigned
347
+ def previous_routing_effect=(previous_routing_effect)
348
+ validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
349
+ unless validator.valid?(previous_routing_effect)
350
+ fail ArgumentError, "invalid value for \"previous_routing_effect\", must be one of #{validator.allowable_values}."
351
+ end
352
+ @previous_routing_effect = previous_routing_effect
353
+ end
354
+
355
+ # Custom attribute writer method checking allowed values (enum).
356
+ # @param [Object] trigger Object to be assigned
357
+ def trigger=(trigger)
358
+ validator = EnumAttributeValidator.new('String', ["manual", "system", "auto_disconnect"])
359
+ unless validator.valid?(trigger)
360
+ fail ArgumentError, "invalid value for \"trigger\", must be one of #{validator.allowable_values}."
361
+ end
362
+ @trigger = trigger
363
+ end
364
+
365
+ # Checks equality by comparing each attribute.
366
+ # @param [Object] Object to be compared
367
+ def ==(o)
368
+ return true if self.equal?(o)
369
+ self.class == o.class &&
370
+ agent_identifier == o.agent_identifier &&
371
+ agent_name == o.agent_name &&
372
+ agent_type == o.agent_type &&
373
+ agent_user_id == o.agent_user_id &&
374
+ channel == o.channel &&
375
+ custom_status_name == o.custom_status_name &&
376
+ custom_status_uuid == o.custom_status_uuid &&
377
+ duration_in_previous_seconds == o.duration_in_previous_seconds &&
378
+ event_dts == o.event_dts &&
379
+ event_uuid == o.event_uuid &&
380
+ merchant_id == o.merchant_id &&
381
+ new_routing_effect == o.new_routing_effect &&
382
+ new_status == o.new_status &&
383
+ parent_merchant_id == o.parent_merchant_id &&
384
+ previous_routing_effect == o.previous_routing_effect &&
385
+ previous_status == o.previous_status &&
386
+ trigger == o.trigger
387
+ end
388
+
389
+ # @see the `==` method
390
+ # @param [Object] Object to be compared
391
+ def eql?(o)
392
+ self == o
393
+ end
394
+
395
+ # Calculates hash code according to all attributes.
396
+ # @return [Integer] Hash code
397
+ def hash
398
+ [agent_identifier, agent_name, agent_type, agent_user_id, channel, custom_status_name, custom_status_uuid, duration_in_previous_seconds, event_dts, event_uuid, merchant_id, new_routing_effect, new_status, parent_merchant_id, previous_routing_effect, previous_status, trigger].hash
399
+ end
400
+
401
+ # Builds the object from hash
402
+ # @param [Hash] attributes Model attributes in the form of hash
403
+ # @return [Object] Returns the model itself
404
+ def self.build_from_hash(attributes)
405
+ new.build_from_hash(attributes)
406
+ end
407
+
408
+ # Builds the object from hash
409
+ # @param [Hash] attributes Model attributes in the form of hash
410
+ # @return [Object] Returns the model itself
411
+ def build_from_hash(attributes)
412
+ return nil unless attributes.is_a?(Hash)
413
+ attributes = attributes.transform_keys(&:to_sym)
414
+ self.class.openapi_types.each_pair do |key, type|
415
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
416
+ self.send("#{key}=", nil)
417
+ elsif type =~ /\AArray<(.*)>/i
418
+ # check to ensure the input is an array given that the attribute
419
+ # is documented as an array but the input is not
420
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
421
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
422
+ end
423
+ elsif !attributes[self.class.attribute_map[key]].nil?
424
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
425
+ end
426
+ end
427
+
428
+ self
429
+ end
430
+
431
+ # Deserializes the data based on type
432
+ # @param string type Data type
433
+ # @param string value Value to be deserialized
434
+ # @return [Object] Deserialized data
435
+ def _deserialize(type, value)
436
+ case type.to_sym
437
+ when :Time
438
+ Time.parse(value)
439
+ when :Date
440
+ Date.parse(value)
441
+ when :String
442
+ value.to_s
443
+ when :Integer
444
+ value.to_i
445
+ when :Float
446
+ value.to_f
447
+ when :Boolean
448
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
449
+ true
450
+ else
451
+ false
452
+ end
453
+ when :Object
454
+ # generic object (usually a Hash), return directly
455
+ value
456
+ when /\AArray<(?<inner_type>.+)>\z/
457
+ inner_type = Regexp.last_match[:inner_type]
458
+ value.map { |v| _deserialize(inner_type, v) }
459
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
460
+ k_type = Regexp.last_match[:k_type]
461
+ v_type = Regexp.last_match[:v_type]
462
+ {}.tap do |hash|
463
+ value.each do |k, v|
464
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
465
+ end
466
+ end
467
+ else # model
468
+ # models (e.g. Pet) or oneOf
469
+ klass = UltracartClient.const_get(type)
470
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
471
+ end
472
+ end
473
+
474
+ # Returns the string representation of the object
475
+ # @return [String] String presentation of the object
476
+ def to_s
477
+ to_hash.to_s
478
+ end
479
+
480
+ # to_body is an alias to to_hash (backward compatibility)
481
+ # @return [Hash] Returns the object in the form of hash
482
+ def to_body
483
+ to_hash
484
+ end
485
+
486
+ # Returns the object in the form of hash
487
+ # @return [Hash] Returns the object in the form of hash
488
+ def to_hash
489
+ hash = {}
490
+ self.class.attribute_map.each_pair do |attr, param|
491
+ value = self.send(attr)
492
+ if value.nil?
493
+ is_nullable = self.class.openapi_nullable.include?(attr)
494
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
495
+ end
496
+
497
+ hash[param] = _to_hash(value)
498
+ end
499
+ hash
500
+ end
501
+
502
+ # Outputs non-array value in the form of hash
503
+ # For object, use to_hash. Otherwise, just return the value
504
+ # @param [Object] value Any valid value
505
+ # @return [Hash] Returns the value in the form of hash
506
+ def _to_hash(value)
507
+ if value.is_a?(Array)
508
+ value.compact.map { |v| _to_hash(v) }
509
+ elsif value.is_a?(Hash)
510
+ {}.tap do |hash|
511
+ value.each { |k, v| hash[k] = _to_hash(v) }
512
+ end
513
+ elsif value.respond_to? :to_hash
514
+ value.to_hash
515
+ else
516
+ value
517
+ end
518
+ end
519
+
520
+ end
521
+
522
+ end