ultracart_api 3.10.86 → 3.10.87
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -4
- data/docs/Order.md +1 -0
- data/docs/OrderPointOfSale.md +10 -0
- data/docs/PointOfSaleLocation.md +16 -0
- data/docs/PointOfSaleReader.md +16 -0
- data/docs/PointOfSaleRegister.md +11 -0
- data/lib/ultracart_api/models/order.rb +10 -1
- data/lib/ultracart_api/models/order_point_of_sale.rb +202 -0
- data/lib/ultracart_api/models/point_of_sale_location.rb +265 -0
- data/lib/ultracart_api/models/point_of_sale_reader.rb +299 -0
- data/lib/ultracart_api/models/point_of_sale_register.rb +215 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +4 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34f8843c1beeb281a4f4c9931006ce6a8214089360872be5c710c90e3ad60c8d
|
4
|
+
data.tar.gz: e4ee2fbe3e5115209d77c688aec9487ef22e90f1bf93ab99d97bb1b363885a18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12eca8ebe0786ef81d787156644f29033810e069a9984a1585921ca00d0dbd84f98663ec1c0d1d86aeeb7bb7968cc5858f28d884447bea7b20fc531d4856a32f
|
7
|
+
data.tar.gz: 58b844c2ac6b81beb6cc393e0f46809510b8abe85f3a5cd5be11abadad6046ed1de9fd17d4becac0605e34151faa32c30a09ad96b514415d3523dd98961b739f
|
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.10.
|
10
|
+
- Package version: 3.10.87
|
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.10.
|
27
|
+
gem install ./ultracart_api-3.10.87.gem
|
28
28
|
```
|
29
|
-
(for development, run `gem install --dev ./ultracart_api-3.10.
|
29
|
+
(for development, run `gem install --dev ./ultracart_api-3.10.87.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.10.
|
35
|
+
gem 'ultracart_api', '~> 3.10.87'
|
36
36
|
|
37
37
|
### Install from Git
|
38
38
|
|
@@ -1050,6 +1050,7 @@ Class | Method | HTTP request | Description
|
|
1050
1050
|
- [UltracartClient::OrderPaymentPurchaseOrder](docs/OrderPaymentPurchaseOrder.md)
|
1051
1051
|
- [UltracartClient::OrderPaymentTransaction](docs/OrderPaymentTransaction.md)
|
1052
1052
|
- [UltracartClient::OrderPaymentTransactionDetail](docs/OrderPaymentTransactionDetail.md)
|
1053
|
+
- [UltracartClient::OrderPointOfSale](docs/OrderPointOfSale.md)
|
1053
1054
|
- [UltracartClient::OrderProcessPaymentRequest](docs/OrderProcessPaymentRequest.md)
|
1054
1055
|
- [UltracartClient::OrderProcessPaymentResponse](docs/OrderProcessPaymentResponse.md)
|
1055
1056
|
- [UltracartClient::OrderProperty](docs/OrderProperty.md)
|
@@ -1071,6 +1072,9 @@ Class | Method | HTTP request | Description
|
|
1071
1072
|
- [UltracartClient::OrderTrackingNumberDetails](docs/OrderTrackingNumberDetails.md)
|
1072
1073
|
- [UltracartClient::OrdersResponse](docs/OrdersResponse.md)
|
1073
1074
|
- [UltracartClient::Permission](docs/Permission.md)
|
1075
|
+
- [UltracartClient::PointOfSaleLocation](docs/PointOfSaleLocation.md)
|
1076
|
+
- [UltracartClient::PointOfSaleReader](docs/PointOfSaleReader.md)
|
1077
|
+
- [UltracartClient::PointOfSaleRegister](docs/PointOfSaleRegister.md)
|
1074
1078
|
- [UltracartClient::PricingTier](docs/PricingTier.md)
|
1075
1079
|
- [UltracartClient::PricingTierNotification](docs/PricingTierNotification.md)
|
1076
1080
|
- [UltracartClient::PricingTiersResponse](docs/PricingTiersResponse.md)
|
@@ -1267,6 +1271,7 @@ Not every change is committed to every SDK.
|
|
1267
1271
|
|
1268
1272
|
| Version | Date | Comments |
|
1269
1273
|
| --: | :-: | --- |
|
1274
|
+
| 3.10.87 | 01/03/2023 | order point of sale details |
|
1270
1275
|
| 3.10.86 | 12/27/2022 | additional loyalty related coupons |
|
1271
1276
|
| 3.10.85 | 12/21/2022 | conversation development |
|
1272
1277
|
| 3.10.84 | 12/20/2022 | conversation engagement update |
|
data/docs/Order.md
CHANGED
@@ -28,6 +28,7 @@ Name | Type | Description | Notes
|
|
28
28
|
**merchant_id** | **String** | UltraCart merchant ID owning this order | [optional]
|
29
29
|
**order_id** | **String** | Order ID | [optional]
|
30
30
|
**payment** | [**OrderPayment**](OrderPayment.md) | | [optional]
|
31
|
+
**point_of_sale** | [**OrderPointOfSale**](OrderPointOfSale.md) | | [optional]
|
31
32
|
**properties** | [**Array<OrderProperty>**](OrderProperty.md) | Properties, available only through update, not through insert due to the nature of how properties are handled internally | [optional]
|
32
33
|
**quote** | [**OrderQuote**](OrderQuote.md) | | [optional]
|
33
34
|
**refund_dts** | **String** | If the order was refunded, the date/time that the last refund occurred | [optional]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# UltracartClient::OrderPointOfSale
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**location** | [**PointOfSaleLocation**](PointOfSaleLocation.md) | | [optional]
|
7
|
+
**reader** | [**PointOfSaleReader**](PointOfSaleReader.md) | | [optional]
|
8
|
+
**register** | [**PointOfSaleRegister**](PointOfSaleRegister.md) | | [optional]
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# UltracartClient::PointOfSaleLocation
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**adddress2** | **String** | Address line 2 | [optional]
|
7
|
+
**address1** | **String** | Address line 1 | [optional]
|
8
|
+
**city** | **String** | City | [optional]
|
9
|
+
**country** | **String** | Country | [optional]
|
10
|
+
**distribution_center_code** | **String** | The distribution center code where inventory is reduced from for this sale. | [optional]
|
11
|
+
**merchant_id** | **String** | Merchant ID that owns this location | [optional]
|
12
|
+
**pos_location_oid** | **Integer** | Object identifier of the point of sale location. | [optional]
|
13
|
+
**postal_code** | **String** | Postal code | [optional]
|
14
|
+
**state_province** | **String** | State/province | [optional]
|
15
|
+
|
16
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# UltracartClient::PointOfSaleReader
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**device_type** | **String** | The device type of the reader. | [optional]
|
7
|
+
**label** | **String** | The label of the reader. | [optional]
|
8
|
+
**merchant_id** | **String** | The merchant id that owns this point of sale reader. | [optional]
|
9
|
+
**payment_provider** | **String** | The payment provider for the card reader. | [optional]
|
10
|
+
**pos_reader_id** | **Integer** | Object identifier of the point of sale reader. | [optional]
|
11
|
+
**pos_register_oid** | **Integer** | Object identifier of the point of sale register this reader is assigned to. | [optional]
|
12
|
+
**serial_number** | **String** | The serial number of the reader. | [optional]
|
13
|
+
**stripe_account_id** | **String** | If the payment provider is Stripe, this is the Stripe account id | [optional]
|
14
|
+
**stripe_reader_id** | **String** | If the payment provide is Stripe, this is the Stripe terminal reader id | [optional]
|
15
|
+
|
16
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# UltracartClient::PointOfSaleRegister
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**merchant_id** | **String** | The merchant id that owns this point of sale register. | [optional]
|
7
|
+
**name** | **String** | Name of the register. | [optional]
|
8
|
+
**pos_location_oid** | **Integer** | Object identifier of the point of sale location where this register is located. | [optional]
|
9
|
+
**pos_register_oid** | **Integer** | Object identifier of the point of sale register. | [optional]
|
10
|
+
|
11
|
+
|
@@ -74,6 +74,8 @@ module UltracartClient
|
|
74
74
|
|
75
75
|
attr_accessor :payment
|
76
76
|
|
77
|
+
attr_accessor :point_of_sale
|
78
|
+
|
77
79
|
# Properties, available only through update, not through insert due to the nature of how properties are handled internally
|
78
80
|
attr_accessor :properties
|
79
81
|
|
@@ -146,6 +148,7 @@ module UltracartClient
|
|
146
148
|
:'merchant_id' => :'merchant_id',
|
147
149
|
:'order_id' => :'order_id',
|
148
150
|
:'payment' => :'payment',
|
151
|
+
:'point_of_sale' => :'point_of_sale',
|
149
152
|
:'properties' => :'properties',
|
150
153
|
:'quote' => :'quote',
|
151
154
|
:'refund_dts' => :'refund_dts',
|
@@ -186,6 +189,7 @@ module UltracartClient
|
|
186
189
|
:'merchant_id' => :'String',
|
187
190
|
:'order_id' => :'String',
|
188
191
|
:'payment' => :'OrderPayment',
|
192
|
+
:'point_of_sale' => :'OrderPointOfSale',
|
189
193
|
:'properties' => :'Array<OrderProperty>',
|
190
194
|
:'quote' => :'OrderQuote',
|
191
195
|
:'refund_dts' => :'String',
|
@@ -312,6 +316,10 @@ module UltracartClient
|
|
312
316
|
self.payment = attributes[:'payment']
|
313
317
|
end
|
314
318
|
|
319
|
+
if attributes.has_key?(:'point_of_sale')
|
320
|
+
self.point_of_sale = attributes[:'point_of_sale']
|
321
|
+
end
|
322
|
+
|
315
323
|
if attributes.has_key?(:'properties')
|
316
324
|
if (value = attributes[:'properties']).is_a?(Array)
|
317
325
|
self.properties = value
|
@@ -438,6 +446,7 @@ module UltracartClient
|
|
438
446
|
merchant_id == o.merchant_id &&
|
439
447
|
order_id == o.order_id &&
|
440
448
|
payment == o.payment &&
|
449
|
+
point_of_sale == o.point_of_sale &&
|
441
450
|
properties == o.properties &&
|
442
451
|
quote == o.quote &&
|
443
452
|
refund_dts == o.refund_dts &&
|
@@ -458,7 +467,7 @@ module UltracartClient
|
|
458
467
|
# Calculates hash code according to all attributes.
|
459
468
|
# @return [Fixnum] Hash code
|
460
469
|
def hash
|
461
|
-
[affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, customer_profile, digital_order, edi, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, properties, quote, refund_dts, reject_dts, salesforce, shipping, summary, tags, taxes].hash
|
470
|
+
[affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, customer_profile, digital_order, edi, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, point_of_sale, properties, quote, refund_dts, reject_dts, salesforce, shipping, summary, tags, taxes].hash
|
462
471
|
end
|
463
472
|
|
464
473
|
# Builds the object from hash
|
@@ -0,0 +1,202 @@
|
|
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 OrderPointOfSale
|
17
|
+
attr_accessor :location
|
18
|
+
|
19
|
+
attr_accessor :reader
|
20
|
+
|
21
|
+
attr_accessor :register
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'location' => :'location',
|
27
|
+
:'reader' => :'reader',
|
28
|
+
:'register' => :'register'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'location' => :'PointOfSaleLocation',
|
36
|
+
:'reader' => :'PointOfSaleReader',
|
37
|
+
:'register' => :'PointOfSaleRegister'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
return unless attributes.is_a?(Hash)
|
45
|
+
|
46
|
+
# convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
48
|
+
|
49
|
+
if attributes.has_key?(:'location')
|
50
|
+
self.location = attributes[:'location']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'reader')
|
54
|
+
self.reader = attributes[:'reader']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'register')
|
58
|
+
self.register = attributes[:'register']
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properties with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
invalid_properties
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
true
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param [Object] Object to be compared
|
77
|
+
def ==(o)
|
78
|
+
return true if self.equal?(o)
|
79
|
+
self.class == o.class &&
|
80
|
+
location == o.location &&
|
81
|
+
reader == o.reader &&
|
82
|
+
register == o.register
|
83
|
+
end
|
84
|
+
|
85
|
+
# @see the `==` method
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def eql?(o)
|
88
|
+
self == o
|
89
|
+
end
|
90
|
+
|
91
|
+
# Calculates hash code according to all attributes.
|
92
|
+
# @return [Fixnum] Hash code
|
93
|
+
def hash
|
94
|
+
[location, reader, register].hash
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def build_from_hash(attributes)
|
101
|
+
return nil unless attributes.is_a?(Hash)
|
102
|
+
self.class.swagger_types.each_pair do |key, type|
|
103
|
+
if type =~ /\AArray<(.*)>/i
|
104
|
+
# check to ensure the input is an array given that the attribute
|
105
|
+
# is documented as an array but the input is not
|
106
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
107
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
108
|
+
end
|
109
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
111
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
112
|
+
end
|
113
|
+
|
114
|
+
self
|
115
|
+
end
|
116
|
+
|
117
|
+
# Deserializes the data based on type
|
118
|
+
# @param string type Data type
|
119
|
+
# @param string value Value to be deserialized
|
120
|
+
# @return [Object] Deserialized data
|
121
|
+
def _deserialize(type, value)
|
122
|
+
case type.to_sym
|
123
|
+
when :DateTime
|
124
|
+
DateTime.parse(value)
|
125
|
+
when :Date
|
126
|
+
Date.parse(value)
|
127
|
+
when :String
|
128
|
+
value.to_s
|
129
|
+
when :Integer
|
130
|
+
value.to_i
|
131
|
+
when :Float
|
132
|
+
value.to_f
|
133
|
+
when :BOOLEAN
|
134
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
135
|
+
true
|
136
|
+
else
|
137
|
+
false
|
138
|
+
end
|
139
|
+
when :Object
|
140
|
+
# generic object (usually a Hash), return directly
|
141
|
+
value
|
142
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
143
|
+
inner_type = Regexp.last_match[:inner_type]
|
144
|
+
value.map { |v| _deserialize(inner_type, v) }
|
145
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
146
|
+
k_type = Regexp.last_match[:k_type]
|
147
|
+
v_type = Regexp.last_match[:v_type]
|
148
|
+
{}.tap do |hash|
|
149
|
+
value.each do |k, v|
|
150
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
else # model
|
154
|
+
temp_model = UltracartClient.const_get(type).new
|
155
|
+
temp_model.build_from_hash(value)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# Returns the string representation of the object
|
160
|
+
# @return [String] String presentation of the object
|
161
|
+
def to_s
|
162
|
+
to_hash.to_s
|
163
|
+
end
|
164
|
+
|
165
|
+
# to_body is an alias to to_hash (backward compatibility)
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_body
|
168
|
+
to_hash
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the object in the form of hash
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_hash
|
174
|
+
hash = {}
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
176
|
+
value = self.send(attr)
|
177
|
+
next if value.nil?
|
178
|
+
hash[param] = _to_hash(value)
|
179
|
+
end
|
180
|
+
hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Outputs non-array value in the form of hash
|
184
|
+
# For object, use to_hash. Otherwise, just return the value
|
185
|
+
# @param [Object] value Any valid value
|
186
|
+
# @return [Hash] Returns the value in the form of hash
|
187
|
+
def _to_hash(value)
|
188
|
+
if value.is_a?(Array)
|
189
|
+
value.compact.map { |v| _to_hash(v) }
|
190
|
+
elsif value.is_a?(Hash)
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
193
|
+
end
|
194
|
+
elsif value.respond_to? :to_hash
|
195
|
+
value.to_hash
|
196
|
+
else
|
197
|
+
value
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
end
|
@@ -0,0 +1,265 @@
|
|
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 PointOfSaleLocation
|
17
|
+
# Address line 2
|
18
|
+
attr_accessor :adddress2
|
19
|
+
|
20
|
+
# Address line 1
|
21
|
+
attr_accessor :address1
|
22
|
+
|
23
|
+
# City
|
24
|
+
attr_accessor :city
|
25
|
+
|
26
|
+
# Country
|
27
|
+
attr_accessor :country
|
28
|
+
|
29
|
+
# The distribution center code where inventory is reduced from for this sale.
|
30
|
+
attr_accessor :distribution_center_code
|
31
|
+
|
32
|
+
# Merchant ID that owns this location
|
33
|
+
attr_accessor :merchant_id
|
34
|
+
|
35
|
+
# Object identifier of the point of sale location.
|
36
|
+
attr_accessor :pos_location_oid
|
37
|
+
|
38
|
+
# Postal code
|
39
|
+
attr_accessor :postal_code
|
40
|
+
|
41
|
+
# State/province
|
42
|
+
attr_accessor :state_province
|
43
|
+
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
45
|
+
def self.attribute_map
|
46
|
+
{
|
47
|
+
:'adddress2' => :'adddress2',
|
48
|
+
:'address1' => :'address1',
|
49
|
+
:'city' => :'city',
|
50
|
+
:'country' => :'country',
|
51
|
+
:'distribution_center_code' => :'distribution_center_code',
|
52
|
+
:'merchant_id' => :'merchant_id',
|
53
|
+
:'pos_location_oid' => :'pos_location_oid',
|
54
|
+
:'postal_code' => :'postal_code',
|
55
|
+
:'state_province' => :'state_province'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Attribute type mapping.
|
60
|
+
def self.swagger_types
|
61
|
+
{
|
62
|
+
:'adddress2' => :'String',
|
63
|
+
:'address1' => :'String',
|
64
|
+
:'city' => :'String',
|
65
|
+
:'country' => :'String',
|
66
|
+
:'distribution_center_code' => :'String',
|
67
|
+
:'merchant_id' => :'String',
|
68
|
+
:'pos_location_oid' => :'Integer',
|
69
|
+
:'postal_code' => :'String',
|
70
|
+
:'state_province' => :'String'
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
# Initializes the object
|
75
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
76
|
+
def initialize(attributes = {})
|
77
|
+
return unless attributes.is_a?(Hash)
|
78
|
+
|
79
|
+
# convert string to symbol for hash key
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
81
|
+
|
82
|
+
if attributes.has_key?(:'adddress2')
|
83
|
+
self.adddress2 = attributes[:'adddress2']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.has_key?(:'address1')
|
87
|
+
self.address1 = attributes[:'address1']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.has_key?(:'city')
|
91
|
+
self.city = attributes[:'city']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.has_key?(:'country')
|
95
|
+
self.country = attributes[:'country']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'distribution_center_code')
|
99
|
+
self.distribution_center_code = attributes[:'distribution_center_code']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'merchant_id')
|
103
|
+
self.merchant_id = attributes[:'merchant_id']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'pos_location_oid')
|
107
|
+
self.pos_location_oid = attributes[:'pos_location_oid']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'postal_code')
|
111
|
+
self.postal_code = attributes[:'postal_code']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'state_province')
|
115
|
+
self.state_province = attributes[:'state_province']
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
120
|
+
# @return Array for valid properties with the reasons
|
121
|
+
def list_invalid_properties
|
122
|
+
invalid_properties = Array.new
|
123
|
+
invalid_properties
|
124
|
+
end
|
125
|
+
|
126
|
+
# Check to see if the all the properties in the model are valid
|
127
|
+
# @return true if the model is valid
|
128
|
+
def valid?
|
129
|
+
true
|
130
|
+
end
|
131
|
+
|
132
|
+
# Checks equality by comparing each attribute.
|
133
|
+
# @param [Object] Object to be compared
|
134
|
+
def ==(o)
|
135
|
+
return true if self.equal?(o)
|
136
|
+
self.class == o.class &&
|
137
|
+
adddress2 == o.adddress2 &&
|
138
|
+
address1 == o.address1 &&
|
139
|
+
city == o.city &&
|
140
|
+
country == o.country &&
|
141
|
+
distribution_center_code == o.distribution_center_code &&
|
142
|
+
merchant_id == o.merchant_id &&
|
143
|
+
pos_location_oid == o.pos_location_oid &&
|
144
|
+
postal_code == o.postal_code &&
|
145
|
+
state_province == o.state_province
|
146
|
+
end
|
147
|
+
|
148
|
+
# @see the `==` method
|
149
|
+
# @param [Object] Object to be compared
|
150
|
+
def eql?(o)
|
151
|
+
self == o
|
152
|
+
end
|
153
|
+
|
154
|
+
# Calculates hash code according to all attributes.
|
155
|
+
# @return [Fixnum] Hash code
|
156
|
+
def hash
|
157
|
+
[adddress2, address1, city, country, distribution_center_code, merchant_id, pos_location_oid, postal_code, state_province].hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Builds the object from hash
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
+
# @return [Object] Returns the model itself
|
163
|
+
def build_from_hash(attributes)
|
164
|
+
return nil unless attributes.is_a?(Hash)
|
165
|
+
self.class.swagger_types.each_pair do |key, type|
|
166
|
+
if type =~ /\AArray<(.*)>/i
|
167
|
+
# check to ensure the input is an array given that the attribute
|
168
|
+
# is documented as an array but the input is not
|
169
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
170
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
171
|
+
end
|
172
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
173
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
174
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
175
|
+
end
|
176
|
+
|
177
|
+
self
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param string type Data type
|
182
|
+
# @param string value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def _deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :DateTime
|
187
|
+
DateTime.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :BOOLEAN
|
197
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
temp_model = UltracartClient.const_get(type).new
|
218
|
+
temp_model.build_from_hash(value)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the string representation of the object
|
223
|
+
# @return [String] String presentation of the object
|
224
|
+
def to_s
|
225
|
+
to_hash.to_s
|
226
|
+
end
|
227
|
+
|
228
|
+
# to_body is an alias to to_hash (backward compatibility)
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
230
|
+
def to_body
|
231
|
+
to_hash
|
232
|
+
end
|
233
|
+
|
234
|
+
# Returns the object in the form of hash
|
235
|
+
# @return [Hash] Returns the object in the form of hash
|
236
|
+
def to_hash
|
237
|
+
hash = {}
|
238
|
+
self.class.attribute_map.each_pair do |attr, param|
|
239
|
+
value = self.send(attr)
|
240
|
+
next if value.nil?
|
241
|
+
hash[param] = _to_hash(value)
|
242
|
+
end
|
243
|
+
hash
|
244
|
+
end
|
245
|
+
|
246
|
+
# Outputs non-array value in the form of hash
|
247
|
+
# For object, use to_hash. Otherwise, just return the value
|
248
|
+
# @param [Object] value Any valid value
|
249
|
+
# @return [Hash] Returns the value in the form of hash
|
250
|
+
def _to_hash(value)
|
251
|
+
if value.is_a?(Array)
|
252
|
+
value.compact.map { |v| _to_hash(v) }
|
253
|
+
elsif value.is_a?(Hash)
|
254
|
+
{}.tap do |hash|
|
255
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
256
|
+
end
|
257
|
+
elsif value.respond_to? :to_hash
|
258
|
+
value.to_hash
|
259
|
+
else
|
260
|
+
value
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
end
|
265
|
+
end
|
@@ -0,0 +1,299 @@
|
|
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 PointOfSaleReader
|
17
|
+
# The device type of the reader.
|
18
|
+
attr_accessor :device_type
|
19
|
+
|
20
|
+
# The label of the reader.
|
21
|
+
attr_accessor :label
|
22
|
+
|
23
|
+
# The merchant id that owns this point of sale reader.
|
24
|
+
attr_accessor :merchant_id
|
25
|
+
|
26
|
+
# The payment provider for the card reader.
|
27
|
+
attr_accessor :payment_provider
|
28
|
+
|
29
|
+
# Object identifier of the point of sale reader.
|
30
|
+
attr_accessor :pos_reader_id
|
31
|
+
|
32
|
+
# Object identifier of the point of sale register this reader is assigned to.
|
33
|
+
attr_accessor :pos_register_oid
|
34
|
+
|
35
|
+
# The serial number of the reader.
|
36
|
+
attr_accessor :serial_number
|
37
|
+
|
38
|
+
# If the payment provider is Stripe, this is the Stripe account id
|
39
|
+
attr_accessor :stripe_account_id
|
40
|
+
|
41
|
+
# If the payment provide is Stripe, this is the Stripe terminal reader id
|
42
|
+
attr_accessor :stripe_reader_id
|
43
|
+
|
44
|
+
class EnumAttributeValidator
|
45
|
+
attr_reader :datatype
|
46
|
+
attr_reader :allowable_values
|
47
|
+
|
48
|
+
def initialize(datatype, allowable_values)
|
49
|
+
@allowable_values = allowable_values.map do |value|
|
50
|
+
case datatype.to_s
|
51
|
+
when /Integer/i
|
52
|
+
value.to_i
|
53
|
+
when /Float/i
|
54
|
+
value.to_f
|
55
|
+
else
|
56
|
+
value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def valid?(value)
|
62
|
+
!value || allowable_values.include?(value)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
67
|
+
def self.attribute_map
|
68
|
+
{
|
69
|
+
:'device_type' => :'device_type',
|
70
|
+
:'label' => :'label',
|
71
|
+
:'merchant_id' => :'merchant_id',
|
72
|
+
:'payment_provider' => :'payment_provider',
|
73
|
+
:'pos_reader_id' => :'pos_reader_id',
|
74
|
+
:'pos_register_oid' => :'pos_register_oid',
|
75
|
+
:'serial_number' => :'serial_number',
|
76
|
+
:'stripe_account_id' => :'stripe_account_id',
|
77
|
+
:'stripe_reader_id' => :'stripe_reader_id'
|
78
|
+
}
|
79
|
+
end
|
80
|
+
|
81
|
+
# Attribute type mapping.
|
82
|
+
def self.swagger_types
|
83
|
+
{
|
84
|
+
:'device_type' => :'String',
|
85
|
+
:'label' => :'String',
|
86
|
+
:'merchant_id' => :'String',
|
87
|
+
:'payment_provider' => :'String',
|
88
|
+
:'pos_reader_id' => :'Integer',
|
89
|
+
:'pos_register_oid' => :'Integer',
|
90
|
+
:'serial_number' => :'String',
|
91
|
+
:'stripe_account_id' => :'String',
|
92
|
+
:'stripe_reader_id' => :'String'
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
# Initializes the object
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
98
|
+
def initialize(attributes = {})
|
99
|
+
return unless attributes.is_a?(Hash)
|
100
|
+
|
101
|
+
# convert string to symbol for hash key
|
102
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
103
|
+
|
104
|
+
if attributes.has_key?(:'device_type')
|
105
|
+
self.device_type = attributes[:'device_type']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.has_key?(:'label')
|
109
|
+
self.label = attributes[:'label']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.has_key?(:'merchant_id')
|
113
|
+
self.merchant_id = attributes[:'merchant_id']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.has_key?(:'payment_provider')
|
117
|
+
self.payment_provider = attributes[:'payment_provider']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.has_key?(:'pos_reader_id')
|
121
|
+
self.pos_reader_id = attributes[:'pos_reader_id']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.has_key?(:'pos_register_oid')
|
125
|
+
self.pos_register_oid = attributes[:'pos_register_oid']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.has_key?(:'serial_number')
|
129
|
+
self.serial_number = attributes[:'serial_number']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.has_key?(:'stripe_account_id')
|
133
|
+
self.stripe_account_id = attributes[:'stripe_account_id']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.has_key?(:'stripe_reader_id')
|
137
|
+
self.stripe_reader_id = attributes[:'stripe_reader_id']
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
142
|
+
# @return Array for valid properties with the reasons
|
143
|
+
def list_invalid_properties
|
144
|
+
invalid_properties = Array.new
|
145
|
+
invalid_properties
|
146
|
+
end
|
147
|
+
|
148
|
+
# Check to see if the all the properties in the model are valid
|
149
|
+
# @return true if the model is valid
|
150
|
+
def valid?
|
151
|
+
payment_provider_validator = EnumAttributeValidator.new('String', ['stripe'])
|
152
|
+
return false unless payment_provider_validator.valid?(@payment_provider)
|
153
|
+
true
|
154
|
+
end
|
155
|
+
|
156
|
+
# Custom attribute writer method checking allowed values (enum).
|
157
|
+
# @param [Object] payment_provider Object to be assigned
|
158
|
+
def payment_provider=(payment_provider)
|
159
|
+
validator = EnumAttributeValidator.new('String', ['stripe'])
|
160
|
+
unless validator.valid?(payment_provider)
|
161
|
+
fail ArgumentError, 'invalid value for "payment_provider", must be one of #{validator.allowable_values}.'
|
162
|
+
end
|
163
|
+
@payment_provider = payment_provider
|
164
|
+
end
|
165
|
+
|
166
|
+
# Checks equality by comparing each attribute.
|
167
|
+
# @param [Object] Object to be compared
|
168
|
+
def ==(o)
|
169
|
+
return true if self.equal?(o)
|
170
|
+
self.class == o.class &&
|
171
|
+
device_type == o.device_type &&
|
172
|
+
label == o.label &&
|
173
|
+
merchant_id == o.merchant_id &&
|
174
|
+
payment_provider == o.payment_provider &&
|
175
|
+
pos_reader_id == o.pos_reader_id &&
|
176
|
+
pos_register_oid == o.pos_register_oid &&
|
177
|
+
serial_number == o.serial_number &&
|
178
|
+
stripe_account_id == o.stripe_account_id &&
|
179
|
+
stripe_reader_id == o.stripe_reader_id
|
180
|
+
end
|
181
|
+
|
182
|
+
# @see the `==` method
|
183
|
+
# @param [Object] Object to be compared
|
184
|
+
def eql?(o)
|
185
|
+
self == o
|
186
|
+
end
|
187
|
+
|
188
|
+
# Calculates hash code according to all attributes.
|
189
|
+
# @return [Fixnum] Hash code
|
190
|
+
def hash
|
191
|
+
[device_type, label, merchant_id, payment_provider, pos_reader_id, pos_register_oid, serial_number, stripe_account_id, stripe_reader_id].hash
|
192
|
+
end
|
193
|
+
|
194
|
+
# Builds the object from hash
|
195
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
196
|
+
# @return [Object] Returns the model itself
|
197
|
+
def build_from_hash(attributes)
|
198
|
+
return nil unless attributes.is_a?(Hash)
|
199
|
+
self.class.swagger_types.each_pair do |key, type|
|
200
|
+
if type =~ /\AArray<(.*)>/i
|
201
|
+
# check to ensure the input is an array given that the attribute
|
202
|
+
# is documented as an array but the input is not
|
203
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
204
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
205
|
+
end
|
206
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
207
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
208
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
209
|
+
end
|
210
|
+
|
211
|
+
self
|
212
|
+
end
|
213
|
+
|
214
|
+
# Deserializes the data based on type
|
215
|
+
# @param string type Data type
|
216
|
+
# @param string value Value to be deserialized
|
217
|
+
# @return [Object] Deserialized data
|
218
|
+
def _deserialize(type, value)
|
219
|
+
case type.to_sym
|
220
|
+
when :DateTime
|
221
|
+
DateTime.parse(value)
|
222
|
+
when :Date
|
223
|
+
Date.parse(value)
|
224
|
+
when :String
|
225
|
+
value.to_s
|
226
|
+
when :Integer
|
227
|
+
value.to_i
|
228
|
+
when :Float
|
229
|
+
value.to_f
|
230
|
+
when :BOOLEAN
|
231
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
232
|
+
true
|
233
|
+
else
|
234
|
+
false
|
235
|
+
end
|
236
|
+
when :Object
|
237
|
+
# generic object (usually a Hash), return directly
|
238
|
+
value
|
239
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
240
|
+
inner_type = Regexp.last_match[:inner_type]
|
241
|
+
value.map { |v| _deserialize(inner_type, v) }
|
242
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
243
|
+
k_type = Regexp.last_match[:k_type]
|
244
|
+
v_type = Regexp.last_match[:v_type]
|
245
|
+
{}.tap do |hash|
|
246
|
+
value.each do |k, v|
|
247
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
else # model
|
251
|
+
temp_model = UltracartClient.const_get(type).new
|
252
|
+
temp_model.build_from_hash(value)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
# Returns the string representation of the object
|
257
|
+
# @return [String] String presentation of the object
|
258
|
+
def to_s
|
259
|
+
to_hash.to_s
|
260
|
+
end
|
261
|
+
|
262
|
+
# to_body is an alias to to_hash (backward compatibility)
|
263
|
+
# @return [Hash] Returns the object in the form of hash
|
264
|
+
def to_body
|
265
|
+
to_hash
|
266
|
+
end
|
267
|
+
|
268
|
+
# Returns the object in the form of hash
|
269
|
+
# @return [Hash] Returns the object in the form of hash
|
270
|
+
def to_hash
|
271
|
+
hash = {}
|
272
|
+
self.class.attribute_map.each_pair do |attr, param|
|
273
|
+
value = self.send(attr)
|
274
|
+
next if value.nil?
|
275
|
+
hash[param] = _to_hash(value)
|
276
|
+
end
|
277
|
+
hash
|
278
|
+
end
|
279
|
+
|
280
|
+
# Outputs non-array value in the form of hash
|
281
|
+
# For object, use to_hash. Otherwise, just return the value
|
282
|
+
# @param [Object] value Any valid value
|
283
|
+
# @return [Hash] Returns the value in the form of hash
|
284
|
+
def _to_hash(value)
|
285
|
+
if value.is_a?(Array)
|
286
|
+
value.compact.map { |v| _to_hash(v) }
|
287
|
+
elsif value.is_a?(Hash)
|
288
|
+
{}.tap do |hash|
|
289
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
290
|
+
end
|
291
|
+
elsif value.respond_to? :to_hash
|
292
|
+
value.to_hash
|
293
|
+
else
|
294
|
+
value
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
end
|
299
|
+
end
|
@@ -0,0 +1,215 @@
|
|
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 PointOfSaleRegister
|
17
|
+
# The merchant id that owns this point of sale register.
|
18
|
+
attr_accessor :merchant_id
|
19
|
+
|
20
|
+
# Name of the register.
|
21
|
+
attr_accessor :name
|
22
|
+
|
23
|
+
# Object identifier of the point of sale location where this register is located.
|
24
|
+
attr_accessor :pos_location_oid
|
25
|
+
|
26
|
+
# Object identifier of the point of sale register.
|
27
|
+
attr_accessor :pos_register_oid
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'merchant_id' => :'merchant_id',
|
33
|
+
:'name' => :'name',
|
34
|
+
:'pos_location_oid' => :'pos_location_oid',
|
35
|
+
:'pos_register_oid' => :'pos_register_oid'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
:'merchant_id' => :'String',
|
43
|
+
:'name' => :'String',
|
44
|
+
:'pos_location_oid' => :'Integer',
|
45
|
+
:'pos_register_oid' => :'Integer'
|
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?(:'merchant_id')
|
58
|
+
self.merchant_id = attributes[:'merchant_id']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'name')
|
62
|
+
self.name = attributes[:'name']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'pos_location_oid')
|
66
|
+
self.pos_location_oid = attributes[:'pos_location_oid']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'pos_register_oid')
|
70
|
+
self.pos_register_oid = attributes[:'pos_register_oid']
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properties with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = Array.new
|
78
|
+
invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(o)
|
90
|
+
return true if self.equal?(o)
|
91
|
+
self.class == o.class &&
|
92
|
+
merchant_id == o.merchant_id &&
|
93
|
+
name == o.name &&
|
94
|
+
pos_location_oid == o.pos_location_oid &&
|
95
|
+
pos_register_oid == o.pos_register_oid
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Fixnum] Hash code
|
106
|
+
def hash
|
107
|
+
[merchant_id, name, pos_location_oid, pos_register_oid].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def build_from_hash(attributes)
|
114
|
+
return nil unless attributes.is_a?(Hash)
|
115
|
+
self.class.swagger_types.each_pair do |key, type|
|
116
|
+
if type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the attribute
|
118
|
+
# is documented as an array but the input is not
|
119
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
121
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def _deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :DateTime
|
137
|
+
DateTime.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :BOOLEAN
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
temp_model = UltracartClient.const_get(type).new
|
168
|
+
temp_model.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
|
+
next if value.nil?
|
191
|
+
hash[param] = _to_hash(value)
|
192
|
+
end
|
193
|
+
hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Outputs non-array value in the form of hash
|
197
|
+
# For object, use to_hash. Otherwise, just return the value
|
198
|
+
# @param [Object] value Any valid value
|
199
|
+
# @return [Hash] Returns the value in the form of hash
|
200
|
+
def _to_hash(value)
|
201
|
+
if value.is_a?(Array)
|
202
|
+
value.compact.map { |v| _to_hash(v) }
|
203
|
+
elsif value.is_a?(Hash)
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
206
|
+
end
|
207
|
+
elsif value.respond_to? :to_hash
|
208
|
+
value.to_hash
|
209
|
+
else
|
210
|
+
value
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|
215
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
@@ -588,6 +588,7 @@ require 'ultracart_api/models/order_payment_insurance'
|
|
588
588
|
require 'ultracart_api/models/order_payment_purchase_order'
|
589
589
|
require 'ultracart_api/models/order_payment_transaction'
|
590
590
|
require 'ultracart_api/models/order_payment_transaction_detail'
|
591
|
+
require 'ultracart_api/models/order_point_of_sale'
|
591
592
|
require 'ultracart_api/models/order_process_payment_request'
|
592
593
|
require 'ultracart_api/models/order_process_payment_response'
|
593
594
|
require 'ultracart_api/models/order_property'
|
@@ -609,6 +610,9 @@ require 'ultracart_api/models/order_tracking_number_detail'
|
|
609
610
|
require 'ultracart_api/models/order_tracking_number_details'
|
610
611
|
require 'ultracart_api/models/orders_response'
|
611
612
|
require 'ultracart_api/models/permission'
|
613
|
+
require 'ultracart_api/models/point_of_sale_location'
|
614
|
+
require 'ultracart_api/models/point_of_sale_reader'
|
615
|
+
require 'ultracart_api/models/point_of_sale_register'
|
612
616
|
require 'ultracart_api/models/pricing_tier'
|
613
617
|
require 'ultracart_api/models/pricing_tier_notification'
|
614
618
|
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: 3.10.
|
4
|
+
version: 3.10.87
|
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
|
@@ -806,6 +806,7 @@ files:
|
|
806
806
|
- docs/OrderPaymentPurchaseOrder.md
|
807
807
|
- docs/OrderPaymentTransaction.md
|
808
808
|
- docs/OrderPaymentTransactionDetail.md
|
809
|
+
- docs/OrderPointOfSale.md
|
809
810
|
- docs/OrderProcessPaymentRequest.md
|
810
811
|
- docs/OrderProcessPaymentResponse.md
|
811
812
|
- docs/OrderProperty.md
|
@@ -827,6 +828,9 @@ files:
|
|
827
828
|
- docs/OrderTrackingNumberDetails.md
|
828
829
|
- docs/OrdersResponse.md
|
829
830
|
- docs/Permission.md
|
831
|
+
- docs/PointOfSaleLocation.md
|
832
|
+
- docs/PointOfSaleReader.md
|
833
|
+
- docs/PointOfSaleRegister.md
|
830
834
|
- docs/PricingTier.md
|
831
835
|
- docs/PricingTierNotification.md
|
832
836
|
- docs/PricingTiersResponse.md
|
@@ -1553,6 +1557,7 @@ files:
|
|
1553
1557
|
- lib/ultracart_api/models/order_payment_purchase_order.rb
|
1554
1558
|
- lib/ultracart_api/models/order_payment_transaction.rb
|
1555
1559
|
- lib/ultracart_api/models/order_payment_transaction_detail.rb
|
1560
|
+
- lib/ultracart_api/models/order_point_of_sale.rb
|
1556
1561
|
- lib/ultracart_api/models/order_process_payment_request.rb
|
1557
1562
|
- lib/ultracart_api/models/order_process_payment_response.rb
|
1558
1563
|
- lib/ultracart_api/models/order_property.rb
|
@@ -1574,6 +1579,9 @@ files:
|
|
1574
1579
|
- lib/ultracart_api/models/order_tracking_number_details.rb
|
1575
1580
|
- lib/ultracart_api/models/orders_response.rb
|
1576
1581
|
- lib/ultracart_api/models/permission.rb
|
1582
|
+
- lib/ultracart_api/models/point_of_sale_location.rb
|
1583
|
+
- lib/ultracart_api/models/point_of_sale_reader.rb
|
1584
|
+
- lib/ultracart_api/models/point_of_sale_register.rb
|
1577
1585
|
- lib/ultracart_api/models/pricing_tier.rb
|
1578
1586
|
- lib/ultracart_api/models/pricing_tier_notification.rb
|
1579
1587
|
- lib/ultracart_api/models/pricing_tiers_response.rb
|