ultracart_api 4.0.102.rc → 4.0.104.rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -4
- data/docs/Coupon.md +8 -0
- data/docs/CouponMoreLoyaltyCashback.md +18 -0
- data/docs/CouponMoreLoyaltyPoints.md +18 -0
- data/docs/CouponPercentMoreLoyaltyCashback.md +18 -0
- data/docs/CouponPercentMoreLoyaltyPoints.md +18 -0
- data/docs/Order.md +2 -0
- data/docs/OrderPointOfSale.md +22 -0
- data/docs/PointOfSaleLocation.md +34 -0
- data/docs/PointOfSaleReader.md +34 -0
- data/docs/PointOfSaleRegister.md +24 -0
- data/lib/ultracart_api/models/coupon.rb +37 -1
- data/lib/ultracart_api/models/coupon_more_loyalty_cashback.rb +220 -0
- data/lib/ultracart_api/models/coupon_more_loyalty_points.rb +220 -0
- data/lib/ultracart_api/models/coupon_percent_more_loyalty_cashback.rb +220 -0
- data/lib/ultracart_api/models/coupon_percent_more_loyalty_points.rb +220 -0
- data/lib/ultracart_api/models/order.rb +10 -1
- data/lib/ultracart_api/models/order_point_of_sale.rb +237 -0
- data/lib/ultracart_api/models/point_of_sale_location.rb +300 -0
- data/lib/ultracart_api/models/point_of_sale_reader.rb +334 -0
- data/lib/ultracart_api/models/point_of_sale_register.rb +250 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +8 -0
- metadata +18 -2
@@ -0,0 +1,334 @@
|
|
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 PointOfSaleReader
|
18
|
+
# The device type of the reader.
|
19
|
+
attr_accessor :device_type
|
20
|
+
|
21
|
+
# The label of the reader.
|
22
|
+
attr_accessor :label
|
23
|
+
|
24
|
+
# The merchant id that owns this point of sale reader.
|
25
|
+
attr_accessor :merchant_id
|
26
|
+
|
27
|
+
# The payment provider for the card reader.
|
28
|
+
attr_accessor :payment_provider
|
29
|
+
|
30
|
+
# Object identifier of the point of sale reader.
|
31
|
+
attr_accessor :pos_reader_id
|
32
|
+
|
33
|
+
# Object identifier of the point of sale register this reader is assigned to.
|
34
|
+
attr_accessor :pos_register_oid
|
35
|
+
|
36
|
+
# The serial number of the reader.
|
37
|
+
attr_accessor :serial_number
|
38
|
+
|
39
|
+
# If the payment provider is Stripe, this is the Stripe account id
|
40
|
+
attr_accessor :stripe_account_id
|
41
|
+
|
42
|
+
# If the payment provide is Stripe, this is the Stripe terminal reader id
|
43
|
+
attr_accessor :stripe_reader_id
|
44
|
+
|
45
|
+
class EnumAttributeValidator
|
46
|
+
attr_reader :datatype
|
47
|
+
attr_reader :allowable_values
|
48
|
+
|
49
|
+
def initialize(datatype, allowable_values)
|
50
|
+
@allowable_values = allowable_values.map do |value|
|
51
|
+
case datatype.to_s
|
52
|
+
when /Integer/i
|
53
|
+
value.to_i
|
54
|
+
when /Float/i
|
55
|
+
value.to_f
|
56
|
+
else
|
57
|
+
value
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def valid?(value)
|
63
|
+
!value || allowable_values.include?(value)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
68
|
+
def self.attribute_map
|
69
|
+
{
|
70
|
+
:'device_type' => :'device_type',
|
71
|
+
:'label' => :'label',
|
72
|
+
:'merchant_id' => :'merchant_id',
|
73
|
+
:'payment_provider' => :'payment_provider',
|
74
|
+
:'pos_reader_id' => :'pos_reader_id',
|
75
|
+
:'pos_register_oid' => :'pos_register_oid',
|
76
|
+
:'serial_number' => :'serial_number',
|
77
|
+
:'stripe_account_id' => :'stripe_account_id',
|
78
|
+
:'stripe_reader_id' => :'stripe_reader_id'
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# Returns all the JSON keys this model knows about
|
83
|
+
def self.acceptable_attributes
|
84
|
+
attribute_map.values
|
85
|
+
end
|
86
|
+
|
87
|
+
# Attribute type mapping.
|
88
|
+
def self.openapi_types
|
89
|
+
{
|
90
|
+
:'device_type' => :'String',
|
91
|
+
:'label' => :'String',
|
92
|
+
:'merchant_id' => :'String',
|
93
|
+
:'payment_provider' => :'String',
|
94
|
+
:'pos_reader_id' => :'Integer',
|
95
|
+
:'pos_register_oid' => :'Integer',
|
96
|
+
:'serial_number' => :'String',
|
97
|
+
:'stripe_account_id' => :'String',
|
98
|
+
:'stripe_reader_id' => :'String'
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
102
|
+
# List of attributes with nullable: true
|
103
|
+
def self.openapi_nullable
|
104
|
+
Set.new([
|
105
|
+
])
|
106
|
+
end
|
107
|
+
|
108
|
+
# Initializes the object
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
+
def initialize(attributes = {})
|
111
|
+
if (!attributes.is_a?(Hash))
|
112
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::PointOfSaleReader` initialize method"
|
113
|
+
end
|
114
|
+
|
115
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
116
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
117
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
118
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::PointOfSaleReader`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
119
|
+
end
|
120
|
+
h[k.to_sym] = v
|
121
|
+
}
|
122
|
+
|
123
|
+
if attributes.key?(:'device_type')
|
124
|
+
self.device_type = attributes[:'device_type']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'label')
|
128
|
+
self.label = attributes[:'label']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'merchant_id')
|
132
|
+
self.merchant_id = attributes[:'merchant_id']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.key?(:'payment_provider')
|
136
|
+
self.payment_provider = attributes[:'payment_provider']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'pos_reader_id')
|
140
|
+
self.pos_reader_id = attributes[:'pos_reader_id']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.key?(:'pos_register_oid')
|
144
|
+
self.pos_register_oid = attributes[:'pos_register_oid']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.key?(:'serial_number')
|
148
|
+
self.serial_number = attributes[:'serial_number']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'stripe_account_id')
|
152
|
+
self.stripe_account_id = attributes[:'stripe_account_id']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.key?(:'stripe_reader_id')
|
156
|
+
self.stripe_reader_id = attributes[:'stripe_reader_id']
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
161
|
+
# @return Array for valid properties with the reasons
|
162
|
+
def list_invalid_properties
|
163
|
+
invalid_properties = Array.new
|
164
|
+
invalid_properties
|
165
|
+
end
|
166
|
+
|
167
|
+
# Check to see if the all the properties in the model are valid
|
168
|
+
# @return true if the model is valid
|
169
|
+
def valid?
|
170
|
+
payment_provider_validator = EnumAttributeValidator.new('String', ["stripe"])
|
171
|
+
return false unless payment_provider_validator.valid?(@payment_provider)
|
172
|
+
true
|
173
|
+
end
|
174
|
+
|
175
|
+
# Custom attribute writer method checking allowed values (enum).
|
176
|
+
# @param [Object] payment_provider Object to be assigned
|
177
|
+
def payment_provider=(payment_provider)
|
178
|
+
validator = EnumAttributeValidator.new('String', ["stripe"])
|
179
|
+
unless validator.valid?(payment_provider)
|
180
|
+
fail ArgumentError, "invalid value for \"payment_provider\", must be one of #{validator.allowable_values}."
|
181
|
+
end
|
182
|
+
@payment_provider = payment_provider
|
183
|
+
end
|
184
|
+
|
185
|
+
# Checks equality by comparing each attribute.
|
186
|
+
# @param [Object] Object to be compared
|
187
|
+
def ==(o)
|
188
|
+
return true if self.equal?(o)
|
189
|
+
self.class == o.class &&
|
190
|
+
device_type == o.device_type &&
|
191
|
+
label == o.label &&
|
192
|
+
merchant_id == o.merchant_id &&
|
193
|
+
payment_provider == o.payment_provider &&
|
194
|
+
pos_reader_id == o.pos_reader_id &&
|
195
|
+
pos_register_oid == o.pos_register_oid &&
|
196
|
+
serial_number == o.serial_number &&
|
197
|
+
stripe_account_id == o.stripe_account_id &&
|
198
|
+
stripe_reader_id == o.stripe_reader_id
|
199
|
+
end
|
200
|
+
|
201
|
+
# @see the `==` method
|
202
|
+
# @param [Object] Object to be compared
|
203
|
+
def eql?(o)
|
204
|
+
self == o
|
205
|
+
end
|
206
|
+
|
207
|
+
# Calculates hash code according to all attributes.
|
208
|
+
# @return [Integer] Hash code
|
209
|
+
def hash
|
210
|
+
[device_type, label, merchant_id, payment_provider, pos_reader_id, pos_register_oid, serial_number, stripe_account_id, stripe_reader_id].hash
|
211
|
+
end
|
212
|
+
|
213
|
+
# Builds the object from hash
|
214
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
215
|
+
# @return [Object] Returns the model itself
|
216
|
+
def self.build_from_hash(attributes)
|
217
|
+
new.build_from_hash(attributes)
|
218
|
+
end
|
219
|
+
|
220
|
+
# Builds the object from hash
|
221
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
222
|
+
# @return [Object] Returns the model itself
|
223
|
+
def build_from_hash(attributes)
|
224
|
+
return nil unless attributes.is_a?(Hash)
|
225
|
+
attributes = attributes.transform_keys(&:to_sym)
|
226
|
+
self.class.openapi_types.each_pair do |key, type|
|
227
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
228
|
+
self.send("#{key}=", nil)
|
229
|
+
elsif type =~ /\AArray<(.*)>/i
|
230
|
+
# check to ensure the input is an array given that the attribute
|
231
|
+
# is documented as an array but the input is not
|
232
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
233
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
234
|
+
end
|
235
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
236
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
self
|
241
|
+
end
|
242
|
+
|
243
|
+
# Deserializes the data based on type
|
244
|
+
# @param string type Data type
|
245
|
+
# @param string value Value to be deserialized
|
246
|
+
# @return [Object] Deserialized data
|
247
|
+
def _deserialize(type, value)
|
248
|
+
case type.to_sym
|
249
|
+
when :Time
|
250
|
+
Time.parse(value)
|
251
|
+
when :Date
|
252
|
+
Date.parse(value)
|
253
|
+
when :String
|
254
|
+
value.to_s
|
255
|
+
when :Integer
|
256
|
+
value.to_i
|
257
|
+
when :Float
|
258
|
+
value.to_f
|
259
|
+
when :Boolean
|
260
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
261
|
+
true
|
262
|
+
else
|
263
|
+
false
|
264
|
+
end
|
265
|
+
when :Object
|
266
|
+
# generic object (usually a Hash), return directly
|
267
|
+
value
|
268
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
269
|
+
inner_type = Regexp.last_match[:inner_type]
|
270
|
+
value.map { |v| _deserialize(inner_type, v) }
|
271
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
272
|
+
k_type = Regexp.last_match[:k_type]
|
273
|
+
v_type = Regexp.last_match[:v_type]
|
274
|
+
{}.tap do |hash|
|
275
|
+
value.each do |k, v|
|
276
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
277
|
+
end
|
278
|
+
end
|
279
|
+
else # model
|
280
|
+
# models (e.g. Pet) or oneOf
|
281
|
+
klass = UltracartClient.const_get(type)
|
282
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
# Returns the string representation of the object
|
287
|
+
# @return [String] String presentation of the object
|
288
|
+
def to_s
|
289
|
+
to_hash.to_s
|
290
|
+
end
|
291
|
+
|
292
|
+
# to_body is an alias to to_hash (backward compatibility)
|
293
|
+
# @return [Hash] Returns the object in the form of hash
|
294
|
+
def to_body
|
295
|
+
to_hash
|
296
|
+
end
|
297
|
+
|
298
|
+
# Returns the object in the form of hash
|
299
|
+
# @return [Hash] Returns the object in the form of hash
|
300
|
+
def to_hash
|
301
|
+
hash = {}
|
302
|
+
self.class.attribute_map.each_pair do |attr, param|
|
303
|
+
value = self.send(attr)
|
304
|
+
if value.nil?
|
305
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
306
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
307
|
+
end
|
308
|
+
|
309
|
+
hash[param] = _to_hash(value)
|
310
|
+
end
|
311
|
+
hash
|
312
|
+
end
|
313
|
+
|
314
|
+
# Outputs non-array value in the form of hash
|
315
|
+
# For object, use to_hash. Otherwise, just return the value
|
316
|
+
# @param [Object] value Any valid value
|
317
|
+
# @return [Hash] Returns the value in the form of hash
|
318
|
+
def _to_hash(value)
|
319
|
+
if value.is_a?(Array)
|
320
|
+
value.compact.map { |v| _to_hash(v) }
|
321
|
+
elsif value.is_a?(Hash)
|
322
|
+
{}.tap do |hash|
|
323
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
324
|
+
end
|
325
|
+
elsif value.respond_to? :to_hash
|
326
|
+
value.to_hash
|
327
|
+
else
|
328
|
+
value
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
end
|
333
|
+
|
334
|
+
end
|
@@ -0,0 +1,250 @@
|
|
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 PointOfSaleRegister
|
18
|
+
# The merchant id that owns this point of sale register.
|
19
|
+
attr_accessor :merchant_id
|
20
|
+
|
21
|
+
# Name of the register.
|
22
|
+
attr_accessor :name
|
23
|
+
|
24
|
+
# Object identifier of the point of sale location where this register is located.
|
25
|
+
attr_accessor :pos_location_oid
|
26
|
+
|
27
|
+
# Object identifier of the point of sale register.
|
28
|
+
attr_accessor :pos_register_oid
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'merchant_id' => :'merchant_id',
|
34
|
+
:'name' => :'name',
|
35
|
+
:'pos_location_oid' => :'pos_location_oid',
|
36
|
+
:'pos_register_oid' => :'pos_register_oid'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'merchant_id' => :'String',
|
49
|
+
:'name' => :'String',
|
50
|
+
:'pos_location_oid' => :'Integer',
|
51
|
+
:'pos_register_oid' => :'Integer'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# List of attributes with nullable: true
|
56
|
+
def self.openapi_nullable
|
57
|
+
Set.new([
|
58
|
+
])
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
if (!attributes.is_a?(Hash))
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::PointOfSaleRegister` initialize method"
|
66
|
+
end
|
67
|
+
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::PointOfSaleRegister`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
72
|
+
end
|
73
|
+
h[k.to_sym] = v
|
74
|
+
}
|
75
|
+
|
76
|
+
if attributes.key?(:'merchant_id')
|
77
|
+
self.merchant_id = attributes[:'merchant_id']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'name')
|
81
|
+
self.name = attributes[:'name']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'pos_location_oid')
|
85
|
+
self.pos_location_oid = attributes[:'pos_location_oid']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'pos_register_oid')
|
89
|
+
self.pos_register_oid = attributes[:'pos_register_oid']
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
94
|
+
# @return Array for valid properties with the reasons
|
95
|
+
def list_invalid_properties
|
96
|
+
invalid_properties = Array.new
|
97
|
+
invalid_properties
|
98
|
+
end
|
99
|
+
|
100
|
+
# Check to see if the all the properties in the model are valid
|
101
|
+
# @return true if the model is valid
|
102
|
+
def valid?
|
103
|
+
true
|
104
|
+
end
|
105
|
+
|
106
|
+
# Checks equality by comparing each attribute.
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def ==(o)
|
109
|
+
return true if self.equal?(o)
|
110
|
+
self.class == o.class &&
|
111
|
+
merchant_id == o.merchant_id &&
|
112
|
+
name == o.name &&
|
113
|
+
pos_location_oid == o.pos_location_oid &&
|
114
|
+
pos_register_oid == o.pos_register_oid
|
115
|
+
end
|
116
|
+
|
117
|
+
# @see the `==` method
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def eql?(o)
|
120
|
+
self == o
|
121
|
+
end
|
122
|
+
|
123
|
+
# Calculates hash code according to all attributes.
|
124
|
+
# @return [Integer] Hash code
|
125
|
+
def hash
|
126
|
+
[merchant_id, name, pos_location_oid, pos_register_oid].hash
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def self.build_from_hash(attributes)
|
133
|
+
new.build_from_hash(attributes)
|
134
|
+
end
|
135
|
+
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
attributes = attributes.transform_keys(&:to_sym)
|
142
|
+
self.class.openapi_types.each_pair do |key, type|
|
143
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
144
|
+
self.send("#{key}=", nil)
|
145
|
+
elsif type =~ /\AArray<(.*)>/i
|
146
|
+
# check to ensure the input is an array given that the attribute
|
147
|
+
# is documented as an array but the input is not
|
148
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
149
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
150
|
+
end
|
151
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
152
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
self
|
157
|
+
end
|
158
|
+
|
159
|
+
# Deserializes the data based on type
|
160
|
+
# @param string type Data type
|
161
|
+
# @param string value Value to be deserialized
|
162
|
+
# @return [Object] Deserialized data
|
163
|
+
def _deserialize(type, value)
|
164
|
+
case type.to_sym
|
165
|
+
when :Time
|
166
|
+
Time.parse(value)
|
167
|
+
when :Date
|
168
|
+
Date.parse(value)
|
169
|
+
when :String
|
170
|
+
value.to_s
|
171
|
+
when :Integer
|
172
|
+
value.to_i
|
173
|
+
when :Float
|
174
|
+
value.to_f
|
175
|
+
when :Boolean
|
176
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
177
|
+
true
|
178
|
+
else
|
179
|
+
false
|
180
|
+
end
|
181
|
+
when :Object
|
182
|
+
# generic object (usually a Hash), return directly
|
183
|
+
value
|
184
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
185
|
+
inner_type = Regexp.last_match[:inner_type]
|
186
|
+
value.map { |v| _deserialize(inner_type, v) }
|
187
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
188
|
+
k_type = Regexp.last_match[:k_type]
|
189
|
+
v_type = Regexp.last_match[:v_type]
|
190
|
+
{}.tap do |hash|
|
191
|
+
value.each do |k, v|
|
192
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
else # model
|
196
|
+
# models (e.g. Pet) or oneOf
|
197
|
+
klass = UltracartClient.const_get(type)
|
198
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the string representation of the object
|
203
|
+
# @return [String] String presentation of the object
|
204
|
+
def to_s
|
205
|
+
to_hash.to_s
|
206
|
+
end
|
207
|
+
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_body
|
211
|
+
to_hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns the object in the form of hash
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_hash
|
217
|
+
hash = {}
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
219
|
+
value = self.send(attr)
|
220
|
+
if value.nil?
|
221
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
222
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
223
|
+
end
|
224
|
+
|
225
|
+
hash[param] = _to_hash(value)
|
226
|
+
end
|
227
|
+
hash
|
228
|
+
end
|
229
|
+
|
230
|
+
# Outputs non-array value in the form of hash
|
231
|
+
# For object, use to_hash. Otherwise, just return the value
|
232
|
+
# @param [Object] value Any valid value
|
233
|
+
# @return [Hash] Returns the value in the form of hash
|
234
|
+
def _to_hash(value)
|
235
|
+
if value.is_a?(Array)
|
236
|
+
value.compact.map { |v| _to_hash(v) }
|
237
|
+
elsif value.is_a?(Hash)
|
238
|
+
{}.tap do |hash|
|
239
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
240
|
+
end
|
241
|
+
elsif value.respond_to? :to_hash
|
242
|
+
value.to_hash
|
243
|
+
else
|
244
|
+
value
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|
249
|
+
|
250
|
+
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'
|
@@ -583,6 +587,7 @@ require 'ultracart_api/models/order_payment_insurance'
|
|
583
587
|
require 'ultracart_api/models/order_payment_purchase_order'
|
584
588
|
require 'ultracart_api/models/order_payment_transaction'
|
585
589
|
require 'ultracart_api/models/order_payment_transaction_detail'
|
590
|
+
require 'ultracart_api/models/order_point_of_sale'
|
586
591
|
require 'ultracart_api/models/order_process_payment_request'
|
587
592
|
require 'ultracart_api/models/order_process_payment_response'
|
588
593
|
require 'ultracart_api/models/order_property'
|
@@ -604,6 +609,9 @@ require 'ultracart_api/models/order_tracking_number_detail'
|
|
604
609
|
require 'ultracart_api/models/order_tracking_number_details'
|
605
610
|
require 'ultracart_api/models/orders_response'
|
606
611
|
require 'ultracart_api/models/permission'
|
612
|
+
require 'ultracart_api/models/point_of_sale_location'
|
613
|
+
require 'ultracart_api/models/point_of_sale_reader'
|
614
|
+
require 'ultracart_api/models/point_of_sale_register'
|
607
615
|
require 'ultracart_api/models/pricing_tier'
|
608
616
|
require 'ultracart_api/models/pricing_tier_notification'
|
609
617
|
require 'ultracart_api/models/pricing_tiers_response'
|
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.104.rc
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-03 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
|
@@ -641,6 +645,7 @@ files:
|
|
641
645
|
- docs/OrderPaymentPurchaseOrder.md
|
642
646
|
- docs/OrderPaymentTransaction.md
|
643
647
|
- docs/OrderPaymentTransactionDetail.md
|
648
|
+
- docs/OrderPointOfSale.md
|
644
649
|
- docs/OrderProcessPaymentRequest.md
|
645
650
|
- docs/OrderProcessPaymentResponse.md
|
646
651
|
- docs/OrderProperty.md
|
@@ -662,6 +667,9 @@ files:
|
|
662
667
|
- docs/OrderTrackingNumberDetails.md
|
663
668
|
- docs/OrdersResponse.md
|
664
669
|
- docs/Permission.md
|
670
|
+
- docs/PointOfSaleLocation.md
|
671
|
+
- docs/PointOfSaleReader.md
|
672
|
+
- docs/PointOfSaleRegister.md
|
665
673
|
- docs/PricingTier.md
|
666
674
|
- docs/PricingTierNotification.md
|
667
675
|
- docs/PricingTiersResponse.md
|
@@ -1019,8 +1027,12 @@ files:
|
|
1019
1027
|
- lib/ultracart_api/models/coupon_free_shipping_with_subtotal.rb
|
1020
1028
|
- lib/ultracart_api/models/coupon_item_search_result.rb
|
1021
1029
|
- lib/ultracart_api/models/coupon_item_search_results_response.rb
|
1030
|
+
- lib/ultracart_api/models/coupon_more_loyalty_cashback.rb
|
1031
|
+
- lib/ultracart_api/models/coupon_more_loyalty_points.rb
|
1022
1032
|
- lib/ultracart_api/models/coupon_multiple_amounts_off_items.rb
|
1023
1033
|
- lib/ultracart_api/models/coupon_no_discount.rb
|
1034
|
+
- lib/ultracart_api/models/coupon_percent_more_loyalty_cashback.rb
|
1035
|
+
- lib/ultracart_api/models/coupon_percent_more_loyalty_points.rb
|
1024
1036
|
- lib/ultracart_api/models/coupon_percent_off_item_with_items_quantity_purchase.rb
|
1025
1037
|
- lib/ultracart_api/models/coupon_percent_off_items.rb
|
1026
1038
|
- lib/ultracart_api/models/coupon_percent_off_items_and_free_shipping.rb
|
@@ -1383,6 +1395,7 @@ files:
|
|
1383
1395
|
- lib/ultracart_api/models/order_payment_purchase_order.rb
|
1384
1396
|
- lib/ultracart_api/models/order_payment_transaction.rb
|
1385
1397
|
- lib/ultracart_api/models/order_payment_transaction_detail.rb
|
1398
|
+
- lib/ultracart_api/models/order_point_of_sale.rb
|
1386
1399
|
- lib/ultracart_api/models/order_process_payment_request.rb
|
1387
1400
|
- lib/ultracart_api/models/order_process_payment_response.rb
|
1388
1401
|
- lib/ultracart_api/models/order_property.rb
|
@@ -1404,6 +1417,9 @@ files:
|
|
1404
1417
|
- lib/ultracart_api/models/order_tracking_number_details.rb
|
1405
1418
|
- lib/ultracart_api/models/orders_response.rb
|
1406
1419
|
- lib/ultracart_api/models/permission.rb
|
1420
|
+
- lib/ultracart_api/models/point_of_sale_location.rb
|
1421
|
+
- lib/ultracart_api/models/point_of_sale_reader.rb
|
1422
|
+
- lib/ultracart_api/models/point_of_sale_register.rb
|
1407
1423
|
- lib/ultracart_api/models/pricing_tier.rb
|
1408
1424
|
- lib/ultracart_api/models/pricing_tier_notification.rb
|
1409
1425
|
- lib/ultracart_api/models/pricing_tiers_response.rb
|