ultracart_api 4.0.156 → 4.0.157
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -4
- data/docs/AutoOrder.md +2 -0
- data/docs/AutoOrderAddonItem.md +28 -0
- data/docs/AutoOrderAddonItemOption.md +20 -0
- data/docs/ItemAutoOrder.md +4 -0
- data/lib/ultracart_api/models/auto_order.rb +13 -1
- data/lib/ultracart_api/models/auto_order_addon_item.rb +267 -0
- data/lib/ultracart_api/models/auto_order_addon_item_option.rb +260 -0
- data/lib/ultracart_api/models/item_auto_order.rb +21 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +2 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f4de1e3b0e54359d0ec843f0cd4e92a08346ad38df8df84087f3f43f2fdd484
|
4
|
+
data.tar.gz: 9a0f8a179a5d79d1b4803760834d9290e7726a6fd22fe597797e9b91ee718b10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6553c75d2d1c3e9e981487eec48825c331b24a0f76297268c78e560d52be54554b98ffc75b8324afab487e39cc0ec57ce71cec35597e58b10d5da5e9642e7401
|
7
|
+
data.tar.gz: b92a212ee80036e272d9a24bbf4a3fa365b86d85180169cc31e931b80bb56e1b92234ffbacf0a0c9d604e4e3e3a0488ec1a9c0c410b426f375041cb1bd057cf0
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 2.0.0
|
10
|
-
- Package version: 4.0.
|
10
|
+
- Package version: 4.0.157
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
|
13
13
|
|
@@ -24,16 +24,16 @@ gem build ultracart_api.gemspec
|
|
24
24
|
Then either install the gem locally:
|
25
25
|
|
26
26
|
```shell
|
27
|
-
gem install ./ultracart_api-4.0.
|
27
|
+
gem install ./ultracart_api-4.0.157.gem
|
28
28
|
```
|
29
29
|
|
30
|
-
(for development, run `gem install --dev ./ultracart_api-4.0.
|
30
|
+
(for development, run `gem install --dev ./ultracart_api-4.0.157.gem` to install the development dependencies)
|
31
31
|
|
32
32
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
33
|
|
34
34
|
Finally add this to the Gemfile:
|
35
35
|
|
36
|
-
gem 'ultracart_api', '~> 4.0.
|
36
|
+
gem 'ultracart_api', '~> 4.0.157'
|
37
37
|
|
38
38
|
### Install from Git
|
39
39
|
|
@@ -538,6 +538,8 @@ Class | Method | HTTP request | Description
|
|
538
538
|
- [UltracartClient::ApplyLibraryItemRequest](docs/ApplyLibraryItemRequest.md)
|
539
539
|
- [UltracartClient::ApplyLibraryItemResponse](docs/ApplyLibraryItemResponse.md)
|
540
540
|
- [UltracartClient::AutoOrder](docs/AutoOrder.md)
|
541
|
+
- [UltracartClient::AutoOrderAddonItem](docs/AutoOrderAddonItem.md)
|
542
|
+
- [UltracartClient::AutoOrderAddonItemOption](docs/AutoOrderAddonItemOption.md)
|
541
543
|
- [UltracartClient::AutoOrderItem](docs/AutoOrderItem.md)
|
542
544
|
- [UltracartClient::AutoOrderItemFutureSchedule](docs/AutoOrderItemFutureSchedule.md)
|
543
545
|
- [UltracartClient::AutoOrderItemOption](docs/AutoOrderItemOption.md)
|
@@ -1362,6 +1364,7 @@ Not every change is committed to every SDK.
|
|
1362
1364
|
|
1363
1365
|
| Version | Date | Comments |
|
1364
1366
|
| --: | :-: | --- |
|
1367
|
+
| 4.0.157 | 06/06/2023 | auto order add_ons |
|
1365
1368
|
| 4.0.156 | 05/25/2023 | added venmo constants for payment type |
|
1366
1369
|
| 4.0.155 | 05/18/2023 | dw bi - send back the executed SQL |
|
1367
1370
|
| 4.0.154 | 05/04/2023 | item api added methods for items reviews |
|
data/docs/AutoOrder.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **add_ons** | [**Array<AutoOrderAddonItem>**](AutoOrderAddonItem.md) | Array of addon objects instructing which items to add to auto order and how many times they should be added. | [optional] |
|
7
8
|
| **auto_order_code** | **String** | Unique code assigned to this auto order | [optional] |
|
8
9
|
| **auto_order_oid** | **Integer** | Auto order object identifier | [optional] |
|
9
10
|
| **cancel_after_next_x_orders** | **Integer** | Cancel this auto order after X additional rebills | [optional] |
|
@@ -34,6 +35,7 @@
|
|
34
35
|
require 'ultracart_api'
|
35
36
|
|
36
37
|
instance = UltracartClient::AutoOrder.new(
|
38
|
+
add_ons: null,
|
37
39
|
auto_order_code: null,
|
38
40
|
auto_order_oid: null,
|
39
41
|
cancel_after_next_x_orders: null,
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# UltracartClient::AutoOrderAddonItem
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **arbitrary_unit_cost** | **Float** | | [optional] |
|
8
|
+
| **free_shipping** | **Boolean** | | [optional] |
|
9
|
+
| **item_id** | **String** | | [optional] |
|
10
|
+
| **next_x_orders** | **Integer** | | [optional] |
|
11
|
+
| **options** | [**Array<AutoOrderAddonItemOption>**](AutoOrderAddonItemOption.md) | Options associated with this item | [optional] |
|
12
|
+
| **quantity** | **Integer** | | [optional] |
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'ultracart_api'
|
18
|
+
|
19
|
+
instance = UltracartClient::AutoOrderAddonItem.new(
|
20
|
+
arbitrary_unit_cost: null,
|
21
|
+
free_shipping: null,
|
22
|
+
item_id: null,
|
23
|
+
next_x_orders: null,
|
24
|
+
options: null,
|
25
|
+
quantity: null
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# UltracartClient::AutoOrderAddonItemOption
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **label** | **String** | Label | [optional] |
|
8
|
+
| **value** | **String** | Value | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'ultracart_api'
|
14
|
+
|
15
|
+
instance = UltracartClient::AutoOrderAddonItemOption.new(
|
16
|
+
label: null,
|
17
|
+
value: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/ItemAutoOrder.md
CHANGED
@@ -9,7 +9,9 @@
|
|
9
9
|
| **auto_order_cancel_charge_minimum_balance** | **Boolean** | If true, the cost of the cancel item will be the remaining balance of the minimum rebill or lifetime value | [optional] |
|
10
10
|
| **auto_order_cancel_item_id** | **String** | Item id to attempt charging the customer for if they cancel | [optional] |
|
11
11
|
| **auto_order_cancel_item_oid** | **Integer** | Item object identifier to attempt charging the customer for if they cancel | [optional] |
|
12
|
+
| **auto_order_cancel_minimum_life_time_count** | **Integer** | The minimum life time count that must be billed in order to not be charged the cancellation item. | [optional] |
|
12
13
|
| **auto_order_cancel_minimum_life_time_value** | **Float** | The minimum life time value that must be paid in order to not be charged the cancellation item. | [optional] |
|
14
|
+
| **auto_order_cancel_minimum_rebill_count** | **Integer** | The minimum rebill count that must be billed in order to not be charged the cancellation item. | [optional] |
|
13
15
|
| **auto_order_cancel_minimum_rebill_value** | **Float** | The minimum rebill value that must be paid in order to not be charged the cancellation item. | [optional] |
|
14
16
|
| **auto_order_downgrade_items** | **Array<String>** | List of downgrade items presented to customer service representatives | [optional] |
|
15
17
|
| **auto_order_paused** | **Boolean** | True if the rebill processing of this item is paused | [optional] |
|
@@ -36,7 +38,9 @@ instance = UltracartClient::ItemAutoOrder.new(
|
|
36
38
|
auto_order_cancel_charge_minimum_balance: null,
|
37
39
|
auto_order_cancel_item_id: null,
|
38
40
|
auto_order_cancel_item_oid: null,
|
41
|
+
auto_order_cancel_minimum_life_time_count: null,
|
39
42
|
auto_order_cancel_minimum_life_time_value: null,
|
43
|
+
auto_order_cancel_minimum_rebill_count: null,
|
40
44
|
auto_order_cancel_minimum_rebill_value: null,
|
41
45
|
auto_order_downgrade_items: null,
|
42
46
|
auto_order_paused: null,
|
@@ -15,6 +15,9 @@ require 'time'
|
|
15
15
|
|
16
16
|
module UltracartClient
|
17
17
|
class AutoOrder
|
18
|
+
# Array of addon objects instructing which items to add to auto order and how many times they should be added.
|
19
|
+
attr_accessor :add_ons
|
20
|
+
|
18
21
|
# Unique code assigned to this auto order
|
19
22
|
attr_accessor :auto_order_code
|
20
23
|
|
@@ -107,6 +110,7 @@ module UltracartClient
|
|
107
110
|
# Attribute mapping from ruby-style variable name to JSON key.
|
108
111
|
def self.attribute_map
|
109
112
|
{
|
113
|
+
:'add_ons' => :'add_ons',
|
110
114
|
:'auto_order_code' => :'auto_order_code',
|
111
115
|
:'auto_order_oid' => :'auto_order_oid',
|
112
116
|
:'cancel_after_next_x_orders' => :'cancel_after_next_x_orders',
|
@@ -141,6 +145,7 @@ module UltracartClient
|
|
141
145
|
# Attribute type mapping.
|
142
146
|
def self.openapi_types
|
143
147
|
{
|
148
|
+
:'add_ons' => :'Array<AutoOrderAddonItem>',
|
144
149
|
:'auto_order_code' => :'String',
|
145
150
|
:'auto_order_oid' => :'Integer',
|
146
151
|
:'cancel_after_next_x_orders' => :'Integer',
|
@@ -188,6 +193,12 @@ module UltracartClient
|
|
188
193
|
h[k.to_sym] = v
|
189
194
|
}
|
190
195
|
|
196
|
+
if attributes.key?(:'add_ons')
|
197
|
+
if (value = attributes[:'add_ons']).is_a?(Array)
|
198
|
+
self.add_ons = value
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
191
202
|
if attributes.key?(:'auto_order_code')
|
192
203
|
self.auto_order_code = attributes[:'auto_order_code']
|
193
204
|
end
|
@@ -317,6 +328,7 @@ module UltracartClient
|
|
317
328
|
def ==(o)
|
318
329
|
return true if self.equal?(o)
|
319
330
|
self.class == o.class &&
|
331
|
+
add_ons == o.add_ons &&
|
320
332
|
auto_order_code == o.auto_order_code &&
|
321
333
|
auto_order_oid == o.auto_order_oid &&
|
322
334
|
cancel_after_next_x_orders == o.cancel_after_next_x_orders &&
|
@@ -351,7 +363,7 @@ module UltracartClient
|
|
351
363
|
# Calculates hash code according to all attributes.
|
352
364
|
# @return [Integer] Hash code
|
353
365
|
def hash
|
354
|
-
[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, next_attempt, original_order, original_order_id, override_affiliate_id, rebill_orders, rotating_transaction_gateway_code, status].hash
|
366
|
+
[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, next_attempt, original_order, original_order_id, override_affiliate_id, rebill_orders, rotating_transaction_gateway_code, status].hash
|
355
367
|
end
|
356
368
|
|
357
369
|
# Builds the object from hash
|
@@ -0,0 +1,267 @@
|
|
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 AutoOrderAddonItem
|
18
|
+
attr_accessor :arbitrary_unit_cost
|
19
|
+
|
20
|
+
attr_accessor :free_shipping
|
21
|
+
|
22
|
+
attr_accessor :item_id
|
23
|
+
|
24
|
+
attr_accessor :next_x_orders
|
25
|
+
|
26
|
+
# Options associated with this item
|
27
|
+
attr_accessor :options
|
28
|
+
|
29
|
+
attr_accessor :quantity
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'arbitrary_unit_cost' => :'arbitrary_unit_cost',
|
35
|
+
:'free_shipping' => :'free_shipping',
|
36
|
+
:'item_id' => :'item_id',
|
37
|
+
:'next_x_orders' => :'next_x_orders',
|
38
|
+
:'options' => :'options',
|
39
|
+
:'quantity' => :'quantity'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Returns all the JSON keys this model knows about
|
44
|
+
def self.acceptable_attributes
|
45
|
+
attribute_map.values
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.openapi_types
|
50
|
+
{
|
51
|
+
:'arbitrary_unit_cost' => :'Float',
|
52
|
+
:'free_shipping' => :'Boolean',
|
53
|
+
:'item_id' => :'String',
|
54
|
+
:'next_x_orders' => :'Integer',
|
55
|
+
:'options' => :'Array<AutoOrderAddonItemOption>',
|
56
|
+
:'quantity' => :'Integer'
|
57
|
+
}
|
58
|
+
end
|
59
|
+
|
60
|
+
# List of attributes with nullable: true
|
61
|
+
def self.openapi_nullable
|
62
|
+
Set.new([
|
63
|
+
])
|
64
|
+
end
|
65
|
+
|
66
|
+
# Initializes the object
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
68
|
+
def initialize(attributes = {})
|
69
|
+
if (!attributes.is_a?(Hash))
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::AutoOrderAddonItem` initialize method"
|
71
|
+
end
|
72
|
+
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
75
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::AutoOrderAddonItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
77
|
+
end
|
78
|
+
h[k.to_sym] = v
|
79
|
+
}
|
80
|
+
|
81
|
+
if attributes.key?(:'arbitrary_unit_cost')
|
82
|
+
self.arbitrary_unit_cost = attributes[:'arbitrary_unit_cost']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'free_shipping')
|
86
|
+
self.free_shipping = attributes[:'free_shipping']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'item_id')
|
90
|
+
self.item_id = attributes[:'item_id']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'next_x_orders')
|
94
|
+
self.next_x_orders = attributes[:'next_x_orders']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'options')
|
98
|
+
if (value = attributes[:'options']).is_a?(Array)
|
99
|
+
self.options = value
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'quantity')
|
104
|
+
self.quantity = attributes[:'quantity']
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
109
|
+
# @return Array for valid properties with the reasons
|
110
|
+
def list_invalid_properties
|
111
|
+
invalid_properties = Array.new
|
112
|
+
invalid_properties
|
113
|
+
end
|
114
|
+
|
115
|
+
# Check to see if the all the properties in the model are valid
|
116
|
+
# @return true if the model is valid
|
117
|
+
def valid?
|
118
|
+
true
|
119
|
+
end
|
120
|
+
|
121
|
+
# Checks equality by comparing each attribute.
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def ==(o)
|
124
|
+
return true if self.equal?(o)
|
125
|
+
self.class == o.class &&
|
126
|
+
arbitrary_unit_cost == o.arbitrary_unit_cost &&
|
127
|
+
free_shipping == o.free_shipping &&
|
128
|
+
item_id == o.item_id &&
|
129
|
+
next_x_orders == o.next_x_orders &&
|
130
|
+
options == o.options &&
|
131
|
+
quantity == o.quantity
|
132
|
+
end
|
133
|
+
|
134
|
+
# @see the `==` method
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def eql?(o)
|
137
|
+
self == o
|
138
|
+
end
|
139
|
+
|
140
|
+
# Calculates hash code according to all attributes.
|
141
|
+
# @return [Integer] Hash code
|
142
|
+
def hash
|
143
|
+
[arbitrary_unit_cost, free_shipping, item_id, next_x_orders, options, quantity].hash
|
144
|
+
end
|
145
|
+
|
146
|
+
# Builds the object from hash
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
+
# @return [Object] Returns the model itself
|
149
|
+
def self.build_from_hash(attributes)
|
150
|
+
new.build_from_hash(attributes)
|
151
|
+
end
|
152
|
+
|
153
|
+
# Builds the object from hash
|
154
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
155
|
+
# @return [Object] Returns the model itself
|
156
|
+
def build_from_hash(attributes)
|
157
|
+
return nil unless attributes.is_a?(Hash)
|
158
|
+
attributes = attributes.transform_keys(&:to_sym)
|
159
|
+
self.class.openapi_types.each_pair do |key, type|
|
160
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
161
|
+
self.send("#{key}=", nil)
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
163
|
+
# check to ensure the input is an array given that the attribute
|
164
|
+
# is documented as an array but the input is not
|
165
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
166
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
167
|
+
end
|
168
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
169
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
self
|
174
|
+
end
|
175
|
+
|
176
|
+
# Deserializes the data based on type
|
177
|
+
# @param string type Data type
|
178
|
+
# @param string value Value to be deserialized
|
179
|
+
# @return [Object] Deserialized data
|
180
|
+
def _deserialize(type, value)
|
181
|
+
case type.to_sym
|
182
|
+
when :Time
|
183
|
+
Time.parse(value)
|
184
|
+
when :Date
|
185
|
+
Date.parse(value)
|
186
|
+
when :String
|
187
|
+
value.to_s
|
188
|
+
when :Integer
|
189
|
+
value.to_i
|
190
|
+
when :Float
|
191
|
+
value.to_f
|
192
|
+
when :Boolean
|
193
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
194
|
+
true
|
195
|
+
else
|
196
|
+
false
|
197
|
+
end
|
198
|
+
when :Object
|
199
|
+
# generic object (usually a Hash), return directly
|
200
|
+
value
|
201
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
202
|
+
inner_type = Regexp.last_match[:inner_type]
|
203
|
+
value.map { |v| _deserialize(inner_type, v) }
|
204
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
205
|
+
k_type = Regexp.last_match[:k_type]
|
206
|
+
v_type = Regexp.last_match[:v_type]
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each do |k, v|
|
209
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
else # model
|
213
|
+
# models (e.g. Pet) or oneOf
|
214
|
+
klass = UltracartClient.const_get(type)
|
215
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
# Returns the string representation of the object
|
220
|
+
# @return [String] String presentation of the object
|
221
|
+
def to_s
|
222
|
+
to_hash.to_s
|
223
|
+
end
|
224
|
+
|
225
|
+
# to_body is an alias to to_hash (backward compatibility)
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
227
|
+
def to_body
|
228
|
+
to_hash
|
229
|
+
end
|
230
|
+
|
231
|
+
# Returns the object in the form of hash
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_hash
|
234
|
+
hash = {}
|
235
|
+
self.class.attribute_map.each_pair do |attr, param|
|
236
|
+
value = self.send(attr)
|
237
|
+
if value.nil?
|
238
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
239
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
240
|
+
end
|
241
|
+
|
242
|
+
hash[param] = _to_hash(value)
|
243
|
+
end
|
244
|
+
hash
|
245
|
+
end
|
246
|
+
|
247
|
+
# Outputs non-array value in the form of hash
|
248
|
+
# For object, use to_hash. Otherwise, just return the value
|
249
|
+
# @param [Object] value Any valid value
|
250
|
+
# @return [Hash] Returns the value in the form of hash
|
251
|
+
def _to_hash(value)
|
252
|
+
if value.is_a?(Array)
|
253
|
+
value.compact.map { |v| _to_hash(v) }
|
254
|
+
elsif value.is_a?(Hash)
|
255
|
+
{}.tap do |hash|
|
256
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
257
|
+
end
|
258
|
+
elsif value.respond_to? :to_hash
|
259
|
+
value.to_hash
|
260
|
+
else
|
261
|
+
value
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
end
|
266
|
+
|
267
|
+
end
|
@@ -0,0 +1,260 @@
|
|
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 AutoOrderAddonItemOption
|
18
|
+
# Label
|
19
|
+
attr_accessor :label
|
20
|
+
|
21
|
+
# Value
|
22
|
+
attr_accessor :value
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'label' => :'label',
|
28
|
+
:'value' => :'value'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'label' => :'String',
|
41
|
+
:'value' => :'String'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::AutoOrderAddonItemOption` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::AutoOrderAddonItemOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'label')
|
67
|
+
self.label = attributes[:'label']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'value')
|
71
|
+
self.value = attributes[:'value']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
if !@label.nil? && @label.to_s.length > 50
|
80
|
+
invalid_properties.push('invalid value for "label", the character length must be smaller than or equal to 50.')
|
81
|
+
end
|
82
|
+
|
83
|
+
if !@value.nil? && @value.to_s.length > 1024
|
84
|
+
invalid_properties.push('invalid value for "value", the character length must be smaller than or equal to 1024.')
|
85
|
+
end
|
86
|
+
|
87
|
+
invalid_properties
|
88
|
+
end
|
89
|
+
|
90
|
+
# Check to see if the all the properties in the model are valid
|
91
|
+
# @return true if the model is valid
|
92
|
+
def valid?
|
93
|
+
return false if !@label.nil? && @label.to_s.length > 50
|
94
|
+
return false if !@value.nil? && @value.to_s.length > 1024
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Custom attribute writer method with validation
|
99
|
+
# @param [Object] label Value to be assigned
|
100
|
+
def label=(label)
|
101
|
+
if !label.nil? && label.to_s.length > 50
|
102
|
+
fail ArgumentError, 'invalid value for "label", the character length must be smaller than or equal to 50.'
|
103
|
+
end
|
104
|
+
|
105
|
+
@label = label
|
106
|
+
end
|
107
|
+
|
108
|
+
# Custom attribute writer method with validation
|
109
|
+
# @param [Object] value Value to be assigned
|
110
|
+
def value=(value)
|
111
|
+
if !value.nil? && value.to_s.length > 1024
|
112
|
+
fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to 1024.'
|
113
|
+
end
|
114
|
+
|
115
|
+
@value = value
|
116
|
+
end
|
117
|
+
|
118
|
+
# Checks equality by comparing each attribute.
|
119
|
+
# @param [Object] Object to be compared
|
120
|
+
def ==(o)
|
121
|
+
return true if self.equal?(o)
|
122
|
+
self.class == o.class &&
|
123
|
+
label == o.label &&
|
124
|
+
value == o.value
|
125
|
+
end
|
126
|
+
|
127
|
+
# @see the `==` method
|
128
|
+
# @param [Object] Object to be compared
|
129
|
+
def eql?(o)
|
130
|
+
self == o
|
131
|
+
end
|
132
|
+
|
133
|
+
# Calculates hash code according to all attributes.
|
134
|
+
# @return [Integer] Hash code
|
135
|
+
def hash
|
136
|
+
[label, value].hash
|
137
|
+
end
|
138
|
+
|
139
|
+
# Builds the object from hash
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
141
|
+
# @return [Object] Returns the model itself
|
142
|
+
def self.build_from_hash(attributes)
|
143
|
+
new.build_from_hash(attributes)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Builds the object from hash
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
+
# @return [Object] Returns the model itself
|
149
|
+
def build_from_hash(attributes)
|
150
|
+
return nil unless attributes.is_a?(Hash)
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
152
|
+
self.class.openapi_types.each_pair do |key, type|
|
153
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
154
|
+
self.send("#{key}=", nil)
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
156
|
+
# check to ensure the input is an array given that the attribute
|
157
|
+
# is documented as an array but the input is not
|
158
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
159
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
160
|
+
end
|
161
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
162
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
self
|
167
|
+
end
|
168
|
+
|
169
|
+
# Deserializes the data based on type
|
170
|
+
# @param string type Data type
|
171
|
+
# @param string value Value to be deserialized
|
172
|
+
# @return [Object] Deserialized data
|
173
|
+
def _deserialize(type, value)
|
174
|
+
case type.to_sym
|
175
|
+
when :Time
|
176
|
+
Time.parse(value)
|
177
|
+
when :Date
|
178
|
+
Date.parse(value)
|
179
|
+
when :String
|
180
|
+
value.to_s
|
181
|
+
when :Integer
|
182
|
+
value.to_i
|
183
|
+
when :Float
|
184
|
+
value.to_f
|
185
|
+
when :Boolean
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
187
|
+
true
|
188
|
+
else
|
189
|
+
false
|
190
|
+
end
|
191
|
+
when :Object
|
192
|
+
# generic object (usually a Hash), return directly
|
193
|
+
value
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
200
|
+
{}.tap do |hash|
|
201
|
+
value.each do |k, v|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
else # model
|
206
|
+
# models (e.g. Pet) or oneOf
|
207
|
+
klass = UltracartClient.const_get(type)
|
208
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the string representation of the object
|
213
|
+
# @return [String] String presentation of the object
|
214
|
+
def to_s
|
215
|
+
to_hash.to_s
|
216
|
+
end
|
217
|
+
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
220
|
+
def to_body
|
221
|
+
to_hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the object in the form of hash
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_hash
|
227
|
+
hash = {}
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
229
|
+
value = self.send(attr)
|
230
|
+
if value.nil?
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
233
|
+
end
|
234
|
+
|
235
|
+
hash[param] = _to_hash(value)
|
236
|
+
end
|
237
|
+
hash
|
238
|
+
end
|
239
|
+
|
240
|
+
# Outputs non-array value in the form of hash
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
242
|
+
# @param [Object] value Any valid value
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
244
|
+
def _to_hash(value)
|
245
|
+
if value.is_a?(Array)
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
247
|
+
elsif value.is_a?(Hash)
|
248
|
+
{}.tap do |hash|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
250
|
+
end
|
251
|
+
elsif value.respond_to? :to_hash
|
252
|
+
value.to_hash
|
253
|
+
else
|
254
|
+
value
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
259
|
+
|
260
|
+
end
|
@@ -30,9 +30,15 @@ module UltracartClient
|
|
30
30
|
# Item object identifier to attempt charging the customer for if they cancel
|
31
31
|
attr_accessor :auto_order_cancel_item_oid
|
32
32
|
|
33
|
+
# The minimum life time count that must be billed in order to not be charged the cancellation item.
|
34
|
+
attr_accessor :auto_order_cancel_minimum_life_time_count
|
35
|
+
|
33
36
|
# The minimum life time value that must be paid in order to not be charged the cancellation item.
|
34
37
|
attr_accessor :auto_order_cancel_minimum_life_time_value
|
35
38
|
|
39
|
+
# The minimum rebill count that must be billed in order to not be charged the cancellation item.
|
40
|
+
attr_accessor :auto_order_cancel_minimum_rebill_count
|
41
|
+
|
36
42
|
# The minimum rebill value that must be paid in order to not be charged the cancellation item.
|
37
43
|
attr_accessor :auto_order_cancel_minimum_rebill_value
|
38
44
|
|
@@ -83,7 +89,9 @@ module UltracartClient
|
|
83
89
|
:'auto_order_cancel_charge_minimum_balance' => :'auto_order_cancel_charge_minimum_balance',
|
84
90
|
:'auto_order_cancel_item_id' => :'auto_order_cancel_item_id',
|
85
91
|
:'auto_order_cancel_item_oid' => :'auto_order_cancel_item_oid',
|
92
|
+
:'auto_order_cancel_minimum_life_time_count' => :'auto_order_cancel_minimum_life_time_count',
|
86
93
|
:'auto_order_cancel_minimum_life_time_value' => :'auto_order_cancel_minimum_life_time_value',
|
94
|
+
:'auto_order_cancel_minimum_rebill_count' => :'auto_order_cancel_minimum_rebill_count',
|
87
95
|
:'auto_order_cancel_minimum_rebill_value' => :'auto_order_cancel_minimum_rebill_value',
|
88
96
|
:'auto_order_downgrade_items' => :'auto_order_downgrade_items',
|
89
97
|
:'auto_order_paused' => :'auto_order_paused',
|
@@ -114,7 +122,9 @@ module UltracartClient
|
|
114
122
|
:'auto_order_cancel_charge_minimum_balance' => :'Boolean',
|
115
123
|
:'auto_order_cancel_item_id' => :'String',
|
116
124
|
:'auto_order_cancel_item_oid' => :'Integer',
|
125
|
+
:'auto_order_cancel_minimum_life_time_count' => :'Integer',
|
117
126
|
:'auto_order_cancel_minimum_life_time_value' => :'Float',
|
127
|
+
:'auto_order_cancel_minimum_rebill_count' => :'Integer',
|
118
128
|
:'auto_order_cancel_minimum_rebill_value' => :'Float',
|
119
129
|
:'auto_order_downgrade_items' => :'Array<String>',
|
120
130
|
:'auto_order_paused' => :'Boolean',
|
@@ -173,10 +183,18 @@ module UltracartClient
|
|
173
183
|
self.auto_order_cancel_item_oid = attributes[:'auto_order_cancel_item_oid']
|
174
184
|
end
|
175
185
|
|
186
|
+
if attributes.key?(:'auto_order_cancel_minimum_life_time_count')
|
187
|
+
self.auto_order_cancel_minimum_life_time_count = attributes[:'auto_order_cancel_minimum_life_time_count']
|
188
|
+
end
|
189
|
+
|
176
190
|
if attributes.key?(:'auto_order_cancel_minimum_life_time_value')
|
177
191
|
self.auto_order_cancel_minimum_life_time_value = attributes[:'auto_order_cancel_minimum_life_time_value']
|
178
192
|
end
|
179
193
|
|
194
|
+
if attributes.key?(:'auto_order_cancel_minimum_rebill_count')
|
195
|
+
self.auto_order_cancel_minimum_rebill_count = attributes[:'auto_order_cancel_minimum_rebill_count']
|
196
|
+
end
|
197
|
+
|
180
198
|
if attributes.key?(:'auto_order_cancel_minimum_rebill_value')
|
181
199
|
self.auto_order_cancel_minimum_rebill_value = attributes[:'auto_order_cancel_minimum_rebill_value']
|
182
200
|
end
|
@@ -280,7 +298,9 @@ module UltracartClient
|
|
280
298
|
auto_order_cancel_charge_minimum_balance == o.auto_order_cancel_charge_minimum_balance &&
|
281
299
|
auto_order_cancel_item_id == o.auto_order_cancel_item_id &&
|
282
300
|
auto_order_cancel_item_oid == o.auto_order_cancel_item_oid &&
|
301
|
+
auto_order_cancel_minimum_life_time_count == o.auto_order_cancel_minimum_life_time_count &&
|
283
302
|
auto_order_cancel_minimum_life_time_value == o.auto_order_cancel_minimum_life_time_value &&
|
303
|
+
auto_order_cancel_minimum_rebill_count == o.auto_order_cancel_minimum_rebill_count &&
|
284
304
|
auto_order_cancel_minimum_rebill_value == o.auto_order_cancel_minimum_rebill_value &&
|
285
305
|
auto_order_downgrade_items == o.auto_order_downgrade_items &&
|
286
306
|
auto_order_paused == o.auto_order_paused &&
|
@@ -306,7 +326,7 @@ module UltracartClient
|
|
306
326
|
# Calculates hash code according to all attributes.
|
307
327
|
# @return [Integer] Hash code
|
308
328
|
def hash
|
309
|
-
[auth_future_amount, auth_test_amount, auto_order_cancel_charge_minimum_balance, auto_order_cancel_item_id, auto_order_cancel_item_oid, auto_order_cancel_minimum_life_time_value, auto_order_cancel_minimum_rebill_value, auto_order_downgrade_items, auto_order_paused, auto_order_prohibit_expiring_cards, auto_order_schedules, auto_order_upgrade_items, auto_order_upsell, auto_order_upsell_no_easy_cancel, auto_order_upsell_one_per_customer, auto_orderable, cancel_other_auto_orders, free_shipping_auto_order, refund_other_auto_orders, steps].hash
|
329
|
+
[auth_future_amount, auth_test_amount, auto_order_cancel_charge_minimum_balance, auto_order_cancel_item_id, auto_order_cancel_item_oid, auto_order_cancel_minimum_life_time_count, auto_order_cancel_minimum_life_time_value, auto_order_cancel_minimum_rebill_count, auto_order_cancel_minimum_rebill_value, auto_order_downgrade_items, auto_order_paused, auto_order_prohibit_expiring_cards, auto_order_schedules, auto_order_upgrade_items, auto_order_upsell, auto_order_upsell_no_easy_cancel, auto_order_upsell_one_per_customer, auto_orderable, cancel_other_auto_orders, free_shipping_auto_order, refund_other_auto_orders, steps].hash
|
310
330
|
end
|
311
331
|
|
312
332
|
# Builds the object from hash
|
data/lib/ultracart_api.rb
CHANGED
@@ -40,6 +40,8 @@ require 'ultracart_api/models/api_user_application_profile'
|
|
40
40
|
require 'ultracart_api/models/apply_library_item_request'
|
41
41
|
require 'ultracart_api/models/apply_library_item_response'
|
42
42
|
require 'ultracart_api/models/auto_order'
|
43
|
+
require 'ultracart_api/models/auto_order_addon_item'
|
44
|
+
require 'ultracart_api/models/auto_order_addon_item_option'
|
43
45
|
require 'ultracart_api/models/auto_order_item'
|
44
46
|
require 'ultracart_api/models/auto_order_item_future_schedule'
|
45
47
|
require 'ultracart_api/models/auto_order_item_option'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultracart_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.157
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -85,6 +85,8 @@ files:
|
|
85
85
|
- docs/ApplyLibraryItemRequest.md
|
86
86
|
- docs/ApplyLibraryItemResponse.md
|
87
87
|
- docs/AutoOrder.md
|
88
|
+
- docs/AutoOrderAddonItem.md
|
89
|
+
- docs/AutoOrderAddonItemOption.md
|
88
90
|
- docs/AutoOrderApi.md
|
89
91
|
- docs/AutoOrderItem.md
|
90
92
|
- docs/AutoOrderItemFutureSchedule.md
|
@@ -903,6 +905,8 @@ files:
|
|
903
905
|
- lib/ultracart_api/models/apply_library_item_request.rb
|
904
906
|
- lib/ultracart_api/models/apply_library_item_response.rb
|
905
907
|
- lib/ultracart_api/models/auto_order.rb
|
908
|
+
- lib/ultracart_api/models/auto_order_addon_item.rb
|
909
|
+
- lib/ultracart_api/models/auto_order_addon_item_option.rb
|
906
910
|
- lib/ultracart_api/models/auto_order_item.rb
|
907
911
|
- lib/ultracart_api/models/auto_order_item_future_schedule.rb
|
908
912
|
- lib/ultracart_api/models/auto_order_item_option.rb
|