ultracart_api 3.8.1 → 3.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/docs/Coupon.md +1 -0
- data/docs/CouponAmountShippingWithSubtotal.md +11 -0
- data/docs/GiftCertificateCreateRequest.md +1 -0
- data/lib/ultracart_api/configuration.rb +2 -2
- data/lib/ultracart_api/models/coupon.rb +10 -1
- data/lib/ultracart_api/models/coupon_amount_shipping_with_subtotal.rb +232 -0
- data/lib/ultracart_api/models/gift_certificate_create_request.rb +11 -1
- data/lib/ultracart_api/models/gift_certificate_ledger_entry.rb +15 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 283ed366ada8b6f4f9a6261af9a60db63f2747c2acf87f56e2aa7b0ad7c0291f
|
4
|
+
data.tar.gz: 7e21c4d70d160658f01f7cedf9864ca2bfeac80b7f5c624a41fbf6984a5d039c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 119c57941197c329641a77c8c64e0f97c8060f0da15480c4a748ff5b322129ee8a433e76588cfd720f238e2d5267f6919b28f1ef8b01d6f656ed598595b86f44
|
7
|
+
data.tar.gz: 6a6c85dcfbcf16838c7d6fb0d6bda8c0b6d3d3b53145a30948f9b13a7d5782fc1de7025d69dbc078f0f3d1a6140bf4311100f65f6c911e6ea609761304921cf2
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
|
|
7
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
8
|
|
9
9
|
- API version: 2.0.0
|
10
|
-
- Package version: 3.8.
|
10
|
+
- Package version: 3.8.6
|
11
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
|
13
13
|
|
@@ -24,15 +24,15 @@ gem build ultracart_api.gemspec
|
|
24
24
|
Then either install the gem locally:
|
25
25
|
|
26
26
|
```shell
|
27
|
-
gem install ./ultracart_api-3.8.
|
27
|
+
gem install ./ultracart_api-3.8.6.gem
|
28
28
|
```
|
29
|
-
(for development, run `gem install --dev ./ultracart_api-3.8.
|
29
|
+
(for development, run `gem install --dev ./ultracart_api-3.8.6.gem` to install the development dependencies)
|
30
30
|
|
31
31
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
32
32
|
|
33
33
|
Finally add this to the Gemfile:
|
34
34
|
|
35
|
-
gem 'ultracart_api', '~> 3.8.
|
35
|
+
gem 'ultracart_api', '~> 3.8.6'
|
36
36
|
|
37
37
|
### Install from Git
|
38
38
|
|
@@ -545,6 +545,7 @@ Class | Method | HTTP request | Description
|
|
545
545
|
- [UltracartClient::CouponAmountOffSubtotalWithBlockPurchase](docs/CouponAmountOffSubtotalWithBlockPurchase.md)
|
546
546
|
- [UltracartClient::CouponAmountOffSubtotalWithItemsPurchase](docs/CouponAmountOffSubtotalWithItemsPurchase.md)
|
547
547
|
- [UltracartClient::CouponAmountOffSubtotalWithPurchase](docs/CouponAmountOffSubtotalWithPurchase.md)
|
548
|
+
- [UltracartClient::CouponAmountShippingWithSubtotal](docs/CouponAmountShippingWithSubtotal.md)
|
548
549
|
- [UltracartClient::CouponAutoApplyCondition](docs/CouponAutoApplyCondition.md)
|
549
550
|
- [UltracartClient::CouponAutoApplyConditions](docs/CouponAutoApplyConditions.md)
|
550
551
|
- [UltracartClient::CouponAutomaticallyApplyCouponCodes](docs/CouponAutomaticallyApplyCouponCodes.md)
|
@@ -1145,6 +1146,9 @@ Not every change is committed to every SDK.
|
|
1145
1146
|
|
1146
1147
|
| Version | Date | Comments |
|
1147
1148
|
| --: | :-: | --- |
|
1149
|
+
| 3.8.6 | 03/02/2022 | bug fix for ruby sdk, uri.escape deprecated in 3.x |
|
1150
|
+
| 3.8.5 | 02/25/2022 | new coupon for fixed cost shipping method |
|
1151
|
+
| 3.8.2 | 02/16/2022 | create gift certificate method was missing email |
|
1148
1152
|
| 3.8.1 | 02/16/2022 | auto order item level pause flag |
|
1149
1153
|
| 3.8.0 | 02/16/2022 | gift certificate api (testing) |
|
1150
1154
|
| 3.7.38 | 02/15/2022 | gift certificate api (currently in testing) |
|
data/docs/Coupon.md
CHANGED
@@ -14,6 +14,7 @@ Name | Type | Description | Notes
|
|
14
14
|
**amount_off_subtotal_with_block_purchase** | [**CouponAmountOffSubtotalWithBlockPurchase**](CouponAmountOffSubtotalWithBlockPurchase.md) | | [optional]
|
15
15
|
**amount_off_subtotal_with_items_purchase** | [**CouponAmountOffSubtotalWithItemsPurchase**](CouponAmountOffSubtotalWithItemsPurchase.md) | | [optional]
|
16
16
|
**amount_off_subtotal_with_purchase** | [**CouponAmountOffSubtotalWithPurchase**](CouponAmountOffSubtotalWithPurchase.md) | | [optional]
|
17
|
+
**amount_shipping_with_subtotal** | [**CouponAmountShippingWithSubtotal**](CouponAmountShippingWithSubtotal.md) | | [optional]
|
17
18
|
**automatically_apply_coupon_codes** | [**CouponAutomaticallyApplyCouponCodes**](CouponAutomaticallyApplyCouponCodes.md) | | [optional]
|
18
19
|
**buy_one_get_one** | [**CouponBuyOneGetOneLimit**](CouponBuyOneGetOneLimit.md) | | [optional]
|
19
20
|
**calculated_description** | **String** | Calculated description displayed to the customer if no description is specified. | [optional]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# UltracartClient::CouponAmountShippingWithSubtotal
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**currency_code** | **String** | The ISO-4217 three letter currency code the customer is viewing prices in | [optional]
|
7
|
+
**purchase_amount** | **Float** | The purchase amount to qualify for subtotal discount and free shipping | [optional]
|
8
|
+
**shipping_amount** | **Float** | The amount of the shipping cost (this is not a discount, this is the actual cost of shipping) | [optional]
|
9
|
+
**shipping_methods** | **Array<String>** | One or more shipping methods that may be used with this coupon | [optional]
|
10
|
+
|
11
|
+
|
@@ -4,6 +4,7 @@
|
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
6
|
**amount** | **Float** | Initial amount of this gift certificate. | [optional]
|
7
|
+
**email** | **String** | The email address (customer/owner) associated with this gift certificate. | [optional]
|
7
8
|
**expiration_dts** | **String** | Expiration date time. | [optional]
|
8
9
|
**initial_ledger_description** | **String** | A brief description of how and/or why this gift certificate was created. | [optional]
|
9
10
|
**merchant_note** | **String** | Any internal details you wish to record about this gift certificate. | [optional]
|
@@ -10,7 +10,7 @@ Swagger Codegen version: 2.4.15-SNAPSHOT
|
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require '
|
13
|
+
require 'cgi'
|
14
14
|
|
15
15
|
module UltracartClient
|
16
16
|
class Configuration
|
@@ -181,7 +181,7 @@ module UltracartClient
|
|
181
181
|
|
182
182
|
def base_url
|
183
183
|
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
184
|
-
|
184
|
+
CGI.escape(url)
|
185
185
|
end
|
186
186
|
|
187
187
|
# Gets API key (with prefix if set).
|
@@ -38,6 +38,8 @@ module UltracartClient
|
|
38
38
|
|
39
39
|
attr_accessor :amount_off_subtotal_with_purchase
|
40
40
|
|
41
|
+
attr_accessor :amount_shipping_with_subtotal
|
42
|
+
|
41
43
|
attr_accessor :automatically_apply_coupon_codes
|
42
44
|
|
43
45
|
attr_accessor :buy_one_get_one
|
@@ -164,6 +166,7 @@ module UltracartClient
|
|
164
166
|
:'amount_off_subtotal_with_block_purchase' => :'amount_off_subtotal_with_block_purchase',
|
165
167
|
:'amount_off_subtotal_with_items_purchase' => :'amount_off_subtotal_with_items_purchase',
|
166
168
|
:'amount_off_subtotal_with_purchase' => :'amount_off_subtotal_with_purchase',
|
169
|
+
:'amount_shipping_with_subtotal' => :'amount_shipping_with_subtotal',
|
167
170
|
:'automatically_apply_coupon_codes' => :'automatically_apply_coupon_codes',
|
168
171
|
:'buy_one_get_one' => :'buy_one_get_one',
|
169
172
|
:'calculated_description' => :'calculated_description',
|
@@ -229,6 +232,7 @@ module UltracartClient
|
|
229
232
|
:'amount_off_subtotal_with_block_purchase' => :'CouponAmountOffSubtotalWithBlockPurchase',
|
230
233
|
:'amount_off_subtotal_with_items_purchase' => :'CouponAmountOffSubtotalWithItemsPurchase',
|
231
234
|
:'amount_off_subtotal_with_purchase' => :'CouponAmountOffSubtotalWithPurchase',
|
235
|
+
:'amount_shipping_with_subtotal' => :'CouponAmountShippingWithSubtotal',
|
232
236
|
:'automatically_apply_coupon_codes' => :'CouponAutomaticallyApplyCouponCodes',
|
233
237
|
:'buy_one_get_one' => :'CouponBuyOneGetOneLimit',
|
234
238
|
:'calculated_description' => :'String',
|
@@ -332,6 +336,10 @@ module UltracartClient
|
|
332
336
|
self.amount_off_subtotal_with_purchase = attributes[:'amount_off_subtotal_with_purchase']
|
333
337
|
end
|
334
338
|
|
339
|
+
if attributes.has_key?(:'amount_shipping_with_subtotal')
|
340
|
+
self.amount_shipping_with_subtotal = attributes[:'amount_shipping_with_subtotal']
|
341
|
+
end
|
342
|
+
|
335
343
|
if attributes.has_key?(:'automatically_apply_coupon_codes')
|
336
344
|
self.automatically_apply_coupon_codes = attributes[:'automatically_apply_coupon_codes']
|
337
345
|
end
|
@@ -650,6 +658,7 @@ module UltracartClient
|
|
650
658
|
amount_off_subtotal_with_block_purchase == o.amount_off_subtotal_with_block_purchase &&
|
651
659
|
amount_off_subtotal_with_items_purchase == o.amount_off_subtotal_with_items_purchase &&
|
652
660
|
amount_off_subtotal_with_purchase == o.amount_off_subtotal_with_purchase &&
|
661
|
+
amount_shipping_with_subtotal == o.amount_shipping_with_subtotal &&
|
653
662
|
automatically_apply_coupon_codes == o.automatically_apply_coupon_codes &&
|
654
663
|
buy_one_get_one == o.buy_one_get_one &&
|
655
664
|
calculated_description == o.calculated_description &&
|
@@ -709,7 +718,7 @@ module UltracartClient
|
|
709
718
|
# Calculates hash code according to all attributes.
|
710
719
|
# @return [Fixnum] Hash code
|
711
720
|
def hash
|
712
|
-
[affiliate_oid, allow_multiple_one_time_codes, amount_off_items, amount_off_shipping, amount_off_shipping_with_items_purchase, amount_off_subtotal, amount_off_subtotal_and_free_shipping, amount_off_subtotal_and_shipping, amount_off_subtotal_with_block_purchase, amount_off_subtotal_with_items_purchase, amount_off_subtotal_with_purchase, automatically_apply_coupon_codes, buy_one_get_one, calculated_description, can_be_used_with_other_coupons, coupon_oid, coupon_type, description, discount_item_with_item_purchase, discount_items, expiration_dts, free_item_and_shipping_with_subtotal, free_item_with_item_purchase, free_item_with_subtotal, free_items_with_item_purchase, free_items_with_mixmatch_purchase, free_shipping, free_shipping_specific_items, free_shipping_with_items_purchase, free_shipping_with_subtotal, hide_from_customer, merchant_code, merchant_notes, multiple_amounts_off_items, no_discount, percent_off_item_with_items_quantity_purchase, percent_off_items, percent_off_items_and_free_shipping, percent_off_items_with_items_purchase, percent_off_msrp_items, percent_off_retail_price_items, percent_off_shipping, percent_off_subtotal, percent_off_subtotal_and_free_shipping, percent_off_subtotal_limit, percent_off_subtotal_with_items_purchase, percent_off_subtotal_with_subtotal, quickbooks_code, restrict_by_postal_codes, restrict_by_screen_branding_theme_codes, restrict_by_storefronts, start_dts, super_coupon, tiered_amount_off_items, tiered_amount_off_subtotal, tiered_percent_off_items, tiered_percent_off_shipping, tiered_percent_off_subtotal, usable_by].hash
|
721
|
+
[affiliate_oid, allow_multiple_one_time_codes, amount_off_items, amount_off_shipping, amount_off_shipping_with_items_purchase, amount_off_subtotal, amount_off_subtotal_and_free_shipping, amount_off_subtotal_and_shipping, amount_off_subtotal_with_block_purchase, amount_off_subtotal_with_items_purchase, amount_off_subtotal_with_purchase, amount_shipping_with_subtotal, automatically_apply_coupon_codes, buy_one_get_one, calculated_description, can_be_used_with_other_coupons, coupon_oid, coupon_type, description, discount_item_with_item_purchase, discount_items, expiration_dts, free_item_and_shipping_with_subtotal, free_item_with_item_purchase, free_item_with_subtotal, free_items_with_item_purchase, free_items_with_mixmatch_purchase, free_shipping, free_shipping_specific_items, free_shipping_with_items_purchase, free_shipping_with_subtotal, hide_from_customer, merchant_code, merchant_notes, multiple_amounts_off_items, no_discount, percent_off_item_with_items_quantity_purchase, percent_off_items, percent_off_items_and_free_shipping, percent_off_items_with_items_purchase, percent_off_msrp_items, percent_off_retail_price_items, percent_off_shipping, percent_off_subtotal, percent_off_subtotal_and_free_shipping, percent_off_subtotal_limit, percent_off_subtotal_with_items_purchase, percent_off_subtotal_with_subtotal, quickbooks_code, restrict_by_postal_codes, restrict_by_screen_branding_theme_codes, restrict_by_storefronts, start_dts, super_coupon, tiered_amount_off_items, tiered_amount_off_subtotal, tiered_percent_off_items, tiered_percent_off_shipping, tiered_percent_off_subtotal, usable_by].hash
|
713
722
|
end
|
714
723
|
|
715
724
|
# Builds the object from hash
|
@@ -0,0 +1,232 @@
|
|
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 CouponAmountShippingWithSubtotal
|
17
|
+
# The ISO-4217 three letter currency code the customer is viewing prices in
|
18
|
+
attr_accessor :currency_code
|
19
|
+
|
20
|
+
# The purchase amount to qualify for subtotal discount and free shipping
|
21
|
+
attr_accessor :purchase_amount
|
22
|
+
|
23
|
+
# The amount of the shipping cost (this is not a discount, this is the actual cost of shipping)
|
24
|
+
attr_accessor :shipping_amount
|
25
|
+
|
26
|
+
# One or more shipping methods that may be used with this coupon
|
27
|
+
attr_accessor :shipping_methods
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'currency_code' => :'currency_code',
|
33
|
+
:'purchase_amount' => :'purchase_amount',
|
34
|
+
:'shipping_amount' => :'shipping_amount',
|
35
|
+
:'shipping_methods' => :'shipping_methods'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
:'currency_code' => :'String',
|
43
|
+
:'purchase_amount' => :'Float',
|
44
|
+
:'shipping_amount' => :'Float',
|
45
|
+
:'shipping_methods' => :'Array<String>'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
return unless attributes.is_a?(Hash)
|
53
|
+
|
54
|
+
# convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
56
|
+
|
57
|
+
if attributes.has_key?(:'currency_code')
|
58
|
+
self.currency_code = attributes[:'currency_code']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'purchase_amount')
|
62
|
+
self.purchase_amount = attributes[:'purchase_amount']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'shipping_amount')
|
66
|
+
self.shipping_amount = attributes[:'shipping_amount']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'shipping_methods')
|
70
|
+
if (value = attributes[:'shipping_methods']).is_a?(Array)
|
71
|
+
self.shipping_methods = value
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
77
|
+
# @return Array for valid properties with the reasons
|
78
|
+
def list_invalid_properties
|
79
|
+
invalid_properties = Array.new
|
80
|
+
if !@currency_code.nil? && @currency_code.to_s.length > 3
|
81
|
+
invalid_properties.push('invalid value for "currency_code", the character length must be smaller than or equal to 3.')
|
82
|
+
end
|
83
|
+
|
84
|
+
invalid_properties
|
85
|
+
end
|
86
|
+
|
87
|
+
# Check to see if the all the properties in the model are valid
|
88
|
+
# @return true if the model is valid
|
89
|
+
def valid?
|
90
|
+
return false if !@currency_code.nil? && @currency_code.to_s.length > 3
|
91
|
+
true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Custom attribute writer method with validation
|
95
|
+
# @param [Object] currency_code Value to be assigned
|
96
|
+
def currency_code=(currency_code)
|
97
|
+
if !currency_code.nil? && currency_code.to_s.length > 3
|
98
|
+
fail ArgumentError, 'invalid value for "currency_code", the character length must be smaller than or equal to 3.'
|
99
|
+
end
|
100
|
+
|
101
|
+
@currency_code = currency_code
|
102
|
+
end
|
103
|
+
|
104
|
+
# Checks equality by comparing each attribute.
|
105
|
+
# @param [Object] Object to be compared
|
106
|
+
def ==(o)
|
107
|
+
return true if self.equal?(o)
|
108
|
+
self.class == o.class &&
|
109
|
+
currency_code == o.currency_code &&
|
110
|
+
purchase_amount == o.purchase_amount &&
|
111
|
+
shipping_amount == o.shipping_amount &&
|
112
|
+
shipping_methods == o.shipping_methods
|
113
|
+
end
|
114
|
+
|
115
|
+
# @see the `==` method
|
116
|
+
# @param [Object] Object to be compared
|
117
|
+
def eql?(o)
|
118
|
+
self == o
|
119
|
+
end
|
120
|
+
|
121
|
+
# Calculates hash code according to all attributes.
|
122
|
+
# @return [Fixnum] Hash code
|
123
|
+
def hash
|
124
|
+
[currency_code, purchase_amount, shipping_amount, shipping_methods].hash
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def build_from_hash(attributes)
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
132
|
+
self.class.swagger_types.each_pair do |key, type|
|
133
|
+
if type =~ /\AArray<(.*)>/i
|
134
|
+
# check to ensure the input is an array given that the attribute
|
135
|
+
# is documented as an array but the input is not
|
136
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
137
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
138
|
+
end
|
139
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
142
|
+
end
|
143
|
+
|
144
|
+
self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def _deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :DateTime
|
154
|
+
DateTime.parse(value)
|
155
|
+
when :Date
|
156
|
+
Date.parse(value)
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :BOOLEAN
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else # model
|
184
|
+
temp_model = UltracartClient.const_get(type).new
|
185
|
+
temp_model.build_from_hash(value)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the string representation of the object
|
190
|
+
# @return [String] String presentation of the object
|
191
|
+
def to_s
|
192
|
+
to_hash.to_s
|
193
|
+
end
|
194
|
+
|
195
|
+
# to_body is an alias to to_hash (backward compatibility)
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_body
|
198
|
+
to_hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns the object in the form of hash
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_hash
|
204
|
+
hash = {}
|
205
|
+
self.class.attribute_map.each_pair do |attr, param|
|
206
|
+
value = self.send(attr)
|
207
|
+
next if value.nil?
|
208
|
+
hash[param] = _to_hash(value)
|
209
|
+
end
|
210
|
+
hash
|
211
|
+
end
|
212
|
+
|
213
|
+
# Outputs non-array value in the form of hash
|
214
|
+
# For object, use to_hash. Otherwise, just return the value
|
215
|
+
# @param [Object] value Any valid value
|
216
|
+
# @return [Hash] Returns the value in the form of hash
|
217
|
+
def _to_hash(value)
|
218
|
+
if value.is_a?(Array)
|
219
|
+
value.compact.map { |v| _to_hash(v) }
|
220
|
+
elsif value.is_a?(Hash)
|
221
|
+
{}.tap do |hash|
|
222
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
223
|
+
end
|
224
|
+
elsif value.respond_to? :to_hash
|
225
|
+
value.to_hash
|
226
|
+
else
|
227
|
+
value
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
232
|
+
end
|
@@ -17,6 +17,9 @@ module UltracartClient
|
|
17
17
|
# Initial amount of this gift certificate.
|
18
18
|
attr_accessor :amount
|
19
19
|
|
20
|
+
# The email address (customer/owner) associated with this gift certificate.
|
21
|
+
attr_accessor :email
|
22
|
+
|
20
23
|
# Expiration date time.
|
21
24
|
attr_accessor :expiration_dts
|
22
25
|
|
@@ -30,6 +33,7 @@ module UltracartClient
|
|
30
33
|
def self.attribute_map
|
31
34
|
{
|
32
35
|
:'amount' => :'amount',
|
36
|
+
:'email' => :'email',
|
33
37
|
:'expiration_dts' => :'expiration_dts',
|
34
38
|
:'initial_ledger_description' => :'initial_ledger_description',
|
35
39
|
:'merchant_note' => :'merchant_note'
|
@@ -40,6 +44,7 @@ module UltracartClient
|
|
40
44
|
def self.swagger_types
|
41
45
|
{
|
42
46
|
:'amount' => :'Float',
|
47
|
+
:'email' => :'String',
|
43
48
|
:'expiration_dts' => :'String',
|
44
49
|
:'initial_ledger_description' => :'String',
|
45
50
|
:'merchant_note' => :'String'
|
@@ -58,6 +63,10 @@ module UltracartClient
|
|
58
63
|
self.amount = attributes[:'amount']
|
59
64
|
end
|
60
65
|
|
66
|
+
if attributes.has_key?(:'email')
|
67
|
+
self.email = attributes[:'email']
|
68
|
+
end
|
69
|
+
|
61
70
|
if attributes.has_key?(:'expiration_dts')
|
62
71
|
self.expiration_dts = attributes[:'expiration_dts']
|
63
72
|
end
|
@@ -90,6 +99,7 @@ module UltracartClient
|
|
90
99
|
return true if self.equal?(o)
|
91
100
|
self.class == o.class &&
|
92
101
|
amount == o.amount &&
|
102
|
+
email == o.email &&
|
93
103
|
expiration_dts == o.expiration_dts &&
|
94
104
|
initial_ledger_description == o.initial_ledger_description &&
|
95
105
|
merchant_note == o.merchant_note
|
@@ -104,7 +114,7 @@ module UltracartClient
|
|
104
114
|
# Calculates hash code according to all attributes.
|
105
115
|
# @return [Fixnum] Hash code
|
106
116
|
def hash
|
107
|
-
[amount, expiration_dts, initial_ledger_description, merchant_note].hash
|
117
|
+
[amount, email, expiration_dts, initial_ledger_description, merchant_note].hash
|
108
118
|
end
|
109
119
|
|
110
120
|
# Builds the object from hash
|
@@ -93,15 +93,30 @@ module UltracartClient
|
|
93
93
|
# @return Array for valid properties with the reasons
|
94
94
|
def list_invalid_properties
|
95
95
|
invalid_properties = Array.new
|
96
|
+
if !@description.nil? && @description.to_s.length > 50
|
97
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 50.')
|
98
|
+
end
|
99
|
+
|
96
100
|
invalid_properties
|
97
101
|
end
|
98
102
|
|
99
103
|
# Check to see if the all the properties in the model are valid
|
100
104
|
# @return true if the model is valid
|
101
105
|
def valid?
|
106
|
+
return false if !@description.nil? && @description.to_s.length > 50
|
102
107
|
true
|
103
108
|
end
|
104
109
|
|
110
|
+
# Custom attribute writer method with validation
|
111
|
+
# @param [Object] description Value to be assigned
|
112
|
+
def description=(description)
|
113
|
+
if !description.nil? && description.to_s.length > 50
|
114
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 50.'
|
115
|
+
end
|
116
|
+
|
117
|
+
@description = description
|
118
|
+
end
|
119
|
+
|
105
120
|
# Checks equality by comparing each attribute.
|
106
121
|
# @param [Object] Object to be compared
|
107
122
|
def ==(o)
|
data/lib/ultracart_api.rb
CHANGED
@@ -129,6 +129,7 @@ require 'ultracart_api/models/coupon_amount_off_subtotal_free_shipping_with_purc
|
|
129
129
|
require 'ultracart_api/models/coupon_amount_off_subtotal_with_block_purchase'
|
130
130
|
require 'ultracart_api/models/coupon_amount_off_subtotal_with_items_purchase'
|
131
131
|
require 'ultracart_api/models/coupon_amount_off_subtotal_with_purchase'
|
132
|
+
require 'ultracart_api/models/coupon_amount_shipping_with_subtotal'
|
132
133
|
require 'ultracart_api/models/coupon_auto_apply_condition'
|
133
134
|
require 'ultracart_api/models/coupon_auto_apply_conditions'
|
134
135
|
require 'ultracart_api/models/coupon_automatically_apply_coupon_codes'
|
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: 3.8.
|
4
|
+
version: 3.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02
|
11
|
+
date: 2022-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -318,6 +318,7 @@ files:
|
|
318
318
|
- docs/CouponAmountOffSubtotalWithBlockPurchase.md
|
319
319
|
- docs/CouponAmountOffSubtotalWithItemsPurchase.md
|
320
320
|
- docs/CouponAmountOffSubtotalWithPurchase.md
|
321
|
+
- docs/CouponAmountShippingWithSubtotal.md
|
321
322
|
- docs/CouponApi.md
|
322
323
|
- docs/CouponAutoApplyCondition.md
|
323
324
|
- docs/CouponAutoApplyConditions.md
|
@@ -1000,6 +1001,7 @@ files:
|
|
1000
1001
|
- lib/ultracart_api/models/coupon_amount_off_subtotal_with_block_purchase.rb
|
1001
1002
|
- lib/ultracart_api/models/coupon_amount_off_subtotal_with_items_purchase.rb
|
1002
1003
|
- lib/ultracart_api/models/coupon_amount_off_subtotal_with_purchase.rb
|
1004
|
+
- lib/ultracart_api/models/coupon_amount_shipping_with_subtotal.rb
|
1003
1005
|
- lib/ultracart_api/models/coupon_auto_apply_condition.rb
|
1004
1006
|
- lib/ultracart_api/models/coupon_auto_apply_conditions.rb
|
1005
1007
|
- lib/ultracart_api/models/coupon_automatically_apply_coupon_codes.rb
|