ultracart_api 4.0.201 → 4.0.202

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +80 -4
  3. data/docs/ConversationApi.md +3565 -549
  4. data/docs/ConversationPbxAgent.md +34 -0
  5. data/docs/ConversationPbxAgentResponse.md +26 -0
  6. data/docs/ConversationPbxAgentsResponse.md +26 -0
  7. data/docs/ConversationPbxAudio.md +34 -0
  8. data/docs/ConversationPbxAudioResponse.md +26 -0
  9. data/docs/ConversationPbxAudiosResponse.md +26 -0
  10. data/docs/ConversationPbxCustomerSnapshotRequest.md +32 -0
  11. data/docs/ConversationPbxCustomerSnapshotResponse.md +30 -0
  12. data/docs/ConversationPbxMenu.md +36 -0
  13. data/docs/ConversationPbxMenuMapping.md +24 -0
  14. data/docs/ConversationPbxMenuResponse.md +26 -0
  15. data/docs/ConversationPbxMenusResponse.md +26 -0
  16. data/docs/ConversationPbxPhoneNumber.md +26 -0
  17. data/docs/ConversationPbxPhoneNumberResponse.md +26 -0
  18. data/docs/ConversationPbxPhoneNumbersResponse.md +26 -0
  19. data/docs/ConversationPbxQueue.md +52 -0
  20. data/docs/ConversationPbxQueueMembers.md +20 -0
  21. data/docs/ConversationPbxQueueResponse.md +26 -0
  22. data/docs/ConversationPbxQueuesResponse.md +26 -0
  23. data/docs/ConversationPbxTimeBased.md +24 -0
  24. data/docs/ConversationPbxTimeBasedMapping.md +24 -0
  25. data/docs/ConversationPbxTimeBasedMappingConfig.md +20 -0
  26. data/docs/ConversationPbxTimeBasedResponse.md +26 -0
  27. data/docs/ConversationPbxTimeBasedsResponse.md +26 -0
  28. data/docs/ConversationPbxTimeRange.md +26 -0
  29. data/docs/ConversationPbxTimeRangeConfig.md +28 -0
  30. data/docs/ConversationPbxTimeRangeResponse.md +26 -0
  31. data/docs/ConversationPbxTimeRangesResponse.md +26 -0
  32. data/docs/ConversationPbxVoicemailMailbox.md +38 -0
  33. data/docs/ConversationPbxVoicemailMailboxResponse.md +26 -0
  34. data/docs/ConversationPbxVoicemailMailboxesResponse.md +26 -0
  35. data/docs/WorkflowApi.md +69 -0
  36. data/docs/WorkflowTaskTagsResponse.md +26 -0
  37. data/lib/ultracart_api/api/conversation_api.rb +3422 -649
  38. data/lib/ultracart_api/api/workflow_api.rb +58 -0
  39. data/lib/ultracart_api/models/conversation_pbx_agent.rb +360 -0
  40. data/lib/ultracart_api/models/conversation_pbx_agent_response.rb +256 -0
  41. data/lib/ultracart_api/models/conversation_pbx_agents_response.rb +258 -0
  42. data/lib/ultracart_api/models/conversation_pbx_audio.rb +390 -0
  43. data/lib/ultracart_api/models/conversation_pbx_audio_response.rb +256 -0
  44. data/lib/ultracart_api/models/conversation_pbx_audios_response.rb +258 -0
  45. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +283 -0
  46. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb +278 -0
  47. data/lib/ultracart_api/models/conversation_pbx_menu.rb +402 -0
  48. data/lib/ultracart_api/models/conversation_pbx_menu_mapping.rb +250 -0
  49. data/lib/ultracart_api/models/conversation_pbx_menu_response.rb +256 -0
  50. data/lib/ultracart_api/models/conversation_pbx_menus_response.rb +258 -0
  51. data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +335 -0
  52. data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +256 -0
  53. data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +258 -0
  54. data/lib/ultracart_api/models/conversation_pbx_queue.rb +539 -0
  55. data/lib/ultracart_api/models/conversation_pbx_queue_members.rb +232 -0
  56. data/lib/ultracart_api/models/conversation_pbx_queue_response.rb +256 -0
  57. data/lib/ultracart_api/models/conversation_pbx_queues_response.rb +258 -0
  58. data/lib/ultracart_api/models/conversation_pbx_time_based.rb +246 -0
  59. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping.rb +310 -0
  60. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping_config.rb +231 -0
  61. data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +256 -0
  62. data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +258 -0
  63. data/lib/ultracart_api/models/conversation_pbx_time_range.rb +322 -0
  64. data/lib/ultracart_api/models/conversation_pbx_time_range_config.rb +270 -0
  65. data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +256 -0
  66. data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +258 -0
  67. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +440 -0
  68. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +256 -0
  69. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +258 -0
  70. data/lib/ultracart_api/models/workflow_task_tags_response.rb +259 -0
  71. data/lib/ultracart_api/version.rb +1 -1
  72. data/lib/ultracart_api.rb +32 -0
  73. metadata +66 -2
@@ -0,0 +1,402 @@
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 ConversationPbxMenu
18
+ # If true, the customer is allowed to input direct extensions within this menu
19
+ attr_accessor :allow_direct_extensions
20
+
21
+ # Conversation Pbx Menu UUID
22
+ attr_accessor :conversation_pbx_menu_uuid
23
+
24
+ # The default action for this menu
25
+ attr_accessor :default_action
26
+
27
+ # The default action target for this menu
28
+ attr_accessor :default_action_target
29
+
30
+ # Action mappings for this menu
31
+ attr_accessor :mappings
32
+
33
+ # Merchant Id
34
+ attr_accessor :merchant_id
35
+
36
+ # Menu name
37
+ attr_accessor :name
38
+
39
+ # An optional audio clip that plays when a customer enters this menu
40
+ attr_accessor :play_audio_uuid
41
+
42
+ # An optional saying that plays when a customer enters this menu
43
+ attr_accessor :say
44
+
45
+ # The idle seconds before this menu times out
46
+ attr_accessor :timeout
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'allow_direct_extensions' => :'allow_direct_extensions',
52
+ :'conversation_pbx_menu_uuid' => :'conversation_pbx_menu_uuid',
53
+ :'default_action' => :'default_action',
54
+ :'default_action_target' => :'default_action_target',
55
+ :'mappings' => :'mappings',
56
+ :'merchant_id' => :'merchant_id',
57
+ :'name' => :'name',
58
+ :'play_audio_uuid' => :'play_audio_uuid',
59
+ :'say' => :'say',
60
+ :'timeout' => :'timeout'
61
+ }
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'allow_direct_extensions' => :'Boolean',
73
+ :'conversation_pbx_menu_uuid' => :'String',
74
+ :'default_action' => :'String',
75
+ :'default_action_target' => :'String',
76
+ :'mappings' => :'Array<ConversationPbxMenuMapping>',
77
+ :'merchant_id' => :'String',
78
+ :'name' => :'String',
79
+ :'play_audio_uuid' => :'String',
80
+ :'say' => :'String',
81
+ :'timeout' => :'Integer'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxMenu` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ attributes = attributes.each_with_object({}) { |(k, v), h|
100
+ if (!self.class.attribute_map.key?(k.to_sym))
101
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxMenu`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
102
+ end
103
+ h[k.to_sym] = v
104
+ }
105
+
106
+ if attributes.key?(:'allow_direct_extensions')
107
+ self.allow_direct_extensions = attributes[:'allow_direct_extensions']
108
+ end
109
+
110
+ if attributes.key?(:'conversation_pbx_menu_uuid')
111
+ self.conversation_pbx_menu_uuid = attributes[:'conversation_pbx_menu_uuid']
112
+ end
113
+
114
+ if attributes.key?(:'default_action')
115
+ self.default_action = attributes[:'default_action']
116
+ end
117
+
118
+ if attributes.key?(:'default_action_target')
119
+ self.default_action_target = attributes[:'default_action_target']
120
+ end
121
+
122
+ if attributes.key?(:'mappings')
123
+ if (value = attributes[:'mappings']).is_a?(Array)
124
+ self.mappings = value
125
+ end
126
+ end
127
+
128
+ if attributes.key?(:'merchant_id')
129
+ self.merchant_id = attributes[:'merchant_id']
130
+ end
131
+
132
+ if attributes.key?(:'name')
133
+ self.name = attributes[:'name']
134
+ end
135
+
136
+ if attributes.key?(:'play_audio_uuid')
137
+ self.play_audio_uuid = attributes[:'play_audio_uuid']
138
+ end
139
+
140
+ if attributes.key?(:'say')
141
+ self.say = attributes[:'say']
142
+ end
143
+
144
+ if attributes.key?(:'timeout')
145
+ self.timeout = attributes[:'timeout']
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ invalid_properties = Array.new
153
+ if !@conversation_pbx_menu_uuid.nil? && @conversation_pbx_menu_uuid.to_s.length > 50
154
+ invalid_properties.push('invalid value for "conversation_pbx_menu_uuid", the character length must be smaller than or equal to 50.')
155
+ end
156
+
157
+ if !@default_action.nil? && @default_action.to_s.length > 30
158
+ invalid_properties.push('invalid value for "default_action", the character length must be smaller than or equal to 30.')
159
+ end
160
+
161
+ if !@default_action_target.nil? && @default_action_target.to_s.length > 50
162
+ invalid_properties.push('invalid value for "default_action_target", the character length must be smaller than or equal to 50.')
163
+ end
164
+
165
+ if !@merchant_id.nil? && @merchant_id.to_s.length > 5
166
+ invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
167
+ end
168
+
169
+ if !@name.nil? && @name.to_s.length > 50
170
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.')
171
+ end
172
+
173
+ if !@play_audio_uuid.nil? && @play_audio_uuid.to_s.length > 50
174
+ invalid_properties.push('invalid value for "play_audio_uuid", the character length must be smaller than or equal to 50.')
175
+ end
176
+
177
+ invalid_properties
178
+ end
179
+
180
+ # Check to see if the all the properties in the model are valid
181
+ # @return true if the model is valid
182
+ def valid?
183
+ return false if !@conversation_pbx_menu_uuid.nil? && @conversation_pbx_menu_uuid.to_s.length > 50
184
+ return false if !@default_action.nil? && @default_action.to_s.length > 30
185
+ return false if !@default_action_target.nil? && @default_action_target.to_s.length > 50
186
+ return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
187
+ return false if !@name.nil? && @name.to_s.length > 50
188
+ return false if !@play_audio_uuid.nil? && @play_audio_uuid.to_s.length > 50
189
+ true
190
+ end
191
+
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] conversation_pbx_menu_uuid Value to be assigned
194
+ def conversation_pbx_menu_uuid=(conversation_pbx_menu_uuid)
195
+ if !conversation_pbx_menu_uuid.nil? && conversation_pbx_menu_uuid.to_s.length > 50
196
+ fail ArgumentError, 'invalid value for "conversation_pbx_menu_uuid", the character length must be smaller than or equal to 50.'
197
+ end
198
+
199
+ @conversation_pbx_menu_uuid = conversation_pbx_menu_uuid
200
+ end
201
+
202
+ # Custom attribute writer method with validation
203
+ # @param [Object] default_action Value to be assigned
204
+ def default_action=(default_action)
205
+ if !default_action.nil? && default_action.to_s.length > 30
206
+ fail ArgumentError, 'invalid value for "default_action", the character length must be smaller than or equal to 30.'
207
+ end
208
+
209
+ @default_action = default_action
210
+ end
211
+
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] default_action_target Value to be assigned
214
+ def default_action_target=(default_action_target)
215
+ if !default_action_target.nil? && default_action_target.to_s.length > 50
216
+ fail ArgumentError, 'invalid value for "default_action_target", the character length must be smaller than or equal to 50.'
217
+ end
218
+
219
+ @default_action_target = default_action_target
220
+ end
221
+
222
+ # Custom attribute writer method with validation
223
+ # @param [Object] merchant_id Value to be assigned
224
+ def merchant_id=(merchant_id)
225
+ if !merchant_id.nil? && merchant_id.to_s.length > 5
226
+ fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
227
+ end
228
+
229
+ @merchant_id = merchant_id
230
+ end
231
+
232
+ # Custom attribute writer method with validation
233
+ # @param [Object] name Value to be assigned
234
+ def name=(name)
235
+ if !name.nil? && name.to_s.length > 50
236
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.'
237
+ end
238
+
239
+ @name = name
240
+ end
241
+
242
+ # Custom attribute writer method with validation
243
+ # @param [Object] play_audio_uuid Value to be assigned
244
+ def play_audio_uuid=(play_audio_uuid)
245
+ if !play_audio_uuid.nil? && play_audio_uuid.to_s.length > 50
246
+ fail ArgumentError, 'invalid value for "play_audio_uuid", the character length must be smaller than or equal to 50.'
247
+ end
248
+
249
+ @play_audio_uuid = play_audio_uuid
250
+ end
251
+
252
+ # Checks equality by comparing each attribute.
253
+ # @param [Object] Object to be compared
254
+ def ==(o)
255
+ return true if self.equal?(o)
256
+ self.class == o.class &&
257
+ allow_direct_extensions == o.allow_direct_extensions &&
258
+ conversation_pbx_menu_uuid == o.conversation_pbx_menu_uuid &&
259
+ default_action == o.default_action &&
260
+ default_action_target == o.default_action_target &&
261
+ mappings == o.mappings &&
262
+ merchant_id == o.merchant_id &&
263
+ name == o.name &&
264
+ play_audio_uuid == o.play_audio_uuid &&
265
+ say == o.say &&
266
+ timeout == o.timeout
267
+ end
268
+
269
+ # @see the `==` method
270
+ # @param [Object] Object to be compared
271
+ def eql?(o)
272
+ self == o
273
+ end
274
+
275
+ # Calculates hash code according to all attributes.
276
+ # @return [Integer] Hash code
277
+ def hash
278
+ [allow_direct_extensions, conversation_pbx_menu_uuid, default_action, default_action_target, mappings, merchant_id, name, play_audio_uuid, say, timeout].hash
279
+ end
280
+
281
+ # Builds the object from hash
282
+ # @param [Hash] attributes Model attributes in the form of hash
283
+ # @return [Object] Returns the model itself
284
+ def self.build_from_hash(attributes)
285
+ new.build_from_hash(attributes)
286
+ end
287
+
288
+ # Builds the object from hash
289
+ # @param [Hash] attributes Model attributes in the form of hash
290
+ # @return [Object] Returns the model itself
291
+ def build_from_hash(attributes)
292
+ return nil unless attributes.is_a?(Hash)
293
+ attributes = attributes.transform_keys(&:to_sym)
294
+ self.class.openapi_types.each_pair do |key, type|
295
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
296
+ self.send("#{key}=", nil)
297
+ elsif type =~ /\AArray<(.*)>/i
298
+ # check to ensure the input is an array given that the attribute
299
+ # is documented as an array but the input is not
300
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
301
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
302
+ end
303
+ elsif !attributes[self.class.attribute_map[key]].nil?
304
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
305
+ end
306
+ end
307
+
308
+ self
309
+ end
310
+
311
+ # Deserializes the data based on type
312
+ # @param string type Data type
313
+ # @param string value Value to be deserialized
314
+ # @return [Object] Deserialized data
315
+ def _deserialize(type, value)
316
+ case type.to_sym
317
+ when :Time
318
+ Time.parse(value)
319
+ when :Date
320
+ Date.parse(value)
321
+ when :String
322
+ value.to_s
323
+ when :Integer
324
+ value.to_i
325
+ when :Float
326
+ value.to_f
327
+ when :Boolean
328
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
329
+ true
330
+ else
331
+ false
332
+ end
333
+ when :Object
334
+ # generic object (usually a Hash), return directly
335
+ value
336
+ when /\AArray<(?<inner_type>.+)>\z/
337
+ inner_type = Regexp.last_match[:inner_type]
338
+ value.map { |v| _deserialize(inner_type, v) }
339
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
340
+ k_type = Regexp.last_match[:k_type]
341
+ v_type = Regexp.last_match[:v_type]
342
+ {}.tap do |hash|
343
+ value.each do |k, v|
344
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
345
+ end
346
+ end
347
+ else # model
348
+ # models (e.g. Pet) or oneOf
349
+ klass = UltracartClient.const_get(type)
350
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
351
+ end
352
+ end
353
+
354
+ # Returns the string representation of the object
355
+ # @return [String] String presentation of the object
356
+ def to_s
357
+ to_hash.to_s
358
+ end
359
+
360
+ # to_body is an alias to to_hash (backward compatibility)
361
+ # @return [Hash] Returns the object in the form of hash
362
+ def to_body
363
+ to_hash
364
+ end
365
+
366
+ # Returns the object in the form of hash
367
+ # @return [Hash] Returns the object in the form of hash
368
+ def to_hash
369
+ hash = {}
370
+ self.class.attribute_map.each_pair do |attr, param|
371
+ value = self.send(attr)
372
+ if value.nil?
373
+ is_nullable = self.class.openapi_nullable.include?(attr)
374
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
375
+ end
376
+
377
+ hash[param] = _to_hash(value)
378
+ end
379
+ hash
380
+ end
381
+
382
+ # Outputs non-array value in the form of hash
383
+ # For object, use to_hash. Otherwise, just return the value
384
+ # @param [Object] value Any valid value
385
+ # @return [Hash] Returns the value in the form of hash
386
+ def _to_hash(value)
387
+ if value.is_a?(Array)
388
+ value.compact.map { |v| _to_hash(v) }
389
+ elsif value.is_a?(Hash)
390
+ {}.tap do |hash|
391
+ value.each { |k, v| hash[k] = _to_hash(v) }
392
+ end
393
+ elsif value.respond_to? :to_hash
394
+ value.to_hash
395
+ else
396
+ value
397
+ end
398
+ end
399
+
400
+ end
401
+
402
+ end
@@ -0,0 +1,250 @@
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 ConversationPbxMenuMapping
18
+ # Action
19
+ attr_accessor :action
20
+
21
+ # Action target
22
+ attr_accessor :action_target
23
+
24
+ # Digits
25
+ attr_accessor :digits
26
+
27
+ # Speech
28
+ attr_accessor :speech
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'action' => :'action',
34
+ :'action_target' => :'action_target',
35
+ :'digits' => :'digits',
36
+ :'speech' => :'speech'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'action' => :'String',
49
+ :'action_target' => :'String',
50
+ :'digits' => :'Integer',
51
+ :'speech' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxMenuMapping` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxMenuMapping`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'action')
77
+ self.action = attributes[:'action']
78
+ end
79
+
80
+ if attributes.key?(:'action_target')
81
+ self.action_target = attributes[:'action_target']
82
+ end
83
+
84
+ if attributes.key?(:'digits')
85
+ self.digits = attributes[:'digits']
86
+ end
87
+
88
+ if attributes.key?(:'speech')
89
+ self.speech = attributes[:'speech']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ action == o.action &&
112
+ action_target == o.action_target &&
113
+ digits == o.digits &&
114
+ speech == o.speech
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [action, action_target, digits, speech].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = UltracartClient.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end