Class: SquareConnect::V1ItemsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/square_connect/api/v1_items_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ V1ItemsApi

Returns a new instance of V1ItemsApi.



16
17
18
# File 'lib/square_connect/api/v1_items_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/square_connect/api/v1_items_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#adjust_inventory(location_id, variation_id, body, opts = {}) ⇒ V1InventoryEntry

AdjustInventory Adjusts an item variation’s current available inventory.

Parameters:

  • location_id

    The ID of the item's associated location.

  • variation_id

    The ID of the variation to adjust inventory information for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/square_connect/api/v1_items_api.rb', line 27

def adjust_inventory(location_id, variation_id, body, opts = {})
  data, _status_code, _headers = adjust_inventory_with_http_info(location_id, variation_id, body, opts)
  return data
end

#adjust_inventory_with_http_info(location_id, variation_id, body, opts = {}) ⇒ Array<(V1InventoryEntry, Fixnum, Hash)>

AdjustInventory Adjusts an item variation&#39;s current available inventory.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • variation_id

    The ID of the variation to adjust inventory information for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1InventoryEntry, Fixnum, Hash)>)

    V1InventoryEntry data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/square_connect/api/v1_items_api.rb', line 39

def adjust_inventory_with_http_info(location_id, variation_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.adjust_inventory ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.adjust_inventory" if location_id.nil?
  # verify the required parameter 'variation_id' is set
  fail ArgumentError, "Missing the required parameter 'variation_id' when calling V1ItemsApi.adjust_inventory" if variation_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.adjust_inventory" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/inventory/{variation_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'variation_id' + '}', variation_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1InventoryEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#adjust_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#apply_fee(location_id, item_id, fee_id, opts = {}) ⇒ V1Item

ApplyFee Associates a fee with an item, meaning the fee is automatically applied to the item in Square Register.

Parameters:

  • location_id

    The ID of the fee&#39;s associated location.

  • item_id

    The ID of the item to add the fee to.

  • fee_id

    The ID of the fee to apply.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



90
91
92
93
# File 'lib/square_connect/api/v1_items_api.rb', line 90

def apply_fee(location_id, item_id, fee_id, opts = {})
  data, _status_code, _headers = apply_fee_with_http_info(location_id, item_id, fee_id, opts)
  return data
end

#apply_fee_with_http_info(location_id, item_id, fee_id, opts = {}) ⇒ Array<(V1Item, Fixnum, Hash)>

ApplyFee Associates a fee with an item, meaning the fee is automatically applied to the item in Square Register.

Parameters:

  • location_id

    The ID of the fee&#39;s associated location.

  • item_id

    The ID of the item to add the fee to.

  • fee_id

    The ID of the fee to apply.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Item, Fixnum, Hash)>)

    V1Item data, response status code and response headers



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/square_connect/api/v1_items_api.rb', line 102

def apply_fee_with_http_info(location_id, item_id, fee_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.apply_fee ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.apply_fee" if location_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.apply_fee" if item_id.nil?
  # verify the required parameter 'fee_id' is set
  fail ArgumentError, "Missing the required parameter 'fee_id' when calling V1ItemsApi.apply_fee" if fee_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}/fees/{fee_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s).sub('{' + 'fee_id' + '}', fee_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Item')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#apply_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#apply_modifier_list(location_id, modifier_list_id, item_id, opts = {}) ⇒ V1Item

ApplyModifierList Associates a modifier list with an item, meaning modifier options from the list can be applied to the item.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to apply.

  • item_id

    The ID of the item to add the modifier list to.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



153
154
155
156
# File 'lib/square_connect/api/v1_items_api.rb', line 153

def apply_modifier_list(location_id, modifier_list_id, item_id, opts = {})
  data, _status_code, _headers = apply_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts)
  return data
end

#apply_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts = {}) ⇒ Array<(V1Item, Fixnum, Hash)>

ApplyModifierList Associates a modifier list with an item, meaning modifier options from the list can be applied to the item.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to apply.

  • item_id

    The ID of the item to add the modifier list to.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Item, Fixnum, Hash)>)

    V1Item data, response status code and response headers



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/square_connect/api/v1_items_api.rb', line 165

def apply_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.apply_modifier_list ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.apply_modifier_list" if location_id.nil?
  # verify the required parameter 'modifier_list_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.apply_modifier_list" if modifier_list_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.apply_modifier_list" if item_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Item')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#apply_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_category(location_id, body, opts = {}) ⇒ V1Category

CreateCategory Creates an item category.

Parameters:

  • location_id

    The ID of the location to create an item for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



215
216
217
218
# File 'lib/square_connect/api/v1_items_api.rb', line 215

def create_category(location_id, body, opts = {})
  data, _status_code, _headers = create_category_with_http_info(location_id, body, opts)
  return data
end

#create_category_with_http_info(location_id, body, opts = {}) ⇒ Array<(V1Category, Fixnum, Hash)>

CreateCategory Creates an item category.

Parameters:

  • location_id

    The ID of the location to create an item for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Category, Fixnum, Hash)>)

    V1Category data, response status code and response headers



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/square_connect/api/v1_items_api.rb', line 226

def create_category_with_http_info(location_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.create_category ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_category" if location_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_category" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/categories".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Category')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#create_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_discount(location_id, body, opts = {}) ⇒ V1Discount

CreateDiscount Creates a discount.

Parameters:

  • location_id

    The ID of the location to create an item for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



274
275
276
277
# File 'lib/square_connect/api/v1_items_api.rb', line 274

def create_discount(location_id, body, opts = {})
  data, _status_code, _headers = create_discount_with_http_info(location_id, body, opts)
  return data
end

#create_discount_with_http_info(location_id, body, opts = {}) ⇒ Array<(V1Discount, Fixnum, Hash)>

CreateDiscount Creates a discount.

Parameters:

  • location_id

    The ID of the location to create an item for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Discount, Fixnum, Hash)>)

    V1Discount data, response status code and response headers



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/square_connect/api/v1_items_api.rb', line 285

def create_discount_with_http_info(location_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.create_discount ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_discount" if location_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_discount" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/discounts".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Discount')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#create_discount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_fee(location_id, body, opts = {}) ⇒ V1Fee

CreateFee Creates a fee (tax).

Parameters:

  • location_id

    The ID of the location to create a fee for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



333
334
335
336
# File 'lib/square_connect/api/v1_items_api.rb', line 333

def create_fee(location_id, body, opts = {})
  data, _status_code, _headers = create_fee_with_http_info(location_id, body, opts)
  return data
end

#create_fee_with_http_info(location_id, body, opts = {}) ⇒ Array<(V1Fee, Fixnum, Hash)>

CreateFee Creates a fee (tax).

Parameters:

  • location_id

    The ID of the location to create a fee for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Fee, Fixnum, Hash)>)

    V1Fee data, response status code and response headers



344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/square_connect/api/v1_items_api.rb', line 344

def create_fee_with_http_info(location_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.create_fee ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_fee" if location_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_fee" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/fees".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Fee')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#create_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_item(location_id, body, opts = {}) ⇒ V1Item

CreateItem Creates an item and at least one variation for it. Item-related entities include fields you can use to associate them with entities in a non-Square system. When you create an item-related entity, you can optionally specify its ‘id`. This value must be unique among all IDs ever specified for the account, including those specified by other applications. You can never reuse an entity ID. If you do not specify an ID, Square generates one for the entity. Item variations have a `user_data` string that lets you associate arbitrary metadata with the variation. The string cannot exceed 255 characters.

Parameters:

  • location_id

    The ID of the location to create an item for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



392
393
394
395
# File 'lib/square_connect/api/v1_items_api.rb', line 392

def create_item(location_id, body, opts = {})
  data, _status_code, _headers = create_item_with_http_info(location_id, body, opts)
  return data
end

#create_item_with_http_info(location_id, body, opts = {}) ⇒ Array<(V1Item, Fixnum, Hash)>

CreateItem Creates an item and at least one variation for it. Item-related entities include fields you can use to associate them with entities in a non-Square system. When you create an item-related entity, you can optionally specify its &#x60;id&#x60;. This value must be unique among all IDs ever specified for the account, including those specified by other applications. You can never reuse an entity ID. If you do not specify an ID, Square generates one for the entity. Item variations have a &#x60;user_data&#x60; string that lets you associate arbitrary metadata with the variation. The string cannot exceed 255 characters.

Parameters:

  • location_id

    The ID of the location to create an item for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Item, Fixnum, Hash)>)

    V1Item data, response status code and response headers



403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/square_connect/api/v1_items_api.rb', line 403

def create_item_with_http_info(location_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.create_item ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_item" if location_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_item" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Item')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#create_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_modifier_list(location_id, body, opts = {}) ⇒ V1ModifierList

CreateModifierList Creates an item modifier list and at least one modifier option for it.

Parameters:

  • location_id

    The ID of the location to create a modifier list for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



451
452
453
454
# File 'lib/square_connect/api/v1_items_api.rb', line 451

def create_modifier_list(location_id, body, opts = {})
  data, _status_code, _headers = create_modifier_list_with_http_info(location_id, body, opts)
  return data
end

#create_modifier_list_with_http_info(location_id, body, opts = {}) ⇒ Array<(V1ModifierList, Fixnum, Hash)>

CreateModifierList Creates an item modifier list and at least one modifier option for it.

Parameters:

  • location_id

    The ID of the location to create a modifier list for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1ModifierList, Fixnum, Hash)>)

    V1ModifierList data, response status code and response headers



462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/square_connect/api/v1_items_api.rb', line 462

def create_modifier_list_with_http_info(location_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.create_modifier_list ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_modifier_list" if location_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_modifier_list" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/modifier-lists".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1ModifierList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#create_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_modifier_option(location_id, modifier_list_id, body, opts = {}) ⇒ V1ModifierOption

CreateModifierOption Creates an item modifier option and adds it to a modifier list.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



511
512
513
514
# File 'lib/square_connect/api/v1_items_api.rb', line 511

def create_modifier_option(location_id, modifier_list_id, body, opts = {})
  data, _status_code, _headers = create_modifier_option_with_http_info(location_id, modifier_list_id, body, opts)
  return data
end

#create_modifier_option_with_http_info(location_id, modifier_list_id, body, opts = {}) ⇒ Array<(V1ModifierOption, Fixnum, Hash)>

CreateModifierOption Creates an item modifier option and adds it to a modifier list.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1ModifierOption, Fixnum, Hash)>)

    V1ModifierOption data, response status code and response headers



523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/square_connect/api/v1_items_api.rb', line 523

def create_modifier_option_with_http_info(location_id, modifier_list_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.create_modifier_option ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_modifier_option" if location_id.nil?
  # verify the required parameter 'modifier_list_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.create_modifier_option" if modifier_list_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_modifier_option" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1ModifierOption')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#create_modifier_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_page(location_id, body, opts = {}) ⇒ V1Page

CreatePage Creates a Favorites page in Square Register.

Parameters:

  • location_id

    The ID of the location to create an item for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



573
574
575
576
# File 'lib/square_connect/api/v1_items_api.rb', line 573

def create_page(location_id, body, opts = {})
  data, _status_code, _headers = create_page_with_http_info(location_id, body, opts)
  return data
end

#create_page_with_http_info(location_id, body, opts = {}) ⇒ Array<(V1Page, Fixnum, Hash)>

CreatePage Creates a Favorites page in Square Register.

Parameters:

  • location_id

    The ID of the location to create an item for.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Page, Fixnum, Hash)>)

    V1Page data, response status code and response headers



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'lib/square_connect/api/v1_items_api.rb', line 584

def create_page_with_http_info(location_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.create_page ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_page" if location_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_page" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/pages".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Page')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#create_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_variation(location_id, item_id, body, opts = {}) ⇒ V1Variation

CreateVariation Creates an item variation for an existing item.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The item&#39;s ID.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



633
634
635
636
# File 'lib/square_connect/api/v1_items_api.rb', line 633

def create_variation(location_id, item_id, body, opts = {})
  data, _status_code, _headers = create_variation_with_http_info(location_id, item_id, body, opts)
  return data
end

#create_variation_with_http_info(location_id, item_id, body, opts = {}) ⇒ Array<(V1Variation, Fixnum, Hash)>

CreateVariation Creates an item variation for an existing item.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The item&#39;s ID.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Variation, Fixnum, Hash)>)

    V1Variation data, response status code and response headers



645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/square_connect/api/v1_items_api.rb', line 645

def create_variation_with_http_info(location_id, item_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.create_variation ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_variation" if location_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.create_variation" if item_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_variation" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}/variations".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Variation')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#create_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_category(location_id, category_id, opts = {}) ⇒ V1Category

DeleteCategory Deletes an existing item category. Note*: DeleteCategory returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeleteCategoryRequest` object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • category_id

    The ID of the category to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



695
696
697
698
# File 'lib/square_connect/api/v1_items_api.rb', line 695

def delete_category(location_id, category_id, opts = {})
  data, _status_code, _headers = delete_category_with_http_info(location_id, category_id, opts)
  return data
end

#delete_category_with_http_info(location_id, category_id, opts = {}) ⇒ Array<(V1Category, Fixnum, Hash)>

DeleteCategory Deletes an existing item category. Note*: DeleteCategory returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeleteCategoryRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • category_id

    The ID of the category to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Category, Fixnum, Hash)>)

    V1Category data, response status code and response headers



706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
# File 'lib/square_connect/api/v1_items_api.rb', line 706

def delete_category_with_http_info(location_id, category_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_category ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_category" if location_id.nil?
  # verify the required parameter 'category_id' is set
  fail ArgumentError, "Missing the required parameter 'category_id' when calling V1ItemsApi.delete_category" if category_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/categories/{category_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'category_id' + '}', category_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Category')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_discount(location_id, discount_id, opts = {}) ⇒ V1Discount

DeleteDiscount Deletes an existing discount. Note*: DeleteDiscount returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeleteDiscountRequest` object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • discount_id

    The ID of the discount to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



754
755
756
757
# File 'lib/square_connect/api/v1_items_api.rb', line 754

def delete_discount(location_id, discount_id, opts = {})
  data, _status_code, _headers = delete_discount_with_http_info(location_id, discount_id, opts)
  return data
end

#delete_discount_with_http_info(location_id, discount_id, opts = {}) ⇒ Array<(V1Discount, Fixnum, Hash)>

DeleteDiscount Deletes an existing discount. Note*: DeleteDiscount returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeleteDiscountRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • discount_id

    The ID of the discount to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Discount, Fixnum, Hash)>)

    V1Discount data, response status code and response headers



765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
# File 'lib/square_connect/api/v1_items_api.rb', line 765

def delete_discount_with_http_info(location_id, discount_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_discount ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_discount" if location_id.nil?
  # verify the required parameter 'discount_id' is set
  fail ArgumentError, "Missing the required parameter 'discount_id' when calling V1ItemsApi.delete_discount" if discount_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/discounts/{discount_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'discount_id' + '}', discount_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Discount')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_discount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_fee(location_id, fee_id, opts = {}) ⇒ V1Fee

DeleteFee Deletes an existing fee (tax). Note*: DeleteFee returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeleteFeeRequest` object as documented below.

Parameters:

  • location_id

    The ID of the fee&#39;s associated location.

  • fee_id

    The ID of the fee to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



813
814
815
816
# File 'lib/square_connect/api/v1_items_api.rb', line 813

def delete_fee(location_id, fee_id, opts = {})
  data, _status_code, _headers = delete_fee_with_http_info(location_id, fee_id, opts)
  return data
end

#delete_fee_with_http_info(location_id, fee_id, opts = {}) ⇒ Array<(V1Fee, Fixnum, Hash)>

DeleteFee Deletes an existing fee (tax). Note*: DeleteFee returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeleteFeeRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the fee&#39;s associated location.

  • fee_id

    The ID of the fee to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Fee, Fixnum, Hash)>)

    V1Fee data, response status code and response headers



824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
# File 'lib/square_connect/api/v1_items_api.rb', line 824

def delete_fee_with_http_info(location_id, fee_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_fee ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_fee" if location_id.nil?
  # verify the required parameter 'fee_id' is set
  fail ArgumentError, "Missing the required parameter 'fee_id' when calling V1ItemsApi.delete_fee" if fee_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/fees/{fee_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'fee_id' + '}', fee_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Fee')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_item(location_id, item_id, opts = {}) ⇒ V1Item

DeleteItem Deletes an existing item and all item variations associated with it. Note*: DeleteItem returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeleteItemRequest` object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The ID of the item to modify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



872
873
874
875
# File 'lib/square_connect/api/v1_items_api.rb', line 872

def delete_item(location_id, item_id, opts = {})
  data, _status_code, _headers = delete_item_with_http_info(location_id, item_id, opts)
  return data
end

#delete_item_with_http_info(location_id, item_id, opts = {}) ⇒ Array<(V1Item, Fixnum, Hash)>

DeleteItem Deletes an existing item and all item variations associated with it. Note*: DeleteItem returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeleteItemRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The ID of the item to modify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Item, Fixnum, Hash)>)

    V1Item data, response status code and response headers



883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
# File 'lib/square_connect/api/v1_items_api.rb', line 883

def delete_item_with_http_info(location_id, item_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_item ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_item" if location_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.delete_item" if item_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Item')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_modifier_list(location_id, modifier_list_id, opts = {}) ⇒ V1ModifierList

DeleteModifierList Deletes an existing item modifier list and all modifier options associated with it. Note*: DeleteModifierList returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeleteModifierListRequest` object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



931
932
933
934
# File 'lib/square_connect/api/v1_items_api.rb', line 931

def delete_modifier_list(location_id, modifier_list_id, opts = {})
  data, _status_code, _headers = delete_modifier_list_with_http_info(location_id, modifier_list_id, opts)
  return data
end

#delete_modifier_list_with_http_info(location_id, modifier_list_id, opts = {}) ⇒ Array<(V1ModifierList, Fixnum, Hash)>

DeleteModifierList Deletes an existing item modifier list and all modifier options associated with it. Note*: DeleteModifierList returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeleteModifierListRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1ModifierList, Fixnum, Hash)>)

    V1ModifierList data, response status code and response headers



942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
# File 'lib/square_connect/api/v1_items_api.rb', line 942

def delete_modifier_list_with_http_info(location_id, modifier_list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_modifier_list ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_modifier_list" if location_id.nil?
  # verify the required parameter 'modifier_list_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.delete_modifier_list" if modifier_list_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1ModifierList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_modifier_option(location_id, modifier_list_id, modifier_option_id, opts = {}) ⇒ V1ModifierOption

DeleteModifierOption Deletes an existing item modifier option from a modifier list. Note*: DeleteModifierOption returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeleteModifierOptionRequest` object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to delete.

  • modifier_option_id

    The ID of the modifier list to edit.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



991
992
993
994
# File 'lib/square_connect/api/v1_items_api.rb', line 991

def delete_modifier_option(location_id, modifier_list_id, modifier_option_id, opts = {})
  data, _status_code, _headers = delete_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, opts)
  return data
end

#delete_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, opts = {}) ⇒ Array<(V1ModifierOption, Fixnum, Hash)>

DeleteModifierOption Deletes an existing item modifier option from a modifier list. Note*: DeleteModifierOption returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeleteModifierOptionRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to delete.

  • modifier_option_id

    The ID of the modifier list to edit.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1ModifierOption, Fixnum, Hash)>)

    V1ModifierOption data, response status code and response headers



1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
# File 'lib/square_connect/api/v1_items_api.rb', line 1003

def delete_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_modifier_option ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_modifier_option" if location_id.nil?
  # verify the required parameter 'modifier_list_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.delete_modifier_option" if modifier_list_id.nil?
  # verify the required parameter 'modifier_option_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_option_id' when calling V1ItemsApi.delete_modifier_option" if modifier_option_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'modifier_option_id' + '}', modifier_option_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1ModifierOption')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_modifier_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_page(location_id, page_id, opts = {}) ⇒ V1Page

DeletePage Deletes an existing Favorites page and all of its cells. Note*: DeletePage returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeletePageRequest` object as documented below.

Parameters:

  • location_id

    The ID of the Favorites page&#39;s associated location.

  • page_id

    The ID of the page to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1053
1054
1055
1056
# File 'lib/square_connect/api/v1_items_api.rb', line 1053

def delete_page(location_id, page_id, opts = {})
  data, _status_code, _headers = delete_page_with_http_info(location_id, page_id, opts)
  return data
end

#delete_page_cell(location_id, page_id, opts = {}) ⇒ V1Page

DeletePageCell Deletes a cell from a Favorites page in Square Register. Note*: DeletePageCell returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeletePageCellRequest` object as documented below.

Parameters:

  • location_id

    The ID of the Favorites page&#39;s associated location.

  • page_id

    The ID of the page to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :row (String)

    The row of the cell to clear. Always an integer between 0 and 4, inclusive. Row 0 is the top row.

  • :column (String)

    The column of the cell to clear. Always an integer between 0 and 4, inclusive. Column 0 is the leftmost column.

Returns:



1114
1115
1116
1117
# File 'lib/square_connect/api/v1_items_api.rb', line 1114

def delete_page_cell(location_id, page_id, opts = {})
  data, _status_code, _headers = delete_page_cell_with_http_info(location_id, page_id, opts)
  return data
end

#delete_page_cell_with_http_info(location_id, page_id, opts = {}) ⇒ Array<(V1Page, Fixnum, Hash)>

DeletePageCell Deletes a cell from a Favorites page in Square Register. Note*: DeletePageCell returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeletePageCellRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the Favorites page&#39;s associated location.

  • page_id

    The ID of the page to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :row (String)

    The row of the cell to clear. Always an integer between 0 and 4, inclusive. Row 0 is the top row.

  • :column (String)

    The column of the cell to clear. Always an integer between 0 and 4, inclusive. Column 0 is the leftmost column.

Returns:

  • (Array<(V1Page, Fixnum, Hash)>)

    V1Page data, response status code and response headers



1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
# File 'lib/square_connect/api/v1_items_api.rb', line 1127

def delete_page_cell_with_http_info(location_id, page_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_page_cell ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_page_cell" if location_id.nil?
  # verify the required parameter 'page_id' is set
  fail ArgumentError, "Missing the required parameter 'page_id' when calling V1ItemsApi.delete_page_cell" if page_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/pages/{page_id}/cells".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'row'] = opts[:'row'] if !opts[:'row'].nil?
  query_params[:'column'] = opts[:'column'] if !opts[:'column'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Page')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_page_cell\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_page_with_http_info(location_id, page_id, opts = {}) ⇒ Array<(V1Page, Fixnum, Hash)>

DeletePage Deletes an existing Favorites page and all of its cells. Note*: DeletePage returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeletePageRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the Favorites page&#39;s associated location.

  • page_id

    The ID of the page to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Page, Fixnum, Hash)>)

    V1Page data, response status code and response headers



1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
# File 'lib/square_connect/api/v1_items_api.rb', line 1064

def delete_page_with_http_info(location_id, page_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_page ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_page" if location_id.nil?
  # verify the required parameter 'page_id' is set
  fail ArgumentError, "Missing the required parameter 'page_id' when calling V1ItemsApi.delete_page" if page_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/pages/{page_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Page')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_variation(location_id, item_id, variation_id, opts = {}) ⇒ V1Variation

DeleteVariation Deletes an existing item variation from an item. Note*: DeleteVariation returns nothing on success but Connect SDKs map the empty response to an empty ‘V1DeleteVariationRequest` object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The ID of the item to delete.

  • variation_id

    The ID of the variation to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1178
1179
1180
1181
# File 'lib/square_connect/api/v1_items_api.rb', line 1178

def delete_variation(location_id, item_id, variation_id, opts = {})
  data, _status_code, _headers = delete_variation_with_http_info(location_id, item_id, variation_id, opts)
  return data
end

#delete_variation_with_http_info(location_id, item_id, variation_id, opts = {}) ⇒ Array<(V1Variation, Fixnum, Hash)>

DeleteVariation Deletes an existing item variation from an item. Note*: DeleteVariation returns nothing on success but Connect SDKs map the empty response to an empty &#x60;V1DeleteVariationRequest&#x60; object as documented below.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The ID of the item to delete.

  • variation_id

    The ID of the variation to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Variation, Fixnum, Hash)>)

    V1Variation data, response status code and response headers



1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
# File 'lib/square_connect/api/v1_items_api.rb', line 1190

def delete_variation_with_http_info(location_id, item_id, variation_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_variation ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_variation" if location_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.delete_variation" if item_id.nil?
  # verify the required parameter 'variation_id' is set
  fail ArgumentError, "Missing the required parameter 'variation_id' when calling V1ItemsApi.delete_variation" if variation_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}/variations/{variation_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s).sub('{' + 'variation_id' + '}', variation_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Variation')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#delete_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_categories(location_id, opts = {}) ⇒ Array<V1Category>

ListCategories Lists all of a location’s item categories.

Parameters:

  • location_id

    The ID of the location to list categories for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1239
1240
1241
1242
# File 'lib/square_connect/api/v1_items_api.rb', line 1239

def list_categories(location_id, opts = {})
  data, _status_code, _headers = list_categories_with_http_info(location_id, opts)
  return data
end

#list_categories_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Category>, Fixnum, Hash)>

ListCategories Lists all of a location&#39;s item categories.

Parameters:

  • location_id

    The ID of the location to list categories for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<V1Category>, Fixnum, Hash)>)

    Array<V1Category> data, response status code and response headers



1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
# File 'lib/square_connect/api/v1_items_api.rb', line 1249

def list_categories_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.list_categories ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_categories" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/categories".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Category>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#list_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_discounts(location_id, opts = {}) ⇒ Array<V1Discount>

ListDiscounts Lists all of a location’s discounts.

Parameters:

  • location_id

    The ID of the location to list categories for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1294
1295
1296
1297
# File 'lib/square_connect/api/v1_items_api.rb', line 1294

def list_discounts(location_id, opts = {})
  data, _status_code, _headers = list_discounts_with_http_info(location_id, opts)
  return data
end

#list_discounts_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Discount>, Fixnum, Hash)>

ListDiscounts Lists all of a location&#39;s discounts.

Parameters:

  • location_id

    The ID of the location to list categories for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<V1Discount>, Fixnum, Hash)>)

    Array<V1Discount> data, response status code and response headers



1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
# File 'lib/square_connect/api/v1_items_api.rb', line 1304

def list_discounts_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.list_discounts ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_discounts" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/discounts".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Discount>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#list_discounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_fees(location_id, opts = {}) ⇒ Array<V1Fee>

ListFees Lists all of a location’s fees (taxes).

Parameters:

  • location_id

    The ID of the location to list fees for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1349
1350
1351
1352
# File 'lib/square_connect/api/v1_items_api.rb', line 1349

def list_fees(location_id, opts = {})
  data, _status_code, _headers = list_fees_with_http_info(location_id, opts)
  return data
end

#list_fees_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Fee>, Fixnum, Hash)>

ListFees Lists all of a location&#39;s fees (taxes).

Parameters:

  • location_id

    The ID of the location to list fees for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<V1Fee>, Fixnum, Hash)>)

    Array<V1Fee> data, response status code and response headers



1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
# File 'lib/square_connect/api/v1_items_api.rb', line 1359

def list_fees_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.list_fees ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_fees" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/fees".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Fee>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#list_fees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_inventory(location_id, opts = {}) ⇒ Array<V1InventoryEntry>

ListInventory Provides inventory information for all of a merchant’s inventory-enabled item variations.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of inventory entries to return in a single response. This value cannot exceed 1000.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



1406
1407
1408
1409
# File 'lib/square_connect/api/v1_items_api.rb', line 1406

def list_inventory(location_id, opts = {})
  data, _status_code, _headers = list_inventory_with_http_info(location_id, opts)
  return data
end

#list_inventory_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1InventoryEntry>, Fixnum, Hash)>

ListInventory Provides inventory information for all of a merchant&#39;s inventory-enabled item variations.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The maximum number of inventory entries to return in a single response. This value cannot exceed 1000.

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

  • (Array<(Array<V1InventoryEntry>, Fixnum, Hash)>)

    Array<V1InventoryEntry> data, response status code and response headers



1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
# File 'lib/square_connect/api/v1_items_api.rb', line 1418

def list_inventory_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.list_inventory ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_inventory" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/inventory".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1InventoryEntry>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#list_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_items(location_id, opts = {}) ⇒ Array<V1Item>

ListItems Provides summary information for all of a location’s items.

Parameters:

  • location_id

    The ID of the location to list items for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:



1466
1467
1468
1469
# File 'lib/square_connect/api/v1_items_api.rb', line 1466

def list_items(location_id, opts = {})
  data, _status_code, _headers = list_items_with_http_info(location_id, opts)
  return data
end

#list_items_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Item>, Fixnum, Hash)>

ListItems Provides summary information for all of a location&#39;s items.

Parameters:

  • location_id

    The ID of the location to list items for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :batch_token (String)

    A pagination cursor to retrieve the next set of results for your original query to the endpoint.

Returns:

  • (Array<(Array<V1Item>, Fixnum, Hash)>)

    Array<V1Item> data, response status code and response headers



1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
# File 'lib/square_connect/api/v1_items_api.rb', line 1477

def list_items_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.list_items ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_items" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Item>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#list_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_modifier_lists(location_id, opts = {}) ⇒ Array<V1ModifierList>

ListModifierLists Lists all of a location’s modifier lists.

Parameters:

  • location_id

    The ID of the location to list modifier lists for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1523
1524
1525
1526
# File 'lib/square_connect/api/v1_items_api.rb', line 1523

def list_modifier_lists(location_id, opts = {})
  data, _status_code, _headers = list_modifier_lists_with_http_info(location_id, opts)
  return data
end

#list_modifier_lists_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1ModifierList>, Fixnum, Hash)>

ListModifierLists Lists all of a location&#39;s modifier lists.

Parameters:

  • location_id

    The ID of the location to list modifier lists for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<V1ModifierList>, Fixnum, Hash)>)

    Array<V1ModifierList> data, response status code and response headers



1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
# File 'lib/square_connect/api/v1_items_api.rb', line 1533

def list_modifier_lists_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.list_modifier_lists ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_modifier_lists" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/modifier-lists".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1ModifierList>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#list_modifier_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_pages(location_id, opts = {}) ⇒ Array<V1Page>

ListPages Lists all of a location’s Favorites pages in Square Register.

Parameters:

  • location_id

    The ID of the location to list Favorites pages for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1578
1579
1580
1581
# File 'lib/square_connect/api/v1_items_api.rb', line 1578

def list_pages(location_id, opts = {})
  data, _status_code, _headers = list_pages_with_http_info(location_id, opts)
  return data
end

#list_pages_with_http_info(location_id, opts = {}) ⇒ Array<(Array<V1Page>, Fixnum, Hash)>

ListPages Lists all of a location&#39;s Favorites pages in Square Register.

Parameters:

  • location_id

    The ID of the location to list Favorites pages for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<V1Page>, Fixnum, Hash)>)

    Array<V1Page> data, response status code and response headers



1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
# File 'lib/square_connect/api/v1_items_api.rb', line 1588

def list_pages_with_http_info(location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.list_pages ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_pages" if location_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/pages".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<V1Page>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#list_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_fee(location_id, item_id, fee_id, opts = {}) ⇒ V1Item

RemoveFee Removes a fee assocation from an item, meaning the fee is no longer automatically applied to the item in Square Register.

Parameters:

  • location_id

    The ID of the fee&#39;s associated location.

  • item_id

    The ID of the item to add the fee to.

  • fee_id

    The ID of the fee to apply.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1635
1636
1637
1638
# File 'lib/square_connect/api/v1_items_api.rb', line 1635

def remove_fee(location_id, item_id, fee_id, opts = {})
  data, _status_code, _headers = remove_fee_with_http_info(location_id, item_id, fee_id, opts)
  return data
end

#remove_fee_with_http_info(location_id, item_id, fee_id, opts = {}) ⇒ Array<(V1Item, Fixnum, Hash)>

RemoveFee Removes a fee assocation from an item, meaning the fee is no longer automatically applied to the item in Square Register.

Parameters:

  • location_id

    The ID of the fee&#39;s associated location.

  • item_id

    The ID of the item to add the fee to.

  • fee_id

    The ID of the fee to apply.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Item, Fixnum, Hash)>)

    V1Item data, response status code and response headers



1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
# File 'lib/square_connect/api/v1_items_api.rb', line 1647

def remove_fee_with_http_info(location_id, item_id, fee_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.remove_fee ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.remove_fee" if location_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.remove_fee" if item_id.nil?
  # verify the required parameter 'fee_id' is set
  fail ArgumentError, "Missing the required parameter 'fee_id' when calling V1ItemsApi.remove_fee" if fee_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}/fees/{fee_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s).sub('{' + 'fee_id' + '}', fee_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Item')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#remove_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_modifier_list(location_id, modifier_list_id, item_id, opts = {}) ⇒ V1Item

RemoveModifierList Removes a modifier list association from an item, meaning modifier options from the list can no longer be applied to the item.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to remove.

  • item_id

    The ID of the item to remove the modifier list from.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1698
1699
1700
1701
# File 'lib/square_connect/api/v1_items_api.rb', line 1698

def remove_modifier_list(location_id, modifier_list_id, item_id, opts = {})
  data, _status_code, _headers = remove_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts)
  return data
end

#remove_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts = {}) ⇒ Array<(V1Item, Fixnum, Hash)>

RemoveModifierList Removes a modifier list association from an item, meaning modifier options from the list can no longer be applied to the item.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to remove.

  • item_id

    The ID of the item to remove the modifier list from.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Item, Fixnum, Hash)>)

    V1Item data, response status code and response headers



1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
# File 'lib/square_connect/api/v1_items_api.rb', line 1710

def remove_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.remove_modifier_list ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.remove_modifier_list" if location_id.nil?
  # verify the required parameter 'modifier_list_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.remove_modifier_list" if modifier_list_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.remove_modifier_list" if item_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Item')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#remove_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_item(location_id, item_id, opts = {}) ⇒ V1Item

RetrieveItem Provides the details for a single item, including associated modifier lists and fees.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The item&#39;s ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1760
1761
1762
1763
# File 'lib/square_connect/api/v1_items_api.rb', line 1760

def retrieve_item(location_id, item_id, opts = {})
  data, _status_code, _headers = retrieve_item_with_http_info(location_id, item_id, opts)
  return data
end

#retrieve_item_with_http_info(location_id, item_id, opts = {}) ⇒ Array<(V1Item, Fixnum, Hash)>

RetrieveItem Provides the details for a single item, including associated modifier lists and fees.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The item&#39;s ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Item, Fixnum, Hash)>)

    V1Item data, response status code and response headers



1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
# File 'lib/square_connect/api/v1_items_api.rb', line 1771

def retrieve_item_with_http_info(location_id, item_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.retrieve_item ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.retrieve_item" if location_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.retrieve_item" if item_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Item')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#retrieve_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_modifier_list(location_id, modifier_list_id, opts = {}) ⇒ V1ModifierList

RetrieveModifierList Provides the details for a single modifier list.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The modifier list&#39;s ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1819
1820
1821
1822
# File 'lib/square_connect/api/v1_items_api.rb', line 1819

def retrieve_modifier_list(location_id, modifier_list_id, opts = {})
  data, _status_code, _headers = retrieve_modifier_list_with_http_info(location_id, modifier_list_id, opts)
  return data
end

#retrieve_modifier_list_with_http_info(location_id, modifier_list_id, opts = {}) ⇒ Array<(V1ModifierList, Fixnum, Hash)>

RetrieveModifierList Provides the details for a single modifier list.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The modifier list&#39;s ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1ModifierList, Fixnum, Hash)>)

    V1ModifierList data, response status code and response headers



1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
# File 'lib/square_connect/api/v1_items_api.rb', line 1830

def retrieve_modifier_list_with_http_info(location_id, modifier_list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.retrieve_modifier_list ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.retrieve_modifier_list" if location_id.nil?
  # verify the required parameter 'modifier_list_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.retrieve_modifier_list" if modifier_list_id.nil?
  # resource path
  local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1ModifierList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#retrieve_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_category(location_id, category_id, body, opts = {}) ⇒ V1Category

UpdateCategory Modifies the details of an existing item category.

Parameters:

  • location_id

    The ID of the category&#39;s associated location.

  • category_id

    The ID of the category to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1879
1880
1881
1882
# File 'lib/square_connect/api/v1_items_api.rb', line 1879

def update_category(location_id, category_id, body, opts = {})
  data, _status_code, _headers = update_category_with_http_info(location_id, category_id, body, opts)
  return data
end

#update_category_with_http_info(location_id, category_id, body, opts = {}) ⇒ Array<(V1Category, Fixnum, Hash)>

UpdateCategory Modifies the details of an existing item category.

Parameters:

  • location_id

    The ID of the category&#39;s associated location.

  • category_id

    The ID of the category to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Category, Fixnum, Hash)>)

    V1Category data, response status code and response headers



1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
# File 'lib/square_connect/api/v1_items_api.rb', line 1891

def update_category_with_http_info(location_id, category_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_category ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_category" if location_id.nil?
  # verify the required parameter 'category_id' is set
  fail ArgumentError, "Missing the required parameter 'category_id' when calling V1ItemsApi.update_category" if category_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_category" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/categories/{category_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'category_id' + '}', category_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Category')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_discount(location_id, discount_id, body, opts = {}) ⇒ V1Discount

UpdateDiscount Modifies the details of an existing discount.

Parameters:

  • location_id

    The ID of the category&#39;s associated location.

  • discount_id

    The ID of the discount to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1942
1943
1944
1945
# File 'lib/square_connect/api/v1_items_api.rb', line 1942

def update_discount(location_id, discount_id, body, opts = {})
  data, _status_code, _headers = update_discount_with_http_info(location_id, discount_id, body, opts)
  return data
end

#update_discount_with_http_info(location_id, discount_id, body, opts = {}) ⇒ Array<(V1Discount, Fixnum, Hash)>

UpdateDiscount Modifies the details of an existing discount.

Parameters:

  • location_id

    The ID of the category&#39;s associated location.

  • discount_id

    The ID of the discount to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Discount, Fixnum, Hash)>)

    V1Discount data, response status code and response headers



1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
# File 'lib/square_connect/api/v1_items_api.rb', line 1954

def update_discount_with_http_info(location_id, discount_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_discount ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_discount" if location_id.nil?
  # verify the required parameter 'discount_id' is set
  fail ArgumentError, "Missing the required parameter 'discount_id' when calling V1ItemsApi.update_discount" if discount_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_discount" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/discounts/{discount_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'discount_id' + '}', discount_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Discount')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_discount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_fee(location_id, fee_id, body, opts = {}) ⇒ V1Fee

UpdateFee Modifies the details of an existing fee (tax).

Parameters:

  • location_id

    The ID of the fee&#39;s associated location.

  • fee_id

    The ID of the fee to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2005
2006
2007
2008
# File 'lib/square_connect/api/v1_items_api.rb', line 2005

def update_fee(location_id, fee_id, body, opts = {})
  data, _status_code, _headers = update_fee_with_http_info(location_id, fee_id, body, opts)
  return data
end

#update_fee_with_http_info(location_id, fee_id, body, opts = {}) ⇒ Array<(V1Fee, Fixnum, Hash)>

UpdateFee Modifies the details of an existing fee (tax).

Parameters:

  • location_id

    The ID of the fee&#39;s associated location.

  • fee_id

    The ID of the fee to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Fee, Fixnum, Hash)>)

    V1Fee data, response status code and response headers



2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
# File 'lib/square_connect/api/v1_items_api.rb', line 2017

def update_fee_with_http_info(location_id, fee_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_fee ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_fee" if location_id.nil?
  # verify the required parameter 'fee_id' is set
  fail ArgumentError, "Missing the required parameter 'fee_id' when calling V1ItemsApi.update_fee" if fee_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_fee" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/fees/{fee_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'fee_id' + '}', fee_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Fee')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_item(location_id, item_id, body, opts = {}) ⇒ V1Item

UpdateItem Modifies the core details of an existing item.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The ID of the item to modify.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2068
2069
2070
2071
# File 'lib/square_connect/api/v1_items_api.rb', line 2068

def update_item(location_id, item_id, body, opts = {})
  data, _status_code, _headers = update_item_with_http_info(location_id, item_id, body, opts)
  return data
end

#update_item_with_http_info(location_id, item_id, body, opts = {}) ⇒ Array<(V1Item, Fixnum, Hash)>

UpdateItem Modifies the core details of an existing item.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The ID of the item to modify.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Item, Fixnum, Hash)>)

    V1Item data, response status code and response headers



2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
# File 'lib/square_connect/api/v1_items_api.rb', line 2080

def update_item_with_http_info(location_id, item_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_item ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_item" if location_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.update_item" if item_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_item" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Item')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_modifier_list(location_id, modifier_list_id, body, opts = {}) ⇒ V1ModifierList

UpdateModifierList Modifies the details of an existing item modifier list.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2131
2132
2133
2134
# File 'lib/square_connect/api/v1_items_api.rb', line 2131

def update_modifier_list(location_id, modifier_list_id, body, opts = {})
  data, _status_code, _headers = update_modifier_list_with_http_info(location_id, modifier_list_id, body, opts)
  return data
end

#update_modifier_list_with_http_info(location_id, modifier_list_id, body, opts = {}) ⇒ Array<(V1ModifierList, Fixnum, Hash)>

UpdateModifierList Modifies the details of an existing item modifier list.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1ModifierList, Fixnum, Hash)>)

    V1ModifierList data, response status code and response headers



2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
# File 'lib/square_connect/api/v1_items_api.rb', line 2143

def update_modifier_list_with_http_info(location_id, modifier_list_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_modifier_list ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_modifier_list" if location_id.nil?
  # verify the required parameter 'modifier_list_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.update_modifier_list" if modifier_list_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_modifier_list" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1ModifierList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_modifier_option(location_id, modifier_list_id, modifier_option_id, body, opts = {}) ⇒ V1ModifierOption

UpdateModifierOption Modifies the details of an existing item modifier option.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to edit.

  • modifier_option_id

    The ID of the modifier list to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2195
2196
2197
2198
# File 'lib/square_connect/api/v1_items_api.rb', line 2195

def update_modifier_option(location_id, modifier_list_id, modifier_option_id, body, opts = {})
  data, _status_code, _headers = update_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, body, opts)
  return data
end

#update_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, body, opts = {}) ⇒ Array<(V1ModifierOption, Fixnum, Hash)>

UpdateModifierOption Modifies the details of an existing item modifier option.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • modifier_list_id

    The ID of the modifier list to edit.

  • modifier_option_id

    The ID of the modifier list to edit.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1ModifierOption, Fixnum, Hash)>)

    V1ModifierOption data, response status code and response headers



2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
# File 'lib/square_connect/api/v1_items_api.rb', line 2208

def update_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_modifier_option ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_modifier_option" if location_id.nil?
  # verify the required parameter 'modifier_list_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.update_modifier_option" if modifier_list_id.nil?
  # verify the required parameter 'modifier_option_id' is set
  fail ArgumentError, "Missing the required parameter 'modifier_option_id' when calling V1ItemsApi.update_modifier_option" if modifier_option_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_modifier_option" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'modifier_option_id' + '}', modifier_option_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1ModifierOption')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_modifier_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_page(location_id, page_id, body, opts = {}) ⇒ V1Page

UpdatePage Modifies the details of a Favorites page in Square Register.

Parameters:

  • location_id

    The ID of the Favorites page&#39;s associated location

  • page_id

    The ID of the page to modify.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2261
2262
2263
2264
# File 'lib/square_connect/api/v1_items_api.rb', line 2261

def update_page(location_id, page_id, body, opts = {})
  data, _status_code, _headers = update_page_with_http_info(location_id, page_id, body, opts)
  return data
end

#update_page_cell(location_id, page_id, body, opts = {}) ⇒ V1Page

UpdatePageCell Modifies a cell of a Favorites page in Square Register.

Parameters:

  • location_id

    The ID of the Favorites page&#39;s associated location.

  • page_id

    The ID of the page the cell belongs to.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2324
2325
2326
2327
# File 'lib/square_connect/api/v1_items_api.rb', line 2324

def update_page_cell(location_id, page_id, body, opts = {})
  data, _status_code, _headers = update_page_cell_with_http_info(location_id, page_id, body, opts)
  return data
end

#update_page_cell_with_http_info(location_id, page_id, body, opts = {}) ⇒ Array<(V1Page, Fixnum, Hash)>

UpdatePageCell Modifies a cell of a Favorites page in Square Register.

Parameters:

  • location_id

    The ID of the Favorites page&#39;s associated location.

  • page_id

    The ID of the page the cell belongs to.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Page, Fixnum, Hash)>)

    V1Page data, response status code and response headers



2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
# File 'lib/square_connect/api/v1_items_api.rb', line 2336

def update_page_cell_with_http_info(location_id, page_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_page_cell ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_page_cell" if location_id.nil?
  # verify the required parameter 'page_id' is set
  fail ArgumentError, "Missing the required parameter 'page_id' when calling V1ItemsApi.update_page_cell" if page_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_page_cell" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/pages/{page_id}/cells".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Page')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_page_cell\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_page_with_http_info(location_id, page_id, body, opts = {}) ⇒ Array<(V1Page, Fixnum, Hash)>

UpdatePage Modifies the details of a Favorites page in Square Register.

Parameters:

  • location_id

    The ID of the Favorites page&#39;s associated location

  • page_id

    The ID of the page to modify.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Page, Fixnum, Hash)>)

    V1Page data, response status code and response headers



2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
# File 'lib/square_connect/api/v1_items_api.rb', line 2273

def update_page_with_http_info(location_id, page_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_page ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_page" if location_id.nil?
  # verify the required parameter 'page_id' is set
  fail ArgumentError, "Missing the required parameter 'page_id' when calling V1ItemsApi.update_page" if page_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_page" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/pages/{page_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'page_id' + '}', page_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Page')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_variation(location_id, item_id, variation_id, body, opts = {}) ⇒ V1Variation

UpdateVariation Modifies the details of an existing item variation.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The ID of the item to modify.

  • variation_id

    The ID of the variation to modify.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2388
2389
2390
2391
# File 'lib/square_connect/api/v1_items_api.rb', line 2388

def update_variation(location_id, item_id, variation_id, body, opts = {})
  data, _status_code, _headers = update_variation_with_http_info(location_id, item_id, variation_id, body, opts)
  return data
end

#update_variation_with_http_info(location_id, item_id, variation_id, body, opts = {}) ⇒ Array<(V1Variation, Fixnum, Hash)>

UpdateVariation Modifies the details of an existing item variation.

Parameters:

  • location_id

    The ID of the item&#39;s associated location.

  • item_id

    The ID of the item to modify.

  • variation_id

    The ID of the variation to modify.

  • body

    An object containing the fields to POST for the request. See the corresponding object definition for field details.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(V1Variation, Fixnum, Hash)>)

    V1Variation data, response status code and response headers



2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
# File 'lib/square_connect/api/v1_items_api.rb', line 2401

def update_variation_with_http_info(location_id, item_id, variation_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: V1ItemsApi.update_variation ..."
  end
  # verify the required parameter 'location_id' is set
  fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_variation" if location_id.nil?
  # verify the required parameter 'item_id' is set
  fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.update_variation" if item_id.nil?
  # verify the required parameter 'variation_id' is set
  fail ArgumentError, "Missing the required parameter 'variation_id' when calling V1ItemsApi.update_variation" if variation_id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_variation" if body.nil?
  # resource path
  local_var_path = "/v1/{location_id}/items/{item_id}/variations/{variation_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s).sub('{' + 'variation_id' + '}', variation_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  
  header_params['Square-Version'] = "2019-06-12"

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'V1Variation')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: V1ItemsApi#update_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end