ultracart_api 3.10.183 → 3.10.185

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +88 -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/EmailSmsOrder.md +11 -0
  36. data/docs/EmailSmsOrdersResponse.md +12 -0
  37. data/docs/EmailSmsStat.md +37 -0
  38. data/docs/EmailStatSmsSummaryRequest.md +9 -0
  39. data/docs/EmailStatSmsSummaryResponse.md +12 -0
  40. data/docs/PricingTier.md +1 -0
  41. data/docs/StorefrontApi.md +114 -0
  42. data/docs/WorkflowApi.md +46 -0
  43. data/docs/WorkflowTaskTagsResponse.md +12 -0
  44. data/lib/ultracart_api/api/conversation_api.rb +2919 -609
  45. data/lib/ultracart_api/api/storefront_api.rb +133 -0
  46. data/lib/ultracart_api/api/workflow_api.rb +49 -0
  47. data/lib/ultracart_api/models/conversation_pbx_agent.rb +325 -0
  48. data/lib/ultracart_api/models/conversation_pbx_agent_response.rb +221 -0
  49. data/lib/ultracart_api/models/conversation_pbx_agents_response.rb +223 -0
  50. data/lib/ultracart_api/models/conversation_pbx_audio.rb +355 -0
  51. data/lib/ultracart_api/models/conversation_pbx_audio_response.rb +221 -0
  52. data/lib/ultracart_api/models/conversation_pbx_audios_response.rb +223 -0
  53. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +248 -0
  54. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb +243 -0
  55. data/lib/ultracart_api/models/conversation_pbx_menu.rb +367 -0
  56. data/lib/ultracart_api/models/conversation_pbx_menu_mapping.rb +215 -0
  57. data/lib/ultracart_api/models/conversation_pbx_menu_response.rb +221 -0
  58. data/lib/ultracart_api/models/conversation_pbx_menus_response.rb +223 -0
  59. data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +300 -0
  60. data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +221 -0
  61. data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +223 -0
  62. data/lib/ultracart_api/models/conversation_pbx_queue.rb +504 -0
  63. data/lib/ultracart_api/models/conversation_pbx_queue_members.rb +197 -0
  64. data/lib/ultracart_api/models/conversation_pbx_queue_response.rb +221 -0
  65. data/lib/ultracart_api/models/conversation_pbx_queues_response.rb +223 -0
  66. data/lib/ultracart_api/models/conversation_pbx_time_based.rb +211 -0
  67. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping.rb +275 -0
  68. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping_config.rb +196 -0
  69. data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +221 -0
  70. data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +223 -0
  71. data/lib/ultracart_api/models/conversation_pbx_time_range.rb +287 -0
  72. data/lib/ultracart_api/models/conversation_pbx_time_range_config.rb +235 -0
  73. data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +221 -0
  74. data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +223 -0
  75. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +405 -0
  76. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +221 -0
  77. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +223 -0
  78. data/lib/ultracart_api/models/email_sms_order.rb +214 -0
  79. data/lib/ultracart_api/models/email_sms_orders_response.rb +223 -0
  80. data/lib/ultracart_api/models/email_sms_stat.rb +476 -0
  81. data/lib/ultracart_api/models/email_stat_sms_summary_request.rb +195 -0
  82. data/lib/ultracart_api/models/email_stat_sms_summary_response.rb +223 -0
  83. data/lib/ultracart_api/models/pricing_tier.rb +11 -1
  84. data/lib/ultracart_api/models/workflow_task_tags_response.rb +224 -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,275 @@
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 ConversationPbxTimeBasedMapping
17
+ # Action
18
+ attr_accessor :action
19
+
20
+ # Action target
21
+ attr_accessor :action_target
22
+
23
+ # Name
24
+ attr_accessor :name
25
+
26
+ # Time range UUID
27
+ attr_accessor :time_range_uuid
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'action' => :'action',
33
+ :'action_target' => :'action_target',
34
+ :'name' => :'name',
35
+ :'time_range_uuid' => :'time_range_uuid'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'action' => :'String',
43
+ :'action_target' => :'String',
44
+ :'name' => :'String',
45
+ :'time_range_uuid' => :'String'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'action')
58
+ self.action = attributes[:'action']
59
+ end
60
+
61
+ if attributes.has_key?(:'action_target')
62
+ self.action_target = attributes[:'action_target']
63
+ end
64
+
65
+ if attributes.has_key?(:'name')
66
+ self.name = attributes[:'name']
67
+ end
68
+
69
+ if attributes.has_key?(:'time_range_uuid')
70
+ self.time_range_uuid = attributes[:'time_range_uuid']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ if !@action.nil? && @action.to_s.length > 30
79
+ invalid_properties.push('invalid value for "action", the character length must be smaller than or equal to 30.')
80
+ end
81
+
82
+ if !@action_target.nil? && @action_target.to_s.length > 50
83
+ invalid_properties.push('invalid value for "action_target", the character length must be smaller than or equal to 50.')
84
+ end
85
+
86
+ if !@name.nil? && @name.to_s.length > 50
87
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.')
88
+ end
89
+
90
+ if !@time_range_uuid.nil? && @time_range_uuid.to_s.length > 50
91
+ invalid_properties.push('invalid value for "time_range_uuid", the character length must be smaller than or equal to 50.')
92
+ end
93
+
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ return false if !@action.nil? && @action.to_s.length > 30
101
+ return false if !@action_target.nil? && @action_target.to_s.length > 50
102
+ return false if !@name.nil? && @name.to_s.length > 50
103
+ return false if !@time_range_uuid.nil? && @time_range_uuid.to_s.length > 50
104
+ true
105
+ end
106
+
107
+ # Custom attribute writer method with validation
108
+ # @param [Object] action Value to be assigned
109
+ def action=(action)
110
+ if !action.nil? && action.to_s.length > 30
111
+ fail ArgumentError, 'invalid value for "action", the character length must be smaller than or equal to 30.'
112
+ end
113
+
114
+ @action = action
115
+ end
116
+
117
+ # Custom attribute writer method with validation
118
+ # @param [Object] action_target Value to be assigned
119
+ def action_target=(action_target)
120
+ if !action_target.nil? && action_target.to_s.length > 50
121
+ fail ArgumentError, 'invalid value for "action_target", the character length must be smaller than or equal to 50.'
122
+ end
123
+
124
+ @action_target = action_target
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] name Value to be assigned
129
+ def name=(name)
130
+ if !name.nil? && name.to_s.length > 50
131
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.'
132
+ end
133
+
134
+ @name = name
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] time_range_uuid Value to be assigned
139
+ def time_range_uuid=(time_range_uuid)
140
+ if !time_range_uuid.nil? && time_range_uuid.to_s.length > 50
141
+ fail ArgumentError, 'invalid value for "time_range_uuid", the character length must be smaller than or equal to 50.'
142
+ end
143
+
144
+ @time_range_uuid = time_range_uuid
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ action == o.action &&
153
+ action_target == o.action_target &&
154
+ name == o.name &&
155
+ time_range_uuid == o.time_range_uuid
156
+ end
157
+
158
+ # @see the `==` method
159
+ # @param [Object] Object to be compared
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculates hash code according to all attributes.
165
+ # @return [Fixnum] Hash code
166
+ def hash
167
+ [action, action_target, name, time_range_uuid].hash
168
+ end
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def build_from_hash(attributes)
174
+ return nil unless attributes.is_a?(Hash)
175
+ self.class.swagger_types.each_pair do |key, type|
176
+ if type =~ /\AArray<(.*)>/i
177
+ # check to ensure the input is an array given that the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
180
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
181
+ end
182
+ elsif !attributes[self.class.attribute_map[key]].nil?
183
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
184
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
185
+ end
186
+
187
+ self
188
+ end
189
+
190
+ # Deserializes the data based on type
191
+ # @param string type Data type
192
+ # @param string value Value to be deserialized
193
+ # @return [Object] Deserialized data
194
+ def _deserialize(type, value)
195
+ case type.to_sym
196
+ when :DateTime
197
+ DateTime.parse(value)
198
+ when :Date
199
+ Date.parse(value)
200
+ when :String
201
+ value.to_s
202
+ when :Integer
203
+ value.to_i
204
+ when :Float
205
+ value.to_f
206
+ when :BOOLEAN
207
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
208
+ true
209
+ else
210
+ false
211
+ end
212
+ when :Object
213
+ # generic object (usually a Hash), return directly
214
+ value
215
+ when /\AArray<(?<inner_type>.+)>\z/
216
+ inner_type = Regexp.last_match[:inner_type]
217
+ value.map { |v| _deserialize(inner_type, v) }
218
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
219
+ k_type = Regexp.last_match[:k_type]
220
+ v_type = Regexp.last_match[:v_type]
221
+ {}.tap do |hash|
222
+ value.each do |k, v|
223
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
+ end
225
+ end
226
+ else # model
227
+ temp_model = UltracartClient.const_get(type).new
228
+ temp_model.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ next if value.nil?
251
+ hash[param] = _to_hash(value)
252
+ end
253
+ hash
254
+ end
255
+
256
+ # Outputs non-array value in the form of hash
257
+ # For object, use to_hash. Otherwise, just return the value
258
+ # @param [Object] value Any valid value
259
+ # @return [Hash] Returns the value in the form of hash
260
+ def _to_hash(value)
261
+ if value.is_a?(Array)
262
+ value.compact.map { |v| _to_hash(v) }
263
+ elsif value.is_a?(Hash)
264
+ {}.tap do |hash|
265
+ value.each { |k, v| hash[k] = _to_hash(v) }
266
+ end
267
+ elsif value.respond_to? :to_hash
268
+ value.to_hash
269
+ else
270
+ value
271
+ end
272
+ end
273
+
274
+ end
275
+ end
@@ -0,0 +1,196 @@
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 ConversationPbxTimeBasedMappingConfig
17
+ attr_accessor :default
18
+
19
+ # Mappings
20
+ attr_accessor :mappings
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'default' => :'default',
26
+ :'mappings' => :'mappings'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'default' => :'ConversationPbxTimeBasedMapping',
34
+ :'mappings' => :'Array<ConversationPbxTimeBasedMapping>'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ if attributes.has_key?(:'default')
47
+ self.default = attributes[:'default']
48
+ end
49
+
50
+ if attributes.has_key?(:'mappings')
51
+ if (value = attributes[:'mappings']).is_a?(Array)
52
+ self.mappings = value
53
+ end
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ default == o.default &&
76
+ mappings == o.mappings
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [default, mappings].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = UltracartClient.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+
195
+ end
196
+ 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 ConversationPbxTimeBasedResponse
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 :time_based
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
+ :'time_based' => :'timeBased',
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
+ :'time_based' => :'ConversationPbxTimeBased',
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?(:'timeBased')
71
+ self.time_based = attributes[:'timeBased']
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
+ time_based == o.time_based &&
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, time_based, 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