ultracart_api 4.0.102.rc → 4.0.103.rc

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a64a1afa4a2d83919658e247dd99c8b5468d01d7776d6595b1a4bb4c720ad42
4
- data.tar.gz: 6db73e562b30820226b0ba7160834ae51b720fddb43180c90b160e50b712dbf2
3
+ metadata.gz: 863c755bc404ed1ae18d8c3c38b32160ae1f4dd4d15c23fbcdd726fc840a27a0
4
+ data.tar.gz: 50ed92c2b89e35fd855428b123aec0ac7985fee17f8997f71be58c9ce3ded267
5
5
  SHA512:
6
- metadata.gz: d22dd15b843c5411e948234a4558f8d78f49867fdee098b63437cf8c57138a26f3b9513519a03e1f74776bb8fabea7833b97c53836601b2d28c682ad7e289c9d
7
- data.tar.gz: 1928eadbcd8786860925fc392ec1fed31d1f1d0987e5939601d917ef0762f877cd57c418fdc86a9326f9e0347f19e267a6580dedbe3e24bb52def63de4229171
6
+ metadata.gz: 910c7d48bb30def245e60aea214d2da7b696339bccf53b9392d1359b242d98efb7fd07ddb1f2748bcf532ff3759cbaf0f5ddd458ca3d57bd51cf8543570e86f0
7
+ data.tar.gz: 271d69adb4e1d7c2638a1984685b90b6779e8a63fc8962d6c054f67520e6a3d89735e2919140b5e8d2c4edffd13ae59f6ae920ba2b6cb39caa2b03f91358d917
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.102.rc
10
+ - Package version: 4.0.103.rc
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.102.rc.gem
27
+ gem install ./ultracart_api-4.0.103.rc.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./ultracart_api-4.0.102.rc.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./ultracart_api-4.0.103.rc.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.102.rc'
36
+ gem 'ultracart_api', '~> 4.0.103.rc'
37
37
 
38
38
  ### Install from Git
39
39
 
@@ -687,8 +687,12 @@ Class | Method | HTTP request | Description
687
687
  - [UltracartClient::CouponFreeShippingWithSubtotal](docs/CouponFreeShippingWithSubtotal.md)
688
688
  - [UltracartClient::CouponItemSearchResult](docs/CouponItemSearchResult.md)
689
689
  - [UltracartClient::CouponItemSearchResultsResponse](docs/CouponItemSearchResultsResponse.md)
690
+ - [UltracartClient::CouponMoreLoyaltyCashback](docs/CouponMoreLoyaltyCashback.md)
691
+ - [UltracartClient::CouponMoreLoyaltyPoints](docs/CouponMoreLoyaltyPoints.md)
690
692
  - [UltracartClient::CouponMultipleAmountsOffItems](docs/CouponMultipleAmountsOffItems.md)
691
693
  - [UltracartClient::CouponNoDiscount](docs/CouponNoDiscount.md)
694
+ - [UltracartClient::CouponPercentMoreLoyaltyCashback](docs/CouponPercentMoreLoyaltyCashback.md)
695
+ - [UltracartClient::CouponPercentMoreLoyaltyPoints](docs/CouponPercentMoreLoyaltyPoints.md)
692
696
  - [UltracartClient::CouponPercentOffItemWithItemsQuantityPurchase](docs/CouponPercentOffItemWithItemsQuantityPurchase.md)
693
697
  - [UltracartClient::CouponPercentOffItems](docs/CouponPercentOffItems.md)
694
698
  - [UltracartClient::CouponPercentOffItemsAndFreeShipping](docs/CouponPercentOffItemsAndFreeShipping.md)
@@ -1271,6 +1275,7 @@ Not every change is committed to every SDK.
1271
1275
 
1272
1276
  | Version | Date | Comments |
1273
1277
  | --: | :-: | --- |
1278
+ | 4.0.103-RC | 12/27/2022 | additional loyalty related coupons |
1274
1279
  | 4.0.102-RC | 12/21/2022 | conversation development |
1275
1280
  | 4.0.101-RC | 12/20/2022 | conversation engagement update |
1276
1281
  | 4.0.100-RC | 12/20/2022 | conversation engagement update |
data/docs/Coupon.md CHANGED
@@ -38,8 +38,12 @@
38
38
  | **hide_from_customer** | **Boolean** | Hide coupon from customer during checkout. Often used when coupons are automatic discounting mechanisms. | [optional] |
39
39
  | **merchant_code** | **String** | Merchant code of coupon up to 20 characters. | [optional] |
40
40
  | **merchant_notes** | **String** | Internal notes about this coupon. These are not visible to customer. | [optional] |
41
+ | **more_loyalty_cashback** | [**CouponMoreLoyaltyCashback**](CouponMoreLoyaltyCashback.md) | | [optional] |
42
+ | **more_loyalty_points** | [**CouponMoreLoyaltyPoints**](CouponMoreLoyaltyPoints.md) | | [optional] |
41
43
  | **multiple_amounts_off_items** | [**CouponMultipleAmountsOffItems**](CouponMultipleAmountsOffItems.md) | | [optional] |
42
44
  | **no_discount** | [**CouponNoDiscount**](CouponNoDiscount.md) | | [optional] |
45
+ | **percent_more_loyalty_cashback** | [**CouponPercentMoreLoyaltyCashback**](CouponPercentMoreLoyaltyCashback.md) | | [optional] |
46
+ | **percent_more_loyalty_points** | [**CouponPercentMoreLoyaltyPoints**](CouponPercentMoreLoyaltyPoints.md) | | [optional] |
43
47
  | **percent_off_item_with_items_quantity_purchase** | [**CouponPercentOffItemWithItemsQuantityPurchase**](CouponPercentOffItemWithItemsQuantityPurchase.md) | | [optional] |
44
48
  | **percent_off_items** | [**CouponPercentOffItems**](CouponPercentOffItems.md) | | [optional] |
45
49
  | **percent_off_items_and_free_shipping** | [**CouponPercentOffItemsAndFreeShipping**](CouponPercentOffItemsAndFreeShipping.md) | | [optional] |
@@ -106,8 +110,12 @@ instance = UltracartClient::Coupon.new(
106
110
  hide_from_customer: null,
107
111
  merchant_code: null,
108
112
  merchant_notes: null,
113
+ more_loyalty_cashback: null,
114
+ more_loyalty_points: null,
109
115
  multiple_amounts_off_items: null,
110
116
  no_discount: null,
117
+ percent_more_loyalty_cashback: null,
118
+ percent_more_loyalty_points: null,
111
119
  percent_off_item_with_items_quantity_purchase: null,
112
120
  percent_off_items: null,
113
121
  percent_off_items_and_free_shipping: null,
@@ -0,0 +1,18 @@
1
+ # UltracartClient::CouponMoreLoyaltyCashback
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **loyalty_cashback** | **Float** | The additional loyalty cashback | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'ultracart_api'
13
+
14
+ instance = UltracartClient::CouponMoreLoyaltyCashback.new(
15
+ loyalty_cashback: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,18 @@
1
+ # UltracartClient::CouponMoreLoyaltyPoints
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **loyalty_points** | **Float** | The additional loyalty points | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'ultracart_api'
13
+
14
+ instance = UltracartClient::CouponMoreLoyaltyPoints.new(
15
+ loyalty_points: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,18 @@
1
+ # UltracartClient::CouponPercentMoreLoyaltyCashback
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **percent_more_loyalty_cashback** | **Float** | The percentage of additional loyalty cashback | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'ultracart_api'
13
+
14
+ instance = UltracartClient::CouponPercentMoreLoyaltyCashback.new(
15
+ percent_more_loyalty_cashback: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,18 @@
1
+ # UltracartClient::CouponPercentMoreLoyaltyPoints
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **percent_more_loyalty_points** | **Float** | The percentage of additional loyalty points | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'ultracart_api'
13
+
14
+ instance = UltracartClient::CouponPercentMoreLoyaltyPoints.new(
15
+ percent_more_loyalty_points: null
16
+ )
17
+ ```
18
+
@@ -94,10 +94,18 @@ module UltracartClient
94
94
  # Internal notes about this coupon. These are not visible to customer.
95
95
  attr_accessor :merchant_notes
96
96
 
97
+ attr_accessor :more_loyalty_cashback
98
+
99
+ attr_accessor :more_loyalty_points
100
+
97
101
  attr_accessor :multiple_amounts_off_items
98
102
 
99
103
  attr_accessor :no_discount
100
104
 
105
+ attr_accessor :percent_more_loyalty_cashback
106
+
107
+ attr_accessor :percent_more_loyalty_points
108
+
101
109
  attr_accessor :percent_off_item_with_items_quantity_purchase
102
110
 
103
111
  attr_accessor :percent_off_items
@@ -192,8 +200,12 @@ module UltracartClient
192
200
  :'hide_from_customer' => :'hide_from_customer',
193
201
  :'merchant_code' => :'merchant_code',
194
202
  :'merchant_notes' => :'merchant_notes',
203
+ :'more_loyalty_cashback' => :'more_loyalty_cashback',
204
+ :'more_loyalty_points' => :'more_loyalty_points',
195
205
  :'multiple_amounts_off_items' => :'multiple_amounts_off_items',
196
206
  :'no_discount' => :'no_discount',
207
+ :'percent_more_loyalty_cashback' => :'percent_more_loyalty_cashback',
208
+ :'percent_more_loyalty_points' => :'percent_more_loyalty_points',
197
209
  :'percent_off_item_with_items_quantity_purchase' => :'percent_off_item_with_items_quantity_purchase',
198
210
  :'percent_off_items' => :'percent_off_items',
199
211
  :'percent_off_items_and_free_shipping' => :'percent_off_items_and_free_shipping',
@@ -264,8 +276,12 @@ module UltracartClient
264
276
  :'hide_from_customer' => :'Boolean',
265
277
  :'merchant_code' => :'String',
266
278
  :'merchant_notes' => :'String',
279
+ :'more_loyalty_cashback' => :'CouponMoreLoyaltyCashback',
280
+ :'more_loyalty_points' => :'CouponMoreLoyaltyPoints',
267
281
  :'multiple_amounts_off_items' => :'CouponMultipleAmountsOffItems',
268
282
  :'no_discount' => :'CouponNoDiscount',
283
+ :'percent_more_loyalty_cashback' => :'CouponPercentMoreLoyaltyCashback',
284
+ :'percent_more_loyalty_points' => :'CouponPercentMoreLoyaltyPoints',
269
285
  :'percent_off_item_with_items_quantity_purchase' => :'CouponPercentOffItemWithItemsQuantityPurchase',
270
286
  :'percent_off_items' => :'CouponPercentOffItems',
271
287
  :'percent_off_items_and_free_shipping' => :'CouponPercentOffItemsAndFreeShipping',
@@ -451,6 +467,14 @@ module UltracartClient
451
467
  self.merchant_notes = attributes[:'merchant_notes']
452
468
  end
453
469
 
470
+ if attributes.key?(:'more_loyalty_cashback')
471
+ self.more_loyalty_cashback = attributes[:'more_loyalty_cashback']
472
+ end
473
+
474
+ if attributes.key?(:'more_loyalty_points')
475
+ self.more_loyalty_points = attributes[:'more_loyalty_points']
476
+ end
477
+
454
478
  if attributes.key?(:'multiple_amounts_off_items')
455
479
  self.multiple_amounts_off_items = attributes[:'multiple_amounts_off_items']
456
480
  end
@@ -459,6 +483,14 @@ module UltracartClient
459
483
  self.no_discount = attributes[:'no_discount']
460
484
  end
461
485
 
486
+ if attributes.key?(:'percent_more_loyalty_cashback')
487
+ self.percent_more_loyalty_cashback = attributes[:'percent_more_loyalty_cashback']
488
+ end
489
+
490
+ if attributes.key?(:'percent_more_loyalty_points')
491
+ self.percent_more_loyalty_points = attributes[:'percent_more_loyalty_points']
492
+ end
493
+
462
494
  if attributes.key?(:'percent_off_item_with_items_quantity_purchase')
463
495
  self.percent_off_item_with_items_quantity_purchase = attributes[:'percent_off_item_with_items_quantity_purchase']
464
496
  end
@@ -708,8 +740,12 @@ module UltracartClient
708
740
  hide_from_customer == o.hide_from_customer &&
709
741
  merchant_code == o.merchant_code &&
710
742
  merchant_notes == o.merchant_notes &&
743
+ more_loyalty_cashback == o.more_loyalty_cashback &&
744
+ more_loyalty_points == o.more_loyalty_points &&
711
745
  multiple_amounts_off_items == o.multiple_amounts_off_items &&
712
746
  no_discount == o.no_discount &&
747
+ percent_more_loyalty_cashback == o.percent_more_loyalty_cashback &&
748
+ percent_more_loyalty_points == o.percent_more_loyalty_points &&
713
749
  percent_off_item_with_items_quantity_purchase == o.percent_off_item_with_items_quantity_purchase &&
714
750
  percent_off_items == o.percent_off_items &&
715
751
  percent_off_items_and_free_shipping == o.percent_off_items_and_free_shipping &&
@@ -746,7 +782,7 @@ module UltracartClient
746
782
  # Calculates hash code according to all attributes.
747
783
  # @return [Integer] Hash code
748
784
  def hash
749
- [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, tiered_percent_off_subtotal_based_on_msrp, usable_by].hash
785
+ [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, more_loyalty_cashback, more_loyalty_points, multiple_amounts_off_items, no_discount, percent_more_loyalty_cashback, percent_more_loyalty_points, 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, tiered_percent_off_subtotal_based_on_msrp, usable_by].hash
750
786
  end
751
787
 
752
788
  # Builds the object from hash
@@ -0,0 +1,220 @@
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 CouponMoreLoyaltyCashback
18
+ # The additional loyalty cashback
19
+ attr_accessor :loyalty_cashback
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'loyalty_cashback' => :'loyalty_cashback'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'loyalty_cashback' => :'Float'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CouponMoreLoyaltyCashback` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CouponMoreLoyaltyCashback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'loyalty_cashback')
62
+ self.loyalty_cashback = attributes[:'loyalty_cashback']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ loyalty_cashback == o.loyalty_cashback
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [loyalty_cashback].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = UltracartClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,220 @@
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 CouponMoreLoyaltyPoints
18
+ # The additional loyalty points
19
+ attr_accessor :loyalty_points
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'loyalty_points' => :'loyalty_points'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'loyalty_points' => :'Float'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CouponMoreLoyaltyPoints` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CouponMoreLoyaltyPoints`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'loyalty_points')
62
+ self.loyalty_points = attributes[:'loyalty_points']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ loyalty_points == o.loyalty_points
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [loyalty_points].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = UltracartClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,220 @@
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 CouponPercentMoreLoyaltyCashback
18
+ # The percentage of additional loyalty cashback
19
+ attr_accessor :percent_more_loyalty_cashback
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'percent_more_loyalty_cashback' => :'percent_more_loyalty_cashback'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'percent_more_loyalty_cashback' => :'Float'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CouponPercentMoreLoyaltyCashback` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CouponPercentMoreLoyaltyCashback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'percent_more_loyalty_cashback')
62
+ self.percent_more_loyalty_cashback = attributes[:'percent_more_loyalty_cashback']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ percent_more_loyalty_cashback == o.percent_more_loyalty_cashback
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [percent_more_loyalty_cashback].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = UltracartClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,220 @@
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 CouponPercentMoreLoyaltyPoints
18
+ # The percentage of additional loyalty points
19
+ attr_accessor :percent_more_loyalty_points
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'percent_more_loyalty_points' => :'percent_more_loyalty_points'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'percent_more_loyalty_points' => :'Float'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CouponPercentMoreLoyaltyPoints` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CouponPercentMoreLoyaltyPoints`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'percent_more_loyalty_points')
62
+ self.percent_more_loyalty_points = attributes[:'percent_more_loyalty_points']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ percent_more_loyalty_points == o.percent_more_loyalty_points
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [percent_more_loyalty_points].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = UltracartClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.102.rc'
14
+ VERSION = '4.0.103.rc'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -219,8 +219,12 @@ require 'ultracart_api/models/coupon_free_shipping_with_items_purchase'
219
219
  require 'ultracart_api/models/coupon_free_shipping_with_subtotal'
220
220
  require 'ultracart_api/models/coupon_item_search_result'
221
221
  require 'ultracart_api/models/coupon_item_search_results_response'
222
+ require 'ultracart_api/models/coupon_more_loyalty_cashback'
223
+ require 'ultracart_api/models/coupon_more_loyalty_points'
222
224
  require 'ultracart_api/models/coupon_multiple_amounts_off_items'
223
225
  require 'ultracart_api/models/coupon_no_discount'
226
+ require 'ultracart_api/models/coupon_percent_more_loyalty_cashback'
227
+ require 'ultracart_api/models/coupon_percent_more_loyalty_points'
224
228
  require 'ultracart_api/models/coupon_percent_off_item_with_items_quantity_purchase'
225
229
  require 'ultracart_api/models/coupon_percent_off_items'
226
230
  require 'ultracart_api/models/coupon_percent_off_items_and_free_shipping'
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.102.rc
4
+ version: 4.0.103.rc
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2022-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -270,8 +270,12 @@ files:
270
270
  - docs/CouponFreeShippingWithSubtotal.md
271
271
  - docs/CouponItemSearchResult.md
272
272
  - docs/CouponItemSearchResultsResponse.md
273
+ - docs/CouponMoreLoyaltyCashback.md
274
+ - docs/CouponMoreLoyaltyPoints.md
273
275
  - docs/CouponMultipleAmountsOffItems.md
274
276
  - docs/CouponNoDiscount.md
277
+ - docs/CouponPercentMoreLoyaltyCashback.md
278
+ - docs/CouponPercentMoreLoyaltyPoints.md
275
279
  - docs/CouponPercentOffItemWithItemsQuantityPurchase.md
276
280
  - docs/CouponPercentOffItems.md
277
281
  - docs/CouponPercentOffItemsAndFreeShipping.md
@@ -1019,8 +1023,12 @@ files:
1019
1023
  - lib/ultracart_api/models/coupon_free_shipping_with_subtotal.rb
1020
1024
  - lib/ultracart_api/models/coupon_item_search_result.rb
1021
1025
  - lib/ultracart_api/models/coupon_item_search_results_response.rb
1026
+ - lib/ultracart_api/models/coupon_more_loyalty_cashback.rb
1027
+ - lib/ultracart_api/models/coupon_more_loyalty_points.rb
1022
1028
  - lib/ultracart_api/models/coupon_multiple_amounts_off_items.rb
1023
1029
  - lib/ultracart_api/models/coupon_no_discount.rb
1030
+ - lib/ultracart_api/models/coupon_percent_more_loyalty_cashback.rb
1031
+ - lib/ultracart_api/models/coupon_percent_more_loyalty_points.rb
1024
1032
  - lib/ultracart_api/models/coupon_percent_off_item_with_items_quantity_purchase.rb
1025
1033
  - lib/ultracart_api/models/coupon_percent_off_items.rb
1026
1034
  - lib/ultracart_api/models/coupon_percent_off_items_and_free_shipping.rb