ultracart_api 3.10.184 → 3.10.185

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