ultracart_api 4.1.86 → 4.1.88

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.
@@ -1236,6 +1236,134 @@ module UltracartClient
1236
1236
  return data, status_code, headers
1237
1237
  end
1238
1238
 
1239
+ # Retrieve email delivery information for this order.
1240
+ # Retrieves email delivery records associated with the specified order id.
1241
+ # @param order_id [String] The order id to retrieve email delivery information for.
1242
+ # @param [Hash] opts the optional parameters
1243
+ # @return [OrderEmailsResponse]
1244
+ def get_order_emails(order_id, opts = {})
1245
+ data, _status_code, _headers = get_order_emails_with_http_info(order_id, opts)
1246
+ data
1247
+ end
1248
+
1249
+ # Retrieve email delivery information for this order.
1250
+ # Retrieves email delivery records associated with the specified order id.
1251
+ # @param order_id [String] The order id to retrieve email delivery information for.
1252
+ # @param [Hash] opts the optional parameters
1253
+ # @return [Array<(OrderEmailsResponse, Integer, Hash)>] OrderEmailsResponse data, response status code and response headers
1254
+ def get_order_emails_with_http_info(order_id, opts = {})
1255
+ if @api_client.config.debugging
1256
+ @api_client.config.logger.debug 'Calling API: OrderApi.get_order_emails ...'
1257
+ end
1258
+ # verify the required parameter 'order_id' is set
1259
+ if @api_client.config.client_side_validation && order_id.nil?
1260
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.get_order_emails"
1261
+ end
1262
+ # resource path
1263
+ local_var_path = '/order/orders/{order_id}/emails'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
1264
+
1265
+ # query parameters
1266
+ query_params = opts[:query_params] || {}
1267
+
1268
+ # header parameters
1269
+ header_params = opts[:header_params] || {}
1270
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1271
+ # HTTP header 'Accept' (if needed)
1272
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1273
+
1274
+ # form parameters
1275
+ form_params = opts[:form_params] || {}
1276
+
1277
+ # http body (model)
1278
+ post_body = opts[:debug_body]
1279
+
1280
+ # return_type
1281
+ return_type = opts[:debug_return_type] || 'OrderEmailsResponse'
1282
+
1283
+ # auth_names
1284
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1285
+
1286
+ new_options = opts.merge(
1287
+ :operation => :"OrderApi.get_order_emails",
1288
+ :header_params => header_params,
1289
+ :query_params => query_params,
1290
+ :form_params => form_params,
1291
+ :body => post_body,
1292
+ :auth_names => auth_names,
1293
+ :return_type => return_type
1294
+ )
1295
+
1296
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1297
+ if @api_client.config.debugging
1298
+ @api_client.config.logger.debug "API called: OrderApi#get_order_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1299
+ end
1300
+ return data, status_code, headers
1301
+ end
1302
+
1303
+ # Retrieve page view history for this order.
1304
+ # Retrieves the page views captured during the session that placed this order.
1305
+ # @param order_id [String] The order id to retrieve page view history for.
1306
+ # @param [Hash] opts the optional parameters
1307
+ # @return [OrderPageViewHistoryResponse]
1308
+ def get_order_page_view_history(order_id, opts = {})
1309
+ data, _status_code, _headers = get_order_page_view_history_with_http_info(order_id, opts)
1310
+ data
1311
+ end
1312
+
1313
+ # Retrieve page view history for this order.
1314
+ # Retrieves the page views captured during the session that placed this order.
1315
+ # @param order_id [String] The order id to retrieve page view history for.
1316
+ # @param [Hash] opts the optional parameters
1317
+ # @return [Array<(OrderPageViewHistoryResponse, Integer, Hash)>] OrderPageViewHistoryResponse data, response status code and response headers
1318
+ def get_order_page_view_history_with_http_info(order_id, opts = {})
1319
+ if @api_client.config.debugging
1320
+ @api_client.config.logger.debug 'Calling API: OrderApi.get_order_page_view_history ...'
1321
+ end
1322
+ # verify the required parameter 'order_id' is set
1323
+ if @api_client.config.client_side_validation && order_id.nil?
1324
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.get_order_page_view_history"
1325
+ end
1326
+ # resource path
1327
+ local_var_path = '/order/orders/{order_id}/page_view_history'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
1328
+
1329
+ # query parameters
1330
+ query_params = opts[:query_params] || {}
1331
+
1332
+ # header parameters
1333
+ header_params = opts[:header_params] || {}
1334
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1335
+ # HTTP header 'Accept' (if needed)
1336
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1337
+
1338
+ # form parameters
1339
+ form_params = opts[:form_params] || {}
1340
+
1341
+ # http body (model)
1342
+ post_body = opts[:debug_body]
1343
+
1344
+ # return_type
1345
+ return_type = opts[:debug_return_type] || 'OrderPageViewHistoryResponse'
1346
+
1347
+ # auth_names
1348
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1349
+
1350
+ new_options = opts.merge(
1351
+ :operation => :"OrderApi.get_order_page_view_history",
1352
+ :header_params => header_params,
1353
+ :query_params => query_params,
1354
+ :form_params => form_params,
1355
+ :body => post_body,
1356
+ :auth_names => auth_names,
1357
+ :return_type => return_type
1358
+ )
1359
+
1360
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1361
+ if @api_client.config.debugging
1362
+ @api_client.config.logger.debug "API called: OrderApi#get_order_page_view_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1363
+ end
1364
+ return data, status_code, headers
1365
+ end
1366
+
1239
1367
  # Get Order Upsell Cart
1240
1368
  # Creates a new cart using cloned information from the order, but with a specific set of items, coupons and optionally a checkout URL to return the customer to
1241
1369
  # @param order_id [String] The order id to base things on.
@@ -51,6 +51,9 @@ module UltracartClient
51
51
  # The date/time the auto order was disabled due to failed rebills
52
52
  attr_accessor :disabled_dts
53
53
 
54
+ # Email delivery records associated with this auto order.
55
+ attr_accessor :emails
56
+
54
57
  # True if this auto order is enabled
55
58
  attr_accessor :enabled
56
59
 
@@ -134,6 +137,7 @@ module UltracartClient
134
137
  :'completed' => :'completed',
135
138
  :'credit_card_attempt' => :'credit_card_attempt',
136
139
  :'disabled_dts' => :'disabled_dts',
140
+ :'emails' => :'emails',
137
141
  :'enabled' => :'enabled',
138
142
  :'failure_reason' => :'failure_reason',
139
143
  :'items' => :'items',
@@ -173,6 +177,7 @@ module UltracartClient
173
177
  :'completed' => :'Boolean',
174
178
  :'credit_card_attempt' => :'Integer',
175
179
  :'disabled_dts' => :'String',
180
+ :'emails' => :'Array<AutoOrderEmail>',
176
181
  :'enabled' => :'Boolean',
177
182
  :'failure_reason' => :'String',
178
183
  :'items' => :'Array<AutoOrderItem>',
@@ -263,6 +268,12 @@ module UltracartClient
263
268
  self.disabled_dts = attributes[:'disabled_dts']
264
269
  end
265
270
 
271
+ if attributes.key?(:'emails')
272
+ if (value = attributes[:'emails']).is_a?(Array)
273
+ self.emails = value
274
+ end
275
+ end
276
+
266
277
  if attributes.key?(:'enabled')
267
278
  self.enabled = attributes[:'enabled']
268
279
  end
@@ -378,6 +389,7 @@ module UltracartClient
378
389
  completed == o.completed &&
379
390
  credit_card_attempt == o.credit_card_attempt &&
380
391
  disabled_dts == o.disabled_dts &&
392
+ emails == o.emails &&
381
393
  enabled == o.enabled &&
382
394
  failure_reason == o.failure_reason &&
383
395
  items == o.items &&
@@ -405,7 +417,7 @@ module UltracartClient
405
417
  # Calculates hash code according to all attributes.
406
418
  # @return [Integer] Hash code
407
419
  def hash
408
- [add_ons, auto_order_code, auto_order_oid, cancel_after_next_x_orders, cancel_downgrade, cancel_reason, cancel_upgrade, canceled_by_user, canceled_dts, completed, credit_card_attempt, disabled_dts, enabled, failure_reason, items, logs, management, merchant_id, merged_dts, merged_into_auto_order_oid, next_attempt, original_order, original_order_id, override_affiliate_id, properties, rebill_orders, rotating_transaction_gateway_code, status].hash
420
+ [add_ons, auto_order_code, auto_order_oid, cancel_after_next_x_orders, cancel_downgrade, cancel_reason, cancel_upgrade, canceled_by_user, canceled_dts, completed, credit_card_attempt, disabled_dts, emails, enabled, failure_reason, items, logs, management, merchant_id, merged_dts, merged_into_auto_order_oid, next_attempt, original_order, original_order_id, override_affiliate_id, properties, rebill_orders, rotating_transaction_gateway_code, status].hash
409
421
  end
410
422
 
411
423
  # 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 AutoOrderEmail
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::AutoOrderEmail` 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::AutoOrderEmail`. 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