ultracart_api 3.10.84 → 3.10.86

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,185 @@
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 CouponPercentMoreLoyaltyPoints
17
+ # The percentage of additional loyalty points
18
+ attr_accessor :percent_more_loyalty_points
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'percent_more_loyalty_points' => :'percent_more_loyalty_points'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'percent_more_loyalty_points' => :'Float'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
41
+
42
+ if attributes.has_key?(:'percent_more_loyalty_points')
43
+ self.percent_more_loyalty_points = attributes[:'percent_more_loyalty_points']
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(o)
63
+ return true if self.equal?(o)
64
+ self.class == o.class &&
65
+ percent_more_loyalty_points == o.percent_more_loyalty_points
66
+ end
67
+
68
+ # @see the `==` method
69
+ # @param [Object] Object to be compared
70
+ def eql?(o)
71
+ self == o
72
+ end
73
+
74
+ # Calculates hash code according to all attributes.
75
+ # @return [Fixnum] Hash code
76
+ def hash
77
+ [percent_more_loyalty_points].hash
78
+ end
79
+
80
+ # Builds the object from hash
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ # @return [Object] Returns the model itself
83
+ def build_from_hash(attributes)
84
+ return nil unless attributes.is_a?(Hash)
85
+ self.class.swagger_types.each_pair do |key, type|
86
+ if type =~ /\AArray<(.*)>/i
87
+ # check to ensure the input is an array given that the attribute
88
+ # is documented as an array but the input is not
89
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
90
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
91
+ end
92
+ elsif !attributes[self.class.attribute_map[key]].nil?
93
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
94
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
95
+ end
96
+
97
+ self
98
+ end
99
+
100
+ # Deserializes the data based on type
101
+ # @param string type Data type
102
+ # @param string value Value to be deserialized
103
+ # @return [Object] Deserialized data
104
+ def _deserialize(type, value)
105
+ case type.to_sym
106
+ when :DateTime
107
+ DateTime.parse(value)
108
+ when :Date
109
+ Date.parse(value)
110
+ when :String
111
+ value.to_s
112
+ when :Integer
113
+ value.to_i
114
+ when :Float
115
+ value.to_f
116
+ when :BOOLEAN
117
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
118
+ true
119
+ else
120
+ false
121
+ end
122
+ when :Object
123
+ # generic object (usually a Hash), return directly
124
+ value
125
+ when /\AArray<(?<inner_type>.+)>\z/
126
+ inner_type = Regexp.last_match[:inner_type]
127
+ value.map { |v| _deserialize(inner_type, v) }
128
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
129
+ k_type = Regexp.last_match[:k_type]
130
+ v_type = Regexp.last_match[:v_type]
131
+ {}.tap do |hash|
132
+ value.each do |k, v|
133
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
134
+ end
135
+ end
136
+ else # model
137
+ temp_model = UltracartClient.const_get(type).new
138
+ temp_model.build_from_hash(value)
139
+ end
140
+ end
141
+
142
+ # Returns the string representation of the object
143
+ # @return [String] String presentation of the object
144
+ def to_s
145
+ to_hash.to_s
146
+ end
147
+
148
+ # to_body is an alias to to_hash (backward compatibility)
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_body
151
+ to_hash
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = self.send(attr)
160
+ next if value.nil?
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ # Outputs non-array value in the form of hash
167
+ # For object, use to_hash. Otherwise, just return the value
168
+ # @param [Object] value Any valid value
169
+ # @return [Hash] Returns the value in the form of hash
170
+ def _to_hash(value)
171
+ if value.is_a?(Array)
172
+ value.compact.map { |v| _to_hash(v) }
173
+ elsif value.is_a?(Hash)
174
+ {}.tap do |hash|
175
+ value.each { |k, v| hash[k] = _to_hash(v) }
176
+ end
177
+ elsif value.respond_to? :to_hash
178
+ value.to_hash
179
+ else
180
+ value
181
+ end
182
+ end
183
+
184
+ end
185
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.15-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '3.10.84'
14
+ VERSION = '3.10.86'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -220,8 +220,12 @@ require 'ultracart_api/models/coupon_free_shipping_with_items_purchase'
220
220
  require 'ultracart_api/models/coupon_free_shipping_with_subtotal'
221
221
  require 'ultracart_api/models/coupon_item_search_result'
222
222
  require 'ultracart_api/models/coupon_item_search_results_response'
223
+ require 'ultracart_api/models/coupon_more_loyalty_cashback'
224
+ require 'ultracart_api/models/coupon_more_loyalty_points'
223
225
  require 'ultracart_api/models/coupon_multiple_amounts_off_items'
224
226
  require 'ultracart_api/models/coupon_no_discount'
227
+ require 'ultracart_api/models/coupon_percent_more_loyalty_cashback'
228
+ require 'ultracart_api/models/coupon_percent_more_loyalty_points'
225
229
  require 'ultracart_api/models/coupon_percent_off_item_with_items_quantity_purchase'
226
230
  require 'ultracart_api/models/coupon_percent_off_items'
227
231
  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: 3.10.84
4
+ version: 3.10.86
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-20 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
@@ -431,8 +431,12 @@ files:
431
431
  - docs/CouponFreeShippingWithSubtotal.md
432
432
  - docs/CouponItemSearchResult.md
433
433
  - docs/CouponItemSearchResultsResponse.md
434
+ - docs/CouponMoreLoyaltyCashback.md
435
+ - docs/CouponMoreLoyaltyPoints.md
434
436
  - docs/CouponMultipleAmountsOffItems.md
435
437
  - docs/CouponNoDiscount.md
438
+ - docs/CouponPercentMoreLoyaltyCashback.md
439
+ - docs/CouponPercentMoreLoyaltyPoints.md
436
440
  - docs/CouponPercentOffItemWithItemsQuantityPurchase.md
437
441
  - docs/CouponPercentOffItems.md
438
442
  - docs/CouponPercentOffItemsAndFreeShipping.md
@@ -1181,8 +1185,12 @@ files:
1181
1185
  - lib/ultracart_api/models/coupon_free_shipping_with_subtotal.rb
1182
1186
  - lib/ultracart_api/models/coupon_item_search_result.rb
1183
1187
  - lib/ultracart_api/models/coupon_item_search_results_response.rb
1188
+ - lib/ultracart_api/models/coupon_more_loyalty_cashback.rb
1189
+ - lib/ultracart_api/models/coupon_more_loyalty_points.rb
1184
1190
  - lib/ultracart_api/models/coupon_multiple_amounts_off_items.rb
1185
1191
  - lib/ultracart_api/models/coupon_no_discount.rb
1192
+ - lib/ultracart_api/models/coupon_percent_more_loyalty_cashback.rb
1193
+ - lib/ultracart_api/models/coupon_percent_more_loyalty_points.rb
1186
1194
  - lib/ultracart_api/models/coupon_percent_off_item_with_items_quantity_purchase.rb
1187
1195
  - lib/ultracart_api/models/coupon_percent_off_items.rb
1188
1196
  - lib/ultracart_api/models/coupon_percent_off_items_and_free_shipping.rb