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,223 @@
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 ConversationPbxAudiosResponse
17
+ attr_accessor :audios
18
+
19
+ attr_accessor :error
20
+
21
+ attr_accessor :metadata
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'audios' => :'audios',
32
+ :'error' => :'error',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'audios' => :'Array<ConversationPbxAudio>',
43
+ :'error' => :'Error',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
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?(:'audios')
59
+ if (value = attributes[:'audios']).is_a?(Array)
60
+ self.audios = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'error')
65
+ self.error = attributes[:'error']
66
+ end
67
+
68
+ if attributes.has_key?(:'metadata')
69
+ self.metadata = attributes[:'metadata']
70
+ end
71
+
72
+ if attributes.has_key?(:'success')
73
+ self.success = attributes[:'success']
74
+ end
75
+
76
+ if attributes.has_key?(:'warning')
77
+ self.warning = attributes[:'warning']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ audios == o.audios &&
100
+ error == o.error &&
101
+ metadata == o.metadata &&
102
+ success == o.success &&
103
+ warning == o.warning
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [audios, error, metadata, success, warning].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = UltracartClient.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -0,0 +1,248 @@
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 ConversationPbxCustomerSnapshotRequest
17
+ attr_accessor :auto_order_expand
18
+
19
+ attr_accessor :customer_expand
20
+
21
+ attr_accessor :error
22
+
23
+ attr_accessor :metadata
24
+
25
+ attr_accessor :order_expand
26
+
27
+ attr_accessor :phone_number
28
+
29
+ # Indicates if API call was successful
30
+ attr_accessor :success
31
+
32
+ attr_accessor :warning
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'auto_order_expand' => :'auto_order_expand',
38
+ :'customer_expand' => :'customer_expand',
39
+ :'error' => :'error',
40
+ :'metadata' => :'metadata',
41
+ :'order_expand' => :'order_expand',
42
+ :'phone_number' => :'phone_number',
43
+ :'success' => :'success',
44
+ :'warning' => :'warning'
45
+ }
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.swagger_types
50
+ {
51
+ :'auto_order_expand' => :'String',
52
+ :'customer_expand' => :'String',
53
+ :'error' => :'Error',
54
+ :'metadata' => :'ResponseMetadata',
55
+ :'order_expand' => :'String',
56
+ :'phone_number' => :'String',
57
+ :'success' => :'BOOLEAN',
58
+ :'warning' => :'Warning'
59
+ }
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ return unless attributes.is_a?(Hash)
66
+
67
+ # convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
69
+
70
+ if attributes.has_key?(:'auto_order_expand')
71
+ self.auto_order_expand = attributes[:'auto_order_expand']
72
+ end
73
+
74
+ if attributes.has_key?(:'customer_expand')
75
+ self.customer_expand = attributes[:'customer_expand']
76
+ end
77
+
78
+ if attributes.has_key?(:'error')
79
+ self.error = attributes[:'error']
80
+ end
81
+
82
+ if attributes.has_key?(:'metadata')
83
+ self.metadata = attributes[:'metadata']
84
+ end
85
+
86
+ if attributes.has_key?(:'order_expand')
87
+ self.order_expand = attributes[:'order_expand']
88
+ end
89
+
90
+ if attributes.has_key?(:'phone_number')
91
+ self.phone_number = attributes[:'phone_number']
92
+ end
93
+
94
+ if attributes.has_key?(:'success')
95
+ self.success = attributes[:'success']
96
+ end
97
+
98
+ if attributes.has_key?(:'warning')
99
+ self.warning = attributes[:'warning']
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ invalid_properties = Array.new
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ auto_order_expand == o.auto_order_expand &&
122
+ customer_expand == o.customer_expand &&
123
+ error == o.error &&
124
+ metadata == o.metadata &&
125
+ order_expand == o.order_expand &&
126
+ phone_number == o.phone_number &&
127
+ success == o.success &&
128
+ warning == o.warning
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Fixnum] Hash code
139
+ def hash
140
+ [auto_order_expand, customer_expand, error, metadata, order_expand, phone_number, success, warning].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ self.class.swagger_types.each_pair do |key, type|
149
+ if type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
153
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
154
+ end
155
+ elsif !attributes[self.class.attribute_map[key]].nil?
156
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
158
+ end
159
+
160
+ self
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def _deserialize(type, value)
168
+ case type.to_sym
169
+ when :DateTime
170
+ DateTime.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :BOOLEAN
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ temp_model = UltracartClient.const_get(type).new
201
+ temp_model.build_from_hash(value)
202
+ end
203
+ end
204
+
205
+ # Returns the string representation of the object
206
+ # @return [String] String presentation of the object
207
+ def to_s
208
+ to_hash.to_s
209
+ end
210
+
211
+ # to_body is an alias to to_hash (backward compatibility)
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_body
214
+ to_hash
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ next if value.nil?
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+
247
+ end
248
+ end
@@ -0,0 +1,243 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationPbxCustomerSnapshotResponse
17
+ attr_accessor :auto_orders
18
+
19
+ attr_accessor :customer
20
+
21
+ attr_accessor :error
22
+
23
+ attr_accessor :metadata
24
+
25
+ attr_accessor :orders
26
+
27
+ # Indicates if API call was successful
28
+ attr_accessor :success
29
+
30
+ attr_accessor :warning
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'auto_orders' => :'auto_orders',
36
+ :'customer' => :'customer',
37
+ :'error' => :'error',
38
+ :'metadata' => :'metadata',
39
+ :'orders' => :'orders',
40
+ :'success' => :'success',
41
+ :'warning' => :'warning'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ :'auto_orders' => :'Array<AutoOrder>',
49
+ :'customer' => :'Customer',
50
+ :'error' => :'Error',
51
+ :'metadata' => :'ResponseMetadata',
52
+ :'orders' => :'Array<Order>',
53
+ :'success' => :'BOOLEAN',
54
+ :'warning' => :'Warning'
55
+ }
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
65
+
66
+ if attributes.has_key?(:'auto_orders')
67
+ if (value = attributes[:'auto_orders']).is_a?(Array)
68
+ self.auto_orders = value
69
+ end
70
+ end
71
+
72
+ if attributes.has_key?(:'customer')
73
+ self.customer = attributes[:'customer']
74
+ end
75
+
76
+ if attributes.has_key?(:'error')
77
+ self.error = attributes[:'error']
78
+ end
79
+
80
+ if attributes.has_key?(:'metadata')
81
+ self.metadata = attributes[:'metadata']
82
+ end
83
+
84
+ if attributes.has_key?(:'orders')
85
+ if (value = attributes[:'orders']).is_a?(Array)
86
+ self.orders = value
87
+ end
88
+ end
89
+
90
+ if attributes.has_key?(:'success')
91
+ self.success = attributes[:'success']
92
+ end
93
+
94
+ if attributes.has_key?(:'warning')
95
+ self.warning = attributes[:'warning']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ auto_orders == o.auto_orders &&
118
+ customer == o.customer &&
119
+ error == o.error &&
120
+ metadata == o.metadata &&
121
+ orders == o.orders &&
122
+ success == o.success &&
123
+ warning == o.warning
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Fixnum] Hash code
134
+ def hash
135
+ [auto_orders, customer, error, metadata, orders, success, warning].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.swagger_types.each_pair do |key, type|
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :DateTime
165
+ DateTime.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :BOOLEAN
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ temp_model = UltracartClient.const_get(type).new
196
+ temp_model.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ next if value.nil?
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+ end