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
|
# See [Currency](#type-currency) for possible values
|
19
19
|
attr_accessor :currency_code
|
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_code_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_code_validator.valid?(@currency_code)
|
89
66
|
return true
|
90
67
|
end
|
91
68
|
|
92
|
-
# Custom attribute writer method checking allowed values (enum).
|
93
|
-
# @param [Object] currency_code Object to be assigned
|
94
|
-
def currency_code=(currency_code)
|
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_code)
|
97
|
-
fail ArgumentError, "invalid value for 'currency_code', must be one of #{validator.allowable_values}."
|
98
|
-
end
|
99
|
-
@currency_code = currency_code
|
100
|
-
end
|
101
|
-
|
102
69
|
# Checks equality by comparing each attribute.
|
103
70
|
# @param [Object] Object to be compared
|
104
71
|
def ==(o)
|
@@ -87,27 +87,6 @@ module SquareConnect
|
|
87
87
|
# For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 BTC).
|
88
88
|
attr_accessor :btc_price_satoshi
|
89
89
|
|
90
|
-
class EnumAttributeValidator
|
91
|
-
attr_reader :datatype
|
92
|
-
attr_reader :allowable_values
|
93
|
-
|
94
|
-
def initialize(datatype, allowable_values)
|
95
|
-
@allowable_values = allowable_values.map do |value|
|
96
|
-
case datatype.to_s
|
97
|
-
when /Integer/i
|
98
|
-
value.to_i
|
99
|
-
when /Float/i
|
100
|
-
value.to_f
|
101
|
-
else
|
102
|
-
value
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
def valid?(value)
|
108
|
-
!value || allowable_values.include?(value)
|
109
|
-
end
|
110
|
-
end
|
111
90
|
|
112
91
|
# Attribute mapping from ruby-style variable name to JSON key.
|
113
92
|
def self.attribute_map
|
@@ -295,21 +274,9 @@ module SquareConnect
|
|
295
274
|
# Check to see if the all the properties in the model are valid
|
296
275
|
# @return true if the model is valid
|
297
276
|
def valid?
|
298
|
-
state_validator = EnumAttributeValidator.new('String', ["PENDING", "OPEN", "COMPLETED", "CANCELED", "REFUNDED", "REJECTED"])
|
299
|
-
return false unless state_validator.valid?(@state)
|
300
277
|
return true
|
301
278
|
end
|
302
279
|
|
303
|
-
# Custom attribute writer method checking allowed values (enum).
|
304
|
-
# @param [Object] state Object to be assigned
|
305
|
-
def state=(state)
|
306
|
-
validator = EnumAttributeValidator.new('String', ["PENDING", "OPEN", "COMPLETED", "CANCELED", "REFUNDED", "REJECTED"])
|
307
|
-
unless validator.valid?(state)
|
308
|
-
fail ArgumentError, "invalid value for 'state', must be one of #{validator.allowable_values}."
|
309
|
-
end
|
310
|
-
@state = state
|
311
|
-
end
|
312
|
-
|
313
280
|
# Checks equality by comparing each attribute.
|
314
281
|
# @param [Object] Object to be compared
|
315
282
|
def ==(o)
|
@@ -18,27 +18,6 @@ module SquareConnect
|
|
18
18
|
# The time when the action was performed, in ISO 8601 format.
|
19
19
|
attr_accessor :created_at
|
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
|
-
action_validator = EnumAttributeValidator.new('String', ["ORDER_PLACED", "DECLINED", "PAYMENT_RECEIVED", "CANCELED", "COMPLETED", "REFUNDED", "EXPIRED"])
|
88
|
-
return false unless action_validator.valid?(@action)
|
89
66
|
return true
|
90
67
|
end
|
91
68
|
|
92
|
-
# Custom attribute writer method checking allowed values (enum).
|
93
|
-
# @param [Object] action Object to be assigned
|
94
|
-
def action=(action)
|
95
|
-
validator = EnumAttributeValidator.new('String', ["ORDER_PLACED", "DECLINED", "PAYMENT_RECEIVED", "CANCELED", "COMPLETED", "REFUNDED", "EXPIRED"])
|
96
|
-
unless validator.valid?(action)
|
97
|
-
fail ArgumentError, "invalid value for 'action', must be one of #{validator.allowable_values}."
|
98
|
-
end
|
99
|
-
@action = action
|
100
|
-
end
|
101
|
-
|
102
69
|
# Checks equality by comparing each attribute.
|
103
70
|
# @param [Object] Object to be compared
|
104
71
|
def ==(o)
|
@@ -30,27 +30,6 @@ module SquareConnect
|
|
30
30
|
# For a cell with an object_type of PLACEHOLDER, this value indicates the cell's special behavior. See [V1PageCellPlaceholderType](#type-v1pagecellplaceholdertype) for possible values
|
31
31
|
attr_accessor :placeholder_type
|
32
32
|
|
33
|
-
class EnumAttributeValidator
|
34
|
-
attr_reader :datatype
|
35
|
-
attr_reader :allowable_values
|
36
|
-
|
37
|
-
def initialize(datatype, allowable_values)
|
38
|
-
@allowable_values = allowable_values.map do |value|
|
39
|
-
case datatype.to_s
|
40
|
-
when /Integer/i
|
41
|
-
value.to_i
|
42
|
-
when /Float/i
|
43
|
-
value.to_f
|
44
|
-
else
|
45
|
-
value
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def valid?(value)
|
51
|
-
!value || allowable_values.include?(value)
|
52
|
-
end
|
53
|
-
end
|
54
33
|
|
55
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
56
35
|
def self.attribute_map
|
@@ -120,33 +99,9 @@ module SquareConnect
|
|
120
99
|
# Check to see if the all the properties in the model are valid
|
121
100
|
# @return true if the model is valid
|
122
101
|
def valid?
|
123
|
-
object_type_validator = EnumAttributeValidator.new('String', ["ITEM", "DISCOUNT", "CATEGORY", "PLACEHOLDER"])
|
124
|
-
return false unless object_type_validator.valid?(@object_type)
|
125
|
-
placeholder_type_validator = EnumAttributeValidator.new('String', ["ALL_ITEMS", "DISCOUNTS_CATEGORY", "REWARDS_FINDER"])
|
126
|
-
return false unless placeholder_type_validator.valid?(@placeholder_type)
|
127
102
|
return true
|
128
103
|
end
|
129
104
|
|
130
|
-
# Custom attribute writer method checking allowed values (enum).
|
131
|
-
# @param [Object] object_type Object to be assigned
|
132
|
-
def object_type=(object_type)
|
133
|
-
validator = EnumAttributeValidator.new('String', ["ITEM", "DISCOUNT", "CATEGORY", "PLACEHOLDER"])
|
134
|
-
unless validator.valid?(object_type)
|
135
|
-
fail ArgumentError, "invalid value for 'object_type', must be one of #{validator.allowable_values}."
|
136
|
-
end
|
137
|
-
@object_type = object_type
|
138
|
-
end
|
139
|
-
|
140
|
-
# Custom attribute writer method checking allowed values (enum).
|
141
|
-
# @param [Object] placeholder_type Object to be assigned
|
142
|
-
def placeholder_type=(placeholder_type)
|
143
|
-
validator = EnumAttributeValidator.new('String', ["ALL_ITEMS", "DISCOUNTS_CATEGORY", "REWARDS_FINDER"])
|
144
|
-
unless validator.valid?(placeholder_type)
|
145
|
-
fail ArgumentError, "invalid value for 'placeholder_type', must be one of #{validator.allowable_values}."
|
146
|
-
end
|
147
|
-
@placeholder_type = placeholder_type
|
148
|
-
end
|
149
|
-
|
150
105
|
# Checks equality by comparing each attribute.
|
151
106
|
# @param [Object] Object to be compared
|
152
107
|
def ==(o)
|
@@ -54,27 +54,6 @@ module SquareConnect
|
|
54
54
|
# All modifier options applied to this itemization.
|
55
55
|
attr_accessor :modifiers
|
56
56
|
|
57
|
-
class EnumAttributeValidator
|
58
|
-
attr_reader :datatype
|
59
|
-
attr_reader :allowable_values
|
60
|
-
|
61
|
-
def initialize(datatype, allowable_values)
|
62
|
-
@allowable_values = allowable_values.map do |value|
|
63
|
-
case datatype.to_s
|
64
|
-
when /Integer/i
|
65
|
-
value.to_i
|
66
|
-
when /Float/i
|
67
|
-
value.to_f
|
68
|
-
else
|
69
|
-
value
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def valid?(value)
|
75
|
-
!value || allowable_values.include?(value)
|
76
|
-
end
|
77
|
-
end
|
78
57
|
|
79
58
|
# Attribute mapping from ruby-style variable name to JSON key.
|
80
59
|
def self.attribute_map
|
@@ -198,21 +177,9 @@ module SquareConnect
|
|
198
177
|
# Check to see if the all the properties in the model are valid
|
199
178
|
# @return true if the model is valid
|
200
179
|
def valid?
|
201
|
-
itemization_type_validator = EnumAttributeValidator.new('String', ["ITEM", "CUSTOM_AMOUNT", "GIFT_CARD_ACTIVATION", "GIFT_CARD_RELOAD", "GIFT_CARD_UNKNOWN", "OTHER"])
|
202
|
-
return false unless itemization_type_validator.valid?(@itemization_type)
|
203
180
|
return true
|
204
181
|
end
|
205
182
|
|
206
|
-
# Custom attribute writer method checking allowed values (enum).
|
207
|
-
# @param [Object] itemization_type Object to be assigned
|
208
|
-
def itemization_type=(itemization_type)
|
209
|
-
validator = EnumAttributeValidator.new('String', ["ITEM", "CUSTOM_AMOUNT", "GIFT_CARD_ACTIVATION", "GIFT_CARD_RELOAD", "GIFT_CARD_UNKNOWN", "OTHER"])
|
210
|
-
unless validator.valid?(itemization_type)
|
211
|
-
fail ArgumentError, "invalid value for 'itemization_type', must be one of #{validator.allowable_values}."
|
212
|
-
end
|
213
|
-
@itemization_type = itemization_type
|
214
|
-
end
|
215
|
-
|
216
183
|
# Checks equality by comparing each attribute.
|
217
184
|
# @param [Object] Object to be compared
|
218
185
|
def ==(o)
|
@@ -36,27 +36,6 @@ module SquareConnect
|
|
36
36
|
# A Square-issued unique identifier associated with the surcharge.
|
37
37
|
attr_accessor :surcharge_id
|
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
|
@@ -140,21 +119,9 @@ module SquareConnect
|
|
140
119
|
# Check to see if the all the properties in the model are valid
|
141
120
|
# @return true if the model is valid
|
142
121
|
def valid?
|
143
|
-
type_validator = EnumAttributeValidator.new('String', ["UNKNOWN", "AUTO_GRATUITY", "CUSTOM"])
|
144
|
-
return false unless type_validator.valid?(@type)
|
145
122
|
return true
|
146
123
|
end
|
147
124
|
|
148
|
-
# Custom attribute writer method checking allowed values (enum).
|
149
|
-
# @param [Object] type Object to be assigned
|
150
|
-
def type=(type)
|
151
|
-
validator = EnumAttributeValidator.new('String', ["UNKNOWN", "AUTO_GRATUITY", "CUSTOM"])
|
152
|
-
unless validator.valid?(type)
|
153
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
154
|
-
end
|
155
|
-
@type = type
|
156
|
-
end
|
157
|
-
|
158
125
|
# Checks equality by comparing each attribute.
|
159
126
|
# @param [Object] Object to be compared
|
160
127
|
def ==(o)
|
@@ -30,27 +30,6 @@ module SquareConnect
|
|
30
30
|
# The ID of the tax, if available. Taxes applied in older versions of Square Register might not have an ID.
|
31
31
|
attr_accessor :fee_id
|
32
32
|
|
33
|
-
class EnumAttributeValidator
|
34
|
-
attr_reader :datatype
|
35
|
-
attr_reader :allowable_values
|
36
|
-
|
37
|
-
def initialize(datatype, allowable_values)
|
38
|
-
@allowable_values = allowable_values.map do |value|
|
39
|
-
case datatype.to_s
|
40
|
-
when /Integer/i
|
41
|
-
value.to_i
|
42
|
-
when /Float/i
|
43
|
-
value.to_f
|
44
|
-
else
|
45
|
-
value
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def valid?(value)
|
51
|
-
!value || allowable_values.include?(value)
|
52
|
-
end
|
53
|
-
end
|
54
33
|
|
55
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
56
35
|
def self.attribute_map
|
@@ -122,21 +101,9 @@ module SquareConnect
|
|
122
101
|
# Check to see if the all the properties in the model are valid
|
123
102
|
# @return true if the model is valid
|
124
103
|
def valid?
|
125
|
-
inclusion_type_validator = EnumAttributeValidator.new('String', ["ADDITIVE", "INCLUSIVE"])
|
126
|
-
return false unless inclusion_type_validator.valid?(@inclusion_type)
|
127
104
|
return true
|
128
105
|
end
|
129
106
|
|
130
|
-
# Custom attribute writer method checking allowed values (enum).
|
131
|
-
# @param [Object] inclusion_type Object to be assigned
|
132
|
-
def inclusion_type=(inclusion_type)
|
133
|
-
validator = EnumAttributeValidator.new('String', ["ADDITIVE", "INCLUSIVE"])
|
134
|
-
unless validator.valid?(inclusion_type)
|
135
|
-
fail ArgumentError, "invalid value for 'inclusion_type', must be one of #{validator.allowable_values}."
|
136
|
-
end
|
137
|
-
@inclusion_type = inclusion_type
|
138
|
-
end
|
139
|
-
|
140
107
|
# Checks equality by comparing each attribute.
|
141
108
|
# @param [Object] Object to be compared
|
142
109
|
def ==(o)
|
@@ -66,27 +66,6 @@ module SquareConnect
|
|
66
66
|
# Indicates whether or not the refund is associated with an exchange. If is_exchange is true, the refund reflects the value of goods returned in the exchange not the total money refunded.
|
67
67
|
attr_accessor :is_exchange
|
68
68
|
|
69
|
-
class EnumAttributeValidator
|
70
|
-
attr_reader :datatype
|
71
|
-
attr_reader :allowable_values
|
72
|
-
|
73
|
-
def initialize(datatype, allowable_values)
|
74
|
-
@allowable_values = allowable_values.map do |value|
|
75
|
-
case datatype.to_s
|
76
|
-
when /Integer/i
|
77
|
-
value.to_i
|
78
|
-
when /Float/i
|
79
|
-
value.to_f
|
80
|
-
else
|
81
|
-
value
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
def valid?(value)
|
87
|
-
!value || allowable_values.include?(value)
|
88
|
-
end
|
89
|
-
end
|
90
69
|
|
91
70
|
# Attribute mapping from ruby-style variable name to JSON key.
|
92
71
|
def self.attribute_map
|
@@ -234,21 +213,9 @@ module SquareConnect
|
|
234
213
|
# Check to see if the all the properties in the model are valid
|
235
214
|
# @return true if the model is valid
|
236
215
|
def valid?
|
237
|
-
type_validator = EnumAttributeValidator.new('String', ["FULL", "PARTIAL"])
|
238
|
-
return false unless type_validator.valid?(@type)
|
239
216
|
return true
|
240
217
|
end
|
241
218
|
|
242
|
-
# Custom attribute writer method checking allowed values (enum).
|
243
|
-
# @param [Object] type Object to be assigned
|
244
|
-
def type=(type)
|
245
|
-
validator = EnumAttributeValidator.new('String', ["FULL", "PARTIAL"])
|
246
|
-
unless validator.valid?(type)
|
247
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
248
|
-
end
|
249
|
-
@type = type
|
250
|
-
end
|
251
|
-
|
252
219
|
# Checks equality by comparing each attribute.
|
253
220
|
# @param [Object] Object to be compared
|
254
221
|
def ==(o)
|
@@ -30,27 +30,6 @@ module SquareConnect
|
|
30
30
|
# The entries included in this settlement.
|
31
31
|
attr_accessor :entries
|
32
32
|
|
33
|
-
class EnumAttributeValidator
|
34
|
-
attr_reader :datatype
|
35
|
-
attr_reader :allowable_values
|
36
|
-
|
37
|
-
def initialize(datatype, allowable_values)
|
38
|
-
@allowable_values = allowable_values.map do |value|
|
39
|
-
case datatype.to_s
|
40
|
-
when /Integer/i
|
41
|
-
value.to_i
|
42
|
-
when /Float/i
|
43
|
-
value.to_f
|
44
|
-
else
|
45
|
-
value
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def valid?(value)
|
51
|
-
!value || allowable_values.include?(value)
|
52
|
-
end
|
53
|
-
end
|
54
33
|
|
55
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
56
35
|
def self.attribute_map
|
@@ -122,21 +101,9 @@ module SquareConnect
|
|
122
101
|
# Check to see if the all the properties in the model are valid
|
123
102
|
# @return true if the model is valid
|
124
103
|
def valid?
|
125
|
-
status_validator = EnumAttributeValidator.new('String', ["FAILED", "SENT"])
|
126
|
-
return false unless status_validator.valid?(@status)
|
127
104
|
return true
|
128
105
|
end
|
129
106
|
|
130
|
-
# Custom attribute writer method checking allowed values (enum).
|
131
|
-
# @param [Object] status Object to be assigned
|
132
|
-
def status=(status)
|
133
|
-
validator = EnumAttributeValidator.new('String', ["FAILED", "SENT"])
|
134
|
-
unless validator.valid?(status)
|
135
|
-
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
136
|
-
end
|
137
|
-
@status = status
|
138
|
-
end
|
139
|
-
|
140
107
|
# Checks equality by comparing each attribute.
|
141
108
|
# @param [Object] Object to be compared
|
142
109
|
def ==(o)
|