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 order in which results are returned. Defaults to DESC. See [SortOrder](#type-sortorder) for possible values
|
19
19
|
attr_accessor :order
|
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,33 +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
|
-
field_validator = EnumAttributeValidator.new('String', ["START_AT", "END_AT", "CREATED_AT", "UPDATED_AT"])
|
88
|
-
return false unless field_validator.valid?(@field)
|
89
|
-
order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
90
|
-
return false unless order_validator.valid?(@order)
|
91
66
|
return true
|
92
67
|
end
|
93
68
|
|
94
|
-
# Custom attribute writer method checking allowed values (enum).
|
95
|
-
# @param [Object] field Object to be assigned
|
96
|
-
def field=(field)
|
97
|
-
validator = EnumAttributeValidator.new('String', ["START_AT", "END_AT", "CREATED_AT", "UPDATED_AT"])
|
98
|
-
unless validator.valid?(field)
|
99
|
-
fail ArgumentError, "invalid value for 'field', must be one of #{validator.allowable_values}."
|
100
|
-
end
|
101
|
-
@field = field
|
102
|
-
end
|
103
|
-
|
104
|
-
# Custom attribute writer method checking allowed values (enum).
|
105
|
-
# @param [Object] order Object to be assigned
|
106
|
-
def order=(order)
|
107
|
-
validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
108
|
-
unless validator.valid?(order)
|
109
|
-
fail ArgumentError, "invalid value for 'order', must be one of #{validator.allowable_values}."
|
110
|
-
end
|
111
|
-
@order = order
|
112
|
-
end
|
113
|
-
|
114
69
|
# Checks equality by comparing each attribute.
|
115
70
|
# @param [Object] Object to be compared
|
116
71
|
def ==(o)
|
@@ -21,27 +21,6 @@ module SquareConnect
|
|
21
21
|
# Location-specific timezones convert workdays to datetime filters. Every location included in the query must have a timezone, or this field must be provided as a fallback. Format: the IANA timezone database identifier for the relevant timezone.
|
22
22
|
attr_accessor :default_timezone
|
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,21 +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
|
-
match_shifts_by_validator = EnumAttributeValidator.new('String', ["START_AT", "END_AT", "INTERSECTION"])
|
97
|
-
return false unless match_shifts_by_validator.valid?(@match_shifts_by)
|
98
75
|
return true
|
99
76
|
end
|
100
77
|
|
101
|
-
# Custom attribute writer method checking allowed values (enum).
|
102
|
-
# @param [Object] match_shifts_by Object to be assigned
|
103
|
-
def match_shifts_by=(match_shifts_by)
|
104
|
-
validator = EnumAttributeValidator.new('String', ["START_AT", "END_AT", "INTERSECTION"])
|
105
|
-
unless validator.valid?(match_shifts_by)
|
106
|
-
fail ArgumentError, "invalid value for 'match_shifts_by', must be one of #{validator.allowable_values}."
|
107
|
-
end
|
108
|
-
@match_shifts_by = match_shifts_by
|
109
|
-
end
|
110
|
-
|
111
78
|
# Checks equality by comparing each attribute.
|
112
79
|
# @param [Object] Object to be compared
|
113
80
|
def ==(o)
|
@@ -21,27 +21,6 @@ module SquareConnect
|
|
21
21
|
# Read-only display name assigned to the application (e.g. `\"Custom Application\"`, `\"Square POS 4.74 for Android\"`).
|
22
22
|
attr_accessor :name
|
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,21 +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
|
-
product_validator = EnumAttributeValidator.new('String', ["SQUARE_POS", "EXTERNAL_API", "BILLING", "APPOINTMENTS", "INVOICES", "ONLINE_STORE", "PAYROLL", "DASHBOARD", "ITEM_LIBRARY_IMPORT", "OTHER"])
|
97
|
-
return false unless product_validator.valid?(@product)
|
98
75
|
return true
|
99
76
|
end
|
100
77
|
|
101
|
-
# Custom attribute writer method checking allowed values (enum).
|
102
|
-
# @param [Object] product Object to be assigned
|
103
|
-
def product=(product)
|
104
|
-
validator = EnumAttributeValidator.new('String', ["SQUARE_POS", "EXTERNAL_API", "BILLING", "APPOINTMENTS", "INVOICES", "ONLINE_STORE", "PAYROLL", "DASHBOARD", "ITEM_LIBRARY_IMPORT", "OTHER"])
|
105
|
-
unless validator.valid?(product)
|
106
|
-
fail ArgumentError, "invalid value for 'product', must be one of #{validator.allowable_values}."
|
107
|
-
end
|
108
|
-
@product = product
|
109
|
-
end
|
110
|
-
|
111
78
|
# Checks equality by comparing each attribute.
|
112
79
|
# @param [Object] Object to be compared
|
113
80
|
def ==(o)
|
@@ -51,27 +51,6 @@ module SquareConnect
|
|
51
51
|
# Additional recipients (other than the merchant) receiving a portion of this tender. For example, fees assessed on the purchase by a third party integration.
|
52
52
|
attr_accessor :additional_recipients
|
53
53
|
|
54
|
-
class EnumAttributeValidator
|
55
|
-
attr_reader :datatype
|
56
|
-
attr_reader :allowable_values
|
57
|
-
|
58
|
-
def initialize(datatype, allowable_values)
|
59
|
-
@allowable_values = allowable_values.map do |value|
|
60
|
-
case datatype.to_s
|
61
|
-
when /Integer/i
|
62
|
-
value.to_i
|
63
|
-
when /Float/i
|
64
|
-
value.to_f
|
65
|
-
else
|
66
|
-
value
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def valid?(value)
|
72
|
-
!value || allowable_values.include?(value)
|
73
|
-
end
|
74
|
-
end
|
75
54
|
|
76
55
|
# Attribute mapping from ruby-style variable name to JSON key.
|
77
56
|
def self.attribute_map
|
@@ -190,21 +169,9 @@ module SquareConnect
|
|
190
169
|
# @return true if the model is valid
|
191
170
|
def valid?
|
192
171
|
return false if @type.nil?
|
193
|
-
type_validator = EnumAttributeValidator.new('String', ["CARD", "CASH", "THIRD_PARTY_CARD", "SQUARE_GIFT_CARD", "NO_SALE", "OTHER"])
|
194
|
-
return false unless type_validator.valid?(@type)
|
195
172
|
return true
|
196
173
|
end
|
197
174
|
|
198
|
-
# Custom attribute writer method checking allowed values (enum).
|
199
|
-
# @param [Object] type Object to be assigned
|
200
|
-
def type=(type)
|
201
|
-
validator = EnumAttributeValidator.new('String', ["CARD", "CASH", "THIRD_PARTY_CARD", "SQUARE_GIFT_CARD", "NO_SALE", "OTHER"])
|
202
|
-
unless validator.valid?(type)
|
203
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
204
|
-
end
|
205
|
-
@type = type
|
206
|
-
end
|
207
|
-
|
208
175
|
# Checks equality by comparing each attribute.
|
209
176
|
# @param [Object] Object to be compared
|
210
177
|
def ==(o)
|
@@ -21,27 +21,6 @@ module SquareConnect
|
|
21
21
|
# The method used to enter the card's details for the transaction. See [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) for possible values
|
22
22
|
attr_accessor :entry_method
|
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
|
-
status_validator = EnumAttributeValidator.new('String', ["AUTHORIZED", "CAPTURED", "VOIDED", "FAILED"])
|
97
|
-
return false unless status_validator.valid?(@status)
|
98
|
-
entry_method_validator = EnumAttributeValidator.new('String', ["SWIPED", "KEYED", "EMV", "ON_FILE", "CONTACTLESS"])
|
99
|
-
return false unless entry_method_validator.valid?(@entry_method)
|
100
75
|
return true
|
101
76
|
end
|
102
77
|
|
103
|
-
# Custom attribute writer method checking allowed values (enum).
|
104
|
-
# @param [Object] status Object to be assigned
|
105
|
-
def status=(status)
|
106
|
-
validator = EnumAttributeValidator.new('String', ["AUTHORIZED", "CAPTURED", "VOIDED", "FAILED"])
|
107
|
-
unless validator.valid?(status)
|
108
|
-
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
109
|
-
end
|
110
|
-
@status = status
|
111
|
-
end
|
112
|
-
|
113
|
-
# Custom attribute writer method checking allowed values (enum).
|
114
|
-
# @param [Object] entry_method Object to be assigned
|
115
|
-
def entry_method=(entry_method)
|
116
|
-
validator = EnumAttributeValidator.new('String', ["SWIPED", "KEYED", "EMV", "ON_FILE", "CONTACTLESS"])
|
117
|
-
unless validator.valid?(entry_method)
|
118
|
-
fail ArgumentError, "invalid value for 'entry_method', must be one of #{validator.allowable_values}."
|
119
|
-
end
|
120
|
-
@entry_method = entry_method
|
121
|
-
end
|
122
|
-
|
123
78
|
# Checks equality by comparing each attribute.
|
124
79
|
# @param [Object] Object to be compared
|
125
80
|
def ==(o)
|
@@ -42,27 +42,6 @@ module SquareConnect
|
|
42
42
|
# The order_id is an identifier for the order associated with this transaction, if any.
|
43
43
|
attr_accessor :order_id
|
44
44
|
|
45
|
-
class EnumAttributeValidator
|
46
|
-
attr_reader :datatype
|
47
|
-
attr_reader :allowable_values
|
48
|
-
|
49
|
-
def initialize(datatype, allowable_values)
|
50
|
-
@allowable_values = allowable_values.map do |value|
|
51
|
-
case datatype.to_s
|
52
|
-
when /Integer/i
|
53
|
-
value.to_i
|
54
|
-
when /Float/i
|
55
|
-
value.to_f
|
56
|
-
else
|
57
|
-
value
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def valid?(value)
|
63
|
-
!value || allowable_values.include?(value)
|
64
|
-
end
|
65
|
-
end
|
66
45
|
|
67
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
68
47
|
def self.attribute_map
|
@@ -160,21 +139,9 @@ module SquareConnect
|
|
160
139
|
# Check to see if the all the properties in the model are valid
|
161
140
|
# @return true if the model is valid
|
162
141
|
def valid?
|
163
|
-
product_validator = EnumAttributeValidator.new('String', ["REGISTER", "EXTERNAL_API", "BILLING", "APPOINTMENTS", "INVOICES", "ONLINE_STORE", "PAYROLL", "OTHER"])
|
164
|
-
return false unless product_validator.valid?(@product)
|
165
142
|
return true
|
166
143
|
end
|
167
144
|
|
168
|
-
# Custom attribute writer method checking allowed values (enum).
|
169
|
-
# @param [Object] product Object to be assigned
|
170
|
-
def product=(product)
|
171
|
-
validator = EnumAttributeValidator.new('String', ["REGISTER", "EXTERNAL_API", "BILLING", "APPOINTMENTS", "INVOICES", "ONLINE_STORE", "PAYROLL", "OTHER"])
|
172
|
-
unless validator.valid?(product)
|
173
|
-
fail ArgumentError, "invalid value for 'product', must be one of #{validator.allowable_values}."
|
174
|
-
end
|
175
|
-
@product = product
|
176
|
-
end
|
177
|
-
|
178
145
|
# Checks equality by comparing each attribute.
|
179
146
|
# @param [Object] Object to be compared
|
180
147
|
def ==(o)
|
@@ -21,27 +21,6 @@ module SquareConnect
|
|
21
21
|
# A note about the inventory adjustment.
|
22
22
|
attr_accessor :memo
|
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,21 +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
|
-
adjustment_type_validator = EnumAttributeValidator.new('String', ["SALE", "RECEIVE_STOCK", "MANUAL_ADJUST"])
|
97
|
-
return false unless adjustment_type_validator.valid?(@adjustment_type)
|
98
75
|
return true
|
99
76
|
end
|
100
77
|
|
101
|
-
# Custom attribute writer method checking allowed values (enum).
|
102
|
-
# @param [Object] adjustment_type Object to be assigned
|
103
|
-
def adjustment_type=(adjustment_type)
|
104
|
-
validator = EnumAttributeValidator.new('String', ["SALE", "RECEIVE_STOCK", "MANUAL_ADJUST"])
|
105
|
-
unless validator.valid?(adjustment_type)
|
106
|
-
fail ArgumentError, "invalid value for 'adjustment_type', must be one of #{validator.allowable_values}."
|
107
|
-
end
|
108
|
-
@adjustment_type = adjustment_type
|
109
|
-
end
|
110
|
-
|
111
78
|
# Checks equality by comparing each attribute.
|
112
79
|
# @param [Object] Object to be compared
|
113
80
|
def ==(o)
|
@@ -36,27 +36,6 @@ module SquareConnect
|
|
36
36
|
# The bank account's type (for example, savings or checking). See [V1BankAccountType](#type-v1bankaccounttype) for possible values
|
37
37
|
attr_accessor :type
|
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
|
@@ -138,21 +117,9 @@ module SquareConnect
|
|
138
117
|
# Check to see if the all the properties in the model are valid
|
139
118
|
# @return true if the model is valid
|
140
119
|
def valid?
|
141
|
-
type_validator = EnumAttributeValidator.new('String', ["BUSINESS_CHECKING", "CHECKING", "INVESTMENT", "LOAN", "SAVINGS", "OTHER"])
|
142
|
-
return false unless type_validator.valid?(@type)
|
143
120
|
return true
|
144
121
|
end
|
145
122
|
|
146
|
-
# Custom attribute writer method checking allowed values (enum).
|
147
|
-
# @param [Object] type Object to be assigned
|
148
|
-
def type=(type)
|
149
|
-
validator = EnumAttributeValidator.new('String', ["BUSINESS_CHECKING", "CHECKING", "INVESTMENT", "LOAN", "SAVINGS", "OTHER"])
|
150
|
-
unless validator.valid?(type)
|
151
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
152
|
-
end
|
153
|
-
@type = type
|
154
|
-
end
|
155
|
-
|
156
123
|
# Checks equality by comparing each attribute.
|
157
124
|
# @param [Object] Object to be compared
|
158
125
|
def ==(o)
|
@@ -30,27 +30,6 @@ module SquareConnect
|
|
30
30
|
# An optional description of the event, entered by the employee that created it.
|
31
31
|
attr_accessor :description
|
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,21 +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
|
-
event_type_validator = EnumAttributeValidator.new('String', ["NO_SALE", "CASH_TENDER_PAYMENT", "OTHER_TENDER_PAYMENT", "CASH_TENDER_CANCELED_PAYMENT", "OTHER_TENDER_CANCELED_PAYMENT", "CASH_TENDER_REFUND", "OTHER_TENDER_REFUND", "PAID_IN", "PAID_OUT"])
|
124
|
-
return false unless event_type_validator.valid?(@event_type)
|
125
102
|
return true
|
126
103
|
end
|
127
104
|
|
128
|
-
# Custom attribute writer method checking allowed values (enum).
|
129
|
-
# @param [Object] event_type Object to be assigned
|
130
|
-
def event_type=(event_type)
|
131
|
-
validator = EnumAttributeValidator.new('String', ["NO_SALE", "CASH_TENDER_PAYMENT", "OTHER_TENDER_PAYMENT", "CASH_TENDER_CANCELED_PAYMENT", "OTHER_TENDER_CANCELED_PAYMENT", "CASH_TENDER_REFUND", "OTHER_TENDER_REFUND", "PAID_IN", "PAID_OUT"])
|
132
|
-
unless validator.valid?(event_type)
|
133
|
-
fail ArgumentError, "invalid value for 'event_type', must be one of #{validator.allowable_values}."
|
134
|
-
end
|
135
|
-
@event_type = event_type
|
136
|
-
end
|
137
|
-
|
138
105
|
# Checks equality by comparing each attribute.
|
139
106
|
# @param [Object] Object to be compared
|
140
107
|
def ==(o)
|