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



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

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



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

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:



151
152
153
154
# File 'lib/square_connect/api/v1_items_api.rb', line 151

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



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

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:



212
213
214
215
# File 'lib/square_connect/api/v1_items_api.rb', line 212

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



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
259
260
261
262
# File 'lib/square_connect/api/v1_items_api.rb', line 223

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:



270
271
272
273
# File 'lib/square_connect/api/v1_items_api.rb', line 270

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



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
316
317
318
319
320
# File 'lib/square_connect/api/v1_items_api.rb', line 281

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:



328
329
330
331
# File 'lib/square_connect/api/v1_items_api.rb', line 328

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



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
373
374
375
376
377
378
# File 'lib/square_connect/api/v1_items_api.rb', line 339

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:



386
387
388
389
# File 'lib/square_connect/api/v1_items_api.rb', line 386

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



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
430
431
432
433
434
435
436
# File 'lib/square_connect/api/v1_items_api.rb', line 397

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:



444
445
446
447
# File 'lib/square_connect/api/v1_items_api.rb', line 444

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



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
487
488
489
490
491
492
493
494
# File 'lib/square_connect/api/v1_items_api.rb', line 455

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:



503
504
505
506
# File 'lib/square_connect/api/v1_items_api.rb', line 503

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



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
548
549
550
551
552
553
554
555
556
# File 'lib/square_connect/api/v1_items_api.rb', line 515

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:



564
565
566
567
# File 'lib/square_connect/api/v1_items_api.rb', line 564

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



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
605
606
607
608
609
610
611
612
613
614
# File 'lib/square_connect/api/v1_items_api.rb', line 575

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:



623
624
625
626
# File 'lib/square_connect/api/v1_items_api.rb', line 623

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



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
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/square_connect/api/v1_items_api.rb', line 635

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:



684
685
686
687
# File 'lib/square_connect/api/v1_items_api.rb', line 684

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



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
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/square_connect/api/v1_items_api.rb', line 695

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:



742
743
744
745
# File 'lib/square_connect/api/v1_items_api.rb', line 742

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



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
780
781
782
783
784
785
786
787
788
789
790
791
792
# File 'lib/square_connect/api/v1_items_api.rb', line 753

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:



800
801
802
803
# File 'lib/square_connect/api/v1_items_api.rb', line 800

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



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
837
838
839
840
841
842
843
844
845
846
847
848
849
850
# File 'lib/square_connect/api/v1_items_api.rb', line 811

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:



858
859
860
861
# File 'lib/square_connect/api/v1_items_api.rb', line 858

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



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
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
# File 'lib/square_connect/api/v1_items_api.rb', line 869

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:



916
917
918
919
# File 'lib/square_connect/api/v1_items_api.rb', line 916

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



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
# File 'lib/square_connect/api/v1_items_api.rb', line 927

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:



975
976
977
978
# File 'lib/square_connect/api/v1_items_api.rb', line 975

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



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
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
# File 'lib/square_connect/api/v1_items_api.rb', line 987

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:



1036
1037
1038
1039
# File 'lib/square_connect/api/v1_items_api.rb', line 1036

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:



1096
1097
1098
1099
# File 'lib/square_connect/api/v1_items_api.rb', line 1096

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



1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/square_connect/api/v1_items_api.rb', line 1109

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



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
# File 'lib/square_connect/api/v1_items_api.rb', line 1047

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:



1159
1160
1161
1162
# File 'lib/square_connect/api/v1_items_api.rb', line 1159

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



1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
# File 'lib/square_connect/api/v1_items_api.rb', line 1171

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:



1219
1220
1221
1222
# File 'lib/square_connect/api/v1_items_api.rb', line 1219

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



1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
# File 'lib/square_connect/api/v1_items_api.rb', line 1229

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:



1273
1274
1275
1276
# File 'lib/square_connect/api/v1_items_api.rb', line 1273

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



1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
# File 'lib/square_connect/api/v1_items_api.rb', line 1283

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:



1327
1328
1329
1330
# File 'lib/square_connect/api/v1_items_api.rb', line 1327

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



1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
# File 'lib/square_connect/api/v1_items_api.rb', line 1337

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:



1383
1384
1385
1386
# File 'lib/square_connect/api/v1_items_api.rb', line 1383

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



1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
# File 'lib/square_connect/api/v1_items_api.rb', line 1395

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:



1446
1447
1448
1449
# File 'lib/square_connect/api/v1_items_api.rb', line 1446

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



1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
# File 'lib/square_connect/api/v1_items_api.rb', line 1457

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:



1502
1503
1504
1505
# File 'lib/square_connect/api/v1_items_api.rb', line 1502

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



1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
# File 'lib/square_connect/api/v1_items_api.rb', line 1512

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:



1556
1557
1558
1559
# File 'lib/square_connect/api/v1_items_api.rb', line 1556

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



1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
# File 'lib/square_connect/api/v1_items_api.rb', line 1566

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:



1612
1613
1614
1615
# File 'lib/square_connect/api/v1_items_api.rb', line 1612

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



1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
# File 'lib/square_connect/api/v1_items_api.rb', line 1624

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:



1674
1675
1676
1677
# File 'lib/square_connect/api/v1_items_api.rb', line 1674

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



1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
# File 'lib/square_connect/api/v1_items_api.rb', line 1686

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:



1735
1736
1737
1738
# File 'lib/square_connect/api/v1_items_api.rb', line 1735

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



1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
# File 'lib/square_connect/api/v1_items_api.rb', line 1746

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:



1793
1794
1795
1796
# File 'lib/square_connect/api/v1_items_api.rb', line 1793

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



1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
# File 'lib/square_connect/api/v1_items_api.rb', line 1804

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:



1852
1853
1854
1855
# File 'lib/square_connect/api/v1_items_api.rb', line 1852

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



1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
# File 'lib/square_connect/api/v1_items_api.rb', line 1864

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:



1914
1915
1916
1917
# File 'lib/square_connect/api/v1_items_api.rb', line 1914

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



1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
# File 'lib/square_connect/api/v1_items_api.rb', line 1926

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:



1976
1977
1978
1979
# File 'lib/square_connect/api/v1_items_api.rb', line 1976

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



1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
# File 'lib/square_connect/api/v1_items_api.rb', line 1988

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:



2038
2039
2040
2041
# File 'lib/square_connect/api/v1_items_api.rb', line 2038

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



2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
# File 'lib/square_connect/api/v1_items_api.rb', line 2050

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:



2100
2101
2102
2103
# File 'lib/square_connect/api/v1_items_api.rb', line 2100

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



2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
# File 'lib/square_connect/api/v1_items_api.rb', line 2112

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:



2163
2164
2165
2166
# File 'lib/square_connect/api/v1_items_api.rb', line 2163

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



2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
# File 'lib/square_connect/api/v1_items_api.rb', line 2176

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:



2228
2229
2230
2231
# File 'lib/square_connect/api/v1_items_api.rb', line 2228

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:



2290
2291
2292
2293
# File 'lib/square_connect/api/v1_items_api.rb', line 2290

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



2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
# File 'lib/square_connect/api/v1_items_api.rb', line 2302

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



2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
# File 'lib/square_connect/api/v1_items_api.rb', line 2240

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:



2353
2354
2355
2356
# File 'lib/square_connect/api/v1_items_api.rb', line 2353

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



2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
# File 'lib/square_connect/api/v1_items_api.rb', line 2366

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