ruby/lib/openapi_client/api/products_api.rb
# Classify Grocery Product
# This endpoint allows you to match a packaged food to a basic category, e.g. a specific brand of milk to the category milk.
# @param inline_object1 [InlineObject1] 
# @param [Hash] opts the optional parameters
# @option opts [String] :locale The display name of the returned category, supported is en_US (for American English) and en_GB (for British English).
# @return [Array<(InlineResponse20033, Integer, Hash)>] InlineResponse20033 data, response status code and response headers
Classify Grocery Product
This endpoint allows you to match a packaged food to a basic category, e.g. a specific brand of milk to the category milk.
Classify Grocery Product This endpoint allows you to match a packaged food to a basic category e . g . a specific brand of milk to the category milk .
def classify_grocery_product_with_http_info(inline_object1, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProductsApi.classify_grocery_product ...'
      end
      if @api_client.config.client_side_validation && inline_object1.nil?
        fail ArgumentError, "Missing the required parameter 'inline_object1' when calling ProductsApi.classify_grocery_product"
      end
      allowable_values = ["en_US", "en_GB"]
      if @api_client.config.client_side_validation && opts[:'locale'] && !allowable_values.include?(opts[:'locale'])
        fail ArgumentError, "invalid value for \"locale\", must be one of #{allowable_values}"
      end
      local_var_path = '/food/products/classify'
      query_params = opts[:query_params] || {}
      query_params[:'locale'] = opts[:'locale'] if !opts[:'locale'].nil?
      header_params = opts[:header_params] || {}
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
      form_params = opts[:form_params] || {}
      post_body = opts[:body] || @api_client.object_to_http_body(inline_object1) 
      return_type = opts[:return_type] || 'InlineResponse20033' 
      auth_names = opts[:auth_names] || ['apiKeyScheme']
      new_options = opts.merge(
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )
      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProductsApi#classify_grocery_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def classify_grocery_product_with_http_info ( inline_object1 , opts = { } ) if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: ProductsApi.classify_grocery_product ...' end if @api_client . config . client_side_validation && inline_object1 . nil? fail ArgumentError , "Missing the required parameter 'inline_object1' when calling ProductsApi.classify_grocery_product" end allowable_values = [ "en_US" , "en_GB" ] if @api_client . config . client_side_validation && opts [ :' locale ' ] && ! allowable_values . include? ( opts [ :' locale ' ] ) fail ArgumentError , "invalid value for \"locale\", must be one of #{allowable_values}" end local_var_path = '/food/products/classify' query_params = opts [ :query_params ] || { } query_params [ :' locale ' ] = opts [ :' locale ' ] if ! opts [ :' locale ' ] . nil? header_params = opts [ :header_params ] || { } header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] ) header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/json' ] ) form_params = opts [ :form_params ] || { } post_body = opts [ :body ] || @api_client . object_to_http_body ( inline_object1 ) return_type = opts [ :return_type ] || 'InlineResponse20033' auth_names = opts [ :auth_names ] || [ 'apiKeyScheme' ] new_options = opts . merge ( :header_params => header_params , :query_params => query_params , :form_params => form_params , :body => post_body , :auth_names => auth_names , :return_type => return_type ) data , status_code , headers = @api_client . call_api ( :POST , local_var_path , new_options ) if @api_client . config . debugging @api_client . config . logger . debug "API called: ProductsApi#classify_grocery_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Classify Grocery Product
This endpoint allows you to match a packaged food to a basic category, e.g.
Classify Grocery Product This endpoint allows you to match a packaged food to a basic category e . g .
# verify the required parameter 'inline_object1' is set # resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # HTTP header 'Content-Type' # form parameters # http body (model) # return_type # auth_names
InlineResponse20033 data, response status code and response headers
InlineResponse20033 data response status code and response headers
Array<(InlineResponse20033, Integer, Hash)>
inline_object1
opts
:locale The display name of the returned category, supported is en_US (for American English) and en_GB (for British English).
: locale The display name of the returned category supported is en_US ( for American English ) and en_GB ( for British English ) .
None
opts the optional parameters
opts the optional parameters