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
@@ -36,27 +36,6 @@ module SquareConnect
36
36
  # A unique, Square-assigned ID that identifies the card across multiple locations and applications for a single Square account.
37
37
  attr_accessor :fingerprint
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
- card_brand_validator = EnumAttributeValidator.new('String', ["OTHER_BRAND", "VISA", "MASTERCARD", "AMERICAN_EXPRESS", "DISCOVER", "DISCOVER_DINERS", "JCB", "CHINA_UNIONPAY", "SQUARE_GIFT_CARD"])
142
- return false unless card_brand_validator.valid?(@card_brand)
143
120
  return true
144
121
  end
145
122
 
146
- # Custom attribute writer method checking allowed values (enum).
147
- # @param [Object] card_brand Object to be assigned
148
- def card_brand=(card_brand)
149
- validator = EnumAttributeValidator.new('String', ["OTHER_BRAND", "VISA", "MASTERCARD", "AMERICAN_EXPRESS", "DISCOVER", "DISCOVER_DINERS", "JCB", "CHINA_UNIONPAY", "SQUARE_GIFT_CARD"])
150
- unless validator.valid?(card_brand)
151
- fail ArgumentError, "invalid value for 'card_brand', must be one of #{validator.allowable_values}."
152
- end
153
- @card_brand = card_brand
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
  # The color of the discount's display label in the Square Point of Sale app. This must be a valid hex color code.
31
31
  attr_accessor :label_color
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
- discount_type_validator = EnumAttributeValidator.new('String', ["FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
124
- return false unless discount_type_validator.valid?(@discount_type)
125
102
  return true
126
103
  end
127
104
 
128
- # Custom attribute writer method checking allowed values (enum).
129
- # @param [Object] discount_type Object to be assigned
130
- def discount_type=(discount_type)
131
- validator = EnumAttributeValidator.new('String', ["FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
132
- unless validator.valid?(discount_type)
133
- fail ArgumentError, "invalid value for 'discount_type', must be one of #{validator.allowable_values}."
134
- end
135
- @discount_type = discount_type
136
- end
137
-
138
105
  # Checks equality by comparing each attribute.
139
106
  # @param [Object] Object to be compared
140
107
  def ==(o)
@@ -42,9 +42,6 @@ module SquareConnect
42
42
  # A set of [CatalogItemModifierListInfo](#type-catalogitemmodifierlistinfo) objects representing the modifier lists that apply to this item, along with the overrides and min and max limits that are specific to this item. [CatalogModifierList](#type-catalogmodifierlist)s may also be added to or deleted from an item using `UpdateItemModifierLists`.
43
43
  attr_accessor :modifier_list_info
44
44
 
45
- # __Deprecated__. The URL of an image representing this item. Deprecated in favor of `image_id` in [`CatalogObject`](#type-catalogobject).
46
- attr_accessor :image_url
47
-
48
45
  # A list of [CatalogObject](#type-catalogobject)s containing the [CatalogItemVariation](#type-catalogitemvariation)s for this item. Maximum: 250 item variations
49
46
  attr_accessor :variations
50
47
 
@@ -54,27 +51,6 @@ module SquareConnect
54
51
  # If `false`, the Square Point of Sale app will present the [CatalogItem](#type-catalogitem)'s details screen immediately, allowing the merchant to choose [CatalogModifier](#type-catalogmodifier)s before adding the item to the cart. This is the default behavior. If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre-selected modifiers, and merchants can edit modifiers by drilling down onto the item's details. Third-party clients are encouraged to implement similar behaviors.
55
52
  attr_accessor :skip_modifier_screen
56
53
 
57
- class EnumAttributeValidator
58
- attr_reader :datatype
59
- attr_reader :allowable_values
60
-
61
- def initialize(datatype, allowable_values)
62
- @allowable_values = allowable_values.map do |value|
63
- case datatype.to_s
64
- when /Integer/i
65
- value.to_i
66
- when /Float/i
67
- value.to_f
68
- else
69
- value
70
- end
71
- end
72
- end
73
-
74
- def valid?(value)
75
- !value || allowable_values.include?(value)
76
- end
77
- end
78
54
 
79
55
  # Attribute mapping from ruby-style variable name to JSON key.
80
56
  def self.attribute_map
@@ -89,7 +65,6 @@ module SquareConnect
89
65
  :'category_id' => :'category_id',
90
66
  :'tax_ids' => :'tax_ids',
91
67
  :'modifier_list_info' => :'modifier_list_info',
92
- :'image_url' => :'image_url',
93
68
  :'variations' => :'variations',
94
69
  :'product_type' => :'product_type',
95
70
  :'skip_modifier_screen' => :'skip_modifier_screen'
@@ -109,7 +84,6 @@ module SquareConnect
109
84
  :'category_id' => :'String',
110
85
  :'tax_ids' => :'Array<String>',
111
86
  :'modifier_list_info' => :'Array<CatalogItemModifierListInfo>',
112
- :'image_url' => :'String',
113
87
  :'variations' => :'Array<CatalogObject>',
114
88
  :'product_type' => :'String',
115
89
  :'skip_modifier_screen' => :'BOOLEAN'
@@ -168,10 +142,6 @@ module SquareConnect
168
142
  end
169
143
  end
170
144
 
171
- if attributes.has_key?(:'image_url')
172
- self.image_url = attributes[:'image_url']
173
- end
174
-
175
145
  if attributes.has_key?(:'variations')
176
146
  if (value = attributes[:'variations']).is_a?(Array)
177
147
  self.variations = value
@@ -198,21 +168,9 @@ module SquareConnect
198
168
  # Check to see if the all the properties in the model are valid
199
169
  # @return true if the model is valid
200
170
  def valid?
201
- product_type_validator = EnumAttributeValidator.new('String', ["REGULAR", "GIFT_CARD", "APPOINTMENTS_SERVICE", "RETAIL_ITEM", "RESTAURANT_ITEM"])
202
- return false unless product_type_validator.valid?(@product_type)
203
171
  return true
204
172
  end
205
173
 
206
- # Custom attribute writer method checking allowed values (enum).
207
- # @param [Object] product_type Object to be assigned
208
- def product_type=(product_type)
209
- validator = EnumAttributeValidator.new('String', ["REGULAR", "GIFT_CARD", "APPOINTMENTS_SERVICE", "RETAIL_ITEM", "RESTAURANT_ITEM"])
210
- unless validator.valid?(product_type)
211
- fail ArgumentError, "invalid value for 'product_type', must be one of #{validator.allowable_values}."
212
- end
213
- @product_type = product_type
214
- end
215
-
216
174
  # Checks equality by comparing each attribute.
217
175
  # @param [Object] Object to be compared
218
176
  def ==(o)
@@ -228,7 +186,6 @@ module SquareConnect
228
186
  category_id == o.category_id &&
229
187
  tax_ids == o.tax_ids &&
230
188
  modifier_list_info == o.modifier_list_info &&
231
- image_url == o.image_url &&
232
189
  variations == o.variations &&
233
190
  product_type == o.product_type &&
234
191
  skip_modifier_screen == o.skip_modifier_screen
@@ -243,7 +200,7 @@ module SquareConnect
243
200
  # Calculates hash code according to all attributes.
244
201
  # @return [Fixnum] Hash code
245
202
  def hash
246
- [name, description, abbreviation, label_color, available_online, available_for_pickup, available_electronically, category_id, tax_ids, modifier_list_info, image_url, variations, product_type, skip_modifier_screen].hash
203
+ [name, description, abbreviation, label_color, available_online, available_for_pickup, available_electronically, category_id, tax_ids, modifier_list_info, variations, product_type, skip_modifier_screen].hash
247
204
  end
248
205
 
249
206
  # Builds the object from hash
@@ -51,33 +51,9 @@ module SquareConnect
51
51
  # If the [CatalogItem](#type-catalogitem) that owns this item variation is of type `APPOINTMENTS_SERVICE`, then this is the duration of the service in milliseconds. For example, a 30 minute appointment would have the value `1800000`, which is equal to 30 (minutes) * 60 (seconds per minute) * 1000 (milliseconds per second).
52
52
  attr_accessor :service_duration
53
53
 
54
- # Represents the unit used to measure a [CatalogItemVariation](#type-catalogitemvariation) and specifies the precision for decimal quantities.
55
- attr_accessor :catalog_measurement_unit_id
56
-
57
54
  # ID of the ‘CatalogMeasurementUnit’ that is used to measure the quantity sold of this item variation. If left unset, the item will be sold in whole quantities.
58
55
  attr_accessor :measurement_unit_id
59
56
 
60
- class EnumAttributeValidator
61
- attr_reader :datatype
62
- attr_reader :allowable_values
63
-
64
- def initialize(datatype, allowable_values)
65
- @allowable_values = allowable_values.map do |value|
66
- case datatype.to_s
67
- when /Integer/i
68
- value.to_i
69
- when /Float/i
70
- value.to_f
71
- else
72
- value
73
- end
74
- end
75
- end
76
-
77
- def valid?(value)
78
- !value || allowable_values.include?(value)
79
- end
80
- end
81
57
 
82
58
  # Attribute mapping from ruby-style variable name to JSON key.
83
59
  def self.attribute_map
@@ -95,7 +71,6 @@ module SquareConnect
95
71
  :'inventory_alert_threshold' => :'inventory_alert_threshold',
96
72
  :'user_data' => :'user_data',
97
73
  :'service_duration' => :'service_duration',
98
- :'catalog_measurement_unit_id' => :'catalog_measurement_unit_id',
99
74
  :'measurement_unit_id' => :'measurement_unit_id'
100
75
  }
101
76
  end
@@ -116,7 +91,6 @@ module SquareConnect
116
91
  :'inventory_alert_threshold' => :'Integer',
117
92
  :'user_data' => :'String',
118
93
  :'service_duration' => :'Integer',
119
- :'catalog_measurement_unit_id' => :'String',
120
94
  :'measurement_unit_id' => :'String'
121
95
  }
122
96
  end
@@ -183,10 +157,6 @@ module SquareConnect
183
157
  self.service_duration = attributes[:'service_duration']
184
158
  end
185
159
 
186
- if attributes.has_key?(:'catalog_measurement_unit_id')
187
- self.catalog_measurement_unit_id = attributes[:'catalog_measurement_unit_id']
188
- end
189
-
190
160
  if attributes.has_key?(:'measurement_unit_id')
191
161
  self.measurement_unit_id = attributes[:'measurement_unit_id']
192
162
  end
@@ -203,33 +173,9 @@ module SquareConnect
203
173
  # Check to see if the all the properties in the model are valid
204
174
  # @return true if the model is valid
205
175
  def valid?
206
- pricing_type_validator = EnumAttributeValidator.new('String', ["FIXED_PRICING", "VARIABLE_PRICING"])
207
- return false unless pricing_type_validator.valid?(@pricing_type)
208
- inventory_alert_type_validator = EnumAttributeValidator.new('String', ["NONE", "LOW_QUANTITY"])
209
- return false unless inventory_alert_type_validator.valid?(@inventory_alert_type)
210
176
  return true
211
177
  end
212
178
 
213
- # Custom attribute writer method checking allowed values (enum).
214
- # @param [Object] pricing_type Object to be assigned
215
- def pricing_type=(pricing_type)
216
- validator = EnumAttributeValidator.new('String', ["FIXED_PRICING", "VARIABLE_PRICING"])
217
- unless validator.valid?(pricing_type)
218
- fail ArgumentError, "invalid value for 'pricing_type', must be one of #{validator.allowable_values}."
219
- end
220
- @pricing_type = pricing_type
221
- end
222
-
223
- # Custom attribute writer method checking allowed values (enum).
224
- # @param [Object] inventory_alert_type Object to be assigned
225
- def inventory_alert_type=(inventory_alert_type)
226
- validator = EnumAttributeValidator.new('String', ["NONE", "LOW_QUANTITY"])
227
- unless validator.valid?(inventory_alert_type)
228
- fail ArgumentError, "invalid value for 'inventory_alert_type', must be one of #{validator.allowable_values}."
229
- end
230
- @inventory_alert_type = inventory_alert_type
231
- end
232
-
233
179
  # Checks equality by comparing each attribute.
234
180
  # @param [Object] Object to be compared
235
181
  def ==(o)
@@ -248,7 +194,6 @@ module SquareConnect
248
194
  inventory_alert_threshold == o.inventory_alert_threshold &&
249
195
  user_data == o.user_data &&
250
196
  service_duration == o.service_duration &&
251
- catalog_measurement_unit_id == o.catalog_measurement_unit_id &&
252
197
  measurement_unit_id == o.measurement_unit_id
253
198
  end
254
199
 
@@ -261,7 +206,7 @@ module SquareConnect
261
206
  # Calculates hash code according to all attributes.
262
207
  # @return [Fixnum] Hash code
263
208
  def hash
264
- [item_id, name, sku, upc, ordinal, pricing_type, price_money, location_overrides, track_inventory, inventory_alert_type, inventory_alert_threshold, user_data, service_duration, catalog_measurement_unit_id, measurement_unit_id].hash
209
+ [item_id, name, sku, upc, ordinal, pricing_type, price_money, location_overrides, track_inventory, inventory_alert_type, inventory_alert_threshold, user_data, service_duration, measurement_unit_id].hash
265
210
  end
266
211
 
267
212
  # Builds the object from hash
@@ -21,27 +21,6 @@ module SquareConnect
21
21
  # The options included in the [CatalogModifierList](#type-catalogmodifierlist). You must include at least one [CatalogModifier](#type-catalogmodifier). Each [CatalogObject](#type-catalogobject) must have type `MODIFIER` and contain [CatalogModifier](#type-catalogmodifier) data.
22
22
  attr_accessor :modifiers
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
@@ -95,21 +74,9 @@ module SquareConnect
95
74
  # Check to see if the all the properties in the model are valid
96
75
  # @return true if the model is valid
97
76
  def valid?
98
- selection_type_validator = EnumAttributeValidator.new('String', ["SINGLE", "MULTIPLE"])
99
- return false unless selection_type_validator.valid?(@selection_type)
100
77
  return true
101
78
  end
102
79
 
103
- # Custom attribute writer method checking allowed values (enum).
104
- # @param [Object] selection_type Object to be assigned
105
- def selection_type=(selection_type)
106
- validator = EnumAttributeValidator.new('String', ["SINGLE", "MULTIPLE"])
107
- unless validator.valid?(selection_type)
108
- fail ArgumentError, "invalid value for 'selection_type', must be one of #{validator.allowable_values}."
109
- end
110
- @selection_type = selection_type
111
- end
112
-
113
80
  # Checks equality by comparing each attribute.
114
81
  # @param [Object] Object to be compared
115
82
  def ==(o)
@@ -63,33 +63,21 @@ module SquareConnect
63
63
  # Structured data for a [CatalogModifier](#type-catalogmodifier), set for CatalogObjects of type `MODIFIER`.
64
64
  attr_accessor :modifier_data
65
65
 
66
+ # Structured data for a [CatalogTimePeriod](#type-catalogtimeperiod), set for CatalogObjects of type `TIME_PERIOD`.
67
+ attr_accessor :time_period_data
68
+
69
+ # Structured data for a [CatalogProductSet](#type-catalogproductset), set for CatalogObjects of type `PRODUCT_SET`.
70
+ attr_accessor :product_set_data
71
+
72
+ # Structured data for a [CatalogPricingRule](#type-catalogpricingrule), set for CatalogObjects of type `PRICING_RULE`.
73
+ attr_accessor :pricing_rule_data
74
+
66
75
  # Structured data for a [CatalogImage](#type-catalogimage), set for CatalogObjects of type `IMAGE`.
67
76
  attr_accessor :image_data
68
77
 
69
78
  # Structured data for a [CatalogMeasurementUnit](#type-catalogmeasurementunit), set for CatalogObjects of type `MEASUREMENT_UNIT`.
70
79
  attr_accessor :measurement_unit_data
71
80
 
72
- class EnumAttributeValidator
73
- attr_reader :datatype
74
- attr_reader :allowable_values
75
-
76
- def initialize(datatype, allowable_values)
77
- @allowable_values = allowable_values.map do |value|
78
- case datatype.to_s
79
- when /Integer/i
80
- value.to_i
81
- when /Float/i
82
- value.to_f
83
- else
84
- value
85
- end
86
- end
87
- end
88
-
89
- def valid?(value)
90
- !value || allowable_values.include?(value)
91
- end
92
- end
93
81
 
94
82
  # Attribute mapping from ruby-style variable name to JSON key.
95
83
  def self.attribute_map
@@ -111,6 +99,9 @@ module SquareConnect
111
99
  :'discount_data' => :'discount_data',
112
100
  :'modifier_list_data' => :'modifier_list_data',
113
101
  :'modifier_data' => :'modifier_data',
102
+ :'time_period_data' => :'time_period_data',
103
+ :'product_set_data' => :'product_set_data',
104
+ :'pricing_rule_data' => :'pricing_rule_data',
114
105
  :'image_data' => :'image_data',
115
106
  :'measurement_unit_data' => :'measurement_unit_data'
116
107
  }
@@ -136,6 +127,9 @@ module SquareConnect
136
127
  :'discount_data' => :'CatalogDiscount',
137
128
  :'modifier_list_data' => :'CatalogModifierList',
138
129
  :'modifier_data' => :'CatalogModifier',
130
+ :'time_period_data' => :'CatalogTimePeriod',
131
+ :'product_set_data' => :'CatalogProductSet',
132
+ :'pricing_rule_data' => :'CatalogPricingRule',
139
133
  :'image_data' => :'CatalogImage',
140
134
  :'measurement_unit_data' => :'CatalogMeasurementUnit'
141
135
  }
@@ -223,6 +217,18 @@ module SquareConnect
223
217
  self.modifier_data = attributes[:'modifier_data']
224
218
  end
225
219
 
220
+ if attributes.has_key?(:'time_period_data')
221
+ self.time_period_data = attributes[:'time_period_data']
222
+ end
223
+
224
+ if attributes.has_key?(:'product_set_data')
225
+ self.product_set_data = attributes[:'product_set_data']
226
+ end
227
+
228
+ if attributes.has_key?(:'pricing_rule_data')
229
+ self.pricing_rule_data = attributes[:'pricing_rule_data']
230
+ end
231
+
226
232
  if attributes.has_key?(:'image_data')
227
233
  self.image_data = attributes[:'image_data']
228
234
  end
@@ -256,23 +262,11 @@ module SquareConnect
256
262
  # @return true if the model is valid
257
263
  def valid?
258
264
  return false if @type.nil?
259
- type_validator = EnumAttributeValidator.new('String', ["ITEM", "IMAGE", "CATEGORY", "ITEM_VARIATION", "TAX", "DISCOUNT", "MODIFIER_LIST", "MODIFIER", "PRICING_RULE", "PRODUCT_SET", "TIME_PERIOD"])
260
- return false unless type_validator.valid?(@type)
261
265
  return false if @id.nil?
262
266
  return false if @id.to_s.length < 1
263
267
  return true
264
268
  end
265
269
 
266
- # Custom attribute writer method checking allowed values (enum).
267
- # @param [Object] type Object to be assigned
268
- def type=(type)
269
- validator = EnumAttributeValidator.new('String', ["ITEM", "IMAGE", "CATEGORY", "ITEM_VARIATION", "TAX", "DISCOUNT", "MODIFIER_LIST", "MODIFIER", "PRICING_RULE", "PRODUCT_SET", "TIME_PERIOD"])
270
- unless validator.valid?(type)
271
- fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
272
- end
273
- @type = type
274
- end
275
-
276
270
  # Custom attribute writer method with validation
277
271
  # @param [Object] id Value to be assigned
278
272
  def id=(id)
@@ -309,6 +303,9 @@ module SquareConnect
309
303
  discount_data == o.discount_data &&
310
304
  modifier_list_data == o.modifier_list_data &&
311
305
  modifier_data == o.modifier_data &&
306
+ time_period_data == o.time_period_data &&
307
+ product_set_data == o.product_set_data &&
308
+ pricing_rule_data == o.pricing_rule_data &&
312
309
  image_data == o.image_data &&
313
310
  measurement_unit_data == o.measurement_unit_data
314
311
  end
@@ -322,7 +319,7 @@ module SquareConnect
322
319
  # Calculates hash code according to all attributes.
323
320
  # @return [Fixnum] Hash code
324
321
  def hash
325
- [type, id, updated_at, version, is_deleted, catalog_v1_ids, present_at_all_locations, present_at_location_ids, absent_at_location_ids, image_id, item_data, category_data, item_variation_data, tax_data, discount_data, modifier_list_data, modifier_data, image_data, measurement_unit_data].hash
322
+ [type, id, updated_at, version, is_deleted, catalog_v1_ids, present_at_all_locations, present_at_location_ids, absent_at_location_ids, image_id, item_data, category_data, item_variation_data, tax_data, discount_data, modifier_list_data, modifier_data, time_period_data, product_set_data, pricing_rule_data, image_data, measurement_unit_data].hash
326
323
  end
327
324
 
328
325
  # Builds the object from hash