ultracart_api 3.10.45 → 3.10.47

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 ConversationMessagesResponse
17
+ attr_accessor :conversation_messages
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
+ :'conversation_messages' => :'conversation_messages',
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
+ :'conversation_messages' => :'Array<ConversationMessage>',
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?(:'conversation_messages')
59
+ if (value = attributes[:'conversation_messages']).is_a?(Array)
60
+ self.conversation_messages = 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
+ conversation_messages == o.conversation_messages &&
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
+ [conversation_messages, 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,404 @@
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 EmailPostcardTracking
17
+ attr_accessor :commseq_postcard_uuid
18
+
19
+ attr_accessor :commseq_step_uuid
20
+
21
+ attr_accessor :commseq_uuid
22
+
23
+ # Conversion date time.
24
+ attr_accessor :conversion_dts
25
+
26
+ attr_accessor :cost
27
+
28
+ attr_accessor :customer_uuid
29
+
30
+ # Delivered date time.
31
+ attr_accessor :delivered_dts
32
+
33
+ attr_accessor :from_address_line1
34
+
35
+ attr_accessor :from_address_line2
36
+
37
+ attr_accessor :from_city
38
+
39
+ attr_accessor :from_name
40
+
41
+ attr_accessor :from_state
42
+
43
+ attr_accessor :from_zip
44
+
45
+ # Mailed date time.
46
+ attr_accessor :mailed_dts
47
+
48
+ attr_accessor :order_id
49
+
50
+ attr_accessor :postcard_tracking_uuid
51
+
52
+ attr_accessor :status
53
+
54
+ # Submit date time.
55
+ attr_accessor :submit_dts
56
+
57
+ attr_accessor :to_address_line1
58
+
59
+ attr_accessor :to_address_line2
60
+
61
+ attr_accessor :to_city
62
+
63
+ attr_accessor :to_name
64
+
65
+ attr_accessor :to_state
66
+
67
+ attr_accessor :to_zip
68
+
69
+ attr_accessor :tracking_description
70
+
71
+ # Attribute mapping from ruby-style variable name to JSON key.
72
+ def self.attribute_map
73
+ {
74
+ :'commseq_postcard_uuid' => :'commseq_postcard_uuid',
75
+ :'commseq_step_uuid' => :'commseq_step_uuid',
76
+ :'commseq_uuid' => :'commseq_uuid',
77
+ :'conversion_dts' => :'conversion_dts',
78
+ :'cost' => :'cost',
79
+ :'customer_uuid' => :'customer_uuid',
80
+ :'delivered_dts' => :'delivered_dts',
81
+ :'from_address_line1' => :'from_address_line1',
82
+ :'from_address_line2' => :'from_address_line2',
83
+ :'from_city' => :'from_city',
84
+ :'from_name' => :'from_name',
85
+ :'from_state' => :'from_state',
86
+ :'from_zip' => :'from_zip',
87
+ :'mailed_dts' => :'mailed_dts',
88
+ :'order_id' => :'order_id',
89
+ :'postcard_tracking_uuid' => :'postcard_tracking_uuid',
90
+ :'status' => :'status',
91
+ :'submit_dts' => :'submit_dts',
92
+ :'to_address_line1' => :'to_address_line1',
93
+ :'to_address_line2' => :'to_address_line2',
94
+ :'to_city' => :'to_city',
95
+ :'to_name' => :'to_name',
96
+ :'to_state' => :'to_state',
97
+ :'to_zip' => :'to_zip',
98
+ :'tracking_description' => :'tracking_description'
99
+ }
100
+ end
101
+
102
+ # Attribute type mapping.
103
+ def self.swagger_types
104
+ {
105
+ :'commseq_postcard_uuid' => :'String',
106
+ :'commseq_step_uuid' => :'String',
107
+ :'commseq_uuid' => :'String',
108
+ :'conversion_dts' => :'String',
109
+ :'cost' => :'Float',
110
+ :'customer_uuid' => :'String',
111
+ :'delivered_dts' => :'String',
112
+ :'from_address_line1' => :'String',
113
+ :'from_address_line2' => :'String',
114
+ :'from_city' => :'String',
115
+ :'from_name' => :'String',
116
+ :'from_state' => :'String',
117
+ :'from_zip' => :'String',
118
+ :'mailed_dts' => :'String',
119
+ :'order_id' => :'String',
120
+ :'postcard_tracking_uuid' => :'String',
121
+ :'status' => :'String',
122
+ :'submit_dts' => :'String',
123
+ :'to_address_line1' => :'String',
124
+ :'to_address_line2' => :'String',
125
+ :'to_city' => :'String',
126
+ :'to_name' => :'String',
127
+ :'to_state' => :'String',
128
+ :'to_zip' => :'String',
129
+ :'tracking_description' => :'String'
130
+ }
131
+ end
132
+
133
+ # Initializes the object
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ def initialize(attributes = {})
136
+ return unless attributes.is_a?(Hash)
137
+
138
+ # convert string to symbol for hash key
139
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
140
+
141
+ if attributes.has_key?(:'commseq_postcard_uuid')
142
+ self.commseq_postcard_uuid = attributes[:'commseq_postcard_uuid']
143
+ end
144
+
145
+ if attributes.has_key?(:'commseq_step_uuid')
146
+ self.commseq_step_uuid = attributes[:'commseq_step_uuid']
147
+ end
148
+
149
+ if attributes.has_key?(:'commseq_uuid')
150
+ self.commseq_uuid = attributes[:'commseq_uuid']
151
+ end
152
+
153
+ if attributes.has_key?(:'conversion_dts')
154
+ self.conversion_dts = attributes[:'conversion_dts']
155
+ end
156
+
157
+ if attributes.has_key?(:'cost')
158
+ self.cost = attributes[:'cost']
159
+ end
160
+
161
+ if attributes.has_key?(:'customer_uuid')
162
+ self.customer_uuid = attributes[:'customer_uuid']
163
+ end
164
+
165
+ if attributes.has_key?(:'delivered_dts')
166
+ self.delivered_dts = attributes[:'delivered_dts']
167
+ end
168
+
169
+ if attributes.has_key?(:'from_address_line1')
170
+ self.from_address_line1 = attributes[:'from_address_line1']
171
+ end
172
+
173
+ if attributes.has_key?(:'from_address_line2')
174
+ self.from_address_line2 = attributes[:'from_address_line2']
175
+ end
176
+
177
+ if attributes.has_key?(:'from_city')
178
+ self.from_city = attributes[:'from_city']
179
+ end
180
+
181
+ if attributes.has_key?(:'from_name')
182
+ self.from_name = attributes[:'from_name']
183
+ end
184
+
185
+ if attributes.has_key?(:'from_state')
186
+ self.from_state = attributes[:'from_state']
187
+ end
188
+
189
+ if attributes.has_key?(:'from_zip')
190
+ self.from_zip = attributes[:'from_zip']
191
+ end
192
+
193
+ if attributes.has_key?(:'mailed_dts')
194
+ self.mailed_dts = attributes[:'mailed_dts']
195
+ end
196
+
197
+ if attributes.has_key?(:'order_id')
198
+ self.order_id = attributes[:'order_id']
199
+ end
200
+
201
+ if attributes.has_key?(:'postcard_tracking_uuid')
202
+ self.postcard_tracking_uuid = attributes[:'postcard_tracking_uuid']
203
+ end
204
+
205
+ if attributes.has_key?(:'status')
206
+ self.status = attributes[:'status']
207
+ end
208
+
209
+ if attributes.has_key?(:'submit_dts')
210
+ self.submit_dts = attributes[:'submit_dts']
211
+ end
212
+
213
+ if attributes.has_key?(:'to_address_line1')
214
+ self.to_address_line1 = attributes[:'to_address_line1']
215
+ end
216
+
217
+ if attributes.has_key?(:'to_address_line2')
218
+ self.to_address_line2 = attributes[:'to_address_line2']
219
+ end
220
+
221
+ if attributes.has_key?(:'to_city')
222
+ self.to_city = attributes[:'to_city']
223
+ end
224
+
225
+ if attributes.has_key?(:'to_name')
226
+ self.to_name = attributes[:'to_name']
227
+ end
228
+
229
+ if attributes.has_key?(:'to_state')
230
+ self.to_state = attributes[:'to_state']
231
+ end
232
+
233
+ if attributes.has_key?(:'to_zip')
234
+ self.to_zip = attributes[:'to_zip']
235
+ end
236
+
237
+ if attributes.has_key?(:'tracking_description')
238
+ self.tracking_description = attributes[:'tracking_description']
239
+ end
240
+ end
241
+
242
+ # Show invalid properties with the reasons. Usually used together with valid?
243
+ # @return Array for valid properties with the reasons
244
+ def list_invalid_properties
245
+ invalid_properties = Array.new
246
+ invalid_properties
247
+ end
248
+
249
+ # Check to see if the all the properties in the model are valid
250
+ # @return true if the model is valid
251
+ def valid?
252
+ true
253
+ end
254
+
255
+ # Checks equality by comparing each attribute.
256
+ # @param [Object] Object to be compared
257
+ def ==(o)
258
+ return true if self.equal?(o)
259
+ self.class == o.class &&
260
+ commseq_postcard_uuid == o.commseq_postcard_uuid &&
261
+ commseq_step_uuid == o.commseq_step_uuid &&
262
+ commseq_uuid == o.commseq_uuid &&
263
+ conversion_dts == o.conversion_dts &&
264
+ cost == o.cost &&
265
+ customer_uuid == o.customer_uuid &&
266
+ delivered_dts == o.delivered_dts &&
267
+ from_address_line1 == o.from_address_line1 &&
268
+ from_address_line2 == o.from_address_line2 &&
269
+ from_city == o.from_city &&
270
+ from_name == o.from_name &&
271
+ from_state == o.from_state &&
272
+ from_zip == o.from_zip &&
273
+ mailed_dts == o.mailed_dts &&
274
+ order_id == o.order_id &&
275
+ postcard_tracking_uuid == o.postcard_tracking_uuid &&
276
+ status == o.status &&
277
+ submit_dts == o.submit_dts &&
278
+ to_address_line1 == o.to_address_line1 &&
279
+ to_address_line2 == o.to_address_line2 &&
280
+ to_city == o.to_city &&
281
+ to_name == o.to_name &&
282
+ to_state == o.to_state &&
283
+ to_zip == o.to_zip &&
284
+ tracking_description == o.tracking_description
285
+ end
286
+
287
+ # @see the `==` method
288
+ # @param [Object] Object to be compared
289
+ def eql?(o)
290
+ self == o
291
+ end
292
+
293
+ # Calculates hash code according to all attributes.
294
+ # @return [Fixnum] Hash code
295
+ def hash
296
+ [commseq_postcard_uuid, commseq_step_uuid, commseq_uuid, conversion_dts, cost, customer_uuid, delivered_dts, from_address_line1, from_address_line2, from_city, from_name, from_state, from_zip, mailed_dts, order_id, postcard_tracking_uuid, status, submit_dts, to_address_line1, to_address_line2, to_city, to_name, to_state, to_zip, tracking_description].hash
297
+ end
298
+
299
+ # Builds the object from hash
300
+ # @param [Hash] attributes Model attributes in the form of hash
301
+ # @return [Object] Returns the model itself
302
+ def build_from_hash(attributes)
303
+ return nil unless attributes.is_a?(Hash)
304
+ self.class.swagger_types.each_pair do |key, type|
305
+ if type =~ /\AArray<(.*)>/i
306
+ # check to ensure the input is an array given that the attribute
307
+ # is documented as an array but the input is not
308
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
309
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
310
+ end
311
+ elsif !attributes[self.class.attribute_map[key]].nil?
312
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
313
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
314
+ end
315
+
316
+ self
317
+ end
318
+
319
+ # Deserializes the data based on type
320
+ # @param string type Data type
321
+ # @param string value Value to be deserialized
322
+ # @return [Object] Deserialized data
323
+ def _deserialize(type, value)
324
+ case type.to_sym
325
+ when :DateTime
326
+ DateTime.parse(value)
327
+ when :Date
328
+ Date.parse(value)
329
+ when :String
330
+ value.to_s
331
+ when :Integer
332
+ value.to_i
333
+ when :Float
334
+ value.to_f
335
+ when :BOOLEAN
336
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
337
+ true
338
+ else
339
+ false
340
+ end
341
+ when :Object
342
+ # generic object (usually a Hash), return directly
343
+ value
344
+ when /\AArray<(?<inner_type>.+)>\z/
345
+ inner_type = Regexp.last_match[:inner_type]
346
+ value.map { |v| _deserialize(inner_type, v) }
347
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
348
+ k_type = Regexp.last_match[:k_type]
349
+ v_type = Regexp.last_match[:v_type]
350
+ {}.tap do |hash|
351
+ value.each do |k, v|
352
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
353
+ end
354
+ end
355
+ else # model
356
+ temp_model = UltracartClient.const_get(type).new
357
+ temp_model.build_from_hash(value)
358
+ end
359
+ end
360
+
361
+ # Returns the string representation of the object
362
+ # @return [String] String presentation of the object
363
+ def to_s
364
+ to_hash.to_s
365
+ end
366
+
367
+ # to_body is an alias to to_hash (backward compatibility)
368
+ # @return [Hash] Returns the object in the form of hash
369
+ def to_body
370
+ to_hash
371
+ end
372
+
373
+ # Returns the object in the form of hash
374
+ # @return [Hash] Returns the object in the form of hash
375
+ def to_hash
376
+ hash = {}
377
+ self.class.attribute_map.each_pair do |attr, param|
378
+ value = self.send(attr)
379
+ next if value.nil?
380
+ hash[param] = _to_hash(value)
381
+ end
382
+ hash
383
+ end
384
+
385
+ # Outputs non-array value in the form of hash
386
+ # For object, use to_hash. Otherwise, just return the value
387
+ # @param [Object] value Any valid value
388
+ # @return [Hash] Returns the value in the form of hash
389
+ def _to_hash(value)
390
+ if value.is_a?(Array)
391
+ value.compact.map { |v| _to_hash(v) }
392
+ elsif value.is_a?(Hash)
393
+ {}.tap do |hash|
394
+ value.each { |k, v| hash[k] = _to_hash(v) }
395
+ end
396
+ elsif value.respond_to? :to_hash
397
+ value.to_hash
398
+ else
399
+ value
400
+ end
401
+ end
402
+
403
+ end
404
+ end