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
@@ -24,27 +24,6 @@ module SquareConnect
|
|
24
24
|
# A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
|
25
25
|
attr_accessor :cursor
|
26
26
|
|
27
|
-
class EnumAttributeValidator
|
28
|
-
attr_reader :datatype
|
29
|
-
attr_reader :allowable_values
|
30
|
-
|
31
|
-
def initialize(datatype, allowable_values)
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
33
|
-
case datatype.to_s
|
34
|
-
when /Integer/i
|
35
|
-
value.to_i
|
36
|
-
when /Float/i
|
37
|
-
value.to_f
|
38
|
-
else
|
39
|
-
value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def valid?(value)
|
45
|
-
!value || allowable_values.include?(value)
|
46
|
-
end
|
47
|
-
end
|
48
27
|
|
49
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
50
29
|
def self.attribute_map
|
@@ -102,21 +81,9 @@ module SquareConnect
|
|
102
81
|
# Check to see if the all the properties in the model are valid
|
103
82
|
# @return true if the model is valid
|
104
83
|
def valid?
|
105
|
-
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
106
|
-
return false unless sort_order_validator.valid?(@sort_order)
|
107
84
|
return true
|
108
85
|
end
|
109
86
|
|
110
|
-
# Custom attribute writer method checking allowed values (enum).
|
111
|
-
# @param [Object] sort_order Object to be assigned
|
112
|
-
def sort_order=(sort_order)
|
113
|
-
validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
114
|
-
unless validator.valid?(sort_order)
|
115
|
-
fail ArgumentError, "invalid value for 'sort_order', must be one of #{validator.allowable_values}."
|
116
|
-
end
|
117
|
-
@sort_order = sort_order
|
118
|
-
end
|
119
|
-
|
120
87
|
# Checks equality by comparing each attribute.
|
121
88
|
# @param [Object] Object to be compared
|
122
89
|
def ==(o)
|
@@ -24,27 +24,6 @@ module SquareConnect
|
|
24
24
|
# A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
|
25
25
|
attr_accessor :cursor
|
26
26
|
|
27
|
-
class EnumAttributeValidator
|
28
|
-
attr_reader :datatype
|
29
|
-
attr_reader :allowable_values
|
30
|
-
|
31
|
-
def initialize(datatype, allowable_values)
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
33
|
-
case datatype.to_s
|
34
|
-
when /Integer/i
|
35
|
-
value.to_i
|
36
|
-
when /Float/i
|
37
|
-
value.to_f
|
38
|
-
else
|
39
|
-
value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def valid?(value)
|
45
|
-
!value || allowable_values.include?(value)
|
46
|
-
end
|
47
|
-
end
|
48
27
|
|
49
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
50
29
|
def self.attribute_map
|
@@ -102,21 +81,9 @@ module SquareConnect
|
|
102
81
|
# Check to see if the all the properties in the model are valid
|
103
82
|
# @return true if the model is valid
|
104
83
|
def valid?
|
105
|
-
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
106
|
-
return false unless sort_order_validator.valid?(@sort_order)
|
107
84
|
return true
|
108
85
|
end
|
109
86
|
|
110
|
-
# Custom attribute writer method checking allowed values (enum).
|
111
|
-
# @param [Object] sort_order Object to be assigned
|
112
|
-
def sort_order=(sort_order)
|
113
|
-
validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
114
|
-
unless validator.valid?(sort_order)
|
115
|
-
fail ArgumentError, "invalid value for 'sort_order', must be one of #{validator.allowable_values}."
|
116
|
-
end
|
117
|
-
@sort_order = sort_order
|
118
|
-
end
|
119
|
-
|
120
87
|
# Checks equality by comparing each attribute.
|
121
88
|
# @param [Object] Object to be compared
|
122
89
|
def ==(o)
|
@@ -21,27 +21,6 @@ module SquareConnect
|
|
21
21
|
# Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. See [SortOrder](#type-sortorder) for possible values
|
22
22
|
attr_accessor :sort_order
|
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
|
-
sort_field_validator = EnumAttributeValidator.new('String', ["DEFAULT", "CREATED_AT"])
|
97
|
-
return false unless sort_field_validator.valid?(@sort_field)
|
98
|
-
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
99
|
-
return false unless sort_order_validator.valid?(@sort_order)
|
100
75
|
return true
|
101
76
|
end
|
102
77
|
|
103
|
-
# Custom attribute writer method checking allowed values (enum).
|
104
|
-
# @param [Object] sort_field Object to be assigned
|
105
|
-
def sort_field=(sort_field)
|
106
|
-
validator = EnumAttributeValidator.new('String', ["DEFAULT", "CREATED_AT"])
|
107
|
-
unless validator.valid?(sort_field)
|
108
|
-
fail ArgumentError, "invalid value for 'sort_field', must be one of #{validator.allowable_values}."
|
109
|
-
end
|
110
|
-
@sort_field = sort_field
|
111
|
-
end
|
112
|
-
|
113
|
-
# Custom attribute writer method checking allowed values (enum).
|
114
|
-
# @param [Object] sort_order Object to be assigned
|
115
|
-
def sort_order=(sort_order)
|
116
|
-
validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
117
|
-
unless validator.valid?(sort_order)
|
118
|
-
fail ArgumentError, "invalid value for 'sort_order', must be one of #{validator.allowable_values}."
|
119
|
-
end
|
120
|
-
@sort_order = sort_order
|
121
|
-
end
|
122
|
-
|
123
78
|
# Checks equality by comparing each attribute.
|
124
79
|
# @param [Object] Object to be compared
|
125
80
|
def ==(o)
|
@@ -24,27 +24,6 @@ module SquareConnect
|
|
24
24
|
# The token required to retrieve the specified page of results.
|
25
25
|
attr_accessor :cursor
|
26
26
|
|
27
|
-
class EnumAttributeValidator
|
28
|
-
attr_reader :datatype
|
29
|
-
attr_reader :allowable_values
|
30
|
-
|
31
|
-
def initialize(datatype, allowable_values)
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
33
|
-
case datatype.to_s
|
34
|
-
when /Integer/i
|
35
|
-
value.to_i
|
36
|
-
when /Float/i
|
37
|
-
value.to_f
|
38
|
-
else
|
39
|
-
value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def valid?(value)
|
45
|
-
!value || allowable_values.include?(value)
|
46
|
-
end
|
47
|
-
end
|
48
27
|
|
49
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
50
29
|
def self.attribute_map
|
@@ -102,21 +81,9 @@ module SquareConnect
|
|
102
81
|
# Check to see if the all the properties in the model are valid
|
103
82
|
# @return true if the model is valid
|
104
83
|
def valid?
|
105
|
-
status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
|
106
|
-
return false unless status_validator.valid?(@status)
|
107
84
|
return true
|
108
85
|
end
|
109
86
|
|
110
|
-
# Custom attribute writer method checking allowed values (enum).
|
111
|
-
# @param [Object] status Object to be assigned
|
112
|
-
def status=(status)
|
113
|
-
validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
|
114
|
-
unless validator.valid?(status)
|
115
|
-
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
116
|
-
end
|
117
|
-
@status = status
|
118
|
-
end
|
119
|
-
|
120
87
|
# Checks equality by comparing each attribute.
|
121
88
|
# @param [Object] Object to be compared
|
122
89
|
def ==(o)
|
@@ -24,27 +24,6 @@ module SquareConnect
|
|
24
24
|
# A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
|
25
25
|
attr_accessor :cursor
|
26
26
|
|
27
|
-
class EnumAttributeValidator
|
28
|
-
attr_reader :datatype
|
29
|
-
attr_reader :allowable_values
|
30
|
-
|
31
|
-
def initialize(datatype, allowable_values)
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
33
|
-
case datatype.to_s
|
34
|
-
when /Integer/i
|
35
|
-
value.to_i
|
36
|
-
when /Float/i
|
37
|
-
value.to_f
|
38
|
-
else
|
39
|
-
value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def valid?(value)
|
45
|
-
!value || allowable_values.include?(value)
|
46
|
-
end
|
47
|
-
end
|
48
27
|
|
49
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
50
29
|
def self.attribute_map
|
@@ -102,21 +81,9 @@ module SquareConnect
|
|
102
81
|
# Check to see if the all the properties in the model are valid
|
103
82
|
# @return true if the model is valid
|
104
83
|
def valid?
|
105
|
-
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
106
|
-
return false unless sort_order_validator.valid?(@sort_order)
|
107
84
|
return true
|
108
85
|
end
|
109
86
|
|
110
|
-
# Custom attribute writer method checking allowed values (enum).
|
111
|
-
# @param [Object] sort_order Object to be assigned
|
112
|
-
def sort_order=(sort_order)
|
113
|
-
validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
114
|
-
unless validator.valid?(sort_order)
|
115
|
-
fail ArgumentError, "invalid value for 'sort_order', must be one of #{validator.allowable_values}."
|
116
|
-
end
|
117
|
-
@sort_order = sort_order
|
118
|
-
end
|
119
|
-
|
120
87
|
# Checks equality by comparing each attribute.
|
121
88
|
# @param [Object] Object to be compared
|
122
89
|
def ==(o)
|
@@ -24,27 +24,6 @@ module SquareConnect
|
|
24
24
|
# A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
|
25
25
|
attr_accessor :cursor
|
26
26
|
|
27
|
-
class EnumAttributeValidator
|
28
|
-
attr_reader :datatype
|
29
|
-
attr_reader :allowable_values
|
30
|
-
|
31
|
-
def initialize(datatype, allowable_values)
|
32
|
-
@allowable_values = allowable_values.map do |value|
|
33
|
-
case datatype.to_s
|
34
|
-
when /Integer/i
|
35
|
-
value.to_i
|
36
|
-
when /Float/i
|
37
|
-
value.to_f
|
38
|
-
else
|
39
|
-
value
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def valid?(value)
|
45
|
-
!value || allowable_values.include?(value)
|
46
|
-
end
|
47
|
-
end
|
48
27
|
|
49
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
50
29
|
def self.attribute_map
|
@@ -102,21 +81,9 @@ module SquareConnect
|
|
102
81
|
# Check to see if the all the properties in the model are valid
|
103
82
|
# @return true if the model is valid
|
104
83
|
def valid?
|
105
|
-
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
106
|
-
return false unless sort_order_validator.valid?(@sort_order)
|
107
84
|
return true
|
108
85
|
end
|
109
86
|
|
110
|
-
# Custom attribute writer method checking allowed values (enum).
|
111
|
-
# @param [Object] sort_order Object to be assigned
|
112
|
-
def sort_order=(sort_order)
|
113
|
-
validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
114
|
-
unless validator.valid?(sort_order)
|
115
|
-
fail ArgumentError, "invalid value for 'sort_order', must be one of #{validator.allowable_values}."
|
116
|
-
end
|
117
|
-
@sort_order = sort_order
|
118
|
-
end
|
119
|
-
|
120
87
|
# Checks equality by comparing each attribute.
|
121
88
|
# @param [Object] Object to be compared
|
122
89
|
def ==(o)
|
@@ -78,27 +78,6 @@ module SquareConnect
|
|
78
78
|
# The physical coordinates (latitude and longitude) of the location.
|
79
79
|
attr_accessor :coordinates
|
80
80
|
|
81
|
-
class EnumAttributeValidator
|
82
|
-
attr_reader :datatype
|
83
|
-
attr_reader :allowable_values
|
84
|
-
|
85
|
-
def initialize(datatype, allowable_values)
|
86
|
-
@allowable_values = allowable_values.map do |value|
|
87
|
-
case datatype.to_s
|
88
|
-
when /Integer/i
|
89
|
-
value.to_i
|
90
|
-
when /Float/i
|
91
|
-
value.to_f
|
92
|
-
else
|
93
|
-
value
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
def valid?(value)
|
99
|
-
!value || allowable_values.include?(value)
|
100
|
-
end
|
101
|
-
end
|
102
81
|
|
103
82
|
# Attribute mapping from ruby-style variable name to JSON key.
|
104
83
|
def self.attribute_map
|
@@ -266,57 +245,9 @@ module SquareConnect
|
|
266
245
|
# Check to see if the all the properties in the model are valid
|
267
246
|
# @return true if the model is valid
|
268
247
|
def valid?
|
269
|
-
status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
|
270
|
-
return false unless status_validator.valid?(@status)
|
271
|
-
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"])
|
272
|
-
return false unless country_validator.valid?(@country)
|
273
|
-
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"])
|
274
|
-
return false unless currency_validator.valid?(@currency)
|
275
|
-
type_validator = EnumAttributeValidator.new('String', ["PHYSICAL", "MOBILE"])
|
276
|
-
return false unless type_validator.valid?(@type)
|
277
248
|
return true
|
278
249
|
end
|
279
250
|
|
280
|
-
# Custom attribute writer method checking allowed values (enum).
|
281
|
-
# @param [Object] status Object to be assigned
|
282
|
-
def status=(status)
|
283
|
-
validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
|
284
|
-
unless validator.valid?(status)
|
285
|
-
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
286
|
-
end
|
287
|
-
@status = status
|
288
|
-
end
|
289
|
-
|
290
|
-
# Custom attribute writer method checking allowed values (enum).
|
291
|
-
# @param [Object] country Object to be assigned
|
292
|
-
def country=(country)
|
293
|
-
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"])
|
294
|
-
unless validator.valid?(country)
|
295
|
-
fail ArgumentError, "invalid value for 'country', must be one of #{validator.allowable_values}."
|
296
|
-
end
|
297
|
-
@country = country
|
298
|
-
end
|
299
|
-
|
300
|
-
# Custom attribute writer method checking allowed values (enum).
|
301
|
-
# @param [Object] currency Object to be assigned
|
302
|
-
def currency=(currency)
|
303
|
-
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"])
|
304
|
-
unless validator.valid?(currency)
|
305
|
-
fail ArgumentError, "invalid value for 'currency', must be one of #{validator.allowable_values}."
|
306
|
-
end
|
307
|
-
@currency = currency
|
308
|
-
end
|
309
|
-
|
310
|
-
# Custom attribute writer method checking allowed values (enum).
|
311
|
-
# @param [Object] type Object to be assigned
|
312
|
-
def type=(type)
|
313
|
-
validator = EnumAttributeValidator.new('String', ["PHYSICAL", "MOBILE"])
|
314
|
-
unless validator.valid?(type)
|
315
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
316
|
-
end
|
317
|
-
@type = type
|
318
|
-
end
|
319
|
-
|
320
251
|
# Checks equality by comparing each attribute.
|
321
252
|
# @param [Object] Object to be compared
|
322
253
|
def ==(o)
|
@@ -30,27 +30,6 @@ module SquareConnect
|
|
30
30
|
# Reserved for API integrations that lack the ability to specify a real measurement unit See [MeasurementUnitGeneric](#type-measurementunitgeneric) for possible values
|
31
31
|
attr_accessor :generic_unit
|
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,69 +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
|
-
area_unit_validator = EnumAttributeValidator.new('String', ["IMPERIAL_ACRE", "IMPERIAL_SQUARE_INCH", "IMPERIAL_SQUARE_FOOT", "IMPERIAL_SQUARE_YARD", "IMPERIAL_SQUARE_MILE", "METRIC_SQUARE_CENTIMETER", "METRIC_SQUARE_METER", "METRIC_SQUARE_KILOMETER"])
|
124
|
-
return false unless area_unit_validator.valid?(@area_unit)
|
125
|
-
length_unit_validator = EnumAttributeValidator.new('String', ["IMPERIAL_INCH", "IMPERIAL_FOOT", "IMPERIAL_YARD", "IMPERIAL_MILE", "METRIC_MILLIMETER", "METRIC_CENTIMETER", "METRIC_METER", "METRIC_KILOMETER"])
|
126
|
-
return false unless length_unit_validator.valid?(@length_unit)
|
127
|
-
volume_unit_validator = EnumAttributeValidator.new('String', ["GENERIC_FLUID_OUNCE", "GENERIC_SHOT", "GENERIC_CUP", "GENERIC_PINT", "GENERIC_QUART", "GENERIC_GALLON", "IMPERIAL_CUBIC_INCH", "IMPERIAL_CUBIC_FOOT", "IMPERIAL_CUBIC_YARD", "METRIC_MILLILITER", "METRIC_LITER"])
|
128
|
-
return false unless volume_unit_validator.valid?(@volume_unit)
|
129
|
-
weight_unit_validator = EnumAttributeValidator.new('String', ["IMPERIAL_WEIGHT_OUNCE", "IMPERIAL_POUND", "IMPERIAL_STONE", "METRIC_MILLIGRAM", "METRIC_GRAM", "METRIC_KILOGRAM"])
|
130
|
-
return false unless weight_unit_validator.valid?(@weight_unit)
|
131
|
-
generic_unit_validator = EnumAttributeValidator.new('String', ["INVALID_GENERIC_UNIT", "UNIT"])
|
132
|
-
return false unless generic_unit_validator.valid?(@generic_unit)
|
133
102
|
return true
|
134
103
|
end
|
135
104
|
|
136
|
-
# Custom attribute writer method checking allowed values (enum).
|
137
|
-
# @param [Object] area_unit Object to be assigned
|
138
|
-
def area_unit=(area_unit)
|
139
|
-
validator = EnumAttributeValidator.new('String', ["IMPERIAL_ACRE", "IMPERIAL_SQUARE_INCH", "IMPERIAL_SQUARE_FOOT", "IMPERIAL_SQUARE_YARD", "IMPERIAL_SQUARE_MILE", "METRIC_SQUARE_CENTIMETER", "METRIC_SQUARE_METER", "METRIC_SQUARE_KILOMETER"])
|
140
|
-
unless validator.valid?(area_unit)
|
141
|
-
fail ArgumentError, "invalid value for 'area_unit', must be one of #{validator.allowable_values}."
|
142
|
-
end
|
143
|
-
@area_unit = area_unit
|
144
|
-
end
|
145
|
-
|
146
|
-
# Custom attribute writer method checking allowed values (enum).
|
147
|
-
# @param [Object] length_unit Object to be assigned
|
148
|
-
def length_unit=(length_unit)
|
149
|
-
validator = EnumAttributeValidator.new('String', ["IMPERIAL_INCH", "IMPERIAL_FOOT", "IMPERIAL_YARD", "IMPERIAL_MILE", "METRIC_MILLIMETER", "METRIC_CENTIMETER", "METRIC_METER", "METRIC_KILOMETER"])
|
150
|
-
unless validator.valid?(length_unit)
|
151
|
-
fail ArgumentError, "invalid value for 'length_unit', must be one of #{validator.allowable_values}."
|
152
|
-
end
|
153
|
-
@length_unit = length_unit
|
154
|
-
end
|
155
|
-
|
156
|
-
# Custom attribute writer method checking allowed values (enum).
|
157
|
-
# @param [Object] volume_unit Object to be assigned
|
158
|
-
def volume_unit=(volume_unit)
|
159
|
-
validator = EnumAttributeValidator.new('String', ["GENERIC_FLUID_OUNCE", "GENERIC_SHOT", "GENERIC_CUP", "GENERIC_PINT", "GENERIC_QUART", "GENERIC_GALLON", "IMPERIAL_CUBIC_INCH", "IMPERIAL_CUBIC_FOOT", "IMPERIAL_CUBIC_YARD", "METRIC_MILLILITER", "METRIC_LITER"])
|
160
|
-
unless validator.valid?(volume_unit)
|
161
|
-
fail ArgumentError, "invalid value for 'volume_unit', must be one of #{validator.allowable_values}."
|
162
|
-
end
|
163
|
-
@volume_unit = volume_unit
|
164
|
-
end
|
165
|
-
|
166
|
-
# Custom attribute writer method checking allowed values (enum).
|
167
|
-
# @param [Object] weight_unit Object to be assigned
|
168
|
-
def weight_unit=(weight_unit)
|
169
|
-
validator = EnumAttributeValidator.new('String', ["IMPERIAL_WEIGHT_OUNCE", "IMPERIAL_POUND", "IMPERIAL_STONE", "METRIC_MILLIGRAM", "METRIC_GRAM", "METRIC_KILOGRAM"])
|
170
|
-
unless validator.valid?(weight_unit)
|
171
|
-
fail ArgumentError, "invalid value for 'weight_unit', must be one of #{validator.allowable_values}."
|
172
|
-
end
|
173
|
-
@weight_unit = weight_unit
|
174
|
-
end
|
175
|
-
|
176
|
-
# Custom attribute writer method checking allowed values (enum).
|
177
|
-
# @param [Object] generic_unit Object to be assigned
|
178
|
-
def generic_unit=(generic_unit)
|
179
|
-
validator = EnumAttributeValidator.new('String', ["INVALID_GENERIC_UNIT", "UNIT"])
|
180
|
-
unless validator.valid?(generic_unit)
|
181
|
-
fail ArgumentError, "invalid value for 'generic_unit', must be one of #{validator.allowable_values}."
|
182
|
-
end
|
183
|
-
@generic_unit = generic_unit
|
184
|
-
end
|
185
|
-
|
186
105
|
# Checks equality by comparing each attribute.
|
187
106
|
# @param [Object] Object to be compared
|
188
107
|
def ==(o)
|