square_connect 2.2.1.145 → 2.3.0.153
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 +9 -1
- data/docs/BatchRetrieveOrdersRequest.md +12 -0
- data/docs/BatchRetrieveOrdersResponse.md +13 -0
- data/docs/CatalogItemVariation.md +1 -1
- data/docs/CatalogObject.md +1 -1
- data/docs/CatalogV1Id.md +2 -2
- data/docs/CreateOrderRequest.md +5 -4
- data/docs/CreateOrderRequestDiscount.md +5 -4
- data/docs/CreateOrderRequestLineItem.md +10 -6
- data/docs/CreateOrderRequestModifier.md +12 -0
- data/docs/CreateOrderRequestTax.md +5 -4
- data/docs/CreateOrderResponse.md +13 -0
- data/docs/Currency.md +1 -0
- data/docs/CustomersApi.md +1 -1
- data/docs/ErrorCode.md +2 -0
- data/docs/ItemVariationLocationOverrides.md +5 -5
- data/docs/Location.md +9 -1
- data/docs/LocationStatus.md +13 -0
- data/docs/Order.md +1 -0
- data/docs/OrderLineItem.md +6 -1
- data/docs/OrderLineItemDiscount.md +1 -0
- data/docs/OrderLineItemDiscountScope.md +1 -0
- data/docs/OrderLineItemDiscountType.md +1 -1
- data/docs/OrderLineItemModifier.md +15 -0
- data/docs/OrderLineItemTax.md +1 -0
- data/docs/OrderLineItemTaxType.md +1 -1
- data/docs/OrdersApi.md +120 -0
- data/docs/SearchCatalogObjectsRequest.md +1 -1
- data/docs/Transaction.md +1 -1
- data/docs/TransactionsApi.md +1 -1
- data/docs/V1Payment.md +3 -3
- data/docs/V1Refund.md +0 -5
- data/lib/square_connect/api/customers_api.rb +2 -2
- data/lib/square_connect/api/orders_api.rb +134 -0
- data/lib/square_connect/api/transactions_api.rb +2 -2
- data/lib/square_connect/api_client.rb +1 -1
- data/lib/square_connect/models/batch_retrieve_orders_request.rb +193 -0
- data/lib/square_connect/models/batch_retrieve_orders_response.rb +200 -0
- data/lib/square_connect/models/catalog_item_variation.rb +1 -1
- data/lib/square_connect/models/catalog_object.rb +1 -1
- data/lib/square_connect/models/catalog_v1_id.rb +2 -2
- data/lib/square_connect/models/charge_request.rb +108 -0
- data/lib/square_connect/models/create_checkout_request.rb +16 -0
- data/lib/square_connect/models/create_order_request.rb +31 -5
- data/lib/square_connect/models/create_order_request_discount.rb +47 -5
- data/lib/square_connect/models/create_order_request_line_item.rb +106 -7
- data/lib/square_connect/models/create_order_request_modifier.rb +219 -0
- data/lib/square_connect/models/create_order_request_tax.rb +49 -7
- data/lib/square_connect/models/create_order_response.rb +198 -0
- data/lib/square_connect/models/create_refund_request.rb +72 -0
- data/lib/square_connect/models/currency.rb +1 -0
- data/lib/square_connect/models/error.rb +2 -2
- data/lib/square_connect/models/error_code.rb +2 -0
- data/lib/square_connect/models/item_variation_location_overrides.rb +5 -5
- data/lib/square_connect/models/location.rb +121 -5
- data/lib/square_connect/models/location_status.rb +19 -0
- data/lib/square_connect/models/money.rb +27 -2
- data/lib/square_connect/models/order.rb +11 -1
- data/lib/square_connect/models/order_line_item.rb +54 -2
- data/lib/square_connect/models/order_line_item_discount.rb +15 -5
- data/lib/square_connect/models/order_line_item_discount_scope.rb +1 -0
- data/lib/square_connect/models/order_line_item_discount_type.rb +1 -1
- data/lib/square_connect/models/order_line_item_modifier.rb +216 -0
- data/lib/square_connect/models/order_line_item_tax.rb +13 -3
- data/lib/square_connect/models/order_line_item_tax_type.rb +1 -1
- data/lib/square_connect/models/search_catalog_objects_request.rb +1 -1
- data/lib/square_connect/models/transaction.rb +14 -14
- data/lib/square_connect/models/v1_payment.rb +3 -0
- data/lib/square_connect/models/v1_refund.rb +1 -51
- data/lib/square_connect/version.rb +1 -1
- data/lib/square_connect.rb +7 -0
- metadata +17 -3
|
@@ -39,6 +39,8 @@ module SquareConnect
|
|
|
39
39
|
VALUE_TOO_LOW = "VALUE_TOO_LOW".freeze
|
|
40
40
|
VALUE_TOO_HIGH = "VALUE_TOO_HIGH".freeze
|
|
41
41
|
VALUE_EMPTY = "VALUE_EMPTY".freeze
|
|
42
|
+
ARRAY_LENGTH_TOO_LONG = "ARRAY_LENGTH_TOO_LONG".freeze
|
|
43
|
+
ARRAY_LENGTH_TOO_SHORT = "ARRAY_LENGTH_TOO_SHORT".freeze
|
|
42
44
|
ARRAY_EMPTY = "ARRAY_EMPTY".freeze
|
|
43
45
|
EXPECTED_BOOLEAN = "EXPECTED_BOOLEAN".freeze
|
|
44
46
|
EXPECTED_INTEGER = "EXPECTED_INTEGER".freeze
|
|
@@ -10,18 +10,18 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
|
10
10
|
require 'date'
|
|
11
11
|
|
|
12
12
|
module SquareConnect
|
|
13
|
-
# Price and inventory alerting overrides for a [CatalogItemVariation](#type-catalogitemvariation) at a specific [location]
|
|
13
|
+
# Price and inventory alerting overrides for a [CatalogItemVariation](#type-catalogitemvariation) at a specific [location](#type-location).
|
|
14
14
|
class ItemVariationLocationOverrides
|
|
15
|
-
# The ID of the [location]
|
|
15
|
+
# The ID of the [location](#type-location).
|
|
16
16
|
attr_accessor :location_id
|
|
17
17
|
|
|
18
|
-
# The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given [location]
|
|
18
|
+
# The price of the [CatalogItemVariation](#type-catalogitemvariation) at the given [location](#type-location), or blank for variable pricing.
|
|
19
19
|
attr_accessor :price_money
|
|
20
20
|
|
|
21
|
-
# The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given [location]
|
|
21
|
+
# The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given [location](#type-location). See [CatalogPricingType](#type-catalogpricingtype) for all possible values.
|
|
22
22
|
attr_accessor :pricing_type
|
|
23
23
|
|
|
24
|
-
# If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this [location]
|
|
24
|
+
# If `true`, inventory tracking is active for the [CatalogItemVariation](#type-catalogitemvariation) at this [location](#type-location).
|
|
25
25
|
attr_accessor :track_inventory
|
|
26
26
|
|
|
27
27
|
# Indicates whether the [CatalogItemVariation](#type-catalogitemvariation) displays an alert when its inventory quantity is less than or equal to its `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for all possible values.
|
|
@@ -15,7 +15,7 @@ module SquareConnect
|
|
|
15
15
|
# The location's unique ID.
|
|
16
16
|
attr_accessor :id
|
|
17
17
|
|
|
18
|
-
# The location's name.
|
|
18
|
+
# The location's name. Location names are set by the location owner and displayed in the dashboard as the location's nickname
|
|
19
19
|
attr_accessor :name
|
|
20
20
|
|
|
21
21
|
# The location's physical address.
|
|
@@ -27,6 +27,30 @@ module SquareConnect
|
|
|
27
27
|
# Indicates which Square features are enabled for the location. See [LocationCapability](#type-locationcapability) for possible values.
|
|
28
28
|
attr_accessor :capabilities
|
|
29
29
|
|
|
30
|
+
# The location's status See [LocationStatus](#type-locationstatus) for possible values.
|
|
31
|
+
attr_accessor :status
|
|
32
|
+
|
|
33
|
+
# The time when the location was created, in RFC 3339 format.
|
|
34
|
+
attr_accessor :created_at
|
|
35
|
+
|
|
36
|
+
# The identifier of the merchant that owns the location.
|
|
37
|
+
attr_accessor :merchant_id
|
|
38
|
+
|
|
39
|
+
# The location's country, in ISO 3166-1-alpha-2 format. See [Country](#type-country) for possible values.
|
|
40
|
+
attr_accessor :country
|
|
41
|
+
|
|
42
|
+
# The language associated with the location in [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A).
|
|
43
|
+
attr_accessor :language_code
|
|
44
|
+
|
|
45
|
+
# The currency used for all transactions at this location, specified in __ISO 4217 format__. For example, the currency for a location processing transactions in the United States is 'USD'. See [Currency](#type-currency) for possible values.
|
|
46
|
+
attr_accessor :currency
|
|
47
|
+
|
|
48
|
+
# The location's phone_number.
|
|
49
|
+
attr_accessor :phone_number
|
|
50
|
+
|
|
51
|
+
# The location's business_name which is shown to its customers. For example, this is the name printed on its customer's receipts.
|
|
52
|
+
attr_accessor :business_name
|
|
53
|
+
|
|
30
54
|
class EnumAttributeValidator
|
|
31
55
|
attr_reader :datatype
|
|
32
56
|
attr_reader :allowable_values
|
|
@@ -56,7 +80,15 @@ module SquareConnect
|
|
|
56
80
|
:'name' => :'name',
|
|
57
81
|
:'address' => :'address',
|
|
58
82
|
:'timezone' => :'timezone',
|
|
59
|
-
:'capabilities' => :'capabilities'
|
|
83
|
+
:'capabilities' => :'capabilities',
|
|
84
|
+
:'status' => :'status',
|
|
85
|
+
:'created_at' => :'created_at',
|
|
86
|
+
:'merchant_id' => :'merchant_id',
|
|
87
|
+
:'country' => :'country',
|
|
88
|
+
:'language_code' => :'language_code',
|
|
89
|
+
:'currency' => :'currency',
|
|
90
|
+
:'phone_number' => :'phone_number',
|
|
91
|
+
:'business_name' => :'business_name'
|
|
60
92
|
}
|
|
61
93
|
end
|
|
62
94
|
|
|
@@ -67,7 +99,15 @@ module SquareConnect
|
|
|
67
99
|
:'name' => :'String',
|
|
68
100
|
:'address' => :'Address',
|
|
69
101
|
:'timezone' => :'String',
|
|
70
|
-
:'capabilities' => :'Array<String>'
|
|
102
|
+
:'capabilities' => :'Array<String>',
|
|
103
|
+
:'status' => :'String',
|
|
104
|
+
:'created_at' => :'String',
|
|
105
|
+
:'merchant_id' => :'String',
|
|
106
|
+
:'country' => :'String',
|
|
107
|
+
:'language_code' => :'String',
|
|
108
|
+
:'currency' => :'String',
|
|
109
|
+
:'phone_number' => :'String',
|
|
110
|
+
:'business_name' => :'String'
|
|
71
111
|
}
|
|
72
112
|
end
|
|
73
113
|
|
|
@@ -101,6 +141,38 @@ module SquareConnect
|
|
|
101
141
|
end
|
|
102
142
|
end
|
|
103
143
|
|
|
144
|
+
if attributes.has_key?(:'status')
|
|
145
|
+
self.status = attributes[:'status']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.has_key?(:'created_at')
|
|
149
|
+
self.created_at = attributes[:'created_at']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.has_key?(:'merchant_id')
|
|
153
|
+
self.merchant_id = attributes[:'merchant_id']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.has_key?(:'country')
|
|
157
|
+
self.country = attributes[:'country']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.has_key?(:'language_code')
|
|
161
|
+
self.language_code = attributes[:'language_code']
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.has_key?(:'currency')
|
|
165
|
+
self.currency = attributes[:'currency']
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.has_key?(:'phone_number')
|
|
169
|
+
self.phone_number = attributes[:'phone_number']
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.has_key?(:'business_name')
|
|
173
|
+
self.business_name = attributes[:'business_name']
|
|
174
|
+
end
|
|
175
|
+
|
|
104
176
|
end
|
|
105
177
|
|
|
106
178
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -113,9 +185,45 @@ module SquareConnect
|
|
|
113
185
|
# Check to see if the all the properties in the model are valid
|
|
114
186
|
# @return true if the model is valid
|
|
115
187
|
def valid?
|
|
188
|
+
status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
|
|
189
|
+
return false unless status_validator.valid?(@status)
|
|
190
|
+
country_validator = EnumAttributeValidator.new('String', ["ZZ", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"])
|
|
191
|
+
return false unless country_validator.valid?(@country)
|
|
192
|
+
currency_validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
|
|
193
|
+
return false unless currency_validator.valid?(@currency)
|
|
116
194
|
return true
|
|
117
195
|
end
|
|
118
196
|
|
|
197
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
198
|
+
# @param [Object] status Object to be assigned
|
|
199
|
+
def status=(status)
|
|
200
|
+
validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
|
|
201
|
+
unless validator.valid?(status)
|
|
202
|
+
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
|
203
|
+
end
|
|
204
|
+
@status = status
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
208
|
+
# @param [Object] country Object to be assigned
|
|
209
|
+
def country=(country)
|
|
210
|
+
validator = EnumAttributeValidator.new('String', ["ZZ", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"])
|
|
211
|
+
unless validator.valid?(country)
|
|
212
|
+
fail ArgumentError, "invalid value for 'country', must be one of #{validator.allowable_values}."
|
|
213
|
+
end
|
|
214
|
+
@country = country
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
218
|
+
# @param [Object] currency Object to be assigned
|
|
219
|
+
def currency=(currency)
|
|
220
|
+
validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
|
|
221
|
+
unless validator.valid?(currency)
|
|
222
|
+
fail ArgumentError, "invalid value for 'currency', must be one of #{validator.allowable_values}."
|
|
223
|
+
end
|
|
224
|
+
@currency = currency
|
|
225
|
+
end
|
|
226
|
+
|
|
119
227
|
# Checks equality by comparing each attribute.
|
|
120
228
|
# @param [Object] Object to be compared
|
|
121
229
|
def ==(o)
|
|
@@ -125,7 +233,15 @@ module SquareConnect
|
|
|
125
233
|
name == o.name &&
|
|
126
234
|
address == o.address &&
|
|
127
235
|
timezone == o.timezone &&
|
|
128
|
-
capabilities == o.capabilities
|
|
236
|
+
capabilities == o.capabilities &&
|
|
237
|
+
status == o.status &&
|
|
238
|
+
created_at == o.created_at &&
|
|
239
|
+
merchant_id == o.merchant_id &&
|
|
240
|
+
country == o.country &&
|
|
241
|
+
language_code == o.language_code &&
|
|
242
|
+
currency == o.currency &&
|
|
243
|
+
phone_number == o.phone_number &&
|
|
244
|
+
business_name == o.business_name
|
|
129
245
|
end
|
|
130
246
|
|
|
131
247
|
# @see the `==` method
|
|
@@ -137,7 +253,7 @@ module SquareConnect
|
|
|
137
253
|
# Calculates hash code according to all attributes.
|
|
138
254
|
# @return [Fixnum] Hash code
|
|
139
255
|
def hash
|
|
140
|
-
[id, name, address, timezone, capabilities].hash
|
|
256
|
+
[id, name, address, timezone, capabilities, status, created_at, merchant_id, country, language_code, currency, phone_number, business_name].hash
|
|
141
257
|
end
|
|
142
258
|
|
|
143
259
|
# Builds the object from hash
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Square Connect API
|
|
3
|
+
|
|
4
|
+
OpenAPI spec version: 2.0
|
|
5
|
+
Contact: developers@squareup.com
|
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
7
|
+
|
|
8
|
+
=end
|
|
9
|
+
|
|
10
|
+
require 'date'
|
|
11
|
+
|
|
12
|
+
module SquareConnect
|
|
13
|
+
class LocationStatus
|
|
14
|
+
|
|
15
|
+
ACTIVE = "ACTIVE".freeze
|
|
16
|
+
INACTIVE = "INACTIVE".freeze
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
|
@@ -78,21 +78,46 @@ module SquareConnect
|
|
|
78
78
|
# @return Array for valid properies with the reasons
|
|
79
79
|
def list_invalid_properties
|
|
80
80
|
invalid_properties = Array.new
|
|
81
|
+
if !@amount.nil? && @amount > 99999999
|
|
82
|
+
invalid_properties.push("invalid value for 'amount', must be smaller than or equal to 99999999.")
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if !@amount.nil? && @amount < 0
|
|
86
|
+
invalid_properties.push("invalid value for 'amount', must be greater than or equal to 0.")
|
|
87
|
+
end
|
|
88
|
+
|
|
81
89
|
return invalid_properties
|
|
82
90
|
end
|
|
83
91
|
|
|
84
92
|
# Check to see if the all the properties in the model are valid
|
|
85
93
|
# @return true if the model is valid
|
|
86
94
|
def valid?
|
|
87
|
-
|
|
95
|
+
return false if !@amount.nil? && @amount > 99999999
|
|
96
|
+
return false if !@amount.nil? && @amount < 0
|
|
97
|
+
currency_validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
|
|
88
98
|
return false unless currency_validator.valid?(@currency)
|
|
89
99
|
return true
|
|
90
100
|
end
|
|
91
101
|
|
|
102
|
+
# Custom attribute writer method with validation
|
|
103
|
+
# @param [Object] amount Value to be assigned
|
|
104
|
+
def amount=(amount)
|
|
105
|
+
|
|
106
|
+
if !amount.nil? && amount > 99999999
|
|
107
|
+
fail ArgumentError, "invalid value for 'amount', must be smaller than or equal to 99999999."
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if !amount.nil? && amount < 0
|
|
111
|
+
fail ArgumentError, "invalid value for 'amount', must be greater than or equal to 0."
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
@amount = amount
|
|
115
|
+
end
|
|
116
|
+
|
|
92
117
|
# Custom attribute writer method checking allowed values (enum).
|
|
93
118
|
# @param [Object] currency Object to be assigned
|
|
94
119
|
def currency=(currency)
|
|
95
|
-
validator = EnumAttributeValidator.new('String', ["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
|
|
120
|
+
validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
|
|
96
121
|
unless validator.valid?(currency)
|
|
97
122
|
fail ArgumentError, "invalid value for 'currency', must be one of #{validator.allowable_values}."
|
|
98
123
|
end
|
|
@@ -12,6 +12,9 @@ require 'date'
|
|
|
12
12
|
module SquareConnect
|
|
13
13
|
# Contains all information related to a single order to process with Square, including line items that specify the products to purchase
|
|
14
14
|
class Order
|
|
15
|
+
# The order's unique ID. This value is only present for Order objects created by the Orders API through the [CreateOrder](#endpoint-createorder) endpoint.
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
15
18
|
# The ID of the merchant location this order is associated with.
|
|
16
19
|
attr_accessor :location_id
|
|
17
20
|
|
|
@@ -34,6 +37,7 @@ module SquareConnect
|
|
|
34
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
35
38
|
def self.attribute_map
|
|
36
39
|
{
|
|
40
|
+
:'id' => :'id',
|
|
37
41
|
:'location_id' => :'location_id',
|
|
38
42
|
:'reference_id' => :'reference_id',
|
|
39
43
|
:'line_items' => :'line_items',
|
|
@@ -46,6 +50,7 @@ module SquareConnect
|
|
|
46
50
|
# Attribute type mapping.
|
|
47
51
|
def self.swagger_types
|
|
48
52
|
{
|
|
53
|
+
:'id' => :'String',
|
|
49
54
|
:'location_id' => :'String',
|
|
50
55
|
:'reference_id' => :'String',
|
|
51
56
|
:'line_items' => :'Array<OrderLineItem>',
|
|
@@ -63,6 +68,10 @@ module SquareConnect
|
|
|
63
68
|
# convert string to symbol for hash key
|
|
64
69
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
65
70
|
|
|
71
|
+
if attributes.has_key?(:'id')
|
|
72
|
+
self.id = attributes[:'id']
|
|
73
|
+
end
|
|
74
|
+
|
|
66
75
|
if attributes.has_key?(:'location_id')
|
|
67
76
|
self.location_id = attributes[:'location_id']
|
|
68
77
|
end
|
|
@@ -109,6 +118,7 @@ module SquareConnect
|
|
|
109
118
|
def ==(o)
|
|
110
119
|
return true if self.equal?(o)
|
|
111
120
|
self.class == o.class &&
|
|
121
|
+
id == o.id &&
|
|
112
122
|
location_id == o.location_id &&
|
|
113
123
|
reference_id == o.reference_id &&
|
|
114
124
|
line_items == o.line_items &&
|
|
@@ -126,7 +136,7 @@ module SquareConnect
|
|
|
126
136
|
# Calculates hash code according to all attributes.
|
|
127
137
|
# @return [Fixnum] Hash code
|
|
128
138
|
def hash
|
|
129
|
-
[location_id, reference_id, line_items, total_money, total_tax_money, total_discount_money].hash
|
|
139
|
+
[id, location_id, reference_id, line_items, total_money, total_tax_money, total_discount_money].hash
|
|
130
140
|
end
|
|
131
141
|
|
|
132
142
|
# Builds the object from hash
|
|
@@ -15,9 +15,21 @@ module SquareConnect
|
|
|
15
15
|
# The name of the line item.
|
|
16
16
|
attr_accessor :name
|
|
17
17
|
|
|
18
|
-
# The quantity
|
|
18
|
+
# The quantity purchased, as a string representation of a number.
|
|
19
19
|
attr_accessor :quantity
|
|
20
20
|
|
|
21
|
+
# The note of the line item.
|
|
22
|
+
attr_accessor :note
|
|
23
|
+
|
|
24
|
+
# The [CatalogItemVariation](#type-catalogitemvariation) id applied to this line item.
|
|
25
|
+
attr_accessor :catalog_object_id
|
|
26
|
+
|
|
27
|
+
# The name of the variation applied to this line item.
|
|
28
|
+
attr_accessor :variation_name
|
|
29
|
+
|
|
30
|
+
# The [CatalogModifier](#type-catalogmodifier)s applied to this line item.
|
|
31
|
+
attr_accessor :modifiers
|
|
32
|
+
|
|
21
33
|
# The taxes applied to this line item.
|
|
22
34
|
attr_accessor :taxes
|
|
23
35
|
|
|
@@ -27,6 +39,9 @@ module SquareConnect
|
|
|
27
39
|
# The base price for a single unit of the line item.
|
|
28
40
|
attr_accessor :base_price_money
|
|
29
41
|
|
|
42
|
+
# The gross sales amount of money calculated as (item base price + modifiers price) * quantity.
|
|
43
|
+
attr_accessor :gross_sales_money
|
|
44
|
+
|
|
30
45
|
# The total tax amount of money to collect for the line item.
|
|
31
46
|
attr_accessor :total_tax_money
|
|
32
47
|
|
|
@@ -42,9 +57,14 @@ module SquareConnect
|
|
|
42
57
|
{
|
|
43
58
|
:'name' => :'name',
|
|
44
59
|
:'quantity' => :'quantity',
|
|
60
|
+
:'note' => :'note',
|
|
61
|
+
:'catalog_object_id' => :'catalog_object_id',
|
|
62
|
+
:'variation_name' => :'variation_name',
|
|
63
|
+
:'modifiers' => :'modifiers',
|
|
45
64
|
:'taxes' => :'taxes',
|
|
46
65
|
:'discounts' => :'discounts',
|
|
47
66
|
:'base_price_money' => :'base_price_money',
|
|
67
|
+
:'gross_sales_money' => :'gross_sales_money',
|
|
48
68
|
:'total_tax_money' => :'total_tax_money',
|
|
49
69
|
:'total_discount_money' => :'total_discount_money',
|
|
50
70
|
:'total_money' => :'total_money'
|
|
@@ -56,9 +76,14 @@ module SquareConnect
|
|
|
56
76
|
{
|
|
57
77
|
:'name' => :'String',
|
|
58
78
|
:'quantity' => :'String',
|
|
79
|
+
:'note' => :'String',
|
|
80
|
+
:'catalog_object_id' => :'String',
|
|
81
|
+
:'variation_name' => :'String',
|
|
82
|
+
:'modifiers' => :'Array<OrderLineItemModifier>',
|
|
59
83
|
:'taxes' => :'Array<OrderLineItemTax>',
|
|
60
84
|
:'discounts' => :'Array<OrderLineItemDiscount>',
|
|
61
85
|
:'base_price_money' => :'Money',
|
|
86
|
+
:'gross_sales_money' => :'Money',
|
|
62
87
|
:'total_tax_money' => :'Money',
|
|
63
88
|
:'total_discount_money' => :'Money',
|
|
64
89
|
:'total_money' => :'Money'
|
|
@@ -81,6 +106,24 @@ module SquareConnect
|
|
|
81
106
|
self.quantity = attributes[:'quantity']
|
|
82
107
|
end
|
|
83
108
|
|
|
109
|
+
if attributes.has_key?(:'note')
|
|
110
|
+
self.note = attributes[:'note']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.has_key?(:'catalog_object_id')
|
|
114
|
+
self.catalog_object_id = attributes[:'catalog_object_id']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.has_key?(:'variation_name')
|
|
118
|
+
self.variation_name = attributes[:'variation_name']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.has_key?(:'modifiers')
|
|
122
|
+
if (value = attributes[:'modifiers']).is_a?(Array)
|
|
123
|
+
self.modifiers = value
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
84
127
|
if attributes.has_key?(:'taxes')
|
|
85
128
|
if (value = attributes[:'taxes']).is_a?(Array)
|
|
86
129
|
self.taxes = value
|
|
@@ -97,6 +140,10 @@ module SquareConnect
|
|
|
97
140
|
self.base_price_money = attributes[:'base_price_money']
|
|
98
141
|
end
|
|
99
142
|
|
|
143
|
+
if attributes.has_key?(:'gross_sales_money')
|
|
144
|
+
self.gross_sales_money = attributes[:'gross_sales_money']
|
|
145
|
+
end
|
|
146
|
+
|
|
100
147
|
if attributes.has_key?(:'total_tax_money')
|
|
101
148
|
self.total_tax_money = attributes[:'total_tax_money']
|
|
102
149
|
end
|
|
@@ -131,9 +178,14 @@ module SquareConnect
|
|
|
131
178
|
self.class == o.class &&
|
|
132
179
|
name == o.name &&
|
|
133
180
|
quantity == o.quantity &&
|
|
181
|
+
note == o.note &&
|
|
182
|
+
catalog_object_id == o.catalog_object_id &&
|
|
183
|
+
variation_name == o.variation_name &&
|
|
184
|
+
modifiers == o.modifiers &&
|
|
134
185
|
taxes == o.taxes &&
|
|
135
186
|
discounts == o.discounts &&
|
|
136
187
|
base_price_money == o.base_price_money &&
|
|
188
|
+
gross_sales_money == o.gross_sales_money &&
|
|
137
189
|
total_tax_money == o.total_tax_money &&
|
|
138
190
|
total_discount_money == o.total_discount_money &&
|
|
139
191
|
total_money == o.total_money
|
|
@@ -148,7 +200,7 @@ module SquareConnect
|
|
|
148
200
|
# Calculates hash code according to all attributes.
|
|
149
201
|
# @return [Fixnum] Hash code
|
|
150
202
|
def hash
|
|
151
|
-
[name, quantity, taxes, discounts, base_price_money, total_tax_money, total_discount_money, total_money].hash
|
|
203
|
+
[name, quantity, note, catalog_object_id, variation_name, modifiers, taxes, discounts, base_price_money, gross_sales_money, total_tax_money, total_discount_money, total_money].hash
|
|
152
204
|
end
|
|
153
205
|
|
|
154
206
|
# Builds the object from hash
|
|
@@ -12,6 +12,9 @@ require 'date'
|
|
|
12
12
|
module SquareConnect
|
|
13
13
|
# Represents a discount that applies to one or more line items in an order. Fixed-amount, order-level discounts are distributed across all non-zero line item totals. The amount distributed to each line item is relative to that item’s contribution to the order subtotal.
|
|
14
14
|
class OrderLineItemDiscount
|
|
15
|
+
# The catalog object id referencing [CatalogDiscount](#type-catalogdiscount).
|
|
16
|
+
attr_accessor :catalog_object_id
|
|
17
|
+
|
|
15
18
|
# The discount's name.
|
|
16
19
|
attr_accessor :name
|
|
17
20
|
|
|
@@ -55,6 +58,7 @@ module SquareConnect
|
|
|
55
58
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
59
|
def self.attribute_map
|
|
57
60
|
{
|
|
61
|
+
:'catalog_object_id' => :'catalog_object_id',
|
|
58
62
|
:'name' => :'name',
|
|
59
63
|
:'type' => :'type',
|
|
60
64
|
:'percentage' => :'percentage',
|
|
@@ -67,6 +71,7 @@ module SquareConnect
|
|
|
67
71
|
# Attribute type mapping.
|
|
68
72
|
def self.swagger_types
|
|
69
73
|
{
|
|
74
|
+
:'catalog_object_id' => :'String',
|
|
70
75
|
:'name' => :'String',
|
|
71
76
|
:'type' => :'String',
|
|
72
77
|
:'percentage' => :'String',
|
|
@@ -84,6 +89,10 @@ module SquareConnect
|
|
|
84
89
|
# convert string to symbol for hash key
|
|
85
90
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
86
91
|
|
|
92
|
+
if attributes.has_key?(:'catalog_object_id')
|
|
93
|
+
self.catalog_object_id = attributes[:'catalog_object_id']
|
|
94
|
+
end
|
|
95
|
+
|
|
87
96
|
if attributes.has_key?(:'name')
|
|
88
97
|
self.name = attributes[:'name']
|
|
89
98
|
end
|
|
@@ -120,9 +129,9 @@ module SquareConnect
|
|
|
120
129
|
# Check to see if the all the properties in the model are valid
|
|
121
130
|
# @return true if the model is valid
|
|
122
131
|
def valid?
|
|
123
|
-
type_validator = EnumAttributeValidator.new('String', ["
|
|
132
|
+
type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_DISCOUNT", "FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
|
|
124
133
|
return false unless type_validator.valid?(@type)
|
|
125
|
-
scope_validator = EnumAttributeValidator.new('String', ["LINE_ITEM", "ORDER"])
|
|
134
|
+
scope_validator = EnumAttributeValidator.new('String', ["OTHER_DISCOUNT_SCOPE", "LINE_ITEM", "ORDER"])
|
|
126
135
|
return false unless scope_validator.valid?(@scope)
|
|
127
136
|
return true
|
|
128
137
|
end
|
|
@@ -130,7 +139,7 @@ module SquareConnect
|
|
|
130
139
|
# Custom attribute writer method checking allowed values (enum).
|
|
131
140
|
# @param [Object] type Object to be assigned
|
|
132
141
|
def type=(type)
|
|
133
|
-
validator = EnumAttributeValidator.new('String', ["
|
|
142
|
+
validator = EnumAttributeValidator.new('String', ["UNKNOWN_DISCOUNT", "FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
|
|
134
143
|
unless validator.valid?(type)
|
|
135
144
|
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
|
136
145
|
end
|
|
@@ -140,7 +149,7 @@ module SquareConnect
|
|
|
140
149
|
# Custom attribute writer method checking allowed values (enum).
|
|
141
150
|
# @param [Object] scope Object to be assigned
|
|
142
151
|
def scope=(scope)
|
|
143
|
-
validator = EnumAttributeValidator.new('String', ["LINE_ITEM", "ORDER"])
|
|
152
|
+
validator = EnumAttributeValidator.new('String', ["OTHER_DISCOUNT_SCOPE", "LINE_ITEM", "ORDER"])
|
|
144
153
|
unless validator.valid?(scope)
|
|
145
154
|
fail ArgumentError, "invalid value for 'scope', must be one of #{validator.allowable_values}."
|
|
146
155
|
end
|
|
@@ -152,6 +161,7 @@ module SquareConnect
|
|
|
152
161
|
def ==(o)
|
|
153
162
|
return true if self.equal?(o)
|
|
154
163
|
self.class == o.class &&
|
|
164
|
+
catalog_object_id == o.catalog_object_id &&
|
|
155
165
|
name == o.name &&
|
|
156
166
|
type == o.type &&
|
|
157
167
|
percentage == o.percentage &&
|
|
@@ -169,7 +179,7 @@ module SquareConnect
|
|
|
169
179
|
# Calculates hash code according to all attributes.
|
|
170
180
|
# @return [Fixnum] Hash code
|
|
171
181
|
def hash
|
|
172
|
-
[name, type, percentage, amount_money, applied_money, scope].hash
|
|
182
|
+
[catalog_object_id, name, type, percentage, amount_money, applied_money, scope].hash
|
|
173
183
|
end
|
|
174
184
|
|
|
175
185
|
# Builds the object from hash
|
|
@@ -12,7 +12,7 @@ require 'date'
|
|
|
12
12
|
module SquareConnect
|
|
13
13
|
class OrderLineItemDiscountType
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
UNKNOWN_DISCOUNT = "UNKNOWN_DISCOUNT".freeze
|
|
16
16
|
FIXED_PERCENTAGE = "FIXED_PERCENTAGE".freeze
|
|
17
17
|
FIXED_AMOUNT = "FIXED_AMOUNT".freeze
|
|
18
18
|
VARIABLE_PERCENTAGE = "VARIABLE_PERCENTAGE".freeze
|