square_connect 2.20190612.1.314 → 2.20190710.0.321
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/README.md +1 -2
- data/docs/CatalogItem.md +0 -1
- data/docs/CatalogItemVariation.md +0 -1
- data/docs/CatalogObject.md +3 -0
- data/docs/CatalogPricingRule.md +0 -3
- data/docs/InventoryAdjustment.md +1 -1
- data/docs/InventoryCount.md +1 -1
- data/docs/InventoryPhysicalCount.md +1 -1
- data/docs/InventoryTransfer.md +1 -1
- data/docs/TransactionsApi.md +2 -2
- data/lib/square_connect.rb +0 -1
- data/lib/square_connect/api/customers_api.rb +0 -6
- data/lib/square_connect/api/employees_api.rb +0 -3
- data/lib/square_connect/api/reporting_api.rb +0 -6
- data/lib/square_connect/api/transactions_api.rb +4 -10
- data/lib/square_connect/api/v1_employees_api.rb +0 -15
- data/lib/square_connect/api/v1_transactions_api.rb +0 -15
- data/lib/square_connect/api_client.rb +1 -1
- data/lib/square_connect/models/address.rb +0 -33
- data/lib/square_connect/models/batch_retrieve_inventory_changes_request.rb +0 -21
- data/lib/square_connect/models/business_hours_period.rb +0 -33
- data/lib/square_connect/models/card.rb +0 -33
- data/lib/square_connect/models/catalog_discount.rb +0 -33
- data/lib/square_connect/models/catalog_item.rb +1 -44
- data/lib/square_connect/models/catalog_item_variation.rb +1 -56
- data/lib/square_connect/models/catalog_modifier_list.rb +0 -33
- data/lib/square_connect/models/catalog_object.rb +31 -34
- data/lib/square_connect/models/catalog_pricing_rule.rb +1 -64
- data/lib/square_connect/models/catalog_query_sorted_attribute.rb +0 -33
- data/lib/square_connect/models/catalog_tax.rb +0 -45
- data/lib/square_connect/models/create_order_request_tax.rb +0 -33
- data/lib/square_connect/models/customer.rb +0 -33
- data/lib/square_connect/models/customer_creation_source_filter.rb +0 -33
- data/lib/square_connect/models/customer_sort.rb +0 -45
- data/lib/square_connect/models/employee.rb +0 -33
- data/lib/square_connect/models/error.rb +0 -45
- data/lib/square_connect/models/inventory_adjustment.rb +1 -46
- data/lib/square_connect/models/inventory_change.rb +0 -33
- data/lib/square_connect/models/inventory_count.rb +1 -34
- data/lib/square_connect/models/inventory_physical_count.rb +1 -34
- data/lib/square_connect/models/inventory_transfer.rb +1 -34
- data/lib/square_connect/models/item_variation_location_overrides.rb +0 -45
- data/lib/square_connect/models/list_additional_recipient_receivable_refunds_request.rb +0 -33
- data/lib/square_connect/models/list_additional_recipient_receivables_request.rb +0 -33
- data/lib/square_connect/models/list_customers_request.rb +0 -45
- data/lib/square_connect/models/list_employees_request.rb +0 -33
- data/lib/square_connect/models/list_refunds_request.rb +0 -33
- data/lib/square_connect/models/list_transactions_request.rb +0 -33
- data/lib/square_connect/models/location.rb +0 -69
- data/lib/square_connect/models/measurement_unit.rb +0 -81
- data/lib/square_connect/models/money.rb +0 -33
- data/lib/square_connect/models/order.rb +0 -33
- data/lib/square_connect/models/order_fulfillment.rb +0 -45
- data/lib/square_connect/models/order_fulfillment_pickup_details.rb +0 -33
- data/lib/square_connect/models/order_line_item_discount.rb +0 -45
- data/lib/square_connect/models/order_line_item_tax.rb +0 -45
- data/lib/square_connect/models/order_return_discount.rb +0 -45
- data/lib/square_connect/models/order_return_service_charge.rb +0 -33
- data/lib/square_connect/models/order_return_tax.rb +0 -45
- data/lib/square_connect/models/order_service_charge.rb +0 -33
- data/lib/square_connect/models/refund.rb +0 -33
- data/lib/square_connect/models/register_domain_response.rb +0 -33
- data/lib/square_connect/models/search_catalog_objects_request.rb +0 -21
- data/lib/square_connect/models/search_orders_fulfillment_filter.rb +0 -21
- data/lib/square_connect/models/search_orders_sort.rb +0 -45
- data/lib/square_connect/models/search_orders_state_filter.rb +0 -21
- data/lib/square_connect/models/shift.rb +0 -33
- data/lib/square_connect/models/shift_filter.rb +0 -33
- data/lib/square_connect/models/shift_sort.rb +0 -45
- data/lib/square_connect/models/shift_workday.rb +0 -33
- data/lib/square_connect/models/source_application.rb +0 -33
- data/lib/square_connect/models/tender.rb +0 -33
- data/lib/square_connect/models/tender_card_details.rb +0 -45
- data/lib/square_connect/models/transaction.rb +0 -33
- data/lib/square_connect/models/v1_adjust_inventory_request.rb +0 -33
- data/lib/square_connect/models/v1_bank_account.rb +0 -33
- data/lib/square_connect/models/v1_cash_drawer_event.rb +0 -33
- data/lib/square_connect/models/v1_cash_drawer_shift.rb +0 -33
- data/lib/square_connect/models/v1_create_refund_request.rb +0 -33
- data/lib/square_connect/models/v1_discount.rb +0 -45
- data/lib/square_connect/models/v1_employee.rb +0 -33
- data/lib/square_connect/models/v1_employee_role.rb +0 -21
- data/lib/square_connect/models/v1_fee.rb +0 -69
- data/lib/square_connect/models/v1_item.rb +0 -57
- data/lib/square_connect/models/v1_list_cash_drawer_shifts_request.rb +0 -33
- data/lib/square_connect/models/v1_list_employee_roles_request.rb +0 -33
- data/lib/square_connect/models/v1_list_employees_request.rb +0 -45
- data/lib/square_connect/models/v1_list_orders_request.rb +0 -33
- data/lib/square_connect/models/v1_list_payments_request.rb +0 -33
- data/lib/square_connect/models/v1_list_refunds_request.rb +0 -33
- data/lib/square_connect/models/v1_list_settlements_request.rb +0 -45
- data/lib/square_connect/models/v1_list_timecards_request.rb +0 -33
- data/lib/square_connect/models/v1_merchant.rb +0 -45
- data/lib/square_connect/models/v1_modifier_list.rb +0 -33
- data/lib/square_connect/models/v1_money.rb +0 -33
- data/lib/square_connect/models/v1_order.rb +0 -33
- data/lib/square_connect/models/v1_order_history_entry.rb +0 -33
- data/lib/square_connect/models/v1_page_cell.rb +0 -45
- data/lib/square_connect/models/v1_payment_itemization.rb +0 -33
- data/lib/square_connect/models/v1_payment_surcharge.rb +0 -33
- data/lib/square_connect/models/v1_payment_tax.rb +0 -33
- data/lib/square_connect/models/v1_refund.rb +0 -33
- data/lib/square_connect/models/v1_settlement.rb +0 -33
- data/lib/square_connect/models/v1_settlement_entry.rb +0 -33
- data/lib/square_connect/models/v1_tender.rb +0 -57
- data/lib/square_connect/models/v1_timecard_event.rb +0 -33
- data/lib/square_connect/models/v1_update_modifier_list_request.rb +0 -33
- data/lib/square_connect/models/v1_update_order_request.rb +0 -33
- data/lib/square_connect/models/v1_variation.rb +0 -45
- data/lib/square_connect/models/workweek_config.rb +0 -33
- data/lib/square_connect/version.rb +1 -1
- data/spec/api/catalog_api_spec.rb +0 -1
- metadata +2 -6
- data/docs/AggregationStrategy.md +0 -15
- data/lib/square_connect/models/aggregation_strategy.rb +0 -21
- data/spec/models/aggregation_strategy_spec.rb +0 -33
@@ -18,27 +18,6 @@ module SquareConnect
|
|
18
18
|
# The type of currency, in __ISO 4217 format__. For example, the currency code for US dollars is `USD`. See [Currency](#type-currency) for possible values
|
19
19
|
attr_accessor :currency
|
20
20
|
|
21
|
-
class EnumAttributeValidator
|
22
|
-
attr_reader :datatype
|
23
|
-
attr_reader :allowable_values
|
24
|
-
|
25
|
-
def initialize(datatype, allowable_values)
|
26
|
-
@allowable_values = allowable_values.map do |value|
|
27
|
-
case datatype.to_s
|
28
|
-
when /Integer/i
|
29
|
-
value.to_i
|
30
|
-
when /Float/i
|
31
|
-
value.to_f
|
32
|
-
else
|
33
|
-
value
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def valid?(value)
|
39
|
-
!value || allowable_values.include?(value)
|
40
|
-
end
|
41
|
-
end
|
42
21
|
|
43
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
44
23
|
def self.attribute_map
|
@@ -84,21 +63,9 @@ module SquareConnect
|
|
84
63
|
# Check to see if the all the properties in the model are valid
|
85
64
|
# @return true if the model is valid
|
86
65
|
def valid?
|
87
|
-
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
|
-
return false unless currency_validator.valid?(@currency)
|
89
66
|
return true
|
90
67
|
end
|
91
68
|
|
92
|
-
# Custom attribute writer method checking allowed values (enum).
|
93
|
-
# @param [Object] currency Object to be assigned
|
94
|
-
def currency=(currency)
|
95
|
-
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
|
-
unless validator.valid?(currency)
|
97
|
-
fail ArgumentError, "invalid value for 'currency', must be one of #{validator.allowable_values}."
|
98
|
-
end
|
99
|
-
@currency = currency
|
100
|
-
end
|
101
|
-
|
102
69
|
# Checks equality by comparing each attribute.
|
103
70
|
# @param [Object] Object to be compared
|
104
71
|
def ==(o)
|
@@ -84,27 +84,6 @@ module SquareConnect
|
|
84
84
|
# The total amount of money collected in service charges for the order. Note: `total_service_charge_money` is the sum of `applied_money` fields for each individual service charge. Therefore, `total_service_charge_money` will only include inclusive tax amounts, not additive tax amounts. This field is read-only.
|
85
85
|
attr_accessor :total_service_charge_money
|
86
86
|
|
87
|
-
class EnumAttributeValidator
|
88
|
-
attr_reader :datatype
|
89
|
-
attr_reader :allowable_values
|
90
|
-
|
91
|
-
def initialize(datatype, allowable_values)
|
92
|
-
@allowable_values = allowable_values.map do |value|
|
93
|
-
case datatype.to_s
|
94
|
-
when /Integer/i
|
95
|
-
value.to_i
|
96
|
-
when /Float/i
|
97
|
-
value.to_f
|
98
|
-
else
|
99
|
-
value
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
def valid?(value)
|
105
|
-
!value || allowable_values.include?(value)
|
106
|
-
end
|
107
|
-
end
|
108
87
|
|
109
88
|
# Attribute mapping from ruby-style variable name to JSON key.
|
110
89
|
def self.attribute_map
|
@@ -313,8 +292,6 @@ module SquareConnect
|
|
313
292
|
return false if @location_id.nil?
|
314
293
|
return false if @location_id.to_s.length < 1
|
315
294
|
return false if !@reference_id.nil? && @reference_id.to_s.length > 40
|
316
|
-
state_validator = EnumAttributeValidator.new('String', ["OPEN", "COMPLETED", "CANCELED"])
|
317
|
-
return false unless state_validator.valid?(@state)
|
318
295
|
return true
|
319
296
|
end
|
320
297
|
|
@@ -343,16 +320,6 @@ module SquareConnect
|
|
343
320
|
@reference_id = reference_id
|
344
321
|
end
|
345
322
|
|
346
|
-
# Custom attribute writer method checking allowed values (enum).
|
347
|
-
# @param [Object] state Object to be assigned
|
348
|
-
def state=(state)
|
349
|
-
validator = EnumAttributeValidator.new('String', ["OPEN", "COMPLETED", "CANCELED"])
|
350
|
-
unless validator.valid?(state)
|
351
|
-
fail ArgumentError, "invalid value for 'state', must be one of #{validator.allowable_values}."
|
352
|
-
end
|
353
|
-
@state = state
|
354
|
-
end
|
355
|
-
|
356
323
|
# Checks equality by comparing each attribute.
|
357
324
|
# @param [Object] Object to be compared
|
358
325
|
def ==(o)
|
@@ -21,27 +21,6 @@ module SquareConnect
|
|
21
21
|
# Contains pickup-specific details. Required when fulfillment type is `PICKUP`.
|
22
22
|
attr_accessor :pickup_details
|
23
23
|
|
24
|
-
class EnumAttributeValidator
|
25
|
-
attr_reader :datatype
|
26
|
-
attr_reader :allowable_values
|
27
|
-
|
28
|
-
def initialize(datatype, allowable_values)
|
29
|
-
@allowable_values = allowable_values.map do |value|
|
30
|
-
case datatype.to_s
|
31
|
-
when /Integer/i
|
32
|
-
value.to_i
|
33
|
-
when /Float/i
|
34
|
-
value.to_f
|
35
|
-
else
|
36
|
-
value
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def valid?(value)
|
42
|
-
!value || allowable_values.include?(value)
|
43
|
-
end
|
44
|
-
end
|
45
24
|
|
46
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
47
26
|
def self.attribute_map
|
@@ -93,33 +72,9 @@ module SquareConnect
|
|
93
72
|
# Check to see if the all the properties in the model are valid
|
94
73
|
# @return true if the model is valid
|
95
74
|
def valid?
|
96
|
-
type_validator = EnumAttributeValidator.new('String', ["PICKUP"])
|
97
|
-
return false unless type_validator.valid?(@type)
|
98
|
-
state_validator = EnumAttributeValidator.new('String', ["PROPOSED", "RESERVED", "PREPARED", "COMPLETED", "CANCELED", "FAILED"])
|
99
|
-
return false unless state_validator.valid?(@state)
|
100
75
|
return true
|
101
76
|
end
|
102
77
|
|
103
|
-
# Custom attribute writer method checking allowed values (enum).
|
104
|
-
# @param [Object] type Object to be assigned
|
105
|
-
def type=(type)
|
106
|
-
validator = EnumAttributeValidator.new('String', ["PICKUP"])
|
107
|
-
unless validator.valid?(type)
|
108
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
109
|
-
end
|
110
|
-
@type = type
|
111
|
-
end
|
112
|
-
|
113
|
-
# Custom attribute writer method checking allowed values (enum).
|
114
|
-
# @param [Object] state Object to be assigned
|
115
|
-
def state=(state)
|
116
|
-
validator = EnumAttributeValidator.new('String', ["PROPOSED", "RESERVED", "PREPARED", "COMPLETED", "CANCELED", "FAILED"])
|
117
|
-
unless validator.valid?(state)
|
118
|
-
fail ArgumentError, "invalid value for 'state', must be one of #{validator.allowable_values}."
|
119
|
-
end
|
120
|
-
@state = state
|
121
|
-
end
|
122
|
-
|
123
78
|
# Checks equality by comparing each attribute.
|
124
79
|
# @param [Object] Object to be compared
|
125
80
|
def ==(o)
|
@@ -60,27 +60,6 @@ module SquareConnect
|
|
60
60
|
# A description of why the pickup was canceled. Max length is 100 characters.
|
61
61
|
attr_accessor :cancel_reason
|
62
62
|
|
63
|
-
class EnumAttributeValidator
|
64
|
-
attr_reader :datatype
|
65
|
-
attr_reader :allowable_values
|
66
|
-
|
67
|
-
def initialize(datatype, allowable_values)
|
68
|
-
@allowable_values = allowable_values.map do |value|
|
69
|
-
case datatype.to_s
|
70
|
-
when /Integer/i
|
71
|
-
value.to_i
|
72
|
-
when /Float/i
|
73
|
-
value.to_f
|
74
|
-
else
|
75
|
-
value
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
def valid?(value)
|
81
|
-
!value || allowable_values.include?(value)
|
82
|
-
end
|
83
|
-
end
|
84
63
|
|
85
64
|
# Attribute mapping from ruby-style variable name to JSON key.
|
86
65
|
def self.attribute_map
|
@@ -218,23 +197,11 @@ module SquareConnect
|
|
218
197
|
# Check to see if the all the properties in the model are valid
|
219
198
|
# @return true if the model is valid
|
220
199
|
def valid?
|
221
|
-
schedule_type_validator = EnumAttributeValidator.new('String', ["SCHEDULED", "ASAP"])
|
222
|
-
return false unless schedule_type_validator.valid?(@schedule_type)
|
223
200
|
return false if !@note.nil? && @note.to_s.length > 500
|
224
201
|
return false if !@cancel_reason.nil? && @cancel_reason.to_s.length > 100
|
225
202
|
return true
|
226
203
|
end
|
227
204
|
|
228
|
-
# Custom attribute writer method checking allowed values (enum).
|
229
|
-
# @param [Object] schedule_type Object to be assigned
|
230
|
-
def schedule_type=(schedule_type)
|
231
|
-
validator = EnumAttributeValidator.new('String', ["SCHEDULED", "ASAP"])
|
232
|
-
unless validator.valid?(schedule_type)
|
233
|
-
fail ArgumentError, "invalid value for 'schedule_type', must be one of #{validator.allowable_values}."
|
234
|
-
end
|
235
|
-
@schedule_type = schedule_type
|
236
|
-
end
|
237
|
-
|
238
205
|
# Custom attribute writer method with validation
|
239
206
|
# @param [Object] note Value to be assigned
|
240
207
|
def note=(note)
|
@@ -36,27 +36,6 @@ module SquareConnect
|
|
36
36
|
# Indicates the level at which the discount applies. This field is set by the server. If set in a CreateOrder request, it will be ignored on write. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values
|
37
37
|
attr_accessor :scope
|
38
38
|
|
39
|
-
class EnumAttributeValidator
|
40
|
-
attr_reader :datatype
|
41
|
-
attr_reader :allowable_values
|
42
|
-
|
43
|
-
def initialize(datatype, allowable_values)
|
44
|
-
@allowable_values = allowable_values.map do |value|
|
45
|
-
case datatype.to_s
|
46
|
-
when /Integer/i
|
47
|
-
value.to_i
|
48
|
-
when /Float/i
|
49
|
-
value.to_f
|
50
|
-
else
|
51
|
-
value
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def valid?(value)
|
57
|
-
!value || allowable_values.include?(value)
|
58
|
-
end
|
59
|
-
end
|
60
39
|
|
61
40
|
# Attribute mapping from ruby-style variable name to JSON key.
|
62
41
|
def self.attribute_map
|
@@ -157,11 +136,7 @@ module SquareConnect
|
|
157
136
|
return false if !@uid.nil? && @uid.to_s.length > 60
|
158
137
|
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
|
159
138
|
return false if !@name.nil? && @name.to_s.length > 255
|
160
|
-
type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_DISCOUNT", "FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
|
161
|
-
return false unless type_validator.valid?(@type)
|
162
139
|
return false if !@percentage.nil? && @percentage.to_s.length > 10
|
163
|
-
scope_validator = EnumAttributeValidator.new('String', ["OTHER_DISCOUNT_SCOPE", "LINE_ITEM", "ORDER"])
|
164
|
-
return false unless scope_validator.valid?(@scope)
|
165
140
|
return true
|
166
141
|
end
|
167
142
|
|
@@ -198,16 +173,6 @@ module SquareConnect
|
|
198
173
|
@name = name
|
199
174
|
end
|
200
175
|
|
201
|
-
# Custom attribute writer method checking allowed values (enum).
|
202
|
-
# @param [Object] type Object to be assigned
|
203
|
-
def type=(type)
|
204
|
-
validator = EnumAttributeValidator.new('String', ["UNKNOWN_DISCOUNT", "FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
|
205
|
-
unless validator.valid?(type)
|
206
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
207
|
-
end
|
208
|
-
@type = type
|
209
|
-
end
|
210
|
-
|
211
176
|
# Custom attribute writer method with validation
|
212
177
|
# @param [Object] percentage Value to be assigned
|
213
178
|
def percentage=(percentage)
|
@@ -219,16 +184,6 @@ module SquareConnect
|
|
219
184
|
@percentage = percentage
|
220
185
|
end
|
221
186
|
|
222
|
-
# Custom attribute writer method checking allowed values (enum).
|
223
|
-
# @param [Object] scope Object to be assigned
|
224
|
-
def scope=(scope)
|
225
|
-
validator = EnumAttributeValidator.new('String', ["OTHER_DISCOUNT_SCOPE", "LINE_ITEM", "ORDER"])
|
226
|
-
unless validator.valid?(scope)
|
227
|
-
fail ArgumentError, "invalid value for 'scope', must be one of #{validator.allowable_values}."
|
228
|
-
end
|
229
|
-
@scope = scope
|
230
|
-
end
|
231
|
-
|
232
187
|
# Checks equality by comparing each attribute.
|
233
188
|
# @param [Object] Object to be compared
|
234
189
|
def ==(o)
|
@@ -33,27 +33,6 @@ module SquareConnect
|
|
33
33
|
# Indicates the level at which the tax applies. This field is set by the server. If set in a CreateOrder request, it will be ignored on write. See [OrderLineItemTaxScope](#type-orderlineitemtaxscope) for possible values
|
34
34
|
attr_accessor :scope
|
35
35
|
|
36
|
-
class EnumAttributeValidator
|
37
|
-
attr_reader :datatype
|
38
|
-
attr_reader :allowable_values
|
39
|
-
|
40
|
-
def initialize(datatype, allowable_values)
|
41
|
-
@allowable_values = allowable_values.map do |value|
|
42
|
-
case datatype.to_s
|
43
|
-
when /Integer/i
|
44
|
-
value.to_i
|
45
|
-
when /Float/i
|
46
|
-
value.to_f
|
47
|
-
else
|
48
|
-
value
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def valid?(value)
|
54
|
-
!value || allowable_values.include?(value)
|
55
|
-
end
|
56
|
-
end
|
57
36
|
|
58
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
59
38
|
def self.attribute_map
|
@@ -148,11 +127,7 @@ module SquareConnect
|
|
148
127
|
return false if !@uid.nil? && @uid.to_s.length > 60
|
149
128
|
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
|
150
129
|
return false if !@name.nil? && @name.to_s.length > 255
|
151
|
-
type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"])
|
152
|
-
return false unless type_validator.valid?(@type)
|
153
130
|
return false if !@percentage.nil? && @percentage.to_s.length > 10
|
154
|
-
scope_validator = EnumAttributeValidator.new('String', ["OTHER_TAX_SCOPE", "LINE_ITEM", "ORDER"])
|
155
|
-
return false unless scope_validator.valid?(@scope)
|
156
131
|
return true
|
157
132
|
end
|
158
133
|
|
@@ -189,16 +164,6 @@ module SquareConnect
|
|
189
164
|
@name = name
|
190
165
|
end
|
191
166
|
|
192
|
-
# Custom attribute writer method checking allowed values (enum).
|
193
|
-
# @param [Object] type Object to be assigned
|
194
|
-
def type=(type)
|
195
|
-
validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"])
|
196
|
-
unless validator.valid?(type)
|
197
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
198
|
-
end
|
199
|
-
@type = type
|
200
|
-
end
|
201
|
-
|
202
167
|
# Custom attribute writer method with validation
|
203
168
|
# @param [Object] percentage Value to be assigned
|
204
169
|
def percentage=(percentage)
|
@@ -210,16 +175,6 @@ module SquareConnect
|
|
210
175
|
@percentage = percentage
|
211
176
|
end
|
212
177
|
|
213
|
-
# Custom attribute writer method checking allowed values (enum).
|
214
|
-
# @param [Object] scope Object to be assigned
|
215
|
-
def scope=(scope)
|
216
|
-
validator = EnumAttributeValidator.new('String', ["OTHER_TAX_SCOPE", "LINE_ITEM", "ORDER"])
|
217
|
-
unless validator.valid?(scope)
|
218
|
-
fail ArgumentError, "invalid value for 'scope', must be one of #{validator.allowable_values}."
|
219
|
-
end
|
220
|
-
@scope = scope
|
221
|
-
end
|
222
|
-
|
223
178
|
# Checks equality by comparing each attribute.
|
224
179
|
# @param [Object] Object to be compared
|
225
180
|
def ==(o)
|
@@ -39,27 +39,6 @@ module SquareConnect
|
|
39
39
|
# Indicates the level at which the discount applies. This field is set by the server. If set in a CreateOrder request, it will be ignored on write. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values
|
40
40
|
attr_accessor :scope
|
41
41
|
|
42
|
-
class EnumAttributeValidator
|
43
|
-
attr_reader :datatype
|
44
|
-
attr_reader :allowable_values
|
45
|
-
|
46
|
-
def initialize(datatype, allowable_values)
|
47
|
-
@allowable_values = allowable_values.map do |value|
|
48
|
-
case datatype.to_s
|
49
|
-
when /Integer/i
|
50
|
-
value.to_i
|
51
|
-
when /Float/i
|
52
|
-
value.to_f
|
53
|
-
else
|
54
|
-
value
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def valid?(value)
|
60
|
-
!value || allowable_values.include?(value)
|
61
|
-
end
|
62
|
-
end
|
63
42
|
|
64
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
65
44
|
def self.attribute_map
|
@@ -171,11 +150,7 @@ module SquareConnect
|
|
171
150
|
return false if !@source_discount_uid.nil? && @source_discount_uid.to_s.length > 60
|
172
151
|
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
|
173
152
|
return false if !@name.nil? && @name.to_s.length > 255
|
174
|
-
type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_DISCOUNT", "FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
|
175
|
-
return false unless type_validator.valid?(@type)
|
176
153
|
return false if !@percentage.nil? && @percentage.to_s.length > 10
|
177
|
-
scope_validator = EnumAttributeValidator.new('String', ["OTHER_DISCOUNT_SCOPE", "LINE_ITEM", "ORDER"])
|
178
|
-
return false unless scope_validator.valid?(@scope)
|
179
154
|
return true
|
180
155
|
end
|
181
156
|
|
@@ -223,16 +198,6 @@ module SquareConnect
|
|
223
198
|
@name = name
|
224
199
|
end
|
225
200
|
|
226
|
-
# Custom attribute writer method checking allowed values (enum).
|
227
|
-
# @param [Object] type Object to be assigned
|
228
|
-
def type=(type)
|
229
|
-
validator = EnumAttributeValidator.new('String', ["UNKNOWN_DISCOUNT", "FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
|
230
|
-
unless validator.valid?(type)
|
231
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
232
|
-
end
|
233
|
-
@type = type
|
234
|
-
end
|
235
|
-
|
236
201
|
# Custom attribute writer method with validation
|
237
202
|
# @param [Object] percentage Value to be assigned
|
238
203
|
def percentage=(percentage)
|
@@ -244,16 +209,6 @@ module SquareConnect
|
|
244
209
|
@percentage = percentage
|
245
210
|
end
|
246
211
|
|
247
|
-
# Custom attribute writer method checking allowed values (enum).
|
248
|
-
# @param [Object] scope Object to be assigned
|
249
|
-
def scope=(scope)
|
250
|
-
validator = EnumAttributeValidator.new('String', ["OTHER_DISCOUNT_SCOPE", "LINE_ITEM", "ORDER"])
|
251
|
-
unless validator.valid?(scope)
|
252
|
-
fail ArgumentError, "invalid value for 'scope', must be one of #{validator.allowable_values}."
|
253
|
-
end
|
254
|
-
@scope = scope
|
255
|
-
end
|
256
|
-
|
257
212
|
# Checks equality by comparing each attribute.
|
258
213
|
# @param [Object] Object to be compared
|
259
214
|
def ==(o)
|
@@ -48,27 +48,6 @@ module SquareConnect
|
|
48
48
|
# The taxes which apply to the service charge. Return-level taxes apply by default to service charge calculated in the `SUBTOTAL_PHASE` if the service charge is marked as taxable.
|
49
49
|
attr_accessor :return_taxes
|
50
50
|
|
51
|
-
class EnumAttributeValidator
|
52
|
-
attr_reader :datatype
|
53
|
-
attr_reader :allowable_values
|
54
|
-
|
55
|
-
def initialize(datatype, allowable_values)
|
56
|
-
@allowable_values = allowable_values.map do |value|
|
57
|
-
case datatype.to_s
|
58
|
-
when /Integer/i
|
59
|
-
value.to_i
|
60
|
-
when /Float/i
|
61
|
-
value.to_f
|
62
|
-
else
|
63
|
-
value
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def valid?(value)
|
69
|
-
!value || allowable_values.include?(value)
|
70
|
-
end
|
71
|
-
end
|
72
51
|
|
73
52
|
# Attribute mapping from ruby-style variable name to JSON key.
|
74
53
|
def self.attribute_map
|
@@ -201,8 +180,6 @@ module SquareConnect
|
|
201
180
|
return false if !@name.nil? && @name.to_s.length > 255
|
202
181
|
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
|
203
182
|
return false if !@percentage.nil? && @percentage.to_s.length > 10
|
204
|
-
calculation_phase_validator = EnumAttributeValidator.new('String', ["SUBTOTAL_PHASE", "TOTAL_PHASE"])
|
205
|
-
return false unless calculation_phase_validator.valid?(@calculation_phase)
|
206
183
|
return true
|
207
184
|
end
|
208
185
|
|
@@ -261,16 +238,6 @@ module SquareConnect
|
|
261
238
|
@percentage = percentage
|
262
239
|
end
|
263
240
|
|
264
|
-
# Custom attribute writer method checking allowed values (enum).
|
265
|
-
# @param [Object] calculation_phase Object to be assigned
|
266
|
-
def calculation_phase=(calculation_phase)
|
267
|
-
validator = EnumAttributeValidator.new('String', ["SUBTOTAL_PHASE", "TOTAL_PHASE"])
|
268
|
-
unless validator.valid?(calculation_phase)
|
269
|
-
fail ArgumentError, "invalid value for 'calculation_phase', must be one of #{validator.allowable_values}."
|
270
|
-
end
|
271
|
-
@calculation_phase = calculation_phase
|
272
|
-
end
|
273
|
-
|
274
241
|
# Checks equality by comparing each attribute.
|
275
242
|
# @param [Object] Object to be compared
|
276
243
|
def ==(o)
|