ruby/lib/openapi_client/api/products_api.rb
# Autocomplete Product Search
# Generate suggestions for grocery products based on a (partial) query. The matches will be found by looking in the title only.
# @param query [String] The (partial) search query.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :number The number of results to return (between 1 and 25).
# @return [Array<(InlineResponse20032, Integer, Hash)>] InlineResponse20032 data, response status code and response headers
Autocomplete Product Search
Generate suggestions for grocery products based on a (partial) query. The matches will be found by looking in the title only.
Autocomplete Product Search Generate suggestions for grocery products based on a ( partial ) query . The matches will be found by looking in the title only .
def autocomplete_product_search_with_http_info(query, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProductsApi.autocomplete_product_search ...'
      end
      if @api_client.config.client_side_validation && query.nil?
        fail ArgumentError, "Missing the required parameter 'query' when calling ProductsApi.autocomplete_product_search"
      end
      if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] > 25
        fail ArgumentError, 'invalid value for "opts[:"number"]" when calling ProductsApi.autocomplete_product_search, must be smaller than or equal to 25.'
      end
      if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] < 1
        fail ArgumentError, 'invalid value for "opts[:"number"]" when calling ProductsApi.autocomplete_product_search, must be greater than or equal to 1.'
      end
      local_var_path = '/food/products/suggest'
      query_params = opts[:query_params] || {}
      query_params[:'query'] = query
      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] || 'InlineResponse20032' 
      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#autocomplete_product_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def autocomplete_product_search_with_http_info ( query , opts = { } ) if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: ProductsApi.autocomplete_product_search ...' end if @api_client . config . client_side_validation && query . nil? fail ArgumentError , "Missing the required parameter 'query' when calling ProductsApi.autocomplete_product_search" end if @api_client . config . client_side_validation && ! opts [ :' number ' ] . nil? && opts [ :' number ' ] > 25 fail ArgumentError , 'invalid value for "opts[:"number"]" when calling ProductsApi.autocomplete_product_search, must be smaller than or equal to 25.' end if @api_client . config . client_side_validation && ! opts [ :' number ' ] . nil? && opts [ :' number ' ] < 1 fail ArgumentError , 'invalid value for "opts[:"number"]" when calling ProductsApi.autocomplete_product_search, must be greater than or equal to 1.' end local_var_path = '/food/products/suggest' query_params = opts [ :query_params ] || { } query_params [ :' query ' ] = query 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 ] || 'InlineResponse20032' 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#autocomplete_product_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Autocomplete Product Search
Generate suggestions for grocery products based on a (partial) query.
Autocomplete Product Search Generate suggestions for grocery products based on a ( partial ) query .
# 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
InlineResponse20032 data, response status code and response headers
InlineResponse20032 data response status code and response headers
Array<(InlineResponse20032, Integer, Hash)>
query
The (partial) search query.
The ( partial ) search query .
opts
:number The number of results to return (between 1 and 25).
: number The number of results to return ( between 1 and 25 ) .
opts the optional parameters
opts the optional parameters