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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +4 -0
  3. data/README.md +1 -2
  4. data/docs/CatalogItem.md +0 -1
  5. data/docs/CatalogItemVariation.md +0 -1
  6. data/docs/CatalogObject.md +3 -0
  7. data/docs/CatalogPricingRule.md +0 -3
  8. data/docs/InventoryAdjustment.md +1 -1
  9. data/docs/InventoryCount.md +1 -1
  10. data/docs/InventoryPhysicalCount.md +1 -1
  11. data/docs/InventoryTransfer.md +1 -1
  12. data/docs/TransactionsApi.md +2 -2
  13. data/lib/square_connect.rb +0 -1
  14. data/lib/square_connect/api/customers_api.rb +0 -6
  15. data/lib/square_connect/api/employees_api.rb +0 -3
  16. data/lib/square_connect/api/reporting_api.rb +0 -6
  17. data/lib/square_connect/api/transactions_api.rb +4 -10
  18. data/lib/square_connect/api/v1_employees_api.rb +0 -15
  19. data/lib/square_connect/api/v1_transactions_api.rb +0 -15
  20. data/lib/square_connect/api_client.rb +1 -1
  21. data/lib/square_connect/models/address.rb +0 -33
  22. data/lib/square_connect/models/batch_retrieve_inventory_changes_request.rb +0 -21
  23. data/lib/square_connect/models/business_hours_period.rb +0 -33
  24. data/lib/square_connect/models/card.rb +0 -33
  25. data/lib/square_connect/models/catalog_discount.rb +0 -33
  26. data/lib/square_connect/models/catalog_item.rb +1 -44
  27. data/lib/square_connect/models/catalog_item_variation.rb +1 -56
  28. data/lib/square_connect/models/catalog_modifier_list.rb +0 -33
  29. data/lib/square_connect/models/catalog_object.rb +31 -34
  30. data/lib/square_connect/models/catalog_pricing_rule.rb +1 -64
  31. data/lib/square_connect/models/catalog_query_sorted_attribute.rb +0 -33
  32. data/lib/square_connect/models/catalog_tax.rb +0 -45
  33. data/lib/square_connect/models/create_order_request_tax.rb +0 -33
  34. data/lib/square_connect/models/customer.rb +0 -33
  35. data/lib/square_connect/models/customer_creation_source_filter.rb +0 -33
  36. data/lib/square_connect/models/customer_sort.rb +0 -45
  37. data/lib/square_connect/models/employee.rb +0 -33
  38. data/lib/square_connect/models/error.rb +0 -45
  39. data/lib/square_connect/models/inventory_adjustment.rb +1 -46
  40. data/lib/square_connect/models/inventory_change.rb +0 -33
  41. data/lib/square_connect/models/inventory_count.rb +1 -34
  42. data/lib/square_connect/models/inventory_physical_count.rb +1 -34
  43. data/lib/square_connect/models/inventory_transfer.rb +1 -34
  44. data/lib/square_connect/models/item_variation_location_overrides.rb +0 -45
  45. data/lib/square_connect/models/list_additional_recipient_receivable_refunds_request.rb +0 -33
  46. data/lib/square_connect/models/list_additional_recipient_receivables_request.rb +0 -33
  47. data/lib/square_connect/models/list_customers_request.rb +0 -45
  48. data/lib/square_connect/models/list_employees_request.rb +0 -33
  49. data/lib/square_connect/models/list_refunds_request.rb +0 -33
  50. data/lib/square_connect/models/list_transactions_request.rb +0 -33
  51. data/lib/square_connect/models/location.rb +0 -69
  52. data/lib/square_connect/models/measurement_unit.rb +0 -81
  53. data/lib/square_connect/models/money.rb +0 -33
  54. data/lib/square_connect/models/order.rb +0 -33
  55. data/lib/square_connect/models/order_fulfillment.rb +0 -45
  56. data/lib/square_connect/models/order_fulfillment_pickup_details.rb +0 -33
  57. data/lib/square_connect/models/order_line_item_discount.rb +0 -45
  58. data/lib/square_connect/models/order_line_item_tax.rb +0 -45
  59. data/lib/square_connect/models/order_return_discount.rb +0 -45
  60. data/lib/square_connect/models/order_return_service_charge.rb +0 -33
  61. data/lib/square_connect/models/order_return_tax.rb +0 -45
  62. data/lib/square_connect/models/order_service_charge.rb +0 -33
  63. data/lib/square_connect/models/refund.rb +0 -33
  64. data/lib/square_connect/models/register_domain_response.rb +0 -33
  65. data/lib/square_connect/models/search_catalog_objects_request.rb +0 -21
  66. data/lib/square_connect/models/search_orders_fulfillment_filter.rb +0 -21
  67. data/lib/square_connect/models/search_orders_sort.rb +0 -45
  68. data/lib/square_connect/models/search_orders_state_filter.rb +0 -21
  69. data/lib/square_connect/models/shift.rb +0 -33
  70. data/lib/square_connect/models/shift_filter.rb +0 -33
  71. data/lib/square_connect/models/shift_sort.rb +0 -45
  72. data/lib/square_connect/models/shift_workday.rb +0 -33
  73. data/lib/square_connect/models/source_application.rb +0 -33
  74. data/lib/square_connect/models/tender.rb +0 -33
  75. data/lib/square_connect/models/tender_card_details.rb +0 -45
  76. data/lib/square_connect/models/transaction.rb +0 -33
  77. data/lib/square_connect/models/v1_adjust_inventory_request.rb +0 -33
  78. data/lib/square_connect/models/v1_bank_account.rb +0 -33
  79. data/lib/square_connect/models/v1_cash_drawer_event.rb +0 -33
  80. data/lib/square_connect/models/v1_cash_drawer_shift.rb +0 -33
  81. data/lib/square_connect/models/v1_create_refund_request.rb +0 -33
  82. data/lib/square_connect/models/v1_discount.rb +0 -45
  83. data/lib/square_connect/models/v1_employee.rb +0 -33
  84. data/lib/square_connect/models/v1_employee_role.rb +0 -21
  85. data/lib/square_connect/models/v1_fee.rb +0 -69
  86. data/lib/square_connect/models/v1_item.rb +0 -57
  87. data/lib/square_connect/models/v1_list_cash_drawer_shifts_request.rb +0 -33
  88. data/lib/square_connect/models/v1_list_employee_roles_request.rb +0 -33
  89. data/lib/square_connect/models/v1_list_employees_request.rb +0 -45
  90. data/lib/square_connect/models/v1_list_orders_request.rb +0 -33
  91. data/lib/square_connect/models/v1_list_payments_request.rb +0 -33
  92. data/lib/square_connect/models/v1_list_refunds_request.rb +0 -33
  93. data/lib/square_connect/models/v1_list_settlements_request.rb +0 -45
  94. data/lib/square_connect/models/v1_list_timecards_request.rb +0 -33
  95. data/lib/square_connect/models/v1_merchant.rb +0 -45
  96. data/lib/square_connect/models/v1_modifier_list.rb +0 -33
  97. data/lib/square_connect/models/v1_money.rb +0 -33
  98. data/lib/square_connect/models/v1_order.rb +0 -33
  99. data/lib/square_connect/models/v1_order_history_entry.rb +0 -33
  100. data/lib/square_connect/models/v1_page_cell.rb +0 -45
  101. data/lib/square_connect/models/v1_payment_itemization.rb +0 -33
  102. data/lib/square_connect/models/v1_payment_surcharge.rb +0 -33
  103. data/lib/square_connect/models/v1_payment_tax.rb +0 -33
  104. data/lib/square_connect/models/v1_refund.rb +0 -33
  105. data/lib/square_connect/models/v1_settlement.rb +0 -33
  106. data/lib/square_connect/models/v1_settlement_entry.rb +0 -33
  107. data/lib/square_connect/models/v1_tender.rb +0 -57
  108. data/lib/square_connect/models/v1_timecard_event.rb +0 -33
  109. data/lib/square_connect/models/v1_update_modifier_list_request.rb +0 -33
  110. data/lib/square_connect/models/v1_update_order_request.rb +0 -33
  111. data/lib/square_connect/models/v1_variation.rb +0 -45
  112. data/lib/square_connect/models/workweek_config.rb +0 -33
  113. data/lib/square_connect/version.rb +1 -1
  114. data/spec/api/catalog_api_spec.rb +0 -1
  115. metadata +2 -6
  116. data/docs/AggregationStrategy.md +0 -15
  117. data/lib/square_connect/models/aggregation_strategy.rb +0 -21
  118. data/spec/models/aggregation_strategy_spec.rb +0 -33
@@ -39,27 +39,6 @@ module SquareConnect
39
39
  # A read-only timestamp in RFC 3339 format.
40
40
  attr_accessor :updated_at
41
41
 
42
- class EnumAttributeValidator
43
- attr_reader :datatype
44
- attr_reader :allowable_values
45
-
46
- def initialize(datatype, allowable_values)
47
- @allowable_values = allowable_values.map do |value|
48
- case datatype.to_s
49
- when /Integer/i
50
- value.to_i
51
- when /Float/i
52
- value.to_f
53
- else
54
- value
55
- end
56
- end
57
- end
58
-
59
- def valid?(value)
60
- !value || allowable_values.include?(value)
61
- end
62
- end
63
42
 
64
43
  # Attribute mapping from ruby-style variable name to JSON key.
65
44
  def self.attribute_map
@@ -149,21 +128,9 @@ module SquareConnect
149
128
  # Check to see if the all the properties in the model are valid
150
129
  # @return true if the model is valid
151
130
  def valid?
152
- status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
153
- return false unless status_validator.valid?(@status)
154
131
  return true
155
132
  end
156
133
 
157
- # Custom attribute writer method checking allowed values (enum).
158
- # @param [Object] status Object to be assigned
159
- def status=(status)
160
- validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
161
- unless validator.valid?(status)
162
- fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
163
- end
164
- @status = status
165
- end
166
-
167
134
  # Checks equality by comparing each attribute.
168
135
  # @param [Object] Object to be compared
169
136
  def ==(o)
@@ -24,27 +24,6 @@ module SquareConnect
24
24
  # The name of the field provided in the original request that the error pertains to, if any.
25
25
  attr_accessor :field
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
@@ -111,34 +90,10 @@ module SquareConnect
111
90
  # @return true if the model is valid
112
91
  def valid?
113
92
  return false if @category.nil?
114
- category_validator = EnumAttributeValidator.new('String', ["API_ERROR", "AUTHENTICATION_ERROR", "INVALID_REQUEST_ERROR", "RATE_LIMIT_ERROR", "PAYMENT_METHOD_ERROR", "REFUND_ERROR"])
115
- return false unless category_validator.valid?(@category)
116
93
  return false if @code.nil?
117
- code_validator = EnumAttributeValidator.new('String', ["INTERNAL_SERVER_ERROR", "UNAUTHORIZED", "ACCESS_TOKEN_EXPIRED", "ACCESS_TOKEN_REVOKED", "FORBIDDEN", "INSUFFICIENT_SCOPES", "APPLICATION_DISABLED", "V1_APPLICATION", "V1_ACCESS_TOKEN", "CARD_PROCESSING_NOT_ENABLED", "BAD_REQUEST", "MISSING_REQUIRED_PARAMETER", "INCORRECT_TYPE", "INVALID_TIME", "INVALID_TIME_RANGE", "INVALID_VALUE", "INVALID_CURSOR", "UNKNOWN_QUERY_PARAMETER", "CONFLICTING_PARAMETERS", "EXPECTED_JSON_BODY", "INVALID_SORT_ORDER", "VALUE_REGEX_MISMATCH", "VALUE_TOO_SHORT", "VALUE_TOO_LONG", "VALUE_TOO_LOW", "VALUE_TOO_HIGH", "VALUE_EMPTY", "ARRAY_LENGTH_TOO_LONG", "ARRAY_LENGTH_TOO_SHORT", "ARRAY_EMPTY", "EXPECTED_BOOLEAN", "EXPECTED_INTEGER", "EXPECTED_FLOAT", "EXPECTED_STRING", "EXPECTED_OBJECT", "EXPECTED_ARRAY", "EXPECTED_MAP", "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", "INVALID_ARRAY_VALUE", "INVALID_ENUM_VALUE", "INVALID_CONTENT_TYPE", "INVALID_FORM_VALUE", "ONE_INSTRUMENT_EXPECTED", "NO_FIELDS_SET", "DEPRECATED_FIELD_SET", "RETIRED_FIELD_SET", "CARD_EXPIRED", "INVALID_EXPIRATION", "INVALID_EXPIRATION_YEAR", "INVALID_EXPIRATION_DATE", "UNSUPPORTED_CARD_BRAND", "UNSUPPORTED_ENTRY_METHOD", "INVALID_ENCRYPTED_CARD", "INVALID_CARD", "DELAYED_TRANSACTION_EXPIRED", "DELAYED_TRANSACTION_CANCELED", "DELAYED_TRANSACTION_CAPTURED", "DELAYED_TRANSACTION_FAILED", "CARD_TOKEN_EXPIRED", "CARD_TOKEN_USED", "AMOUNT_TOO_HIGH", "UNSUPPORTED_INSTRUMENT_TYPE", "REFUND_AMOUNT_INVALID", "REFUND_ALREADY_PENDING", "PAYMENT_NOT_REFUNDABLE", "INVALID_CARD_DATA", "LOCATION_MISMATCH", "IDEMPOTENCY_KEY_REUSED", "UNEXPECTED_VALUE", "SANDBOX_NOT_SUPPORTED", "INVALID_EMAIL_ADDRESS", "INVALID_PHONE_NUMBER", "CHECKOUT_EXPIRED", "BAD_CERTIFICATE", "INVALID_SQUARE_VERSION_FORMAT", "API_VERSION_INCOMPATIBLE", "CARD_DECLINED", "VERIFY_CVV_FAILURE", "VERIFY_AVS_FAILURE", "CARD_DECLINED_CALL_ISSUER", "NOT_FOUND", "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "REQUEST_ENTITY_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "RATE_LIMITED", "NOT_IMPLEMENTED", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT"])
118
- return false unless code_validator.valid?(@code)
119
94
  return true
120
95
  end
121
96
 
122
- # Custom attribute writer method checking allowed values (enum).
123
- # @param [Object] category Object to be assigned
124
- def category=(category)
125
- validator = EnumAttributeValidator.new('String', ["API_ERROR", "AUTHENTICATION_ERROR", "INVALID_REQUEST_ERROR", "RATE_LIMIT_ERROR", "PAYMENT_METHOD_ERROR", "REFUND_ERROR"])
126
- unless validator.valid?(category)
127
- fail ArgumentError, "invalid value for 'category', must be one of #{validator.allowable_values}."
128
- end
129
- @category = category
130
- end
131
-
132
- # Custom attribute writer method checking allowed values (enum).
133
- # @param [Object] code Object to be assigned
134
- def code=(code)
135
- validator = EnumAttributeValidator.new('String', ["INTERNAL_SERVER_ERROR", "UNAUTHORIZED", "ACCESS_TOKEN_EXPIRED", "ACCESS_TOKEN_REVOKED", "FORBIDDEN", "INSUFFICIENT_SCOPES", "APPLICATION_DISABLED", "V1_APPLICATION", "V1_ACCESS_TOKEN", "CARD_PROCESSING_NOT_ENABLED", "BAD_REQUEST", "MISSING_REQUIRED_PARAMETER", "INCORRECT_TYPE", "INVALID_TIME", "INVALID_TIME_RANGE", "INVALID_VALUE", "INVALID_CURSOR", "UNKNOWN_QUERY_PARAMETER", "CONFLICTING_PARAMETERS", "EXPECTED_JSON_BODY", "INVALID_SORT_ORDER", "VALUE_REGEX_MISMATCH", "VALUE_TOO_SHORT", "VALUE_TOO_LONG", "VALUE_TOO_LOW", "VALUE_TOO_HIGH", "VALUE_EMPTY", "ARRAY_LENGTH_TOO_LONG", "ARRAY_LENGTH_TOO_SHORT", "ARRAY_EMPTY", "EXPECTED_BOOLEAN", "EXPECTED_INTEGER", "EXPECTED_FLOAT", "EXPECTED_STRING", "EXPECTED_OBJECT", "EXPECTED_ARRAY", "EXPECTED_MAP", "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", "INVALID_ARRAY_VALUE", "INVALID_ENUM_VALUE", "INVALID_CONTENT_TYPE", "INVALID_FORM_VALUE", "ONE_INSTRUMENT_EXPECTED", "NO_FIELDS_SET", "DEPRECATED_FIELD_SET", "RETIRED_FIELD_SET", "CARD_EXPIRED", "INVALID_EXPIRATION", "INVALID_EXPIRATION_YEAR", "INVALID_EXPIRATION_DATE", "UNSUPPORTED_CARD_BRAND", "UNSUPPORTED_ENTRY_METHOD", "INVALID_ENCRYPTED_CARD", "INVALID_CARD", "DELAYED_TRANSACTION_EXPIRED", "DELAYED_TRANSACTION_CANCELED", "DELAYED_TRANSACTION_CAPTURED", "DELAYED_TRANSACTION_FAILED", "CARD_TOKEN_EXPIRED", "CARD_TOKEN_USED", "AMOUNT_TOO_HIGH", "UNSUPPORTED_INSTRUMENT_TYPE", "REFUND_AMOUNT_INVALID", "REFUND_ALREADY_PENDING", "PAYMENT_NOT_REFUNDABLE", "INVALID_CARD_DATA", "LOCATION_MISMATCH", "IDEMPOTENCY_KEY_REUSED", "UNEXPECTED_VALUE", "SANDBOX_NOT_SUPPORTED", "INVALID_EMAIL_ADDRESS", "INVALID_PHONE_NUMBER", "CHECKOUT_EXPIRED", "BAD_CERTIFICATE", "INVALID_SQUARE_VERSION_FORMAT", "API_VERSION_INCOMPATIBLE", "CARD_DECLINED", "VERIFY_CVV_FAILURE", "VERIFY_AVS_FAILURE", "CARD_DECLINED_CALL_ISSUER", "NOT_FOUND", "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "REQUEST_ENTITY_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "RATE_LIMITED", "NOT_IMPLEMENTED", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT"])
136
- unless validator.valid?(code)
137
- fail ArgumentError, "invalid value for 'code', must be one of #{validator.allowable_values}."
138
- end
139
- @code = code
140
- end
141
-
142
97
  # Checks equality by comparing each attribute.
143
98
  # @param [Object] Object to be compared
144
99
  def ==(o)
@@ -33,7 +33,7 @@ module SquareConnect
33
33
  # The [CatalogObjectType](#type-catalogobjecttype) of the [CatalogObject](#type-catalogobject) being tracked. Tracking is only supported for the `ITEM_VARIATION` type.
34
34
  attr_accessor :catalog_object_type
35
35
 
36
- # The number of items affected by the adjustment as a decimal string. Can support up to 5 digits after the decimal point. _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information.
36
+ # The number of items affected by the adjustment as a decimal string. Can support up to 5 digits after the decimal point. _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/orders-api/what-it-does#decimal-quantities) for more information.
37
37
  attr_accessor :quantity
38
38
 
39
39
  # The read-only total price paid for goods associated with the adjustment. Present if and only if `to_state` is `SOLD`. Always non-negative.
@@ -63,27 +63,6 @@ module SquareConnect
63
63
  # The read-only Square ID of the Square goods receipt that caused the adjustment. Only relevant for state transitions from the Square for Retail app.
64
64
  attr_accessor :goods_receipt_id
65
65
 
66
- class EnumAttributeValidator
67
- attr_reader :datatype
68
- attr_reader :allowable_values
69
-
70
- def initialize(datatype, allowable_values)
71
- @allowable_values = allowable_values.map do |value|
72
- case datatype.to_s
73
- when /Integer/i
74
- value.to_i
75
- when /Float/i
76
- value.to_f
77
- else
78
- value
79
- end
80
- end
81
- end
82
-
83
- def valid?(value)
84
- !value || allowable_values.include?(value)
85
- end
86
- end
87
66
 
88
67
  # Attribute mapping from ruby-style variable name to JSON key.
89
68
  def self.attribute_map
@@ -219,33 +198,9 @@ module SquareConnect
219
198
  # Check to see if the all the properties in the model are valid
220
199
  # @return true if the model is valid
221
200
  def valid?
222
- from_state_validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
223
- return false unless from_state_validator.valid?(@from_state)
224
- to_state_validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
225
- return false unless to_state_validator.valid?(@to_state)
226
201
  return true
227
202
  end
228
203
 
229
- # Custom attribute writer method checking allowed values (enum).
230
- # @param [Object] from_state Object to be assigned
231
- def from_state=(from_state)
232
- validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
233
- unless validator.valid?(from_state)
234
- fail ArgumentError, "invalid value for 'from_state', must be one of #{validator.allowable_values}."
235
- end
236
- @from_state = from_state
237
- end
238
-
239
- # Custom attribute writer method checking allowed values (enum).
240
- # @param [Object] to_state Object to be assigned
241
- def to_state=(to_state)
242
- validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
243
- unless validator.valid?(to_state)
244
- fail ArgumentError, "invalid value for 'to_state', must be one of #{validator.allowable_values}."
245
- end
246
- @to_state = to_state
247
- end
248
-
249
204
  # Checks equality by comparing each attribute.
250
205
  # @param [Object] Object to be compared
251
206
  def ==(o)
@@ -24,27 +24,6 @@ module SquareConnect
24
24
  # Contains details about the inventory transfer when `type` is `TRANSFER` and unset for all other types.
25
25
  attr_accessor :transfer
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', ["PHYSICAL_COUNT", "ADJUSTMENT", "TRANSFER"])
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', ["PHYSICAL_COUNT", "ADJUSTMENT", "TRANSFER"])
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)
@@ -24,33 +24,12 @@ module SquareConnect
24
24
  # The Square ID of the [Location](#type-location) where the related quantity of items are being tracked.
25
25
  attr_accessor :location_id
26
26
 
27
- # The number of items in the count as a decimal string. Can support up to 5 digits after the decimal point. _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information.
27
+ # The number of items in the count as a decimal string. Can support up to 5 digits after the decimal point. _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/orders-api/what-it-does#decimal-quantities) for more information.
28
28
  attr_accessor :quantity
29
29
 
30
30
  # A read-only timestamp in RFC 3339 format that indicates when Square received the most recent physical count or adjustment that had an affect on the estimated count.
31
31
  attr_accessor :calculated_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
@@ -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
- state_validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
124
- return false unless state_validator.valid?(@state)
125
102
  return true
126
103
  end
127
104
 
128
- # Custom attribute writer method checking allowed values (enum).
129
- # @param [Object] state Object to be assigned
130
- def state=(state)
131
- validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
132
- unless validator.valid?(state)
133
- fail ArgumentError, "invalid value for 'state', must be one of #{validator.allowable_values}."
134
- end
135
- @state = state
136
- end
137
-
138
105
  # Checks equality by comparing each attribute.
139
106
  # @param [Object] Object to be compared
140
107
  def ==(o)
@@ -30,7 +30,7 @@ module SquareConnect
30
30
  # The Square ID of the [Location](#type-location) where the related quantity of items are being tracked.
31
31
  attr_accessor :location_id
32
32
 
33
- # The number of items affected by the physical count as a decimal string. Can support up to 5 digits after the decimal point. _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information.
33
+ # The number of items affected by the physical count as a decimal string. Can support up to 5 digits after the decimal point. _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/orders-api/what-it-does#decimal-quantities) for more information.
34
34
  attr_accessor :quantity
35
35
 
36
36
  # Read-only information about the application that submitted the physical count.
@@ -45,27 +45,6 @@ module SquareConnect
45
45
  # A read-only timestamp in RFC 3339 format that indicates when Square received the physical count.
46
46
  attr_accessor :created_at
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
@@ -165,21 +144,9 @@ module SquareConnect
165
144
  # Check to see if the all the properties in the model are valid
166
145
  # @return true if the model is valid
167
146
  def valid?
168
- state_validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
169
- return false unless state_validator.valid?(@state)
170
147
  return true
171
148
  end
172
149
 
173
- # Custom attribute writer method checking allowed values (enum).
174
- # @param [Object] state Object to be assigned
175
- def state=(state)
176
- validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
177
- unless validator.valid?(state)
178
- fail ArgumentError, "invalid value for 'state', must be one of #{validator.allowable_values}."
179
- end
180
- @state = state
181
- end
182
-
183
150
  # Checks equality by comparing each attribute.
184
151
  # @param [Object] Object to be compared
185
152
  def ==(o)
@@ -33,7 +33,7 @@ module SquareConnect
33
33
  # The [CatalogObjectType](#type-catalogobjecttype) of the [CatalogObject](#type-catalogobject) being tracked.Tracking is only supported for the `ITEM_VARIATION` type.
34
34
  attr_accessor :catalog_object_type
35
35
 
36
- # The number of items affected by the transfer as a decimal string. Can support up to 5 digits after the decimal point. _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/more-apis/inventory/overview#decimal-quantities-beta) for more information.
36
+ # The number of items affected by the transfer as a decimal string. Can support up to 5 digits after the decimal point. _Important_: The Point of Sale app and Dashboard do not currently support decimal quantities. If a Point of Sale app or Dashboard attempts to read a decimal quantity on inventory counts or adjustments, the quantity will be rounded down to the nearest integer. For example, `2.5` will become `2`, and `-2.5` will become `-3`. Read [Decimal Quantities (BETA)](/orders-api/what-it-does#decimal-quantities) for more information.
37
37
  attr_accessor :quantity
38
38
 
39
39
  # A client-generated timestamp in RFC 3339 format that indicates when the transfer took place. For write actions, the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request.
@@ -48,27 +48,6 @@ module SquareConnect
48
48
  # The Square ID of the [Employee](#type-employee) responsible for the inventory transfer.
49
49
  attr_accessor :employee_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,21 +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
- state_validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
178
- return false unless state_validator.valid?(@state)
179
156
  return true
180
157
  end
181
158
 
182
- # Custom attribute writer method checking allowed values (enum).
183
- # @param [Object] state Object to be assigned
184
- def state=(state)
185
- validator = EnumAttributeValidator.new('String', ["CUSTOM", "IN_STOCK", "SOLD", "RETURNED_BY_CUSTOMER", "RESERVED_FOR_SALE", "SOLD_ONLINE", "ORDERED_FROM_VENDOR", "RECEIVED_FROM_VENDOR", "IN_TRANSIT_TO", "NONE", "WASTE", "UNLINKED_RETURN"])
186
- unless validator.valid?(state)
187
- fail ArgumentError, "invalid value for 'state', must be one of #{validator.allowable_values}."
188
- end
189
- @state = state
190
- end
191
-
192
159
  # Checks equality by comparing each attribute.
193
160
  # @param [Object] Object to be compared
194
161
  def ==(o)
@@ -30,27 +30,6 @@ module SquareConnect
30
30
  # If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer.
31
31
  attr_accessor :inventory_alert_threshold
32
32
 
33
- class EnumAttributeValidator
34
- attr_reader :datatype
35
- attr_reader :allowable_values
36
-
37
- def initialize(datatype, allowable_values)
38
- @allowable_values = allowable_values.map do |value|
39
- case datatype.to_s
40
- when /Integer/i
41
- value.to_i
42
- when /Float/i
43
- value.to_f
44
- else
45
- value
46
- end
47
- end
48
- end
49
-
50
- def valid?(value)
51
- !value || allowable_values.include?(value)
52
- end
53
- end
54
33
 
55
34
  # Attribute mapping from ruby-style variable name to JSON key.
56
35
  def self.attribute_map
@@ -120,33 +99,9 @@ module SquareConnect
120
99
  # Check to see if the all the properties in the model are valid
121
100
  # @return true if the model is valid
122
101
  def valid?
123
- pricing_type_validator = EnumAttributeValidator.new('String', ["FIXED_PRICING", "VARIABLE_PRICING"])
124
- return false unless pricing_type_validator.valid?(@pricing_type)
125
- inventory_alert_type_validator = EnumAttributeValidator.new('String', ["NONE", "LOW_QUANTITY"])
126
- return false unless inventory_alert_type_validator.valid?(@inventory_alert_type)
127
102
  return true
128
103
  end
129
104
 
130
- # Custom attribute writer method checking allowed values (enum).
131
- # @param [Object] pricing_type Object to be assigned
132
- def pricing_type=(pricing_type)
133
- validator = EnumAttributeValidator.new('String', ["FIXED_PRICING", "VARIABLE_PRICING"])
134
- unless validator.valid?(pricing_type)
135
- fail ArgumentError, "invalid value for 'pricing_type', must be one of #{validator.allowable_values}."
136
- end
137
- @pricing_type = pricing_type
138
- end
139
-
140
- # Custom attribute writer method checking allowed values (enum).
141
- # @param [Object] inventory_alert_type Object to be assigned
142
- def inventory_alert_type=(inventory_alert_type)
143
- validator = EnumAttributeValidator.new('String', ["NONE", "LOW_QUANTITY"])
144
- unless validator.valid?(inventory_alert_type)
145
- fail ArgumentError, "invalid value for 'inventory_alert_type', must be one of #{validator.allowable_values}."
146
- end
147
- @inventory_alert_type = inventory_alert_type
148
- end
149
-
150
105
  # Checks equality by comparing each attribute.
151
106
  # @param [Object] Object to be compared
152
107
  def ==(o)