ruby/lib/openapi_client/api/products_api.rb
def search_grocery_products_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProductsApi.search_grocery_products ...'
      end
      allowable_values = ["false", "true"]
      if @api_client.config.client_side_validation && opts[:'add_product_information'] && !allowable_values.include?(opts[:'add_product_information'])
        fail ArgumentError, "invalid value for \"add_product_information\", must be one of #{allowable_values}"
      end
      if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 900
        fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ProductsApi.search_grocery_products, must be smaller than or equal to 900.'
      end

      if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
        fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ProductsApi.search_grocery_products, must be greater than or equal to 0.'
      end

      if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] > 100
        fail ArgumentError, 'invalid value for "opts[:"number"]" when calling ProductsApi.search_grocery_products, must be smaller than or equal to 100.'
      end

      if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] < 1
        fail ArgumentError, 'invalid value for "opts[:"number"]" when calling ProductsApi.search_grocery_products, must be greater than or equal to 1.'
      end

      # resource path
      local_var_path = '/food/products/search'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
      query_params[:'minCalories'] = opts[:'min_calories'] if !opts[:'min_calories'].nil?
      query_params[:'maxCalories'] = opts[:'max_calories'] if !opts[:'max_calories'].nil?
      query_params[:'minCarbs'] = opts[:'min_carbs'] if !opts[:'min_carbs'].nil?
      query_params[:'maxCarbs'] = opts[:'max_carbs'] if !opts[:'max_carbs'].nil?
      query_params[:'minProtein'] = opts[:'min_protein'] if !opts[:'min_protein'].nil?
      query_params[:'maxProtein'] = opts[:'max_protein'] if !opts[:'max_protein'].nil?
      query_params[:'minFat'] = opts[:'min_fat'] if !opts[:'min_fat'].nil?
      query_params[:'maxFat'] = opts[:'max_fat'] if !opts[:'max_fat'].nil?
      query_params[:'addProductInformation'] = opts[:'add_product_information'] if !opts[:'add_product_information'].nil?
      query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
      query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:body] 

      # return_type
      return_type = opts[:return_type] || 'InlineResponse20027' 

      # auth_names
      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(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProductsApi#search_grocery_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
# Search Grocery Products
# Search packaged food products, such as frozen pizza or Greek yogurt.
# @param [Hash] opts the optional parameters
# @option opts [String] :query The (natural language) search query.
# @option opts [Float] :min_calories The minimum amount of calories the product must have.
# @option opts [Float] :max_calories The maximum amount of calories the product can have.
# @option opts [Float] :min_carbs The minimum amount of carbohydrates in grams the product must have.
# @option opts [Float] :max_carbs The maximum amount of carbohydrates in grams the product can have.
# @option opts [Float] :min_protein The minimum amount of protein in grams the product must have.
# @option opts [Float] :max_protein The maximum amount of protein in grams the product can have.
# @option opts [Float] :min_fat The minimum amount of fat in grams the product must have.
# @option opts [Float] :max_fat The maximum amount of fat in grams the product can have.
# @option opts [Boolean] :add_product_information If set to true, you get more information about the products returned.
# @option opts [Integer] :offset The number of results to skip (between 0 and 900).
# @option opts [Integer] :number The maximum number of items to return (between 1 and 100). Defaults to 10.
# @return [Array<(InlineResponse20027, Integer, Hash)>] InlineResponse20027 data, response status code and response headers
Search Grocery Products
Search packaged food products, such as frozen pizza or Greek yogurt.
Search Grocery Products Search packaged food products such as frozen pizza or Greek yogurt .
def search_grocery_products_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProductsApi.search_grocery_products ...'
      end
      allowable_values = ["false", "true"]
      if @api_client.config.client_side_validation && opts[:'add_product_information'] && !allowable_values.include?(opts[:'add_product_information'])
        fail ArgumentError, "invalid value for \"add_product_information\", must be one of #{allowable_values}"
      end
      if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 900
        fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ProductsApi.search_grocery_products, must be smaller than or equal to 900.'
      end
      if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
        fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ProductsApi.search_grocery_products, must be greater than or equal to 0.'
      end
      if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] > 100
        fail ArgumentError, 'invalid value for "opts[:"number"]" when calling ProductsApi.search_grocery_products, must be smaller than or equal to 100.'
      end
      if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] < 1
        fail ArgumentError, 'invalid value for "opts[:"number"]" when calling ProductsApi.search_grocery_products, must be greater than or equal to 1.'
      end
      local_var_path = '/food/products/search'
      query_params = opts[:query_params] || {}
      query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
      query_params[:'minCalories'] = opts[:'min_calories'] if !opts[:'min_calories'].nil?
      query_params[:'maxCalories'] = opts[:'max_calories'] if !opts[:'max_calories'].nil?
      query_params[:'minCarbs'] = opts[:'min_carbs'] if !opts[:'min_carbs'].nil?
      query_params[:'maxCarbs'] = opts[:'max_carbs'] if !opts[:'max_carbs'].nil?
      query_params[:'minProtein'] = opts[:'min_protein'] if !opts[:'min_protein'].nil?
      query_params[:'maxProtein'] = opts[:'max_protein'] if !opts[:'max_protein'].nil?
      query_params[:'minFat'] = opts[:'min_fat'] if !opts[:'min_fat'].nil?
      query_params[:'maxFat'] = opts[:'max_fat'] if !opts[:'max_fat'].nil?
      query_params[:'addProductInformation'] = opts[:'add_product_information'] if !opts[:'add_product_information'].nil?
      query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
      query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?
      header_params = opts[:header_params] || {}
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      form_params = opts[:form_params] || {}
      post_body = opts[:body] 
      return_type = opts[:return_type] || 'InlineResponse20027' 
      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(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProductsApi#search_grocery_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def search_grocery_products_with_http_info ( opts = { } ) if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: ProductsApi.search_grocery_products ...' end allowable_values = [ "false" , "true" ] if @api_client . config . client_side_validation && opts [ :' add_product_information ' ] && ! allowable_values . include? ( opts [ :' add_product_information ' ] ) fail ArgumentError , "invalid value for \"add_product_information\", must be one of #{allowable_values}" end if @api_client . config . client_side_validation && ! opts [ :' offset ' ] . nil? && opts [ :' offset ' ] > 900 fail ArgumentError , 'invalid value for "opts[:"offset"]" when calling ProductsApi.search_grocery_products, must be smaller than or equal to 900.' end if @api_client . config . client_side_validation && ! opts [ :' offset ' ] . nil? && opts [ :' offset ' ] < 0 fail ArgumentError , 'invalid value for "opts[:"offset"]" when calling ProductsApi.search_grocery_products, must be greater than or equal to 0.' end if @api_client . config . client_side_validation && ! opts [ :' number ' ] . nil? && opts [ :' number ' ] > 100 fail ArgumentError , 'invalid value for "opts[:"number"]" when calling ProductsApi.search_grocery_products, must be smaller than or equal to 100.' end if @api_client . config . client_side_validation && ! opts [ :' number ' ] . nil? && opts [ :' number ' ] < 1 fail ArgumentError , 'invalid value for "opts[:"number"]" when calling ProductsApi.search_grocery_products, must be greater than or equal to 1.' end local_var_path = '/food/products/search' query_params = opts [ :query_params ] || { } query_params [ :' query ' ] = opts [ :' query ' ] if ! opts [ :' query ' ] . nil? query_params [ :' minCalories ' ] = opts [ :' min_calories ' ] if ! opts [ :' min_calories ' ] . nil? query_params [ :' maxCalories ' ] = opts [ :' max_calories ' ] if ! opts [ :' max_calories ' ] . nil? query_params [ :' minCarbs ' ] = opts [ :' min_carbs ' ] if ! opts [ :' min_carbs ' ] . nil? query_params [ :' maxCarbs ' ] = opts [ :' max_carbs ' ] if ! opts [ :' max_carbs ' ] . nil? query_params [ :' minProtein ' ] = opts [ :' min_protein ' ] if ! opts [ :' min_protein ' ] . nil? query_params [ :' maxProtein ' ] = opts [ :' max_protein ' ] if ! opts [ :' max_protein ' ] . nil? query_params [ :' minFat ' ] = opts [ :' min_fat ' ] if ! opts [ :' min_fat ' ] . nil? query_params [ :' maxFat ' ] = opts [ :' max_fat ' ] if ! opts [ :' max_fat ' ] . nil? query_params [ :' addProductInformation ' ] = opts [ :' add_product_information ' ] if ! opts [ :' add_product_information ' ] . nil? query_params [ :' offset ' ] = opts [ :' offset ' ] if ! opts [ :' offset ' ] . nil? query_params [ :' number ' ] = opts [ :' number ' ] if ! opts [ :' number ' ] . nil? header_params = opts [ :header_params ] || { } header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] ) form_params = opts [ :form_params ] || { } post_body = opts [ :body ] return_type = opts [ :return_type ] || 'InlineResponse20027' 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 ( :GET , local_var_path , new_options ) if @api_client . config . debugging @api_client . config . logger . debug "API called: ProductsApi#search_grocery_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Search Grocery Products
Search packaged food products, such as frozen pizza or Greek yogurt.
Search Grocery Products Search packaged food products such as frozen pizza or Greek yogurt .
# resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # form parameters # http body (model) # return_type # auth_names
InlineResponse20027 data, response status code and response headers
InlineResponse20027 data response status code and response headers
Array<(InlineResponse20027, Integer, Hash)>
opts
:number The maximum number of items to return (between 1 and 100). Defaults to 10.
: number The maximum number of items to return ( between 1 and 100 ) . Defaults to 10 .
opts the optional parameters
opts the optional parameters