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

Adjusts an item variation’s current available inventory. 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)>

Adjusts an item variation&#39;s current available inventory. 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
# 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'])

  # 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

Associates a fee with an item, meaning the fee is automatically applied to the item in Square Register. 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:



88
89
90
91
# File 'lib/square_connect/api/v1_items_api.rb', line 88

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)>

Associates a fee with an item, meaning the fee is automatically applied to the item in Square Register. 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



100
101
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
# File 'lib/square_connect/api/v1_items_api.rb', line 100

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'])

  # 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

Associates a modifier list with an item, meaning modifier options from the list can be applied to the item. 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:



149
150
151
152
# File 'lib/square_connect/api/v1_items_api.rb', line 149

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)>

Associates a modifier list with an item, meaning modifier options from the list can be applied to the item. 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



161
162
163
164
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
# File 'lib/square_connect/api/v1_items_api.rb', line 161

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'])

  # 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

Creates an item category. 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:



209
210
211
212
# File 'lib/square_connect/api/v1_items_api.rb', line 209

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)>

Creates an item category. 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



220
221
222
223
224
225
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
# File 'lib/square_connect/api/v1_items_api.rb', line 220

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'])

  # 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

Creates a discount. 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:



266
267
268
269
# File 'lib/square_connect/api/v1_items_api.rb', line 266

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)>

Creates a discount. 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



277
278
279
280
281
282
283
284
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
# File 'lib/square_connect/api/v1_items_api.rb', line 277

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'])

  # 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

Creates a fee (tax). 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:



323
324
325
326
# File 'lib/square_connect/api/v1_items_api.rb', line 323

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)>

Creates a fee (tax). 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



334
335
336
337
338
339
340
341
342
343
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
# File 'lib/square_connect/api/v1_items_api.rb', line 334

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'])

  # 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

Creates an item and at least one variation for it. Creates an item and at least one variation for it.

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:



380
381
382
383
# File 'lib/square_connect/api/v1_items_api.rb', line 380

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)>

Creates an item and at least one variation for it. Creates an item and at least one variation for it.

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



391
392
393
394
395
396
397
398
399
400
401
402
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
# File 'lib/square_connect/api/v1_items_api.rb', line 391

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'])

  # 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

Creates an item modifier list and at least one modifier option for it. 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:



437
438
439
440
# File 'lib/square_connect/api/v1_items_api.rb', line 437

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)>

Creates an item modifier list and at least one modifier option for it. 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



448
449
450
451
452
453
454
455
456
457
458
459
460
461
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
# File 'lib/square_connect/api/v1_items_api.rb', line 448

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'])

  # 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

Creates an item modifier option and adds it to a modifier list. 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:



495
496
497
498
# File 'lib/square_connect/api/v1_items_api.rb', line 495

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)>

Creates an item modifier option and adds it to a modifier list. 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



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
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
# File 'lib/square_connect/api/v1_items_api.rb', line 507

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'])

  # 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

Creates a Favorites page in Square Register. 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:



555
556
557
558
# File 'lib/square_connect/api/v1_items_api.rb', line 555

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)>

Creates a Favorites page in Square Register. 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



566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# File 'lib/square_connect/api/v1_items_api.rb', line 566

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'])

  # 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

Creates an item variation for an existing item. 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:



613
614
615
616
# File 'lib/square_connect/api/v1_items_api.rb', line 613

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)>

Creates an item variation for an existing item. 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



625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
# File 'lib/square_connect/api/v1_items_api.rb', line 625

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'])

  # 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

Deletes an existing item category. Deletes an existing item category.

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:



673
674
675
676
# File 'lib/square_connect/api/v1_items_api.rb', line 673

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)>

Deletes an existing item category. Deletes an existing item category.

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



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'lib/square_connect/api/v1_items_api.rb', line 684

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'])

  # 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

Deletes an existing discount. Deletes an existing discount.

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:



730
731
732
733
# File 'lib/square_connect/api/v1_items_api.rb', line 730

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)>

Deletes an existing discount. Deletes an existing discount.

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



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
# File 'lib/square_connect/api/v1_items_api.rb', line 741

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'])

  # 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

Deletes an existing fee (tax). Deletes an existing fee (tax).

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:



787
788
789
790
# File 'lib/square_connect/api/v1_items_api.rb', line 787

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)>

Deletes an existing fee (tax). Deletes an existing fee (tax).

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



798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
# File 'lib/square_connect/api/v1_items_api.rb', line 798

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'])

  # 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

Deletes an existing item and all item variations associated with it. Deletes an existing item and all item variations associated with it.

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:



844
845
846
847
# File 'lib/square_connect/api/v1_items_api.rb', line 844

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)>

Deletes an existing item and all item variations associated with it. Deletes an existing item and all item variations associated with it.

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



855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
# File 'lib/square_connect/api/v1_items_api.rb', line 855

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'])

  # 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

Deletes an existing item modifier list and all modifier options associated with it. Deletes an existing item modifier list and all modifier options associated with it.

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:



901
902
903
904
# File 'lib/square_connect/api/v1_items_api.rb', line 901

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)>

Deletes an existing item modifier list and all modifier options associated with it. Deletes an existing item modifier list and all modifier options associated with it.

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



912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
# File 'lib/square_connect/api/v1_items_api.rb', line 912

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'])

  # 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

Deletes an existing item modifier option from a modifier list. Deletes an existing item modifier option from 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 delete.

  • modifier_option_id

    The ID of the modifier list to edit.

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

    the optional parameters

Returns:



959
960
961
962
# File 'lib/square_connect/api/v1_items_api.rb', line 959

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)>

Deletes an existing item modifier option from a modifier list. Deletes an existing item modifier option from 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 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



971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
# File 'lib/square_connect/api/v1_items_api.rb', line 971

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'])

  # 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

Deletes an existing Favorites page and all of its cells. Deletes an existing Favorites page and all of its cells.

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:



1019
1020
1021
1022
# File 'lib/square_connect/api/v1_items_api.rb', line 1019

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

Deletes a cell from a Favorites page in Square Register. Deletes a cell from 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 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:



1078
1079
1080
1081
# File 'lib/square_connect/api/v1_items_api.rb', line 1078

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)>

Deletes a cell from a Favorites page in Square Register. Deletes a cell from 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 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



1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
# File 'lib/square_connect/api/v1_items_api.rb', line 1091

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'])

  # 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)>

Deletes an existing Favorites page and all of its cells. Deletes an existing Favorites page and all of its cells.

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



1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
# File 'lib/square_connect/api/v1_items_api.rb', line 1030

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'])

  # 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

Deletes an existing item variation from an item. Deletes an existing item variation from an item.

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:



1140
1141
1142
1143
# File 'lib/square_connect/api/v1_items_api.rb', line 1140

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)>

Deletes an existing item variation from an item. Deletes an existing item variation from an item.

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



1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
# File 'lib/square_connect/api/v1_items_api.rb', line 1152

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'])

  # 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>

Lists all of a location’s item categories. 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:



1199
1200
1201
1202
# File 'lib/square_connect/api/v1_items_api.rb', line 1199

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)>

Lists all of a location&#39;s item categories. 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



1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/square_connect/api/v1_items_api.rb', line 1209

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'])

  # 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>

Lists all of a location’s discounts. 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:



1252
1253
1254
1255
# File 'lib/square_connect/api/v1_items_api.rb', line 1252

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)>

Lists all of a location&#39;s discounts. 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



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
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
# File 'lib/square_connect/api/v1_items_api.rb', line 1262

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'])

  # 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>

Lists all of a location’s fees (taxes). 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:



1305
1306
1307
1308
# File 'lib/square_connect/api/v1_items_api.rb', line 1305

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)>

Lists all of a location&#39;s fees (taxes). 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



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
1343
1344
1345
1346
1347
1348
1349
1350
1351
# File 'lib/square_connect/api/v1_items_api.rb', line 1315

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'])

  # 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>

Provides inventory information for all of a merchant’s inventory-enabled item variations. 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:



1360
1361
1362
1363
# File 'lib/square_connect/api/v1_items_api.rb', line 1360

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)>

Provides inventory information for all of a merchant&#39;s inventory-enabled item variations. 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



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
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'lib/square_connect/api/v1_items_api.rb', line 1372

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?
  if !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling V1ItemsApi.list_inventory, must be smaller than or equal to 1000.'
  end

  # 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'])

  # 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>

Provides summary information for all of a location’s items. 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:



1422
1423
1424
1425
# File 'lib/square_connect/api/v1_items_api.rb', line 1422

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)>

Provides summary information for all of a location&#39;s items. 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



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
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
# File 'lib/square_connect/api/v1_items_api.rb', line 1433

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'])

  # 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>

Lists all of a location’s modifier lists. 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:



1477
1478
1479
1480
# File 'lib/square_connect/api/v1_items_api.rb', line 1477

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)>

Lists all of a location&#39;s modifier lists. 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



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
1517
1518
1519
1520
1521
1522
1523
# File 'lib/square_connect/api/v1_items_api.rb', line 1487

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'])

  # 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>

Lists all of a location’s Favorites pages in Square Register. 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:



1530
1531
1532
1533
# File 'lib/square_connect/api/v1_items_api.rb', line 1530

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)>

Lists all of a location&#39;s Favorites pages in Square Register. 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



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
1572
1573
1574
1575
1576
# File 'lib/square_connect/api/v1_items_api.rb', line 1540

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'])

  # 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

Removes a fee assocation from an item, meaning the fee is no longer automatically applied to the item in Square Register. 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:



1585
1586
1587
1588
# File 'lib/square_connect/api/v1_items_api.rb', line 1585

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)>

Removes a fee assocation from an item, meaning the fee is no longer automatically applied to the item in Square Register. 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



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
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
# File 'lib/square_connect/api/v1_items_api.rb', line 1597

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'])

  # 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

Removes a modifier list association from an item, meaning modifier options from the list can no longer be applied to the item. 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:



1646
1647
1648
1649
# File 'lib/square_connect/api/v1_items_api.rb', line 1646

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)>

Removes a modifier list association from an item, meaning modifier options from the list can no longer be applied to the item. 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



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
1690
1691
1692
1693
1694
1695
1696
1697
1698
# File 'lib/square_connect/api/v1_items_api.rb', line 1658

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'])

  # 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

Provides the details for a single item, including associated modifier lists and fees. 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:



1706
1707
1708
1709
# File 'lib/square_connect/api/v1_items_api.rb', line 1706

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)>

Provides the details for a single item, including associated modifier lists and fees. 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



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
1753
1754
1755
# File 'lib/square_connect/api/v1_items_api.rb', line 1717

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'])

  # 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

Provides the details for a single modifier list. 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:



1763
1764
1765
1766
# File 'lib/square_connect/api/v1_items_api.rb', line 1763

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)>

Provides the details for a single modifier list. 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



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
1812
# File 'lib/square_connect/api/v1_items_api.rb', line 1774

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'])

  # 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

Modifies the details of an existing item category. 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:



1821
1822
1823
1824
# File 'lib/square_connect/api/v1_items_api.rb', line 1821

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)>

Modifies the details of an existing item category. 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



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
1871
1872
1873
# File 'lib/square_connect/api/v1_items_api.rb', line 1833

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'])

  # 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

Modifies the details of an existing discount. 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:



1882
1883
1884
1885
# File 'lib/square_connect/api/v1_items_api.rb', line 1882

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)>

Modifies the details of an existing discount. 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



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
1934
# File 'lib/square_connect/api/v1_items_api.rb', line 1894

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'])

  # 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

Modifies the details of an existing fee (tax). 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:



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

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)>

Modifies the details of an existing fee (tax). 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



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
# File 'lib/square_connect/api/v1_items_api.rb', line 1955

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'])

  # 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

Modifies the core details of an existing item. 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:



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

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)>

Modifies the core details of an existing item. 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



2016
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
# File 'lib/square_connect/api/v1_items_api.rb', line 2016

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'])

  # 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

Modifies the details of an existing item modifier list. 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:



2065
2066
2067
2068
# File 'lib/square_connect/api/v1_items_api.rb', line 2065

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)>

Modifies the details of an existing item modifier list. 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



2077
2078
2079
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
# File 'lib/square_connect/api/v1_items_api.rb', line 2077

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'])

  # 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

Modifies the details of an existing item modifier option. 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:



2127
2128
2129
2130
# File 'lib/square_connect/api/v1_items_api.rb', line 2127

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)>

Modifies the details of an existing item modifier option. 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



2140
2141
2142
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
# File 'lib/square_connect/api/v1_items_api.rb', line 2140

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'])

  # 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

Modifies the details of a Favorites page in Square Register. 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:



2191
2192
2193
2194
# File 'lib/square_connect/api/v1_items_api.rb', line 2191

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

Modifies a cell of a Favorites page in Square Register. 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:



2252
2253
2254
2255
# File 'lib/square_connect/api/v1_items_api.rb', line 2252

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)>

Modifies a cell of a Favorites page in Square Register. 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



2264
2265
2266
2267
2268
2269
2270
2271
2272
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
# File 'lib/square_connect/api/v1_items_api.rb', line 2264

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'])

  # 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)>

Modifies the details of a Favorites page in Square Register. 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



2203
2204
2205
2206
2207
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
# File 'lib/square_connect/api/v1_items_api.rb', line 2203

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'])

  # 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

Modifies the details of an existing item variation. 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:



2314
2315
2316
2317
# File 'lib/square_connect/api/v1_items_api.rb', line 2314

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)>

Modifies the details of an existing item variation. 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



2327
2328
2329
2330
2331
2332
2333
2334
2335
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
# File 'lib/square_connect/api/v1_items_api.rb', line 2327

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'])

  # 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