class SquareConnect::V1ItemsApi
Attributes
Public Class Methods
# File lib/square_connect/api/v1_items_api.rb, line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
AdjustInventory Adjusts an item variation's current available inventory. @param location_id The ID of the item's associated location. @param variation_id The ID of the variation to adjust inventory information for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1InventoryEntry]
# 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
AdjustInventory Adjusts an item variation's current available inventory. @param location_id The ID of the item's associated location. @param variation_id The ID of the variation to adjust inventory information for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1InventoryEntry
, Fixnum, Hash)>] V1InventoryEntry
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 39 def adjust_inventory_with_http_info(location_id, variation_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.adjust_inventory ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.adjust_inventory" if location_id.nil? # verify the required parameter 'variation_id' is set fail ArgumentError, "Missing the required parameter 'variation_id' when calling V1ItemsApi.adjust_inventory" if variation_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.adjust_inventory" if body.nil? # resource path local_var_path = "/v1/{location_id}/inventory/{variation_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'variation_id' + '}', variation_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1InventoryEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#adjust_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ApplyFee Associates a fee with an item, meaning the fee is automatically applied to the item in Square Register. @param location_id The ID of the fee's associated location. @param item_id The ID of the item to add the fee to. @param fee_id The ID of the fee to apply. @param [Hash] opts the optional parameters @return [V1Item]
# File lib/square_connect/api/v1_items_api.rb, line 90 def apply_fee(location_id, item_id, fee_id, opts = {}) data, _status_code, _headers = apply_fee_with_http_info(location_id, item_id, fee_id, opts) return data end
ApplyFee Associates a fee with an item, meaning the fee is automatically applied to the item in Square Register. @param location_id The ID of the fee's associated location. @param item_id The ID of the item to add the fee to. @param fee_id The ID of the fee to apply. @param [Hash] opts the optional parameters @return [Array<(V1Item
, Fixnum, Hash)>] V1Item
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 102 def apply_fee_with_http_info(location_id, item_id, fee_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.apply_fee ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.apply_fee" if location_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.apply_fee" if item_id.nil? # verify the required parameter 'fee_id' is set fail ArgumentError, "Missing the required parameter 'fee_id' when calling V1ItemsApi.apply_fee" if fee_id.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}/fees/{fee_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s).sub('{' + 'fee_id' + '}', fee_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Item') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#apply_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ApplyModifierList Associates a modifier list with an item, meaning modifier options from the list can be applied to the item. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to apply. @param item_id The ID of the item to add the modifier list to. @param [Hash] opts the optional parameters @return [V1Item]
# File lib/square_connect/api/v1_items_api.rb, line 153 def apply_modifier_list(location_id, modifier_list_id, item_id, opts = {}) data, _status_code, _headers = apply_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts) return data end
ApplyModifierList Associates a modifier list with an item, meaning modifier options from the list can be applied to the item. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to apply. @param item_id The ID of the item to add the modifier list to. @param [Hash] opts the optional parameters @return [Array<(V1Item
, Fixnum, Hash)>] V1Item
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 165 def apply_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.apply_modifier_list ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.apply_modifier_list" if location_id.nil? # verify the required parameter 'modifier_list_id' is set fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.apply_modifier_list" if modifier_list_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.apply_modifier_list" if item_id.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Item') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#apply_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
CreateCategory Creates an item category. @param location_id The ID of the location to create an item for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Category]
# File lib/square_connect/api/v1_items_api.rb, line 215 def create_category(location_id, body, opts = {}) data, _status_code, _headers = create_category_with_http_info(location_id, body, opts) return data end
CreateCategory Creates an item category. @param location_id The ID of the location to create an item for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Category
, Fixnum, Hash)>] V1Category
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 226 def create_category_with_http_info(location_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.create_category ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_category" if location_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_category" if body.nil? # resource path local_var_path = "/v1/{location_id}/categories".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Category') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#create_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
CreateDiscount Creates a discount. @param location_id The ID of the location to create an item for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Discount]
# File lib/square_connect/api/v1_items_api.rb, line 274 def create_discount(location_id, body, opts = {}) data, _status_code, _headers = create_discount_with_http_info(location_id, body, opts) return data end
CreateDiscount Creates a discount. @param location_id The ID of the location to create an item for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Discount
, Fixnum, Hash)>] V1Discount
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 285 def create_discount_with_http_info(location_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.create_discount ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_discount" if location_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_discount" if body.nil? # resource path local_var_path = "/v1/{location_id}/discounts".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Discount') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#create_discount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
CreateFee Creates a fee (tax). @param location_id The ID of the location to create a fee for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Fee]
# File lib/square_connect/api/v1_items_api.rb, line 333 def create_fee(location_id, body, opts = {}) data, _status_code, _headers = create_fee_with_http_info(location_id, body, opts) return data end
CreateFee Creates a fee (tax). @param location_id The ID of the location to create a fee for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Fee
, Fixnum, Hash)>] V1Fee
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 344 def create_fee_with_http_info(location_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.create_fee ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_fee" if location_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_fee" if body.nil? # resource path local_var_path = "/v1/{location_id}/fees".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Fee') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#create_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
CreateItem Creates an item and at least one variation for it. Item-related entities include fields you can use to associate them with entities in a non-Square system. When you create an item-related entity, you can optionally specify its `id`. This value must be unique among all IDs ever specified for the account, including those specified by other applications. You can never reuse an entity ID. If you do not specify an ID, Square generates one for the entity. Item variations have a `user_data` string that lets you associate arbitrary metadata with the variation. The string cannot exceed 255 characters. @param location_id The ID of the location to create an item for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Item]
# File lib/square_connect/api/v1_items_api.rb, line 392 def create_item(location_id, body, opts = {}) data, _status_code, _headers = create_item_with_http_info(location_id, body, opts) return data end
CreateItem Creates an item and at least one variation for it. Item-related entities include fields you can use to associate them with entities in a non-Square system. When you create an item-related entity, you can optionally specify its `id`. This value must be unique among all IDs ever specified for the account, including those specified by other applications. You can never reuse an entity ID. If you do not specify an ID, Square generates one for the entity. Item variations have a `user_data` string that lets you associate arbitrary metadata with the variation. The string cannot exceed 255 characters. @param location_id The ID of the location to create an item for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Item
, Fixnum, Hash)>] V1Item
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 403 def create_item_with_http_info(location_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.create_item ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_item" if location_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_item" if body.nil? # resource path local_var_path = "/v1/{location_id}/items".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Item') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#create_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
CreateModifierList Creates an item modifier list and at least one modifier option for it. @param location_id The ID of the location to create a modifier list for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1ModifierList]
# File lib/square_connect/api/v1_items_api.rb, line 451 def create_modifier_list(location_id, body, opts = {}) data, _status_code, _headers = create_modifier_list_with_http_info(location_id, body, opts) return data end
CreateModifierList Creates an item modifier list and at least one modifier option for it. @param location_id The ID of the location to create a modifier list for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1ModifierList
, Fixnum, Hash)>] V1ModifierList
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 462 def create_modifier_list_with_http_info(location_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.create_modifier_list ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_modifier_list" if location_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_modifier_list" if body.nil? # resource path local_var_path = "/v1/{location_id}/modifier-lists".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1ModifierList') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#create_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
CreateModifierOption Creates an item modifier option and adds it to a modifier list. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1ModifierOption]
# File lib/square_connect/api/v1_items_api.rb, line 511 def create_modifier_option(location_id, modifier_list_id, body, opts = {}) data, _status_code, _headers = create_modifier_option_with_http_info(location_id, modifier_list_id, body, opts) return data end
CreateModifierOption Creates an item modifier option and adds it to a modifier list. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1ModifierOption
, Fixnum, Hash)>] V1ModifierOption
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 523 def create_modifier_option_with_http_info(location_id, modifier_list_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.create_modifier_option ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_modifier_option" if location_id.nil? # verify the required parameter 'modifier_list_id' is set fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.create_modifier_option" if modifier_list_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_modifier_option" if body.nil? # resource path local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1ModifierOption') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#create_modifier_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
CreatePage Creates a Favorites page in Square Register. @param location_id The ID of the location to create an item for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Page]
# File lib/square_connect/api/v1_items_api.rb, line 573 def create_page(location_id, body, opts = {}) data, _status_code, _headers = create_page_with_http_info(location_id, body, opts) return data end
CreatePage Creates a Favorites page in Square Register. @param location_id The ID of the location to create an item for. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Page
, Fixnum, Hash)>] V1Page
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 584 def create_page_with_http_info(location_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.create_page ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_page" if location_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_page" if body.nil? # resource path local_var_path = "/v1/{location_id}/pages".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Page') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#create_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
CreateVariation Creates an item variation for an existing item. @param location_id The ID of the item's associated location. @param item_id The item's ID. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Variation]
# File lib/square_connect/api/v1_items_api.rb, line 633 def create_variation(location_id, item_id, body, opts = {}) data, _status_code, _headers = create_variation_with_http_info(location_id, item_id, body, opts) return data end
CreateVariation Creates an item variation for an existing item. @param location_id The ID of the item's associated location. @param item_id The item's ID. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Variation
, Fixnum, Hash)>] V1Variation
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 645 def create_variation_with_http_info(location_id, item_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.create_variation ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.create_variation" if location_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.create_variation" if item_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.create_variation" if body.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}/variations".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Variation') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#create_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeleteCategory Deletes an existing item category. Note*: DeleteCategory returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteCategoryRequest` object as documented below. @param location_id The ID of the item's associated location. @param category_id The ID of the category to delete. @param [Hash] opts the optional parameters @return [V1Category]
# File lib/square_connect/api/v1_items_api.rb, line 695 def delete_category(location_id, category_id, opts = {}) data, _status_code, _headers = delete_category_with_http_info(location_id, category_id, opts) return data end
DeleteCategory Deletes an existing item category. Note*: DeleteCategory returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteCategoryRequest` object as documented below. @param location_id The ID of the item's associated location. @param category_id The ID of the category to delete. @param [Hash] opts the optional parameters @return [Array<(V1Category
, Fixnum, Hash)>] V1Category
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 706 def delete_category_with_http_info(location_id, category_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_category ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_category" if location_id.nil? # verify the required parameter 'category_id' is set fail ArgumentError, "Missing the required parameter 'category_id' when calling V1ItemsApi.delete_category" if category_id.nil? # resource path local_var_path = "/v1/{location_id}/categories/{category_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'category_id' + '}', category_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Category') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeleteDiscount Deletes an existing discount. Note*: DeleteDiscount returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteDiscountRequest` object as documented below. @param location_id The ID of the item's associated location. @param discount_id The ID of the discount to delete. @param [Hash] opts the optional parameters @return [V1Discount]
# File lib/square_connect/api/v1_items_api.rb, line 754 def delete_discount(location_id, discount_id, opts = {}) data, _status_code, _headers = delete_discount_with_http_info(location_id, discount_id, opts) return data end
DeleteDiscount Deletes an existing discount. Note*: DeleteDiscount returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteDiscountRequest` object as documented below. @param location_id The ID of the item's associated location. @param discount_id The ID of the discount to delete. @param [Hash] opts the optional parameters @return [Array<(V1Discount
, Fixnum, Hash)>] V1Discount
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 765 def delete_discount_with_http_info(location_id, discount_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_discount ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_discount" if location_id.nil? # verify the required parameter 'discount_id' is set fail ArgumentError, "Missing the required parameter 'discount_id' when calling V1ItemsApi.delete_discount" if discount_id.nil? # resource path local_var_path = "/v1/{location_id}/discounts/{discount_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'discount_id' + '}', discount_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Discount') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_discount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeleteFee Deletes an existing fee (tax). Note*: DeleteFee returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteFeeRequest` object as documented below. @param location_id The ID of the fee's associated location. @param fee_id The ID of the fee to delete. @param [Hash] opts the optional parameters @return [V1Fee]
# File lib/square_connect/api/v1_items_api.rb, line 813 def delete_fee(location_id, fee_id, opts = {}) data, _status_code, _headers = delete_fee_with_http_info(location_id, fee_id, opts) return data end
DeleteFee Deletes an existing fee (tax). Note*: DeleteFee returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteFeeRequest` object as documented below. @param location_id The ID of the fee's associated location. @param fee_id The ID of the fee to delete. @param [Hash] opts the optional parameters @return [Array<(V1Fee
, Fixnum, Hash)>] V1Fee
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 824 def delete_fee_with_http_info(location_id, fee_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_fee ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_fee" if location_id.nil? # verify the required parameter 'fee_id' is set fail ArgumentError, "Missing the required parameter 'fee_id' when calling V1ItemsApi.delete_fee" if fee_id.nil? # resource path local_var_path = "/v1/{location_id}/fees/{fee_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'fee_id' + '}', fee_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Fee') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeleteItem Deletes an existing item and all item variations associated with it. Note*: DeleteItem returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteItemRequest` object as documented below. @param location_id The ID of the item's associated location. @param item_id The ID of the item to modify. @param [Hash] opts the optional parameters @return [V1Item]
# File lib/square_connect/api/v1_items_api.rb, line 872 def delete_item(location_id, item_id, opts = {}) data, _status_code, _headers = delete_item_with_http_info(location_id, item_id, opts) return data end
DeleteItem Deletes an existing item and all item variations associated with it. Note*: DeleteItem returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteItemRequest` object as documented below. @param location_id The ID of the item's associated location. @param item_id The ID of the item to modify. @param [Hash] opts the optional parameters @return [Array<(V1Item
, Fixnum, Hash)>] V1Item
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 883 def delete_item_with_http_info(location_id, item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_item ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_item" if location_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.delete_item" if item_id.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Item') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeleteModifierList Deletes an existing item modifier list and all modifier options associated with it. Note*: DeleteModifierList returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteModifierListRequest` object as documented below. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to delete. @param [Hash] opts the optional parameters @return [V1ModifierList]
# File lib/square_connect/api/v1_items_api.rb, line 931 def delete_modifier_list(location_id, modifier_list_id, opts = {}) data, _status_code, _headers = delete_modifier_list_with_http_info(location_id, modifier_list_id, opts) return data end
DeleteModifierList Deletes an existing item modifier list and all modifier options associated with it. Note*: DeleteModifierList returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteModifierListRequest` object as documented below. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to delete. @param [Hash] opts the optional parameters @return [Array<(V1ModifierList
, Fixnum, Hash)>] V1ModifierList
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 942 def delete_modifier_list_with_http_info(location_id, modifier_list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_modifier_list ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_modifier_list" if location_id.nil? # verify the required parameter 'modifier_list_id' is set fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.delete_modifier_list" if modifier_list_id.nil? # resource path local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1ModifierList') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeleteModifierOption Deletes an existing item modifier option from a modifier list. Note*: DeleteModifierOption returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteModifierOptionRequest` object as documented below. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to delete. @param modifier_option_id The ID of the modifier list to edit. @param [Hash] opts the optional parameters @return [V1ModifierOption]
# File lib/square_connect/api/v1_items_api.rb, line 991 def delete_modifier_option(location_id, modifier_list_id, modifier_option_id, opts = {}) data, _status_code, _headers = delete_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, opts) return data end
DeleteModifierOption Deletes an existing item modifier option from a modifier list. Note*: DeleteModifierOption returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteModifierOptionRequest` object as documented below. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to delete. @param modifier_option_id The ID of the modifier list to edit. @param [Hash] opts the optional parameters @return [Array<(V1ModifierOption
, Fixnum, Hash)>] V1ModifierOption
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1003 def delete_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_modifier_option ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_modifier_option" if location_id.nil? # verify the required parameter 'modifier_list_id' is set fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.delete_modifier_option" if modifier_list_id.nil? # verify the required parameter 'modifier_option_id' is set fail ArgumentError, "Missing the required parameter 'modifier_option_id' when calling V1ItemsApi.delete_modifier_option" if modifier_option_id.nil? # resource path local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'modifier_option_id' + '}', modifier_option_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1ModifierOption') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_modifier_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeletePage Deletes an existing Favorites page and all of its cells. Note*: DeletePage returns nothing on success but Connect SDKs map the empty response to an empty `V1DeletePageRequest` object as documented below. @param location_id The ID of the Favorites page's associated location. @param page_id The ID of the page to delete. @param [Hash] opts the optional parameters @return [V1Page]
# File lib/square_connect/api/v1_items_api.rb, line 1053 def delete_page(location_id, page_id, opts = {}) data, _status_code, _headers = delete_page_with_http_info(location_id, page_id, opts) return data end
DeletePageCell Deletes a cell from a Favorites page in Square Register. Note*: DeletePageCell returns nothing on success but Connect SDKs map the empty response to an empty `V1DeletePageCellRequest` object as documented below. @param location_id The ID of the Favorites page's associated location. @param page_id The ID of the page to delete. @param [Hash] opts the optional parameters @option opts [String] :row The row of the cell to clear. Always an integer between 0 and 4, inclusive. Row 0 is the top row. @option opts [String] :column The column of the cell to clear. Always an integer between 0 and 4, inclusive. Column 0 is the leftmost column. @return [V1Page]
# File lib/square_connect/api/v1_items_api.rb, line 1114 def delete_page_cell(location_id, page_id, opts = {}) data, _status_code, _headers = delete_page_cell_with_http_info(location_id, page_id, opts) return data end
DeletePageCell Deletes a cell from a Favorites page in Square Register. Note*: DeletePageCell returns nothing on success but Connect SDKs map the empty response to an empty `V1DeletePageCellRequest` object as documented below. @param location_id The ID of the Favorites page's associated location. @param page_id The ID of the page to delete. @param [Hash] opts the optional parameters @option opts [String] :row The row of the cell to clear. Always an integer between 0 and 4, inclusive. Row 0 is the top row. @option opts [String] :column The column of the cell to clear. Always an integer between 0 and 4, inclusive. Column 0 is the leftmost column. @return [Array<(V1Page
, Fixnum, Hash)>] V1Page
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1127 def delete_page_cell_with_http_info(location_id, page_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_page_cell ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_page_cell" if location_id.nil? # verify the required parameter 'page_id' is set fail ArgumentError, "Missing the required parameter 'page_id' when calling V1ItemsApi.delete_page_cell" if page_id.nil? # resource path local_var_path = "/v1/{location_id}/pages/{page_id}/cells".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'page_id' + '}', page_id.to_s) # query parameters query_params = {} query_params[:'row'] = opts[:'row'] if !opts[:'row'].nil? query_params[:'column'] = opts[:'column'] if !opts[:'column'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Page') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_page_cell\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeletePage Deletes an existing Favorites page and all of its cells. Note*: DeletePage returns nothing on success but Connect SDKs map the empty response to an empty `V1DeletePageRequest` object as documented below. @param location_id The ID of the Favorites page's associated location. @param page_id The ID of the page to delete. @param [Hash] opts the optional parameters @return [Array<(V1Page
, Fixnum, Hash)>] V1Page
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1064 def delete_page_with_http_info(location_id, page_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_page ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_page" if location_id.nil? # verify the required parameter 'page_id' is set fail ArgumentError, "Missing the required parameter 'page_id' when calling V1ItemsApi.delete_page" if page_id.nil? # resource path local_var_path = "/v1/{location_id}/pages/{page_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'page_id' + '}', page_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Page') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
DeleteVariation Deletes an existing item variation from an item. Note*: DeleteVariation returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteVariationRequest` object as documented below. @param location_id The ID of the item's associated location. @param item_id The ID of the item to delete. @param variation_id The ID of the variation to delete. @param [Hash] opts the optional parameters @return [V1Variation]
# File lib/square_connect/api/v1_items_api.rb, line 1178 def delete_variation(location_id, item_id, variation_id, opts = {}) data, _status_code, _headers = delete_variation_with_http_info(location_id, item_id, variation_id, opts) return data end
DeleteVariation Deletes an existing item variation from an item. Note*: DeleteVariation returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteVariationRequest` object as documented below. @param location_id The ID of the item's associated location. @param item_id The ID of the item to delete. @param variation_id The ID of the variation to delete. @param [Hash] opts the optional parameters @return [Array<(V1Variation
, Fixnum, Hash)>] V1Variation
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1190 def delete_variation_with_http_info(location_id, item_id, variation_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.delete_variation ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.delete_variation" if location_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.delete_variation" if item_id.nil? # verify the required parameter 'variation_id' is set fail ArgumentError, "Missing the required parameter 'variation_id' when calling V1ItemsApi.delete_variation" if variation_id.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}/variations/{variation_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s).sub('{' + 'variation_id' + '}', variation_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Variation') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#delete_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ListCategories Lists all of a location's item categories. @param location_id The ID of the location to list categories for. @param [Hash] opts the optional parameters @return [Array<V1Category>]
# File lib/square_connect/api/v1_items_api.rb, line 1239 def list_categories(location_id, opts = {}) data, _status_code, _headers = list_categories_with_http_info(location_id, opts) return data end
ListCategories Lists all of a location's item categories. @param location_id The ID of the location to list categories for. @param [Hash] opts the optional parameters @return [Array<(Array<V1Category>, Fixnum, Hash)>] Array<V1Category> data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1249 def list_categories_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.list_categories ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_categories" if location_id.nil? # resource path local_var_path = "/v1/{location_id}/categories".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<V1Category>') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#list_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ListDiscounts Lists all of a location's discounts. @param location_id The ID of the location to list categories for. @param [Hash] opts the optional parameters @return [Array<V1Discount>]
# File lib/square_connect/api/v1_items_api.rb, line 1294 def list_discounts(location_id, opts = {}) data, _status_code, _headers = list_discounts_with_http_info(location_id, opts) return data end
ListDiscounts Lists all of a location's discounts. @param location_id The ID of the location to list categories for. @param [Hash] opts the optional parameters @return [Array<(Array<V1Discount>, Fixnum, Hash)>] Array<V1Discount> data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1304 def list_discounts_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.list_discounts ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_discounts" if location_id.nil? # resource path local_var_path = "/v1/{location_id}/discounts".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<V1Discount>') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#list_discounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ListFees Lists all of a location's fees (taxes). @param location_id The ID of the location to list fees for. @param [Hash] opts the optional parameters @return [Array<V1Fee>]
# File lib/square_connect/api/v1_items_api.rb, line 1349 def list_fees(location_id, opts = {}) data, _status_code, _headers = list_fees_with_http_info(location_id, opts) return data end
ListFees Lists all of a location's fees (taxes). @param location_id The ID of the location to list fees for. @param [Hash] opts the optional parameters @return [Array<(Array<V1Fee>, Fixnum, Hash)>] Array<V1Fee> data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1359 def list_fees_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.list_fees ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_fees" if location_id.nil? # resource path local_var_path = "/v1/{location_id}/fees".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<V1Fee>') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#list_fees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ListInventory Provides inventory information for all of a merchant's inventory-enabled item variations. @param location_id The ID of the item's associated location. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of inventory entries to return in a single response. This value cannot exceed 1000. @option opts [String] :batch_token A pagination cursor to retrieve the next set of results for your original query to the endpoint. @return [Array<V1InventoryEntry>]
# File lib/square_connect/api/v1_items_api.rb, line 1406 def list_inventory(location_id, opts = {}) data, _status_code, _headers = list_inventory_with_http_info(location_id, opts) return data end
ListInventory Provides inventory information for all of a merchant's inventory-enabled item variations. @param location_id The ID of the item's associated location. @param [Hash] opts the optional parameters @option opts [Integer] :limit The maximum number of inventory entries to return in a single response. This value cannot exceed 1000. @option opts [String] :batch_token A pagination cursor to retrieve the next set of results for your original query to the endpoint. @return [Array<(Array<V1InventoryEntry>, Fixnum, Hash)>] Array<V1InventoryEntry> data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1418 def list_inventory_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.list_inventory ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_inventory" if location_id.nil? # resource path local_var_path = "/v1/{location_id}/inventory".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<V1InventoryEntry>') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#list_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ListItems Provides summary information for all of a location's items. @param location_id The ID of the location to list items for. @param [Hash] opts the optional parameters @option opts [String] :batch_token A pagination cursor to retrieve the next set of results for your original query to the endpoint. @return [Array<V1Item>]
# File lib/square_connect/api/v1_items_api.rb, line 1466 def list_items(location_id, opts = {}) data, _status_code, _headers = list_items_with_http_info(location_id, opts) return data end
ListItems Provides summary information for all of a location's items. @param location_id The ID of the location to list items for. @param [Hash] opts the optional parameters @option opts [String] :batch_token A pagination cursor to retrieve the next set of results for your original query to the endpoint. @return [Array<(Array<V1Item>, Fixnum, Hash)>] Array<V1Item> data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1477 def list_items_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.list_items ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_items" if location_id.nil? # resource path local_var_path = "/v1/{location_id}/items".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<V1Item>') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#list_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ListModifierLists Lists all of a location's modifier lists. @param location_id The ID of the location to list modifier lists for. @param [Hash] opts the optional parameters @return [Array<V1ModifierList>]
# File lib/square_connect/api/v1_items_api.rb, line 1523 def list_modifier_lists(location_id, opts = {}) data, _status_code, _headers = list_modifier_lists_with_http_info(location_id, opts) return data end
ListModifierLists Lists all of a location's modifier lists. @param location_id The ID of the location to list modifier lists for. @param [Hash] opts the optional parameters @return [Array<(Array<V1ModifierList>, Fixnum, Hash)>] Array<V1ModifierList> data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1533 def list_modifier_lists_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.list_modifier_lists ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_modifier_lists" if location_id.nil? # resource path local_var_path = "/v1/{location_id}/modifier-lists".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<V1ModifierList>') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#list_modifier_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
ListPages Lists all of a location's Favorites pages in Square Register. @param location_id The ID of the location to list Favorites pages for. @param [Hash] opts the optional parameters @return [Array<V1Page>]
# File lib/square_connect/api/v1_items_api.rb, line 1578 def list_pages(location_id, opts = {}) data, _status_code, _headers = list_pages_with_http_info(location_id, opts) return data end
ListPages Lists all of a location's Favorites pages in Square Register. @param location_id The ID of the location to list Favorites pages for. @param [Hash] opts the optional parameters @return [Array<(Array<V1Page>, Fixnum, Hash)>] Array<V1Page> data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1588 def list_pages_with_http_info(location_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.list_pages ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.list_pages" if location_id.nil? # resource path local_var_path = "/v1/{location_id}/pages".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<V1Page>') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#list_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
RemoveFee Removes a fee assocation from an item, meaning the fee is no longer automatically applied to the item in Square Register. @param location_id The ID of the fee's associated location. @param item_id The ID of the item to add the fee to. @param fee_id The ID of the fee to apply. @param [Hash] opts the optional parameters @return [V1Item]
# File lib/square_connect/api/v1_items_api.rb, line 1635 def remove_fee(location_id, item_id, fee_id, opts = {}) data, _status_code, _headers = remove_fee_with_http_info(location_id, item_id, fee_id, opts) return data end
RemoveFee Removes a fee assocation from an item, meaning the fee is no longer automatically applied to the item in Square Register. @param location_id The ID of the fee's associated location. @param item_id The ID of the item to add the fee to. @param fee_id The ID of the fee to apply. @param [Hash] opts the optional parameters @return [Array<(V1Item
, Fixnum, Hash)>] V1Item
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1647 def remove_fee_with_http_info(location_id, item_id, fee_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.remove_fee ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.remove_fee" if location_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.remove_fee" if item_id.nil? # verify the required parameter 'fee_id' is set fail ArgumentError, "Missing the required parameter 'fee_id' when calling V1ItemsApi.remove_fee" if fee_id.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}/fees/{fee_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s).sub('{' + 'fee_id' + '}', fee_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Item') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#remove_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
RemoveModifierList Removes a modifier list association from an item, meaning modifier options from the list can no longer be applied to the item. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to remove. @param item_id The ID of the item to remove the modifier list from. @param [Hash] opts the optional parameters @return [V1Item]
# File lib/square_connect/api/v1_items_api.rb, line 1698 def remove_modifier_list(location_id, modifier_list_id, item_id, opts = {}) data, _status_code, _headers = remove_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts) return data end
RemoveModifierList Removes a modifier list association from an item, meaning modifier options from the list can no longer be applied to the item. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to remove. @param item_id The ID of the item to remove the modifier list from. @param [Hash] opts the optional parameters @return [Array<(V1Item
, Fixnum, Hash)>] V1Item
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1710 def remove_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.remove_modifier_list ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.remove_modifier_list" if location_id.nil? # verify the required parameter 'modifier_list_id' is set fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.remove_modifier_list" if modifier_list_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.remove_modifier_list" if item_id.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Item') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#remove_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
RetrieveItem Provides the details for a single item, including associated modifier lists and fees. @param location_id The ID of the item's associated location. @param item_id The item's ID. @param [Hash] opts the optional parameters @return [V1Item]
# File lib/square_connect/api/v1_items_api.rb, line 1760 def retrieve_item(location_id, item_id, opts = {}) data, _status_code, _headers = retrieve_item_with_http_info(location_id, item_id, opts) return data end
RetrieveItem Provides the details for a single item, including associated modifier lists and fees. @param location_id The ID of the item's associated location. @param item_id The item's ID. @param [Hash] opts the optional parameters @return [Array<(V1Item
, Fixnum, Hash)>] V1Item
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1771 def retrieve_item_with_http_info(location_id, item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.retrieve_item ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.retrieve_item" if location_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.retrieve_item" if item_id.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Item') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#retrieve_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
RetrieveModifierList Provides the details for a single modifier list. @param location_id The ID of the item's associated location. @param modifier_list_id The modifier list's ID. @param [Hash] opts the optional parameters @return [V1ModifierList]
# File lib/square_connect/api/v1_items_api.rb, line 1819 def retrieve_modifier_list(location_id, modifier_list_id, opts = {}) data, _status_code, _headers = retrieve_modifier_list_with_http_info(location_id, modifier_list_id, opts) return data end
RetrieveModifierList Provides the details for a single modifier list. @param location_id The ID of the item's associated location. @param modifier_list_id The modifier list's ID. @param [Hash] opts the optional parameters @return [Array<(V1ModifierList
, Fixnum, Hash)>] V1ModifierList
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1830 def retrieve_modifier_list_with_http_info(location_id, modifier_list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.retrieve_modifier_list ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.retrieve_modifier_list" if location_id.nil? # verify the required parameter 'modifier_list_id' is set fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.retrieve_modifier_list" if modifier_list_id.nil? # resource path local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1ModifierList') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#retrieve_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdateCategory Modifies the details of an existing item category. @param location_id The ID of the category's associated location. @param category_id The ID of the category to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Category]
# File lib/square_connect/api/v1_items_api.rb, line 1879 def update_category(location_id, category_id, body, opts = {}) data, _status_code, _headers = update_category_with_http_info(location_id, category_id, body, opts) return data end
UpdateCategory Modifies the details of an existing item category. @param location_id The ID of the category's associated location. @param category_id The ID of the category to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Category
, Fixnum, Hash)>] V1Category
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1891 def update_category_with_http_info(location_id, category_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_category ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_category" if location_id.nil? # verify the required parameter 'category_id' is set fail ArgumentError, "Missing the required parameter 'category_id' when calling V1ItemsApi.update_category" if category_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_category" if body.nil? # resource path local_var_path = "/v1/{location_id}/categories/{category_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'category_id' + '}', category_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Category') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdateDiscount Modifies the details of an existing discount. @param location_id The ID of the category's associated location. @param discount_id The ID of the discount to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Discount]
# File lib/square_connect/api/v1_items_api.rb, line 1942 def update_discount(location_id, discount_id, body, opts = {}) data, _status_code, _headers = update_discount_with_http_info(location_id, discount_id, body, opts) return data end
UpdateDiscount Modifies the details of an existing discount. @param location_id The ID of the category's associated location. @param discount_id The ID of the discount to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Discount
, Fixnum, Hash)>] V1Discount
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 1954 def update_discount_with_http_info(location_id, discount_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_discount ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_discount" if location_id.nil? # verify the required parameter 'discount_id' is set fail ArgumentError, "Missing the required parameter 'discount_id' when calling V1ItemsApi.update_discount" if discount_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_discount" if body.nil? # resource path local_var_path = "/v1/{location_id}/discounts/{discount_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'discount_id' + '}', discount_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Discount') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_discount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdateFee Modifies the details of an existing fee (tax). @param location_id The ID of the fee's associated location. @param fee_id The ID of the fee to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Fee]
# File lib/square_connect/api/v1_items_api.rb, line 2005 def update_fee(location_id, fee_id, body, opts = {}) data, _status_code, _headers = update_fee_with_http_info(location_id, fee_id, body, opts) return data end
UpdateFee Modifies the details of an existing fee (tax). @param location_id The ID of the fee's associated location. @param fee_id The ID of the fee to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Fee
, Fixnum, Hash)>] V1Fee
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 2017 def update_fee_with_http_info(location_id, fee_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_fee ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_fee" if location_id.nil? # verify the required parameter 'fee_id' is set fail ArgumentError, "Missing the required parameter 'fee_id' when calling V1ItemsApi.update_fee" if fee_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_fee" if body.nil? # resource path local_var_path = "/v1/{location_id}/fees/{fee_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'fee_id' + '}', fee_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Fee') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdateItem Modifies the core details of an existing item. @param location_id The ID of the item's associated location. @param item_id The ID of the item to modify. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Item]
# File lib/square_connect/api/v1_items_api.rb, line 2068 def update_item(location_id, item_id, body, opts = {}) data, _status_code, _headers = update_item_with_http_info(location_id, item_id, body, opts) return data end
UpdateItem Modifies the core details of an existing item. @param location_id The ID of the item's associated location. @param item_id The ID of the item to modify. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Item
, Fixnum, Hash)>] V1Item
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 2080 def update_item_with_http_info(location_id, item_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_item ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_item" if location_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.update_item" if item_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_item" if body.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Item') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdateModifierList Modifies the details of an existing item modifier list. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1ModifierList]
# File lib/square_connect/api/v1_items_api.rb, line 2131 def update_modifier_list(location_id, modifier_list_id, body, opts = {}) data, _status_code, _headers = update_modifier_list_with_http_info(location_id, modifier_list_id, body, opts) return data end
UpdateModifierList Modifies the details of an existing item modifier list. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1ModifierList
, Fixnum, Hash)>] V1ModifierList
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 2143 def update_modifier_list_with_http_info(location_id, modifier_list_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_modifier_list ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_modifier_list" if location_id.nil? # verify the required parameter 'modifier_list_id' is set fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.update_modifier_list" if modifier_list_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_modifier_list" if body.nil? # resource path local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1ModifierList') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_modifier_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdateModifierOption Modifies the details of an existing item modifier option. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to edit. @param modifier_option_id The ID of the modifier list to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1ModifierOption]
# File lib/square_connect/api/v1_items_api.rb, line 2195 def update_modifier_option(location_id, modifier_list_id, modifier_option_id, body, opts = {}) data, _status_code, _headers = update_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, body, opts) return data end
UpdateModifierOption Modifies the details of an existing item modifier option. @param location_id The ID of the item's associated location. @param modifier_list_id The ID of the modifier list to edit. @param modifier_option_id The ID of the modifier list to edit. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1ModifierOption
, Fixnum, Hash)>] V1ModifierOption
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 2208 def update_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_modifier_option ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_modifier_option" if location_id.nil? # verify the required parameter 'modifier_list_id' is set fail ArgumentError, "Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.update_modifier_option" if modifier_list_id.nil? # verify the required parameter 'modifier_option_id' is set fail ArgumentError, "Missing the required parameter 'modifier_option_id' when calling V1ItemsApi.update_modifier_option" if modifier_option_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_modifier_option" if body.nil? # resource path local_var_path = "/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'modifier_option_id' + '}', modifier_option_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1ModifierOption') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_modifier_option\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdatePage Modifies the details of a Favorites page in Square Register. @param location_id The ID of the Favorites page's associated location @param page_id The ID of the page to modify. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Page]
# File lib/square_connect/api/v1_items_api.rb, line 2261 def update_page(location_id, page_id, body, opts = {}) data, _status_code, _headers = update_page_with_http_info(location_id, page_id, body, opts) return data end
UpdatePageCell Modifies a cell of a Favorites page in Square Register. @param location_id The ID of the Favorites page's associated location. @param page_id The ID of the page the cell belongs to. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Page]
# File lib/square_connect/api/v1_items_api.rb, line 2324 def update_page_cell(location_id, page_id, body, opts = {}) data, _status_code, _headers = update_page_cell_with_http_info(location_id, page_id, body, opts) return data end
UpdatePageCell Modifies a cell of a Favorites page in Square Register. @param location_id The ID of the Favorites page's associated location. @param page_id The ID of the page the cell belongs to. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Page
, Fixnum, Hash)>] V1Page
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 2336 def update_page_cell_with_http_info(location_id, page_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_page_cell ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_page_cell" if location_id.nil? # verify the required parameter 'page_id' is set fail ArgumentError, "Missing the required parameter 'page_id' when calling V1ItemsApi.update_page_cell" if page_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_page_cell" if body.nil? # resource path local_var_path = "/v1/{location_id}/pages/{page_id}/cells".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'page_id' + '}', page_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Page') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_page_cell\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdatePage Modifies the details of a Favorites page in Square Register. @param location_id The ID of the Favorites page's associated location @param page_id The ID of the page to modify. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Page
, Fixnum, Hash)>] V1Page
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 2273 def update_page_with_http_info(location_id, page_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_page ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_page" if location_id.nil? # verify the required parameter 'page_id' is set fail ArgumentError, "Missing the required parameter 'page_id' when calling V1ItemsApi.update_page" if page_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_page" if body.nil? # resource path local_var_path = "/v1/{location_id}/pages/{page_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'page_id' + '}', page_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Page') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
UpdateVariation Modifies the details of an existing item variation. @param location_id The ID of the item's associated location. @param item_id The ID of the item to modify. @param variation_id The ID of the variation to modify. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [V1Variation]
# File lib/square_connect/api/v1_items_api.rb, line 2388 def update_variation(location_id, item_id, variation_id, body, opts = {}) data, _status_code, _headers = update_variation_with_http_info(location_id, item_id, variation_id, body, opts) return data end
UpdateVariation Modifies the details of an existing item variation. @param location_id The ID of the item's associated location. @param item_id The ID of the item to modify. @param variation_id The ID of the variation to modify. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [Array<(V1Variation
, Fixnum, Hash)>] V1Variation
data, response status code and response headers
# File lib/square_connect/api/v1_items_api.rb, line 2401 def update_variation_with_http_info(location_id, item_id, variation_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: V1ItemsApi.update_variation ..." end # verify the required parameter 'location_id' is set fail ArgumentError, "Missing the required parameter 'location_id' when calling V1ItemsApi.update_variation" if location_id.nil? # verify the required parameter 'item_id' is set fail ArgumentError, "Missing the required parameter 'item_id' when calling V1ItemsApi.update_variation" if item_id.nil? # verify the required parameter 'variation_id' is set fail ArgumentError, "Missing the required parameter 'variation_id' when calling V1ItemsApi.update_variation" if variation_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling V1ItemsApi.update_variation" if body.nil? # resource path local_var_path = "/v1/{location_id}/items/{item_id}/variations/{variation_id}".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s).sub('{' + 'variation_id' + '}', variation_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params['Square-Version'] = "2019-06-12" # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'V1Variation') if @api_client.config.debugging @api_client.config.logger.debug "API called: V1ItemsApi#update_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end