ultracart_api 3.10.184 → 3.10.186

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