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
|
# The amount of all Square fees associated with this settlement entry. This value is always negative or zero.
|
25
25
|
attr_accessor :fee_money
|
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
|
-
type_validator = EnumAttributeValidator.new('String', ["ADJUSTMENT", "BALANCE_CHARGE", "CHARGE", "FREE_PROCESSING", "HOLD_ADJUSTMENT", "PAID_SERVICE_FEE", "PAID_SERVICE_FEE_REFUND", "REDEMPTION_CODE", "REFUND", "RETURNED_PAYOUT", "SQUARE_CAPITAL_ADVANCE", "SQUARE_CAPITAL_PAYMENT", "SQUARE_CAPITAL_REVERSED_PAYMENT", "SUBSCRIPTION_FEE", "SUBSCRIPTION_FEE_REFUND", "OTHER", "INCENTED_PAYMENT", "RETURNED_ACH_ENTRY", "RETURNED_SQUARE_275", "SQUARE_275", "SQUARE_CARD"])
|
106
|
-
return false unless type_validator.valid?(@type)
|
107
84
|
return true
|
108
85
|
end
|
109
86
|
|
110
|
-
# Custom attribute writer method checking allowed values (enum).
|
111
|
-
# @param [Object] type Object to be assigned
|
112
|
-
def type=(type)
|
113
|
-
validator = EnumAttributeValidator.new('String', ["ADJUSTMENT", "BALANCE_CHARGE", "CHARGE", "FREE_PROCESSING", "HOLD_ADJUSTMENT", "PAID_SERVICE_FEE", "PAID_SERVICE_FEE_REFUND", "REDEMPTION_CODE", "REFUND", "RETURNED_PAYOUT", "SQUARE_CAPITAL_ADVANCE", "SQUARE_CAPITAL_PAYMENT", "SQUARE_CAPITAL_REVERSED_PAYMENT", "SUBSCRIPTION_FEE", "SUBSCRIPTION_FEE_REFUND", "OTHER", "INCENTED_PAYMENT", "RETURNED_ACH_ENTRY", "RETURNED_SQUARE_275", "SQUARE_275", "SQUARE_CARD"])
|
114
|
-
unless validator.valid?(type)
|
115
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
116
|
-
end
|
117
|
-
@type = type
|
118
|
-
end
|
119
|
-
|
120
87
|
# Checks equality by comparing each attribute.
|
121
88
|
# @param [Object] Object to be compared
|
122
89
|
def ==(o)
|
@@ -60,27 +60,6 @@ module SquareConnect
|
|
60
60
|
# Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange.
|
61
61
|
attr_accessor :is_exchange
|
62
62
|
|
63
|
-
class EnumAttributeValidator
|
64
|
-
attr_reader :datatype
|
65
|
-
attr_reader :allowable_values
|
66
|
-
|
67
|
-
def initialize(datatype, allowable_values)
|
68
|
-
@allowable_values = allowable_values.map do |value|
|
69
|
-
case datatype.to_s
|
70
|
-
when /Integer/i
|
71
|
-
value.to_i
|
72
|
-
when /Float/i
|
73
|
-
value.to_f
|
74
|
-
else
|
75
|
-
value
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
def valid?(value)
|
81
|
-
!value || allowable_values.include?(value)
|
82
|
-
end
|
83
|
-
end
|
84
63
|
|
85
64
|
# Attribute mapping from ruby-style variable name to JSON key.
|
86
65
|
def self.attribute_map
|
@@ -210,45 +189,9 @@ module SquareConnect
|
|
210
189
|
# Check to see if the all the properties in the model are valid
|
211
190
|
# @return true if the model is valid
|
212
191
|
def valid?
|
213
|
-
type_validator = EnumAttributeValidator.new('String', ["CREDIT_CARD", "CASH", "THIRD_PARTY_CARD", "NO_SALE", "SQUARE_WALLET", "SQUARE_GIFT_CARD", "UNKNOWN", "OTHER"])
|
214
|
-
return false unless type_validator.valid?(@type)
|
215
|
-
card_brand_validator = EnumAttributeValidator.new('String', ["OTHER_BRAND", "VISA", "MASTER_CARD", "AMERICAN_EXPRESS", "DISCOVER", "DISCOVER_DINERS", "JCB", "CHINA_UNIONPAY", "SQUARE_GIFT_CARD"])
|
216
|
-
return false unless card_brand_validator.valid?(@card_brand)
|
217
|
-
entry_method_validator = EnumAttributeValidator.new('String', ["MANUAL", "SCANNED", "SQUARE_CASH", "SQUARE_WALLET", "SWIPED", "WEB_FORM", "OTHER"])
|
218
|
-
return false unless entry_method_validator.valid?(@entry_method)
|
219
192
|
return true
|
220
193
|
end
|
221
194
|
|
222
|
-
# Custom attribute writer method checking allowed values (enum).
|
223
|
-
# @param [Object] type Object to be assigned
|
224
|
-
def type=(type)
|
225
|
-
validator = EnumAttributeValidator.new('String', ["CREDIT_CARD", "CASH", "THIRD_PARTY_CARD", "NO_SALE", "SQUARE_WALLET", "SQUARE_GIFT_CARD", "UNKNOWN", "OTHER"])
|
226
|
-
unless validator.valid?(type)
|
227
|
-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
228
|
-
end
|
229
|
-
@type = type
|
230
|
-
end
|
231
|
-
|
232
|
-
# Custom attribute writer method checking allowed values (enum).
|
233
|
-
# @param [Object] card_brand Object to be assigned
|
234
|
-
def card_brand=(card_brand)
|
235
|
-
validator = EnumAttributeValidator.new('String', ["OTHER_BRAND", "VISA", "MASTER_CARD", "AMERICAN_EXPRESS", "DISCOVER", "DISCOVER_DINERS", "JCB", "CHINA_UNIONPAY", "SQUARE_GIFT_CARD"])
|
236
|
-
unless validator.valid?(card_brand)
|
237
|
-
fail ArgumentError, "invalid value for 'card_brand', must be one of #{validator.allowable_values}."
|
238
|
-
end
|
239
|
-
@card_brand = card_brand
|
240
|
-
end
|
241
|
-
|
242
|
-
# Custom attribute writer method checking allowed values (enum).
|
243
|
-
# @param [Object] entry_method Object to be assigned
|
244
|
-
def entry_method=(entry_method)
|
245
|
-
validator = EnumAttributeValidator.new('String', ["MANUAL", "SCANNED", "SQUARE_CASH", "SQUARE_WALLET", "SWIPED", "WEB_FORM", "OTHER"])
|
246
|
-
unless validator.valid?(entry_method)
|
247
|
-
fail ArgumentError, "invalid value for 'entry_method', must be one of #{validator.allowable_values}."
|
248
|
-
end
|
249
|
-
@entry_method = entry_method
|
250
|
-
end
|
251
|
-
|
252
195
|
# Checks equality by comparing each attribute.
|
253
196
|
# @param [Object] Object to be compared
|
254
197
|
def ==(o)
|
@@ -27,27 +27,6 @@ module SquareConnect
|
|
27
27
|
# The time when the event was created, in ISO 8601 format.
|
28
28
|
attr_accessor :created_at
|
29
29
|
|
30
|
-
class EnumAttributeValidator
|
31
|
-
attr_reader :datatype
|
32
|
-
attr_reader :allowable_values
|
33
|
-
|
34
|
-
def initialize(datatype, allowable_values)
|
35
|
-
@allowable_values = allowable_values.map do |value|
|
36
|
-
case datatype.to_s
|
37
|
-
when /Integer/i
|
38
|
-
value.to_i
|
39
|
-
when /Float/i
|
40
|
-
value.to_f
|
41
|
-
else
|
42
|
-
value
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def valid?(value)
|
48
|
-
!value || allowable_values.include?(value)
|
49
|
-
end
|
50
|
-
end
|
51
30
|
|
52
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
53
32
|
def self.attribute_map
|
@@ -111,21 +90,9 @@ module SquareConnect
|
|
111
90
|
# Check to see if the all the properties in the model are valid
|
112
91
|
# @return true if the model is valid
|
113
92
|
def valid?
|
114
|
-
event_type_validator = EnumAttributeValidator.new('String', ["API_CREATE", "API_EDIT", "API_DELETE", "REGISTER_CLOCKIN", "REGISTER_CLOCKOUT", "DASHBOARD_SUPERVISOR_CLOSE", "DASHBOARD_EDIT", "DASHBOARD_DELETE"])
|
115
|
-
return false unless event_type_validator.valid?(@event_type)
|
116
93
|
return true
|
117
94
|
end
|
118
95
|
|
119
|
-
# Custom attribute writer method checking allowed values (enum).
|
120
|
-
# @param [Object] event_type Object to be assigned
|
121
|
-
def event_type=(event_type)
|
122
|
-
validator = EnumAttributeValidator.new('String', ["API_CREATE", "API_EDIT", "API_DELETE", "REGISTER_CLOCKIN", "REGISTER_CLOCKOUT", "DASHBOARD_SUPERVISOR_CLOSE", "DASHBOARD_EDIT", "DASHBOARD_DELETE"])
|
123
|
-
unless validator.valid?(event_type)
|
124
|
-
fail ArgumentError, "invalid value for 'event_type', must be one of #{validator.allowable_values}."
|
125
|
-
end
|
126
|
-
@event_type = event_type
|
127
|
-
end
|
128
|
-
|
129
96
|
# Checks equality by comparing each attribute.
|
130
97
|
# @param [Object] Object to be compared
|
131
98
|
def ==(o)
|
@@ -18,27 +18,6 @@ module SquareConnect
|
|
18
18
|
# Indicates whether multiple options from the modifier list can be applied to a single item. See [V1UpdateModifierListRequestSelectionType](#type-v1updatemodifierlistrequestselectiontype) for possible values
|
19
19
|
attr_accessor :selection_type
|
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
|
-
selection_type_validator = EnumAttributeValidator.new('String', ["SINGLE", "MULTIPLE"])
|
88
|
-
return false unless selection_type_validator.valid?(@selection_type)
|
89
66
|
return true
|
90
67
|
end
|
91
68
|
|
92
|
-
# Custom attribute writer method checking allowed values (enum).
|
93
|
-
# @param [Object] selection_type Object to be assigned
|
94
|
-
def selection_type=(selection_type)
|
95
|
-
validator = EnumAttributeValidator.new('String', ["SINGLE", "MULTIPLE"])
|
96
|
-
unless validator.valid?(selection_type)
|
97
|
-
fail ArgumentError, "invalid value for 'selection_type', must be one of #{validator.allowable_values}."
|
98
|
-
end
|
99
|
-
@selection_type = selection_type
|
100
|
-
end
|
101
|
-
|
102
69
|
# Checks equality by comparing each attribute.
|
103
70
|
# @param [Object] Object to be compared
|
104
71
|
def ==(o)
|
@@ -27,27 +27,6 @@ module SquareConnect
|
|
27
27
|
# A merchant-specified note about the canceling of the order. Only valid if action is CANCEL.
|
28
28
|
attr_accessor :canceled_note
|
29
29
|
|
30
|
-
class EnumAttributeValidator
|
31
|
-
attr_reader :datatype
|
32
|
-
attr_reader :allowable_values
|
33
|
-
|
34
|
-
def initialize(datatype, allowable_values)
|
35
|
-
@allowable_values = allowable_values.map do |value|
|
36
|
-
case datatype.to_s
|
37
|
-
when /Integer/i
|
38
|
-
value.to_i
|
39
|
-
when /Float/i
|
40
|
-
value.to_f
|
41
|
-
else
|
42
|
-
value
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def valid?(value)
|
48
|
-
!value || allowable_values.include?(value)
|
49
|
-
end
|
50
|
-
end
|
51
30
|
|
52
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
53
32
|
def self.attribute_map
|
@@ -116,21 +95,9 @@ module SquareConnect
|
|
116
95
|
# @return true if the model is valid
|
117
96
|
def valid?
|
118
97
|
return false if @action.nil?
|
119
|
-
action_validator = EnumAttributeValidator.new('String', ["COMPLETE", "CANCEL", "REFUND"])
|
120
|
-
return false unless action_validator.valid?(@action)
|
121
98
|
return true
|
122
99
|
end
|
123
100
|
|
124
|
-
# Custom attribute writer method checking allowed values (enum).
|
125
|
-
# @param [Object] action Object to be assigned
|
126
|
-
def action=(action)
|
127
|
-
validator = EnumAttributeValidator.new('String', ["COMPLETE", "CANCEL", "REFUND"])
|
128
|
-
unless validator.valid?(action)
|
129
|
-
fail ArgumentError, "invalid value for 'action', must be one of #{validator.allowable_values}."
|
130
|
-
end
|
131
|
-
@action = action
|
132
|
-
end
|
133
|
-
|
134
101
|
# Checks equality by comparing each attribute.
|
135
102
|
# @param [Object] Object to be compared
|
136
103
|
def ==(o)
|
@@ -48,27 +48,6 @@ module SquareConnect
|
|
48
48
|
# The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID.
|
49
49
|
attr_accessor :v2_id
|
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
|
@@ -174,33 +153,9 @@ module SquareConnect
|
|
174
153
|
# Check to see if the all the properties in the model are valid
|
175
154
|
# @return true if the model is valid
|
176
155
|
def valid?
|
177
|
-
pricing_type_validator = EnumAttributeValidator.new('String', ["FIXED_PRICING", "VARIABLE_PRICING"])
|
178
|
-
return false unless pricing_type_validator.valid?(@pricing_type)
|
179
|
-
inventory_alert_type_validator = EnumAttributeValidator.new('String', ["LOW_QUANTITY", "NONE", "INVESTMENT", "LOAN", "SAVINGS", "OTHER"])
|
180
|
-
return false unless inventory_alert_type_validator.valid?(@inventory_alert_type)
|
181
156
|
return true
|
182
157
|
end
|
183
158
|
|
184
|
-
# Custom attribute writer method checking allowed values (enum).
|
185
|
-
# @param [Object] pricing_type Object to be assigned
|
186
|
-
def pricing_type=(pricing_type)
|
187
|
-
validator = EnumAttributeValidator.new('String', ["FIXED_PRICING", "VARIABLE_PRICING"])
|
188
|
-
unless validator.valid?(pricing_type)
|
189
|
-
fail ArgumentError, "invalid value for 'pricing_type', must be one of #{validator.allowable_values}."
|
190
|
-
end
|
191
|
-
@pricing_type = pricing_type
|
192
|
-
end
|
193
|
-
|
194
|
-
# Custom attribute writer method checking allowed values (enum).
|
195
|
-
# @param [Object] inventory_alert_type Object to be assigned
|
196
|
-
def inventory_alert_type=(inventory_alert_type)
|
197
|
-
validator = EnumAttributeValidator.new('String', ["LOW_QUANTITY", "NONE", "INVESTMENT", "LOAN", "SAVINGS", "OTHER"])
|
198
|
-
unless validator.valid?(inventory_alert_type)
|
199
|
-
fail ArgumentError, "invalid value for 'inventory_alert_type', must be one of #{validator.allowable_values}."
|
200
|
-
end
|
201
|
-
@inventory_alert_type = inventory_alert_type
|
202
|
-
end
|
203
|
-
|
204
159
|
# Checks equality by comparing each attribute.
|
205
160
|
# @param [Object] Object to be compared
|
206
161
|
def ==(o)
|
@@ -30,27 +30,6 @@ module SquareConnect
|
|
30
30
|
# A read-only timestamp in RFC 3339 format; presented in UTC
|
31
31
|
attr_accessor :updated_at
|
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
|
@@ -133,23 +112,11 @@ module SquareConnect
|
|
133
112
|
# @return true if the model is valid
|
134
113
|
def valid?
|
135
114
|
return false if @start_of_week.nil?
|
136
|
-
start_of_week_validator = EnumAttributeValidator.new('String', ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"])
|
137
|
-
return false unless start_of_week_validator.valid?(@start_of_week)
|
138
115
|
return false if @start_of_day_local_time.nil?
|
139
116
|
return false if @start_of_day_local_time.to_s.length < 1
|
140
117
|
return true
|
141
118
|
end
|
142
119
|
|
143
|
-
# Custom attribute writer method checking allowed values (enum).
|
144
|
-
# @param [Object] start_of_week Object to be assigned
|
145
|
-
def start_of_week=(start_of_week)
|
146
|
-
validator = EnumAttributeValidator.new('String', ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"])
|
147
|
-
unless validator.valid?(start_of_week)
|
148
|
-
fail ArgumentError, "invalid value for 'start_of_week', must be one of #{validator.allowable_values}."
|
149
|
-
end
|
150
|
-
@start_of_week = start_of_week
|
151
|
-
end
|
152
|
-
|
153
120
|
# Custom attribute writer method with validation
|
154
121
|
# @param [Object] start_of_day_local_time Value to be assigned
|
155
122
|
def start_of_day_local_time=(start_of_day_local_time)
|
@@ -337,7 +337,6 @@ describe 'CatalogApi' do
|
|
337
337
|
expect(actual_coffee.item_data.modifier_list_info[0].min_selected_modifiers).to be_nil
|
338
338
|
expect(actual_coffee.item_data.modifier_list_info[0].max_selected_modifiers).to be_nil
|
339
339
|
expect(actual_coffee.item_data.modifier_list_info[0].enabled).to be_nil
|
340
|
-
expect(actual_coffee.item_data.image_url).to be_nil
|
341
340
|
|
342
341
|
expect(actual_coffee.item_data.variations.size).to eq(2)
|
343
342
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: square_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.20190710.0.321
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Square, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -207,7 +207,6 @@ files:
|
|
207
207
|
- docs/AdditionalRecipientReceivable.md
|
208
208
|
- docs/AdditionalRecipientReceivableRefund.md
|
209
209
|
- docs/Address.md
|
210
|
-
- docs/AggregationStrategy.md
|
211
210
|
- docs/ApplePayApi.md
|
212
211
|
- docs/BatchChangeInventoryRequest.md
|
213
212
|
- docs/BatchChangeInventoryResponse.md
|
@@ -689,7 +688,6 @@ files:
|
|
689
688
|
- lib/square_connect/models/additional_recipient_receivable.rb
|
690
689
|
- lib/square_connect/models/additional_recipient_receivable_refund.rb
|
691
690
|
- lib/square_connect/models/address.rb
|
692
|
-
- lib/square_connect/models/aggregation_strategy.rb
|
693
691
|
- lib/square_connect/models/batch_change_inventory_request.rb
|
694
692
|
- lib/square_connect/models/batch_change_inventory_response.rb
|
695
693
|
- lib/square_connect/models/batch_delete_catalog_objects_request.rb
|
@@ -1153,7 +1151,6 @@ files:
|
|
1153
1151
|
- spec/models/additional_recipient_receivable_spec.rb
|
1154
1152
|
- spec/models/additional_recipient_spec.rb
|
1155
1153
|
- spec/models/address_spec.rb
|
1156
|
-
- spec/models/aggregation_strategy_spec.rb
|
1157
1154
|
- spec/models/batch_change_inventory_request_spec.rb
|
1158
1155
|
- spec/models/batch_change_inventory_response_spec.rb
|
1159
1156
|
- spec/models/batch_delete_catalog_objects_request_spec.rb
|
@@ -1973,7 +1970,6 @@ test_files:
|
|
1973
1970
|
- spec/models/shift_wage_spec.rb
|
1974
1971
|
- spec/models/void_transaction_response_spec.rb
|
1975
1972
|
- spec/models/create_order_response_spec.rb
|
1976
|
-
- spec/models/aggregation_strategy_spec.rb
|
1977
1973
|
- spec/models/customer_sort_spec.rb
|
1978
1974
|
- spec/models/tender_cash_details_spec.rb
|
1979
1975
|
- spec/models/list_employees_response_spec.rb
|