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