ultracart_api 4.0.200 → 4.0.202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +88 -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/EmailSmsOrder.md +24 -0
  36. data/docs/EmailSmsOrdersResponse.md +26 -0
  37. data/docs/EmailSmsStat.md +76 -0
  38. data/docs/EmailStatSmsSummaryRequest.md +20 -0
  39. data/docs/EmailStatSmsSummaryResponse.md +26 -0
  40. data/docs/PricingTier.md +2 -0
  41. data/docs/StorefrontApi.md +152 -0
  42. data/docs/WorkflowApi.md +69 -0
  43. data/docs/WorkflowTaskTagsResponse.md +26 -0
  44. data/lib/ultracart_api/api/conversation_api.rb +3422 -649
  45. data/lib/ultracart_api/api/storefront_api.rb +156 -0
  46. data/lib/ultracart_api/api/workflow_api.rb +58 -0
  47. data/lib/ultracart_api/models/conversation_pbx_agent.rb +360 -0
  48. data/lib/ultracart_api/models/conversation_pbx_agent_response.rb +256 -0
  49. data/lib/ultracart_api/models/conversation_pbx_agents_response.rb +258 -0
  50. data/lib/ultracart_api/models/conversation_pbx_audio.rb +390 -0
  51. data/lib/ultracart_api/models/conversation_pbx_audio_response.rb +256 -0
  52. data/lib/ultracart_api/models/conversation_pbx_audios_response.rb +258 -0
  53. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +283 -0
  54. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb +278 -0
  55. data/lib/ultracart_api/models/conversation_pbx_menu.rb +402 -0
  56. data/lib/ultracart_api/models/conversation_pbx_menu_mapping.rb +250 -0
  57. data/lib/ultracart_api/models/conversation_pbx_menu_response.rb +256 -0
  58. data/lib/ultracart_api/models/conversation_pbx_menus_response.rb +258 -0
  59. data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +335 -0
  60. data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +256 -0
  61. data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +258 -0
  62. data/lib/ultracart_api/models/conversation_pbx_queue.rb +539 -0
  63. data/lib/ultracart_api/models/conversation_pbx_queue_members.rb +232 -0
  64. data/lib/ultracart_api/models/conversation_pbx_queue_response.rb +256 -0
  65. data/lib/ultracart_api/models/conversation_pbx_queues_response.rb +258 -0
  66. data/lib/ultracart_api/models/conversation_pbx_time_based.rb +246 -0
  67. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping.rb +310 -0
  68. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping_config.rb +231 -0
  69. data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +256 -0
  70. data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +258 -0
  71. data/lib/ultracart_api/models/conversation_pbx_time_range.rb +322 -0
  72. data/lib/ultracart_api/models/conversation_pbx_time_range_config.rb +270 -0
  73. data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +256 -0
  74. data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +258 -0
  75. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +440 -0
  76. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +256 -0
  77. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +258 -0
  78. data/lib/ultracart_api/models/email_sms_order.rb +249 -0
  79. data/lib/ultracart_api/models/email_sms_orders_response.rb +258 -0
  80. data/lib/ultracart_api/models/email_sms_stat.rb +511 -0
  81. data/lib/ultracart_api/models/email_stat_sms_summary_request.rb +230 -0
  82. data/lib/ultracart_api/models/email_stat_sms_summary_response.rb +258 -0
  83. data/lib/ultracart_api/models/pricing_tier.rb +11 -1
  84. data/lib/ultracart_api/models/workflow_task_tags_response.rb +259 -0
  85. data/lib/ultracart_api/version.rb +1 -1
  86. data/lib/ultracart_api.rb +37 -0
  87. metadata +76 -2
@@ -0,0 +1,278 @@
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 ConversationPbxCustomerSnapshotResponse
18
+ attr_accessor :auto_orders
19
+
20
+ attr_accessor :customer
21
+
22
+ attr_accessor :error
23
+
24
+ attr_accessor :metadata
25
+
26
+ attr_accessor :orders
27
+
28
+ # Indicates if API call was successful
29
+ attr_accessor :success
30
+
31
+ attr_accessor :warning
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'auto_orders' => :'auto_orders',
37
+ :'customer' => :'customer',
38
+ :'error' => :'error',
39
+ :'metadata' => :'metadata',
40
+ :'orders' => :'orders',
41
+ :'success' => :'success',
42
+ :'warning' => :'warning'
43
+ }
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'auto_orders' => :'Array<AutoOrder>',
55
+ :'customer' => :'Customer',
56
+ :'error' => :'Error',
57
+ :'metadata' => :'ResponseMetadata',
58
+ :'orders' => :'Array<Order>',
59
+ :'success' => :'Boolean',
60
+ :'warning' => :'Warning'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxCustomerSnapshotResponse` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxCustomerSnapshotResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'auto_orders')
86
+ if (value = attributes[:'auto_orders']).is_a?(Array)
87
+ self.auto_orders = value
88
+ end
89
+ end
90
+
91
+ if attributes.key?(:'customer')
92
+ self.customer = attributes[:'customer']
93
+ end
94
+
95
+ if attributes.key?(:'error')
96
+ self.error = attributes[:'error']
97
+ end
98
+
99
+ if attributes.key?(:'metadata')
100
+ self.metadata = attributes[:'metadata']
101
+ end
102
+
103
+ if attributes.key?(:'orders')
104
+ if (value = attributes[:'orders']).is_a?(Array)
105
+ self.orders = value
106
+ end
107
+ end
108
+
109
+ if attributes.key?(:'success')
110
+ self.success = attributes[:'success']
111
+ end
112
+
113
+ if attributes.key?(:'warning')
114
+ self.warning = attributes[:'warning']
115
+ end
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properties with the reasons
120
+ def list_invalid_properties
121
+ invalid_properties = Array.new
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ true
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ auto_orders == o.auto_orders &&
137
+ customer == o.customer &&
138
+ error == o.error &&
139
+ metadata == o.metadata &&
140
+ orders == o.orders &&
141
+ success == o.success &&
142
+ warning == o.warning
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [auto_orders, customer, error, metadata, orders, success, warning].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ new.build_from_hash(attributes)
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ attributes = attributes.transform_keys(&:to_sym)
170
+ self.class.openapi_types.each_pair do |key, type|
171
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
172
+ self.send("#{key}=", nil)
173
+ elsif type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end
182
+ end
183
+
184
+ self
185
+ end
186
+
187
+ # Deserializes the data based on type
188
+ # @param string type Data type
189
+ # @param string value Value to be deserialized
190
+ # @return [Object] Deserialized data
191
+ def _deserialize(type, value)
192
+ case type.to_sym
193
+ when :Time
194
+ Time.parse(value)
195
+ when :Date
196
+ Date.parse(value)
197
+ when :String
198
+ value.to_s
199
+ when :Integer
200
+ value.to_i
201
+ when :Float
202
+ value.to_f
203
+ when :Boolean
204
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
+ true
206
+ else
207
+ false
208
+ end
209
+ when :Object
210
+ # generic object (usually a Hash), return directly
211
+ value
212
+ when /\AArray<(?<inner_type>.+)>\z/
213
+ inner_type = Regexp.last_match[:inner_type]
214
+ value.map { |v| _deserialize(inner_type, v) }
215
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
+ k_type = Regexp.last_match[:k_type]
217
+ v_type = Regexp.last_match[:v_type]
218
+ {}.tap do |hash|
219
+ value.each do |k, v|
220
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
+ end
222
+ end
223
+ else # model
224
+ # models (e.g. Pet) or oneOf
225
+ klass = UltracartClient.const_get(type)
226
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
227
+ end
228
+ end
229
+
230
+ # Returns the string representation of the object
231
+ # @return [String] String presentation of the object
232
+ def to_s
233
+ to_hash.to_s
234
+ end
235
+
236
+ # to_body is an alias to to_hash (backward compatibility)
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_body
239
+ to_hash
240
+ end
241
+
242
+ # Returns the object in the form of hash
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ if value.nil?
249
+ is_nullable = self.class.openapi_nullable.include?(attr)
250
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
251
+ end
252
+
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ # Outputs non-array value in the form of hash
259
+ # For object, use to_hash. Otherwise, just return the value
260
+ # @param [Object] value Any valid value
261
+ # @return [Hash] Returns the value in the form of hash
262
+ def _to_hash(value)
263
+ if value.is_a?(Array)
264
+ value.compact.map { |v| _to_hash(v) }
265
+ elsif value.is_a?(Hash)
266
+ {}.tap do |hash|
267
+ value.each { |k, v| hash[k] = _to_hash(v) }
268
+ end
269
+ elsif value.respond_to? :to_hash
270
+ value.to_hash
271
+ else
272
+ value
273
+ end
274
+ end
275
+
276
+ end
277
+
278
+ end
@@ -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