ultracart_api 3.11.62 → 3.11.63
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.
- checksums.yaml +4 -4
- data/README.md +21 -4
- data/docs/AutoOrder.md +1 -0
- data/docs/AutoOrderAddonItemsUpdateRequest.md +8 -0
- data/docs/AutoOrderApi.md +180 -0
- data/docs/AutoOrderItem.md +2 -0
- data/docs/AutoOrderPropertiesUpdateRequest.md +8 -0
- data/docs/AutoOrderProperty.md +9 -0
- data/docs/ConversationApi.md +51 -0
- data/docs/EmailCommseqPostcard.md +1 -1
- data/docs/ItemApi.md +166 -0
- data/docs/ItemInventoryUpdate.md +10 -0
- data/docs/ItemInventoryUpdateRequest.md +8 -0
- data/docs/ItemShipping.md +1 -0
- data/docs/ItemShippingDistributionCenterResponse.md +12 -0
- data/docs/OrderAddItemsAndReleaseRequest.md +8 -0
- data/docs/OrderApi.md +113 -0
- data/lib/ultracart_api/api/auto_order_api.rb +204 -0
- data/lib/ultracart_api/api/conversation_api.rb +55 -0
- data/lib/ultracart_api/api/item_api.rb +187 -0
- data/lib/ultracart_api/api/order_api.rb +122 -0
- data/lib/ultracart_api/models/auto_order.rb +13 -1
- data/lib/ultracart_api/models/auto_order_addon_items_update_request.rb +187 -0
- data/lib/ultracart_api/models/auto_order_item.rb +25 -1
- data/lib/ultracart_api/models/auto_order_properties_update_request.rb +187 -0
- data/lib/ultracart_api/models/auto_order_property.rb +195 -0
- data/lib/ultracart_api/models/email_commseq_postcard.rb +1 -1
- data/lib/ultracart_api/models/item_inventory_update.rb +205 -0
- data/lib/ultracart_api/models/item_inventory_update_request.rb +187 -0
- data/lib/ultracart_api/models/item_shipping.rb +11 -1
- data/lib/ultracart_api/models/item_shipping_distribution_center_response.rb +221 -0
- data/lib/ultracart_api/models/order_add_items_and_release_request.rb +187 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +7 -0
- metadata +15 -1
|
@@ -1280,6 +1280,128 @@ module UltracartClient
|
|
|
1280
1280
|
end
|
|
1281
1281
|
return data, status_code, headers
|
|
1282
1282
|
end
|
|
1283
|
+
# Add items and release a held order
|
|
1284
|
+
# This method adds items to an order in the hold stage and releases it
|
|
1285
|
+
# @param add_items_and_release_request Add items and release request
|
|
1286
|
+
# @param order_id The order id to release.
|
|
1287
|
+
# @param [Hash] opts the optional parameters
|
|
1288
|
+
# @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples
|
|
1289
|
+
# @return [OrderResponse]
|
|
1290
|
+
def held_order_add_items_and_release(add_items_and_release_request, order_id, opts = {})
|
|
1291
|
+
data, _status_code, _headers = held_order_add_items_and_release_with_http_info(add_items_and_release_request, order_id, opts)
|
|
1292
|
+
data
|
|
1293
|
+
end
|
|
1294
|
+
|
|
1295
|
+
# Add items and release a held order
|
|
1296
|
+
# This method adds items to an order in the hold stage and releases it
|
|
1297
|
+
# @param add_items_and_release_request Add items and release request
|
|
1298
|
+
# @param order_id The order id to release.
|
|
1299
|
+
# @param [Hash] opts the optional parameters
|
|
1300
|
+
# @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples
|
|
1301
|
+
# @return [Array<(OrderResponse, Fixnum, Hash)>] OrderResponse data, response status code and response headers
|
|
1302
|
+
def held_order_add_items_and_release_with_http_info(add_items_and_release_request, order_id, opts = {})
|
|
1303
|
+
if @api_client.config.debugging
|
|
1304
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.held_order_add_items_and_release ...'
|
|
1305
|
+
end
|
|
1306
|
+
# verify the required parameter 'add_items_and_release_request' is set
|
|
1307
|
+
if @api_client.config.client_side_validation && add_items_and_release_request.nil?
|
|
1308
|
+
fail ArgumentError, "Missing the required parameter 'add_items_and_release_request' when calling OrderApi.held_order_add_items_and_release"
|
|
1309
|
+
end
|
|
1310
|
+
# verify the required parameter 'order_id' is set
|
|
1311
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
|
1312
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.held_order_add_items_and_release"
|
|
1313
|
+
end
|
|
1314
|
+
# resource path
|
|
1315
|
+
local_var_path = '/order/orders/{order_id}/hold/add_items_and_release'.sub('{' + 'order_id' + '}', order_id.to_s)
|
|
1316
|
+
|
|
1317
|
+
# query parameters
|
|
1318
|
+
query_params = {}
|
|
1319
|
+
query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
|
|
1320
|
+
|
|
1321
|
+
# header parameters
|
|
1322
|
+
header_params = {}
|
|
1323
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
1324
|
+
# HTTP header 'Accept' (if needed)
|
|
1325
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1326
|
+
# HTTP header 'Content-Type'
|
|
1327
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
|
|
1328
|
+
|
|
1329
|
+
# form parameters
|
|
1330
|
+
form_params = {}
|
|
1331
|
+
|
|
1332
|
+
# http body (model)
|
|
1333
|
+
post_body = @api_client.object_to_http_body(add_items_and_release_request)
|
|
1334
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
1335
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
1336
|
+
:header_params => header_params,
|
|
1337
|
+
:query_params => query_params,
|
|
1338
|
+
:form_params => form_params,
|
|
1339
|
+
:body => post_body,
|
|
1340
|
+
:auth_names => auth_names,
|
|
1341
|
+
:return_type => 'OrderResponse')
|
|
1342
|
+
if @api_client.config.debugging
|
|
1343
|
+
@api_client.config.logger.debug "API called: OrderApi#held_order_add_items_and_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1344
|
+
end
|
|
1345
|
+
return data, status_code, headers
|
|
1346
|
+
end
|
|
1347
|
+
# Release a held order
|
|
1348
|
+
# This method releases an order from the hold stage
|
|
1349
|
+
# @param order_id The order id to release.
|
|
1350
|
+
# @param [Hash] opts the optional parameters
|
|
1351
|
+
# @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples
|
|
1352
|
+
# @return [OrderResponse]
|
|
1353
|
+
def held_order_release(order_id, opts = {})
|
|
1354
|
+
data, _status_code, _headers = held_order_release_with_http_info(order_id, opts)
|
|
1355
|
+
data
|
|
1356
|
+
end
|
|
1357
|
+
|
|
1358
|
+
# Release a held order
|
|
1359
|
+
# This method releases an order from the hold stage
|
|
1360
|
+
# @param order_id The order id to release.
|
|
1361
|
+
# @param [Hash] opts the optional parameters
|
|
1362
|
+
# @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples
|
|
1363
|
+
# @return [Array<(OrderResponse, Fixnum, Hash)>] OrderResponse data, response status code and response headers
|
|
1364
|
+
def held_order_release_with_http_info(order_id, opts = {})
|
|
1365
|
+
if @api_client.config.debugging
|
|
1366
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.held_order_release ...'
|
|
1367
|
+
end
|
|
1368
|
+
# verify the required parameter 'order_id' is set
|
|
1369
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
|
1370
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.held_order_release"
|
|
1371
|
+
end
|
|
1372
|
+
# resource path
|
|
1373
|
+
local_var_path = '/order/orders/{order_id}/hold/release'.sub('{' + 'order_id' + '}', order_id.to_s)
|
|
1374
|
+
|
|
1375
|
+
# query parameters
|
|
1376
|
+
query_params = {}
|
|
1377
|
+
query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
|
|
1378
|
+
|
|
1379
|
+
# header parameters
|
|
1380
|
+
header_params = {}
|
|
1381
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
1382
|
+
# HTTP header 'Accept' (if needed)
|
|
1383
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1384
|
+
# HTTP header 'Content-Type'
|
|
1385
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
|
|
1386
|
+
|
|
1387
|
+
# form parameters
|
|
1388
|
+
form_params = {}
|
|
1389
|
+
|
|
1390
|
+
# http body (model)
|
|
1391
|
+
post_body = nil
|
|
1392
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
1393
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
1394
|
+
:header_params => header_params,
|
|
1395
|
+
:query_params => query_params,
|
|
1396
|
+
:form_params => form_params,
|
|
1397
|
+
:body => post_body,
|
|
1398
|
+
:auth_names => auth_names,
|
|
1399
|
+
:return_type => 'OrderResponse')
|
|
1400
|
+
if @api_client.config.debugging
|
|
1401
|
+
@api_client.config.logger.debug "API called: OrderApi#held_order_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1402
|
+
end
|
|
1403
|
+
return data, status_code, headers
|
|
1404
|
+
end
|
|
1283
1405
|
# Insert an order
|
|
1284
1406
|
# Inserts a new order on the UltraCart account. This is probably NOT the method you want. This is for channel orders. For regular orders the customer is entering, use the CheckoutApi. It has many, many more features, checks, and validations.
|
|
1285
1407
|
# @param order Order to insert
|
|
@@ -84,6 +84,9 @@ module UltracartClient
|
|
|
84
84
|
# Override the affiliate id given credit for rebills of this auto order
|
|
85
85
|
attr_accessor :override_affiliate_id
|
|
86
86
|
|
|
87
|
+
# Array of property objects
|
|
88
|
+
attr_accessor :properties
|
|
89
|
+
|
|
87
90
|
# Rebill orders that have taken place on this auto order
|
|
88
91
|
attr_accessor :rebill_orders
|
|
89
92
|
|
|
@@ -142,6 +145,7 @@ module UltracartClient
|
|
|
142
145
|
:'original_order' => :'original_order',
|
|
143
146
|
:'original_order_id' => :'original_order_id',
|
|
144
147
|
:'override_affiliate_id' => :'override_affiliate_id',
|
|
148
|
+
:'properties' => :'properties',
|
|
145
149
|
:'rebill_orders' => :'rebill_orders',
|
|
146
150
|
:'rotating_transaction_gateway_code' => :'rotating_transaction_gateway_code',
|
|
147
151
|
:'status' => :'status'
|
|
@@ -175,6 +179,7 @@ module UltracartClient
|
|
|
175
179
|
:'original_order' => :'Order',
|
|
176
180
|
:'original_order_id' => :'String',
|
|
177
181
|
:'override_affiliate_id' => :'Integer',
|
|
182
|
+
:'properties' => :'Array<AutoOrderProperty>',
|
|
178
183
|
:'rebill_orders' => :'Array<Order>',
|
|
179
184
|
:'rotating_transaction_gateway_code' => :'String',
|
|
180
185
|
:'status' => :'String'
|
|
@@ -291,6 +296,12 @@ module UltracartClient
|
|
|
291
296
|
self.override_affiliate_id = attributes[:'override_affiliate_id']
|
|
292
297
|
end
|
|
293
298
|
|
|
299
|
+
if attributes.has_key?(:'properties')
|
|
300
|
+
if (value = attributes[:'properties']).is_a?(Array)
|
|
301
|
+
self.properties = value
|
|
302
|
+
end
|
|
303
|
+
end
|
|
304
|
+
|
|
294
305
|
if attributes.has_key?(:'rebill_orders')
|
|
295
306
|
if (value = attributes[:'rebill_orders']).is_a?(Array)
|
|
296
307
|
self.rebill_orders = value
|
|
@@ -360,6 +371,7 @@ module UltracartClient
|
|
|
360
371
|
original_order == o.original_order &&
|
|
361
372
|
original_order_id == o.original_order_id &&
|
|
362
373
|
override_affiliate_id == o.override_affiliate_id &&
|
|
374
|
+
properties == o.properties &&
|
|
363
375
|
rebill_orders == o.rebill_orders &&
|
|
364
376
|
rotating_transaction_gateway_code == o.rotating_transaction_gateway_code &&
|
|
365
377
|
status == o.status
|
|
@@ -374,7 +386,7 @@ module UltracartClient
|
|
|
374
386
|
# Calculates hash code according to all attributes.
|
|
375
387
|
# @return [Fixnum] Hash code
|
|
376
388
|
def hash
|
|
377
|
-
[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, rebill_orders, rotating_transaction_gateway_code, status].hash
|
|
389
|
+
[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
|
|
378
390
|
end
|
|
379
391
|
|
|
380
392
|
# Builds the object from hash
|
|
@@ -0,0 +1,187 @@
|
|
|
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 AutoOrderAddonItemsUpdateRequest
|
|
17
|
+
# Add on items to update
|
|
18
|
+
attr_accessor :add_on_items
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'add_on_items' => :'add_on_items'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Attribute type mapping.
|
|
28
|
+
def self.swagger_types
|
|
29
|
+
{
|
|
30
|
+
:'add_on_items' => :'Array<AutoOrderAddonItem>'
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Initializes the object
|
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
36
|
+
def initialize(attributes = {})
|
|
37
|
+
return unless attributes.is_a?(Hash)
|
|
38
|
+
|
|
39
|
+
# convert string to symbol for hash key
|
|
40
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
41
|
+
|
|
42
|
+
if attributes.has_key?(:'add_on_items')
|
|
43
|
+
if (value = attributes[:'add_on_items']).is_a?(Array)
|
|
44
|
+
self.add_on_items = value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
50
|
+
# @return Array for valid properties with the reasons
|
|
51
|
+
def list_invalid_properties
|
|
52
|
+
invalid_properties = Array.new
|
|
53
|
+
invalid_properties
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Check to see if the all the properties in the model are valid
|
|
57
|
+
# @return true if the model is valid
|
|
58
|
+
def valid?
|
|
59
|
+
true
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Checks equality by comparing each attribute.
|
|
63
|
+
# @param [Object] Object to be compared
|
|
64
|
+
def ==(o)
|
|
65
|
+
return true if self.equal?(o)
|
|
66
|
+
self.class == o.class &&
|
|
67
|
+
add_on_items == o.add_on_items
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# @see the `==` method
|
|
71
|
+
# @param [Object] Object to be compared
|
|
72
|
+
def eql?(o)
|
|
73
|
+
self == o
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Calculates hash code according to all attributes.
|
|
77
|
+
# @return [Fixnum] Hash code
|
|
78
|
+
def hash
|
|
79
|
+
[add_on_items].hash
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Builds the object from hash
|
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
84
|
+
# @return [Object] Returns the model itself
|
|
85
|
+
def build_from_hash(attributes)
|
|
86
|
+
return nil unless attributes.is_a?(Hash)
|
|
87
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
88
|
+
if type =~ /\AArray<(.*)>/i
|
|
89
|
+
# check to ensure the input is an array given that the attribute
|
|
90
|
+
# is documented as an array but the input is not
|
|
91
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
92
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
93
|
+
end
|
|
94
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
95
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
96
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
self
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Deserializes the data based on type
|
|
103
|
+
# @param string type Data type
|
|
104
|
+
# @param string value Value to be deserialized
|
|
105
|
+
# @return [Object] Deserialized data
|
|
106
|
+
def _deserialize(type, value)
|
|
107
|
+
case type.to_sym
|
|
108
|
+
when :DateTime
|
|
109
|
+
DateTime.parse(value)
|
|
110
|
+
when :Date
|
|
111
|
+
Date.parse(value)
|
|
112
|
+
when :String
|
|
113
|
+
value.to_s
|
|
114
|
+
when :Integer
|
|
115
|
+
value.to_i
|
|
116
|
+
when :Float
|
|
117
|
+
value.to_f
|
|
118
|
+
when :BOOLEAN
|
|
119
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
120
|
+
true
|
|
121
|
+
else
|
|
122
|
+
false
|
|
123
|
+
end
|
|
124
|
+
when :Object
|
|
125
|
+
# generic object (usually a Hash), return directly
|
|
126
|
+
value
|
|
127
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
128
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
129
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
130
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
131
|
+
k_type = Regexp.last_match[:k_type]
|
|
132
|
+
v_type = Regexp.last_match[:v_type]
|
|
133
|
+
{}.tap do |hash|
|
|
134
|
+
value.each do |k, v|
|
|
135
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
else # model
|
|
139
|
+
temp_model = UltracartClient.const_get(type).new
|
|
140
|
+
temp_model.build_from_hash(value)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Returns the string representation of the object
|
|
145
|
+
# @return [String] String presentation of the object
|
|
146
|
+
def to_s
|
|
147
|
+
to_hash.to_s
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
151
|
+
# @return [Hash] Returns the object in the form of hash
|
|
152
|
+
def to_body
|
|
153
|
+
to_hash
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Returns the object in the form of hash
|
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
|
158
|
+
def to_hash
|
|
159
|
+
hash = {}
|
|
160
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
161
|
+
value = self.send(attr)
|
|
162
|
+
next if value.nil?
|
|
163
|
+
hash[param] = _to_hash(value)
|
|
164
|
+
end
|
|
165
|
+
hash
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Outputs non-array value in the form of hash
|
|
169
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
170
|
+
# @param [Object] value Any valid value
|
|
171
|
+
# @return [Hash] Returns the value in the form of hash
|
|
172
|
+
def _to_hash(value)
|
|
173
|
+
if value.is_a?(Array)
|
|
174
|
+
value.compact.map { |v| _to_hash(v) }
|
|
175
|
+
elsif value.is_a?(Hash)
|
|
176
|
+
{}.tap do |hash|
|
|
177
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
178
|
+
end
|
|
179
|
+
elsif value.respond_to? :to_hash
|
|
180
|
+
value.to_hash
|
|
181
|
+
else
|
|
182
|
+
value
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
end
|
|
187
|
+
end
|
|
@@ -14,6 +14,9 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module UltracartClient
|
|
16
16
|
class AutoOrderItem
|
|
17
|
+
# Array of addon objects instructing which items to add to auto order and how many times they should be added.
|
|
18
|
+
attr_accessor :add_ons
|
|
19
|
+
|
|
17
20
|
# Arbitrary item id that should be rebilled instead of the normal schedule
|
|
18
21
|
attr_accessor :arbitrary_item_id
|
|
19
22
|
|
|
@@ -89,6 +92,9 @@ module UltracartClient
|
|
|
89
92
|
# True if the preshipment notice associated with the next rebill has been sent
|
|
90
93
|
attr_accessor :preshipment_notice_sent
|
|
91
94
|
|
|
95
|
+
# Array of property objects
|
|
96
|
+
attr_accessor :properties
|
|
97
|
+
|
|
92
98
|
# The value of the rebills of this item
|
|
93
99
|
attr_accessor :rebill_value
|
|
94
100
|
|
|
@@ -122,6 +128,7 @@ module UltracartClient
|
|
|
122
128
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
123
129
|
def self.attribute_map
|
|
124
130
|
{
|
|
131
|
+
:'add_ons' => :'add_ons',
|
|
125
132
|
:'arbitrary_item_id' => :'arbitrary_item_id',
|
|
126
133
|
:'arbitrary_percentage_discount' => :'arbitrary_percentage_discount',
|
|
127
134
|
:'arbitrary_quantity' => :'arbitrary_quantity',
|
|
@@ -147,6 +154,7 @@ module UltracartClient
|
|
|
147
154
|
:'paypal_payer_id' => :'paypal_payer_id',
|
|
148
155
|
:'paypal_recurring_payment_profile_id' => :'paypal_recurring_payment_profile_id',
|
|
149
156
|
:'preshipment_notice_sent' => :'preshipment_notice_sent',
|
|
157
|
+
:'properties' => :'properties',
|
|
150
158
|
:'rebill_value' => :'rebill_value',
|
|
151
159
|
:'remaining_repeat_count' => :'remaining_repeat_count',
|
|
152
160
|
:'simple_schedule' => :'simple_schedule'
|
|
@@ -156,6 +164,7 @@ module UltracartClient
|
|
|
156
164
|
# Attribute type mapping.
|
|
157
165
|
def self.swagger_types
|
|
158
166
|
{
|
|
167
|
+
:'add_ons' => :'Array<AutoOrderAddonItem>',
|
|
159
168
|
:'arbitrary_item_id' => :'String',
|
|
160
169
|
:'arbitrary_percentage_discount' => :'Float',
|
|
161
170
|
:'arbitrary_quantity' => :'Float',
|
|
@@ -181,6 +190,7 @@ module UltracartClient
|
|
|
181
190
|
:'paypal_payer_id' => :'String',
|
|
182
191
|
:'paypal_recurring_payment_profile_id' => :'String',
|
|
183
192
|
:'preshipment_notice_sent' => :'BOOLEAN',
|
|
193
|
+
:'properties' => :'Array<AutoOrderProperty>',
|
|
184
194
|
:'rebill_value' => :'Float',
|
|
185
195
|
:'remaining_repeat_count' => :'Integer',
|
|
186
196
|
:'simple_schedule' => :'AutoOrderItemSimpleSchedule'
|
|
@@ -195,6 +205,12 @@ module UltracartClient
|
|
|
195
205
|
# convert string to symbol for hash key
|
|
196
206
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
197
207
|
|
|
208
|
+
if attributes.has_key?(:'add_ons')
|
|
209
|
+
if (value = attributes[:'add_ons']).is_a?(Array)
|
|
210
|
+
self.add_ons = value
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
198
214
|
if attributes.has_key?(:'arbitrary_item_id')
|
|
199
215
|
self.arbitrary_item_id = attributes[:'arbitrary_item_id']
|
|
200
216
|
end
|
|
@@ -299,6 +315,12 @@ module UltracartClient
|
|
|
299
315
|
self.preshipment_notice_sent = attributes[:'preshipment_notice_sent']
|
|
300
316
|
end
|
|
301
317
|
|
|
318
|
+
if attributes.has_key?(:'properties')
|
|
319
|
+
if (value = attributes[:'properties']).is_a?(Array)
|
|
320
|
+
self.properties = value
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
302
324
|
if attributes.has_key?(:'rebill_value')
|
|
303
325
|
self.rebill_value = attributes[:'rebill_value']
|
|
304
326
|
end
|
|
@@ -342,6 +364,7 @@ module UltracartClient
|
|
|
342
364
|
def ==(o)
|
|
343
365
|
return true if self.equal?(o)
|
|
344
366
|
self.class == o.class &&
|
|
367
|
+
add_ons == o.add_ons &&
|
|
345
368
|
arbitrary_item_id == o.arbitrary_item_id &&
|
|
346
369
|
arbitrary_percentage_discount == o.arbitrary_percentage_discount &&
|
|
347
370
|
arbitrary_quantity == o.arbitrary_quantity &&
|
|
@@ -367,6 +390,7 @@ module UltracartClient
|
|
|
367
390
|
paypal_payer_id == o.paypal_payer_id &&
|
|
368
391
|
paypal_recurring_payment_profile_id == o.paypal_recurring_payment_profile_id &&
|
|
369
392
|
preshipment_notice_sent == o.preshipment_notice_sent &&
|
|
393
|
+
properties == o.properties &&
|
|
370
394
|
rebill_value == o.rebill_value &&
|
|
371
395
|
remaining_repeat_count == o.remaining_repeat_count &&
|
|
372
396
|
simple_schedule == o.simple_schedule
|
|
@@ -381,7 +405,7 @@ module UltracartClient
|
|
|
381
405
|
# Calculates hash code according to all attributes.
|
|
382
406
|
# @return [Fixnum] Hash code
|
|
383
407
|
def hash
|
|
384
|
-
[arbitrary_item_id, arbitrary_percentage_discount, arbitrary_quantity, arbitrary_schedule_days, arbitrary_unit_cost, arbitrary_unit_cost_remaining_orders, auto_order_item_oid, calculated_next_shipment_dts, first_order_dts, frequency, future_schedules, last_order_dts, life_time_value, next_item_id, next_preshipment_notice_dts, next_shipment_dts, no_order_after_dts, number_of_rebills, options, original_item_id, original_quantity, paused, paypal_payer_id, paypal_recurring_payment_profile_id, preshipment_notice_sent, rebill_value, remaining_repeat_count, simple_schedule].hash
|
|
408
|
+
[add_ons, arbitrary_item_id, arbitrary_percentage_discount, arbitrary_quantity, arbitrary_schedule_days, arbitrary_unit_cost, arbitrary_unit_cost_remaining_orders, auto_order_item_oid, calculated_next_shipment_dts, first_order_dts, frequency, future_schedules, last_order_dts, life_time_value, next_item_id, next_preshipment_notice_dts, next_shipment_dts, no_order_after_dts, number_of_rebills, options, original_item_id, original_quantity, paused, paypal_payer_id, paypal_recurring_payment_profile_id, preshipment_notice_sent, properties, rebill_value, remaining_repeat_count, simple_schedule].hash
|
|
385
409
|
end
|
|
386
410
|
|
|
387
411
|
# Builds the object from hash
|
|
@@ -0,0 +1,187 @@
|
|
|
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 AutoOrderPropertiesUpdateRequest
|
|
17
|
+
# Properties to update
|
|
18
|
+
attr_accessor :properties
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'properties' => :'properties'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Attribute type mapping.
|
|
28
|
+
def self.swagger_types
|
|
29
|
+
{
|
|
30
|
+
:'properties' => :'Array<AutoOrderProperty>'
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Initializes the object
|
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
36
|
+
def initialize(attributes = {})
|
|
37
|
+
return unless attributes.is_a?(Hash)
|
|
38
|
+
|
|
39
|
+
# convert string to symbol for hash key
|
|
40
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
41
|
+
|
|
42
|
+
if attributes.has_key?(:'properties')
|
|
43
|
+
if (value = attributes[:'properties']).is_a?(Array)
|
|
44
|
+
self.properties = value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
50
|
+
# @return Array for valid properties with the reasons
|
|
51
|
+
def list_invalid_properties
|
|
52
|
+
invalid_properties = Array.new
|
|
53
|
+
invalid_properties
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Check to see if the all the properties in the model are valid
|
|
57
|
+
# @return true if the model is valid
|
|
58
|
+
def valid?
|
|
59
|
+
true
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Checks equality by comparing each attribute.
|
|
63
|
+
# @param [Object] Object to be compared
|
|
64
|
+
def ==(o)
|
|
65
|
+
return true if self.equal?(o)
|
|
66
|
+
self.class == o.class &&
|
|
67
|
+
properties == o.properties
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# @see the `==` method
|
|
71
|
+
# @param [Object] Object to be compared
|
|
72
|
+
def eql?(o)
|
|
73
|
+
self == o
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Calculates hash code according to all attributes.
|
|
77
|
+
# @return [Fixnum] Hash code
|
|
78
|
+
def hash
|
|
79
|
+
[properties].hash
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Builds the object from hash
|
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
84
|
+
# @return [Object] Returns the model itself
|
|
85
|
+
def build_from_hash(attributes)
|
|
86
|
+
return nil unless attributes.is_a?(Hash)
|
|
87
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
88
|
+
if type =~ /\AArray<(.*)>/i
|
|
89
|
+
# check to ensure the input is an array given that the attribute
|
|
90
|
+
# is documented as an array but the input is not
|
|
91
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
92
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
93
|
+
end
|
|
94
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
95
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
96
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
self
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Deserializes the data based on type
|
|
103
|
+
# @param string type Data type
|
|
104
|
+
# @param string value Value to be deserialized
|
|
105
|
+
# @return [Object] Deserialized data
|
|
106
|
+
def _deserialize(type, value)
|
|
107
|
+
case type.to_sym
|
|
108
|
+
when :DateTime
|
|
109
|
+
DateTime.parse(value)
|
|
110
|
+
when :Date
|
|
111
|
+
Date.parse(value)
|
|
112
|
+
when :String
|
|
113
|
+
value.to_s
|
|
114
|
+
when :Integer
|
|
115
|
+
value.to_i
|
|
116
|
+
when :Float
|
|
117
|
+
value.to_f
|
|
118
|
+
when :BOOLEAN
|
|
119
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
120
|
+
true
|
|
121
|
+
else
|
|
122
|
+
false
|
|
123
|
+
end
|
|
124
|
+
when :Object
|
|
125
|
+
# generic object (usually a Hash), return directly
|
|
126
|
+
value
|
|
127
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
128
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
129
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
130
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
131
|
+
k_type = Regexp.last_match[:k_type]
|
|
132
|
+
v_type = Regexp.last_match[:v_type]
|
|
133
|
+
{}.tap do |hash|
|
|
134
|
+
value.each do |k, v|
|
|
135
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
else # model
|
|
139
|
+
temp_model = UltracartClient.const_get(type).new
|
|
140
|
+
temp_model.build_from_hash(value)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Returns the string representation of the object
|
|
145
|
+
# @return [String] String presentation of the object
|
|
146
|
+
def to_s
|
|
147
|
+
to_hash.to_s
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
151
|
+
# @return [Hash] Returns the object in the form of hash
|
|
152
|
+
def to_body
|
|
153
|
+
to_hash
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Returns the object in the form of hash
|
|
157
|
+
# @return [Hash] Returns the object in the form of hash
|
|
158
|
+
def to_hash
|
|
159
|
+
hash = {}
|
|
160
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
161
|
+
value = self.send(attr)
|
|
162
|
+
next if value.nil?
|
|
163
|
+
hash[param] = _to_hash(value)
|
|
164
|
+
end
|
|
165
|
+
hash
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Outputs non-array value in the form of hash
|
|
169
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
170
|
+
# @param [Object] value Any valid value
|
|
171
|
+
# @return [Hash] Returns the value in the form of hash
|
|
172
|
+
def _to_hash(value)
|
|
173
|
+
if value.is_a?(Array)
|
|
174
|
+
value.compact.map { |v| _to_hash(v) }
|
|
175
|
+
elsif value.is_a?(Hash)
|
|
176
|
+
{}.tap do |hash|
|
|
177
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
178
|
+
end
|
|
179
|
+
elsif value.respond_to? :to_hash
|
|
180
|
+
value.to_hash
|
|
181
|
+
else
|
|
182
|
+
value
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
end
|
|
187
|
+
end
|