ruby/lib/openapi_client/api/misc_api.rb
# Search All Food
# Search all food content with one call. That includes recipes, grocery products, menu items, simple foods (ingredients), and food videos.
# @param query [String] The search query.
# @param [Hash] opts the optional parameters
# @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<(InlineResponse20053, Integer, Hash)>] InlineResponse20053 data, response status code and response headers
Search All Food
Search all food content with one call. That includes recipes, grocery products, menu items, simple foods (ingredients), and food videos.
Search All Food Search all food content with one call . That includes recipes grocery products menu items simple foods ( ingredients ) and food videos .
def search_all_food_with_http_info(query, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MiscApi.search_all_food ...'
      end
      if @api_client.config.client_side_validation && query.nil?
        fail ArgumentError, "Missing the required parameter 'query' when calling MiscApi.search_all_food"
      end
      if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 900
        fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling MiscApi.search_all_food, 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 MiscApi.search_all_food, 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 MiscApi.search_all_food, 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 MiscApi.search_all_food, must be greater than or equal to 1.'
      end
      local_var_path = '/food/search'
      query_params = opts[:query_params] || {}
      query_params[:'query'] = query
      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] || 'InlineResponse20053' 
      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: MiscApi#search_all_food\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def search_all_food_with_http_info ( query , opts = { } ) if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: MiscApi.search_all_food ...' end if @api_client . config . client_side_validation && query . nil? fail ArgumentError , "Missing the required parameter 'query' when calling MiscApi.search_all_food" end if @api_client . config . client_side_validation && ! opts [ :' offset ' ] . nil? && opts [ :' offset ' ] > 900 fail ArgumentError , 'invalid value for "opts[:"offset"]" when calling MiscApi.search_all_food, 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 MiscApi.search_all_food, 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 MiscApi.search_all_food, 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 MiscApi.search_all_food, must be greater than or equal to 1.' end local_var_path = '/food/search' query_params = opts [ :query_params ] || { } query_params [ :' query ' ] = query 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 ] || 'InlineResponse20053' 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: MiscApi#search_all_food\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Search All Food
Search all food content with one call.
Search All Food Search all food content with one call .
# verify the required parameter 'query' is set # resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # form parameters # http body (model) # return_type # auth_names
InlineResponse20053 data, response status code and response headers
InlineResponse20053 data response status code and response headers
Array<(InlineResponse20053, Integer, Hash)>
query
The search query.
The search query .
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