ruby/lib/openapi_client/api/recipes_api.rb
# Parse Ingredients
# Extract an ingredient from plain text.
# @param [Hash] opts the optional parameters
# @option opts [String] :content_type The content type.
# @option opts [String] :language The language of the input. Either &#39;en&#39; or &#39;de&#39;.
# @return [Array<(Array<InlineResponse20020>, Integer, Hash)>] Array<InlineResponse20020> data, response status code and response headers
Parse Ingredients
Extract an ingredient from plain text.
Parse Ingredients Extract an ingredient from plain text .
def parse_ingredients_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: RecipesApi.parse_ingredients ...'
      end
      allowable_values = ["application/x-www-form-urlencoded", "application/json", "multipart/form-data"]
      if @api_client.config.client_side_validation && opts[:'content_type'] && !allowable_values.include?(opts[:'content_type'])
        fail ArgumentError, "invalid value for \"content_type\", must be one of #{allowable_values}"
      end
      allowable_values = ["en", "de"]
      if @api_client.config.client_side_validation && opts[:'language'] && !allowable_values.include?(opts[:'language'])
        fail ArgumentError, "invalid value for \"language\", must be one of #{allowable_values}"
      end
      local_var_path = '/recipes/parseIngredients'
      query_params = opts[:query_params] || {}
      query_params[:'language'] = opts[:'language'] if !opts[:'language'].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/x-www-form-urlencoded'])
      header_params[:'Content-Type'] = opts[:'content_type'] if !opts[:'content_type'].nil?
      form_params = opts[:form_params] || {}
      post_body = opts[:body] 
      return_type = opts[:return_type] || 'Array<InlineResponse20020>' 
      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: RecipesApi#parse_ingredients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def parse_ingredients_with_http_info ( opts = { } ) if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: RecipesApi.parse_ingredients ...' end allowable_values = [ "application/x-www-form-urlencoded" , "application/json" , "multipart/form-data" ] if @api_client . config . client_side_validation && opts [ :' content_type ' ] && ! allowable_values . include? ( opts [ :' content_type ' ] ) fail ArgumentError , "invalid value for \"content_type\", must be one of #{allowable_values}" end allowable_values = [ "en" , "de" ] if @api_client . config . client_side_validation && opts [ :' language ' ] && ! allowable_values . include? ( opts [ :' language ' ] ) fail ArgumentError , "invalid value for \"language\", must be one of #{allowable_values}" end local_var_path = '/recipes/parseIngredients' query_params = opts [ :query_params ] || { } query_params [ :' language ' ] = opts [ :' language ' ] if ! opts [ :' language ' ] . 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/x-www-form-urlencoded' ] ) header_params [ :' Content-Type ' ] = opts [ :' content_type ' ] if ! opts [ :' content_type ' ] . nil? form_params = opts [ :form_params ] || { } post_body = opts [ :body ] return_type = opts [ :return_type ] || 'Array<InlineResponse20020>' 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: RecipesApi#parse_ingredients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Parse Ingredients
Extract an ingredient from plain text.
Parse Ingredients Extract an ingredient from plain text .
# resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # HTTP header 'Content-Type' # form parameters # http body (model) # return_type # auth_names
Array data, response status code and response headers
Array data response status code and response headers
Array<(Array<InlineResponse20020>, Integer, Hash)>
opts
:language The language of the input. Either 'en' or 'de'.
: language The language of the input . Either ' en ' or ' de ' .
opts the optional parameters
opts the optional parameters