ultracart_api 4.1.86 → 4.1.87

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.
@@ -49,6 +49,9 @@ module UltracartClient
49
49
 
50
50
  attr_accessor :edi
51
51
 
52
+ # Email delivery records associated with this order.
53
+ attr_accessor :emails
54
+
52
55
  # Exchange rate at the time the order was placed if currency code is different than the base currency
53
56
  attr_accessor :exchange_rate
54
57
 
@@ -150,6 +153,7 @@ module UltracartClient
150
153
  :'customer_profile' => :'customer_profile',
151
154
  :'digital_order' => :'digital_order',
152
155
  :'edi' => :'edi',
156
+ :'emails' => :'emails',
153
157
  :'exchange_rate' => :'exchange_rate',
154
158
  :'fraud_score' => :'fraud_score',
155
159
  :'gift' => :'gift',
@@ -200,6 +204,7 @@ module UltracartClient
200
204
  :'customer_profile' => :'Customer',
201
205
  :'digital_order' => :'OrderDigitalOrder',
202
206
  :'edi' => :'OrderEdi',
207
+ :'emails' => :'Array<OrderEmail>',
203
208
  :'exchange_rate' => :'Float',
204
209
  :'fraud_score' => :'OrderFraudScore',
205
210
  :'gift' => :'OrderGift',
@@ -311,6 +316,12 @@ module UltracartClient
311
316
  self.edi = attributes[:'edi']
312
317
  end
313
318
 
319
+ if attributes.key?(:'emails')
320
+ if (value = attributes[:'emails']).is_a?(Array)
321
+ self.emails = value
322
+ end
323
+ end
324
+
314
325
  if attributes.key?(:'exchange_rate')
315
326
  self.exchange_rate = attributes[:'exchange_rate']
316
327
  end
@@ -494,6 +505,7 @@ module UltracartClient
494
505
  customer_profile == o.customer_profile &&
495
506
  digital_order == o.digital_order &&
496
507
  edi == o.edi &&
508
+ emails == o.emails &&
497
509
  exchange_rate == o.exchange_rate &&
498
510
  fraud_score == o.fraud_score &&
499
511
  gift == o.gift &&
@@ -530,7 +542,7 @@ module UltracartClient
530
542
  # Calculates hash code according to all attributes.
531
543
  # @return [Integer] Hash code
532
544
  def hash
533
- [affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, current_stage_histories, customer_profile, digital_order, edi, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, point_of_sale, properties, quote, refund_dts, refund_reason, reject_dts, reject_reason, salesforce, shipping, summary, tags, taxes, utms].hash
545
+ [affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, current_stage_histories, customer_profile, digital_order, edi, emails, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, point_of_sale, properties, quote, refund_dts, refund_reason, reject_dts, reject_reason, salesforce, shipping, summary, tags, taxes, utms].hash
534
546
  end
535
547
 
536
548
  # Builds the object from hash
@@ -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 OrderEmail
18
+ attr_accessor :bounce_diagnostic_code
19
+
20
+ # Date/time that the email was bounced
21
+ attr_accessor :bounce_dts
22
+
23
+ attr_accessor :bounce_sub_type
24
+
25
+ attr_accessor :bounce_type
26
+
27
+ attr_accessor :clicked
28
+
29
+ # Date/time that the email was clicked
30
+ attr_accessor :clicked_dts
31
+
32
+ attr_accessor :delivered
33
+
34
+ # Date/time that the email was delivered
35
+ attr_accessor :delivery_dts
36
+
37
+ # Email
38
+ attr_accessor :email
39
+
40
+ attr_accessor :internal
41
+
42
+ attr_accessor :message_id
43
+
44
+ attr_accessor :opened
45
+
46
+ # Date/time that the email was opened
47
+ attr_accessor :opened_dts
48
+
49
+ attr_accessor :reporting_mta
50
+
51
+ # Date/time that the email was sent
52
+ attr_accessor :send_dts
53
+
54
+ attr_accessor :skip_reason
55
+
56
+ attr_accessor :skipped
57
+
58
+ attr_accessor :smtp_response
59
+
60
+ attr_accessor :subject
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'bounce_diagnostic_code' => :'bounce_diagnostic_code',
66
+ :'bounce_dts' => :'bounce_dts',
67
+ :'bounce_sub_type' => :'bounce_sub_type',
68
+ :'bounce_type' => :'bounce_type',
69
+ :'clicked' => :'clicked',
70
+ :'clicked_dts' => :'clicked_dts',
71
+ :'delivered' => :'delivered',
72
+ :'delivery_dts' => :'delivery_dts',
73
+ :'email' => :'email',
74
+ :'internal' => :'internal',
75
+ :'message_id' => :'message_id',
76
+ :'opened' => :'opened',
77
+ :'opened_dts' => :'opened_dts',
78
+ :'reporting_mta' => :'reporting_mta',
79
+ :'send_dts' => :'send_dts',
80
+ :'skip_reason' => :'skip_reason',
81
+ :'skipped' => :'skipped',
82
+ :'smtp_response' => :'smtp_response',
83
+ :'subject' => :'subject'
84
+ }
85
+ end
86
+
87
+ # Returns all the JSON keys this model knows about
88
+ def self.acceptable_attributes
89
+ attribute_map.values
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'bounce_diagnostic_code' => :'String',
96
+ :'bounce_dts' => :'String',
97
+ :'bounce_sub_type' => :'String',
98
+ :'bounce_type' => :'String',
99
+ :'clicked' => :'Boolean',
100
+ :'clicked_dts' => :'String',
101
+ :'delivered' => :'Boolean',
102
+ :'delivery_dts' => :'String',
103
+ :'email' => :'String',
104
+ :'internal' => :'Boolean',
105
+ :'message_id' => :'String',
106
+ :'opened' => :'Boolean',
107
+ :'opened_dts' => :'String',
108
+ :'reporting_mta' => :'String',
109
+ :'send_dts' => :'String',
110
+ :'skip_reason' => :'String',
111
+ :'skipped' => :'Boolean',
112
+ :'smtp_response' => :'String',
113
+ :'subject' => :'String'
114
+ }
115
+ end
116
+
117
+ # List of attributes with nullable: true
118
+ def self.openapi_nullable
119
+ Set.new([
120
+ ])
121
+ end
122
+
123
+ # Initializes the object
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ def initialize(attributes = {})
126
+ if (!attributes.is_a?(Hash))
127
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderEmail` initialize method"
128
+ end
129
+
130
+ # check to see if the attribute exists and convert string to symbol for hash key
131
+ attributes = attributes.each_with_object({}) { |(k, v), h|
132
+ if (!self.class.attribute_map.key?(k.to_sym))
133
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
134
+ end
135
+ h[k.to_sym] = v
136
+ }
137
+
138
+ if attributes.key?(:'bounce_diagnostic_code')
139
+ self.bounce_diagnostic_code = attributes[:'bounce_diagnostic_code']
140
+ end
141
+
142
+ if attributes.key?(:'bounce_dts')
143
+ self.bounce_dts = attributes[:'bounce_dts']
144
+ end
145
+
146
+ if attributes.key?(:'bounce_sub_type')
147
+ self.bounce_sub_type = attributes[:'bounce_sub_type']
148
+ end
149
+
150
+ if attributes.key?(:'bounce_type')
151
+ self.bounce_type = attributes[:'bounce_type']
152
+ end
153
+
154
+ if attributes.key?(:'clicked')
155
+ self.clicked = attributes[:'clicked']
156
+ end
157
+
158
+ if attributes.key?(:'clicked_dts')
159
+ self.clicked_dts = attributes[:'clicked_dts']
160
+ end
161
+
162
+ if attributes.key?(:'delivered')
163
+ self.delivered = attributes[:'delivered']
164
+ end
165
+
166
+ if attributes.key?(:'delivery_dts')
167
+ self.delivery_dts = attributes[:'delivery_dts']
168
+ end
169
+
170
+ if attributes.key?(:'email')
171
+ self.email = attributes[:'email']
172
+ end
173
+
174
+ if attributes.key?(:'internal')
175
+ self.internal = attributes[:'internal']
176
+ end
177
+
178
+ if attributes.key?(:'message_id')
179
+ self.message_id = attributes[:'message_id']
180
+ end
181
+
182
+ if attributes.key?(:'opened')
183
+ self.opened = attributes[:'opened']
184
+ end
185
+
186
+ if attributes.key?(:'opened_dts')
187
+ self.opened_dts = attributes[:'opened_dts']
188
+ end
189
+
190
+ if attributes.key?(:'reporting_mta')
191
+ self.reporting_mta = attributes[:'reporting_mta']
192
+ end
193
+
194
+ if attributes.key?(:'send_dts')
195
+ self.send_dts = attributes[:'send_dts']
196
+ end
197
+
198
+ if attributes.key?(:'skip_reason')
199
+ self.skip_reason = attributes[:'skip_reason']
200
+ end
201
+
202
+ if attributes.key?(:'skipped')
203
+ self.skipped = attributes[:'skipped']
204
+ end
205
+
206
+ if attributes.key?(:'smtp_response')
207
+ self.smtp_response = attributes[:'smtp_response']
208
+ end
209
+
210
+ if attributes.key?(:'subject')
211
+ self.subject = attributes[:'subject']
212
+ end
213
+ end
214
+
215
+ # Show invalid properties with the reasons. Usually used together with valid?
216
+ # @return Array for valid properties with the reasons
217
+ def list_invalid_properties
218
+ invalid_properties = Array.new
219
+ if !@email.nil? && @email.to_s.length > 100
220
+ invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 100.')
221
+ end
222
+
223
+ invalid_properties
224
+ end
225
+
226
+ # Check to see if the all the properties in the model are valid
227
+ # @return true if the model is valid
228
+ def valid?
229
+ return false if !@email.nil? && @email.to_s.length > 100
230
+ true
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] email Value to be assigned
235
+ def email=(email)
236
+ if !email.nil? && email.to_s.length > 100
237
+ fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 100.'
238
+ end
239
+
240
+ @email = email
241
+ end
242
+
243
+ # Checks equality by comparing each attribute.
244
+ # @param [Object] Object to be compared
245
+ def ==(o)
246
+ return true if self.equal?(o)
247
+ self.class == o.class &&
248
+ bounce_diagnostic_code == o.bounce_diagnostic_code &&
249
+ bounce_dts == o.bounce_dts &&
250
+ bounce_sub_type == o.bounce_sub_type &&
251
+ bounce_type == o.bounce_type &&
252
+ clicked == o.clicked &&
253
+ clicked_dts == o.clicked_dts &&
254
+ delivered == o.delivered &&
255
+ delivery_dts == o.delivery_dts &&
256
+ email == o.email &&
257
+ internal == o.internal &&
258
+ message_id == o.message_id &&
259
+ opened == o.opened &&
260
+ opened_dts == o.opened_dts &&
261
+ reporting_mta == o.reporting_mta &&
262
+ send_dts == o.send_dts &&
263
+ skip_reason == o.skip_reason &&
264
+ skipped == o.skipped &&
265
+ smtp_response == o.smtp_response &&
266
+ subject == o.subject
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
+ [bounce_diagnostic_code, bounce_dts, bounce_sub_type, bounce_type, clicked, clicked_dts, delivered, delivery_dts, email, internal, message_id, opened, opened_dts, reporting_mta, send_dts, skip_reason, skipped, smtp_response, subject].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