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
@@ -36,27 +36,6 @@ module SquareConnect
|
|
36
36
|
# 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
|
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
|
@@ -162,11 +141,7 @@ module SquareConnect
|
|
162
141
|
return false if !@source_tax_uid.nil? && @source_tax_uid.to_s.length > 60
|
163
142
|
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
|
164
143
|
return false if !@name.nil? && @name.to_s.length > 255
|
165
|
-
type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"])
|
166
|
-
return false unless type_validator.valid?(@type)
|
167
144
|
return false if !@percentage.nil? && @percentage.to_s.length > 10
|
168
|
-
scope_validator = EnumAttributeValidator.new('String', ["OTHER_TAX_SCOPE", "LINE_ITEM", "ORDER"])
|
169
|
-
return false unless scope_validator.valid?(@scope)
|
170
145
|
return true
|
171
146
|
end
|
172
147
|
|
@@ -214,16 +189,6 @@ module SquareConnect
|
|
214
189
|
@name = name
|
215
190
|
end
|
216
191
|
|
217
|
-
# Custom attribute writer method checking allowed values (enum).
|
218
|
-
# @param [Object] type Object to be assigned
|
219
|
-
def type=(type)
|
220
|
-
validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"])
|
221
|
-
unless validator.valid?(type)
|
222
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
223
|
-
end
|
224
|
-
@type = type
|
225
|
-
end
|
226
|
-
|
227
192
|
# Custom attribute writer method with validation
|
228
193
|
# @param [Object] percentage Value to be assigned
|
229
194
|
def percentage=(percentage)
|
@@ -235,16 +200,6 @@ module SquareConnect
|
|
235
200
|
@percentage = percentage
|
236
201
|
end
|
237
202
|
|
238
|
-
# Custom attribute writer method checking allowed values (enum).
|
239
|
-
# @param [Object] scope Object to be assigned
|
240
|
-
def scope=(scope)
|
241
|
-
validator = EnumAttributeValidator.new('String', ["OTHER_TAX_SCOPE", "LINE_ITEM", "ORDER"])
|
242
|
-
unless validator.valid?(scope)
|
243
|
-
fail ArgumentError, "invalid value for 'scope', must be one of #{validator.allowable_values}."
|
244
|
-
end
|
245
|
-
@scope = scope
|
246
|
-
end
|
247
|
-
|
248
203
|
# Checks equality by comparing each attribute.
|
249
204
|
# @param [Object] Object to be compared
|
250
205
|
def ==(o)
|
@@ -45,27 +45,6 @@ module SquareConnect
|
|
45
45
|
# Taxes applied to the service charge. By default, order-level taxes apply to service charges calculated in the `SUBTOTAL_PHASE` if `taxable` is set to `true`.
|
46
46
|
attr_accessor :taxes
|
47
47
|
|
48
|
-
class EnumAttributeValidator
|
49
|
-
attr_reader :datatype
|
50
|
-
attr_reader :allowable_values
|
51
|
-
|
52
|
-
def initialize(datatype, allowable_values)
|
53
|
-
@allowable_values = allowable_values.map do |value|
|
54
|
-
case datatype.to_s
|
55
|
-
when /Integer/i
|
56
|
-
value.to_i
|
57
|
-
when /Float/i
|
58
|
-
value.to_f
|
59
|
-
else
|
60
|
-
value
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def valid?(value)
|
66
|
-
!value || allowable_values.include?(value)
|
67
|
-
end
|
68
|
-
end
|
69
48
|
|
70
49
|
# Attribute mapping from ruby-style variable name to JSON key.
|
71
50
|
def self.attribute_map
|
@@ -187,8 +166,6 @@ module SquareConnect
|
|
187
166
|
return false if !@name.nil? && @name.to_s.length > 255
|
188
167
|
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
|
189
168
|
return false if !@percentage.nil? && @percentage.to_s.length > 10
|
190
|
-
calculation_phase_validator = EnumAttributeValidator.new('String', ["SUBTOTAL_PHASE", "TOTAL_PHASE"])
|
191
|
-
return false unless calculation_phase_validator.valid?(@calculation_phase)
|
192
169
|
return true
|
193
170
|
end
|
194
171
|
|
@@ -236,16 +213,6 @@ module SquareConnect
|
|
236
213
|
@percentage = percentage
|
237
214
|
end
|
238
215
|
|
239
|
-
# Custom attribute writer method checking allowed values (enum).
|
240
|
-
# @param [Object] calculation_phase Object to be assigned
|
241
|
-
def calculation_phase=(calculation_phase)
|
242
|
-
validator = EnumAttributeValidator.new('String', ["SUBTOTAL_PHASE", "TOTAL_PHASE"])
|
243
|
-
unless validator.valid?(calculation_phase)
|
244
|
-
fail ArgumentError, "invalid value for 'calculation_phase', must be one of #{validator.allowable_values}."
|
245
|
-
end
|
246
|
-
@calculation_phase = calculation_phase
|
247
|
-
end
|
248
|
-
|
249
216
|
# Checks equality by comparing each attribute.
|
250
217
|
# @param [Object] Object to be compared
|
251
218
|
def ==(o)
|
@@ -42,27 +42,6 @@ module SquareConnect
|
|
42
42
|
# Additional recipients (other than the merchant) receiving a portion of this refund. For example, fees assessed on a refund of a purchase by a third party integration.
|
43
43
|
attr_accessor :additional_recipients
|
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
|
@@ -193,21 +172,9 @@ module SquareConnect
|
|
193
172
|
return false if @reason.nil?
|
194
173
|
return false if @amount_money.nil?
|
195
174
|
return false if @status.nil?
|
196
|
-
status_validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED", "REJECTED", "FAILED"])
|
197
|
-
return false unless status_validator.valid?(@status)
|
198
175
|
return true
|
199
176
|
end
|
200
177
|
|
201
|
-
# Custom attribute writer method checking allowed values (enum).
|
202
|
-
# @param [Object] status Object to be assigned
|
203
|
-
def status=(status)
|
204
|
-
validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED", "REJECTED", "FAILED"])
|
205
|
-
unless validator.valid?(status)
|
206
|
-
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
207
|
-
end
|
208
|
-
@status = status
|
209
|
-
end
|
210
|
-
|
211
178
|
# Checks equality by comparing each attribute.
|
212
179
|
# @param [Object] Object to be compared
|
213
180
|
def ==(o)
|
@@ -18,27 +18,6 @@ module SquareConnect
|
|
18
18
|
# Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values
|
19
19
|
attr_accessor :status
|
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
|
@@ -86,21 +65,9 @@ module SquareConnect
|
|
86
65
|
# Check to see if the all the properties in the model are valid
|
87
66
|
# @return true if the model is valid
|
88
67
|
def valid?
|
89
|
-
status_validator = EnumAttributeValidator.new('String', ["PENDING", "VERIFIED"])
|
90
|
-
return false unless status_validator.valid?(@status)
|
91
68
|
return true
|
92
69
|
end
|
93
70
|
|
94
|
-
# Custom attribute writer method checking allowed values (enum).
|
95
|
-
# @param [Object] status Object to be assigned
|
96
|
-
def status=(status)
|
97
|
-
validator = EnumAttributeValidator.new('String', ["PENDING", "VERIFIED"])
|
98
|
-
unless validator.valid?(status)
|
99
|
-
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
100
|
-
end
|
101
|
-
@status = status
|
102
|
-
end
|
103
|
-
|
104
71
|
# Checks equality by comparing each attribute.
|
105
72
|
# @param [Object] Object to be compared
|
106
73
|
def ==(o)
|
@@ -33,27 +33,6 @@ module SquareConnect
|
|
33
33
|
# A limit on the number of results to be returned in a single page. The limit is advisory - the implementation may return more or fewer results. If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored.
|
34
34
|
attr_accessor :limit
|
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
|
@@ -18,27 +18,6 @@ module SquareConnect
|
|
18
18
|
# List of [fulfillment states](#type-orderfulfillmentstate) to filter for. Will return orders if any of its fulfillments match any of the fulfillment states listed in this field. See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values
|
19
19
|
attr_accessor :fulfillment_states
|
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
|
@@ -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 :sort_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
|
@@ -89,33 +68,9 @@ module SquareConnect
|
|
89
68
|
# @return true if the model is valid
|
90
69
|
def valid?
|
91
70
|
return false if @sort_field.nil?
|
92
|
-
sort_field_validator = EnumAttributeValidator.new('String', ["CREATED_AT", "UPDATED_AT", "CLOSED_AT"])
|
93
|
-
return false unless sort_field_validator.valid?(@sort_field)
|
94
|
-
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
95
|
-
return false unless sort_order_validator.valid?(@sort_order)
|
96
71
|
return true
|
97
72
|
end
|
98
73
|
|
99
|
-
# Custom attribute writer method checking allowed values (enum).
|
100
|
-
# @param [Object] sort_field Object to be assigned
|
101
|
-
def sort_field=(sort_field)
|
102
|
-
validator = EnumAttributeValidator.new('String', ["CREATED_AT", "UPDATED_AT", "CLOSED_AT"])
|
103
|
-
unless validator.valid?(sort_field)
|
104
|
-
fail ArgumentError, "invalid value for 'sort_field', must be one of #{validator.allowable_values}."
|
105
|
-
end
|
106
|
-
@sort_field = sort_field
|
107
|
-
end
|
108
|
-
|
109
|
-
# Custom attribute writer method checking allowed values (enum).
|
110
|
-
# @param [Object] sort_order Object to be assigned
|
111
|
-
def sort_order=(sort_order)
|
112
|
-
validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
113
|
-
unless validator.valid?(sort_order)
|
114
|
-
fail ArgumentError, "invalid value for 'sort_order', must be one of #{validator.allowable_values}."
|
115
|
-
end
|
116
|
-
@sort_order = sort_order
|
117
|
-
end
|
118
|
-
|
119
74
|
# Checks equality by comparing each attribute.
|
120
75
|
# @param [Object] Object to be compared
|
121
76
|
def ==(o)
|
@@ -15,27 +15,6 @@ module SquareConnect
|
|
15
15
|
# States to filter for. See [OrderState](#type-orderstate) for possible values
|
16
16
|
attr_accessor :states
|
17
17
|
|
18
|
-
class EnumAttributeValidator
|
19
|
-
attr_reader :datatype
|
20
|
-
attr_reader :allowable_values
|
21
|
-
|
22
|
-
def initialize(datatype, allowable_values)
|
23
|
-
@allowable_values = allowable_values.map do |value|
|
24
|
-
case datatype.to_s
|
25
|
-
when /Integer/i
|
26
|
-
value.to_i
|
27
|
-
when /Float/i
|
28
|
-
value.to_f
|
29
|
-
else
|
30
|
-
value
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def valid?(value)
|
36
|
-
!value || allowable_values.include?(value)
|
37
|
-
end
|
38
|
-
end
|
39
18
|
|
40
19
|
# Attribute mapping from ruby-style variable name to JSON key.
|
41
20
|
def self.attribute_map
|
@@ -48,27 +48,6 @@ module SquareConnect
|
|
48
48
|
# A read-only timestamp in RFC 3339 format; presented in UTC.
|
49
49
|
attr_accessor :updated_at
|
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 @employee_id.to_s.length < 1
|
202
181
|
return false if @start_at.nil?
|
203
182
|
return false if @start_at.to_s.length < 1
|
204
|
-
status_validator = EnumAttributeValidator.new('String', ["OPEN", "CLOSED"])
|
205
|
-
return false unless status_validator.valid?(@status)
|
206
183
|
return true
|
207
184
|
end
|
208
185
|
|
@@ -245,16 +222,6 @@ module SquareConnect
|
|
245
222
|
@start_at = start_at
|
246
223
|
end
|
247
224
|
|
248
|
-
# Custom attribute writer method checking allowed values (enum).
|
249
|
-
# @param [Object] status Object to be assigned
|
250
|
-
def status=(status)
|
251
|
-
validator = EnumAttributeValidator.new('String', ["OPEN", "CLOSED"])
|
252
|
-
unless validator.valid?(status)
|
253
|
-
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
254
|
-
end
|
255
|
-
@status = status
|
256
|
-
end
|
257
|
-
|
258
225
|
# Checks equality by comparing each attribute.
|
259
226
|
# @param [Object] Object to be compared
|
260
227
|
def ==(o)
|
@@ -30,27 +30,6 @@ module SquareConnect
|
|
30
30
|
# Fetch the `Shift`s based on workday date range.
|
31
31
|
attr_accessor :workday
|
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
|
@@ -124,21 +103,9 @@ module SquareConnect
|
|
124
103
|
# Check to see if the all the properties in the model are valid
|
125
104
|
# @return true if the model is valid
|
126
105
|
def valid?
|
127
|
-
status_validator = EnumAttributeValidator.new('String', ["OPEN", "CLOSED"])
|
128
|
-
return false unless status_validator.valid?(@status)
|
129
106
|
return true
|
130
107
|
end
|
131
108
|
|
132
|
-
# Custom attribute writer method checking allowed values (enum).
|
133
|
-
# @param [Object] status Object to be assigned
|
134
|
-
def status=(status)
|
135
|
-
validator = EnumAttributeValidator.new('String', ["OPEN", "CLOSED"])
|
136
|
-
unless validator.valid?(status)
|
137
|
-
fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
|
138
|
-
end
|
139
|
-
@status = status
|
140
|
-
end
|
141
|
-
|
142
109
|
# Checks equality by comparing each attribute.
|
143
110
|
# @param [Object] Object to be compared
|
144
111
|
def ==(o)
|