python/spoonacular/com/spoonacular/default_api.py
def ingredient_search_with_http_info(self, query, **kwargs):  # noqa: E501
        """Ingredient Search  # noqa: E501

        Search for simple whole foods (e.g. fruits, vegetables, nuts, grains, meat, fish, dairy etc.).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.ingredient_search_with_http_info(query, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str query: The partial or full ingredient name. (required)
        :param bool add_children: Whether to add children of found foods.
        :param float min_protein_percent: The minimum percentage of protein the food must have (between 0 and 100).
        :param float max_protein_percent: The maximum percentage of protein the food can have (between 0 and 100).
        :param float min_fat_percent: The minimum percentage of fat the food must have (between 0 and 100).
        :param float max_fat_percent: The maximum percentage of fat the food can have (between 0 and 100).
        :param float min_carbs_percent: The minimum percentage of carbs the food must have (between 0 and 100).
        :param float max_carbs_percent: The maximum percentage of carbs the food can have (between 0 and 100).
        :param bool meta_information: Whether to return more meta information about the ingredients.
        :param str intolerances: A comma-separated list of intolerances. All recipes returned must not contain ingredients that are not suitable for people with the intolerances entered. See a full list of supported intolerances.
        :param str sort: The strategy to sort recipes by. See a full list of supported sorting options.
        :param str sort_direction: The direction in which to sort. Must be either 'asc' (ascending) or 'desc' (descending).
        :param float offset: The number of results to skip (between 0 and 990).
        :param float number: The number of expected results (between 1 and 100).
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['query', 'add_children', 'min_protein_percent', 'max_protein_percent', 'min_fat_percent', 'max_fat_percent', 'min_carbs_percent', 'max_carbs_percent', 'meta_information', 'intolerances', 'sort', 'sort_direction', 'offset', 'number']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method ingredient_search" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'query' is set
        if ('query' not in local_var_params or
                local_var_params['query'] is None):
            raise ApiValueError("Missing the required parameter `query` when calling `ingredient_search`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'query' in local_var_params:
            query_params.append(('query', local_var_params['query']))  # noqa: E501
        if 'add_children' in local_var_params:
            query_params.append(('addChildren', local_var_params['add_children']))  # noqa: E501
        if 'min_protein_percent' in local_var_params:
            query_params.append(('minProteinPercent', local_var_params['min_protein_percent']))  # noqa: E501
        if 'max_protein_percent' in local_var_params:
            query_params.append(('maxProteinPercent', local_var_params['max_protein_percent']))  # noqa: E501
        if 'min_fat_percent' in local_var_params:
            query_params.append(('minFatPercent', local_var_params['min_fat_percent']))  # noqa: E501
        if 'max_fat_percent' in local_var_params:
            query_params.append(('maxFatPercent', local_var_params['max_fat_percent']))  # noqa: E501
        if 'min_carbs_percent' in local_var_params:
            query_params.append(('minCarbsPercent', local_var_params['min_carbs_percent']))  # noqa: E501
        if 'max_carbs_percent' in local_var_params:
            query_params.append(('maxCarbsPercent', local_var_params['max_carbs_percent']))  # noqa: E501
        if 'meta_information' in local_var_params:
            query_params.append(('metaInformation', local_var_params['meta_information']))  # noqa: E501
        if 'intolerances' in local_var_params:
            query_params.append(('intolerances', local_var_params['intolerances']))  # noqa: E501
        if 'sort' in local_var_params:
            query_params.append(('sort', local_var_params['sort']))  # noqa: E501
        if 'sort_direction' in local_var_params:
            query_params.append(('sortDirection', local_var_params['sort_direction']))  # noqa: E501
        if 'offset' in local_var_params:
            query_params.append(('offset', local_var_params['offset']))  # noqa: E501
        if 'number' in local_var_params:
            query_params.append(('number', local_var_params['number']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/food/ingredients/search', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
Ingredient Search  # noqa: E501

        Search for simple whole foods (e.g. fruits, vegetables, nuts, grains, meat, fish, dairy etc.).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.ingredient_search_with_http_info(query, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str query: The partial or full ingredient name. (required)
        :param bool add_children: Whether to add children of found foods.
        :param float min_protein_percent: The minimum percentage of protein the food must have (between 0 and 100).
        :param float max_protein_percent: The maximum percentage of protein the food can have (between 0 and 100).
        :param float min_fat_percent: The minimum percentage of fat the food must have (between 0 and 100).
        :param float max_fat_percent: The maximum percentage of fat the food can have (between 0 and 100).
        :param float min_carbs_percent: The minimum percentage of carbs the food must have (between 0 and 100).
        :param float max_carbs_percent: The maximum percentage of carbs the food can have (between 0 and 100).
        :param bool meta_information: Whether to return more meta information about the ingredients.
        :param str intolerances: A comma-separated list of intolerances. All recipes returned must not contain ingredients that are not suitable for people with the intolerances entered. See a full list of supported intolerances.
        :param str sort: The strategy to sort recipes by. See a full list of supported sorting options.
        :param str sort_direction: The direction in which to sort. Must be either 'asc' (ascending) or 'desc' (descending).
        :param float offset: The number of results to skip (between 0 and 990).
        :param float number: The number of expected results (between 1 and 100).
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        
Ingredient Search  # noqa: E501
Search for simple whole foods .  # noqa: E501
This method makes a synchronous HTTP request by default.

:param async_req bool
:param str query: The partial or full ingredient name. (required)
:param bool add_children: Whether to add children of found foods.
:param float min_protein_percent: The minimum percentage of protein the food must have (between 0 and 100).
:param float max_protein_percent: The maximum percentage of protein the food can have (between 0 and 100).
:param float min_fat_percent: The minimum percentage of fat the food must have (between 0 and 100).
:param float max_fat_percent: The maximum percentage of fat the food can have (between 0 and 100).
:param float min_carbs_percent: The minimum percentage of carbs the food must have (between 0 and 100).
:param float max_carbs_percent: The maximum percentage of carbs the food can have (between 0 and 100).
:param bool meta_information: Whether to return more meta information about the ingredients.
:param str intolerances: A comma-separated list of intolerances. All recipes returned must not contain ingredients that are not suitable for people with the intolerances entered. See a full list of supported intolerances.
:param str sort: The strategy to sort recipes by. See a full list of supported sorting options.
:param str sort_direction: The direction in which to sort. Must be either 'asc' (ascending) or 'desc' (descending).
:param float offset: The number of results to skip (between 0 and 990).
:param float number: The number of expected results (between 1 and 100).
:return: object
If the method is called asynchronously,
returns the request thread.
Ingredient Search # noqa : E501 Search for simple whole foods . # noqa : E501 This method makes a synchronous HTTP request by default . : param async_req bool : param str query : The partial or full ingredient name . ( required ) : param bool add_children : Whether to add children of found foods . : param float min_protein_percent : The minimum percentage of protein the food must have ( between 0 and 100 ) . : param float max_protein_percent : The maximum percentage of protein the food can have ( between 0 and 100 ) . : param float min_fat_percent : The minimum percentage of fat the food must have ( between 0 and 100 ) . : param float max_fat_percent : The maximum percentage of fat the food can have ( between 0 and 100 ) . : param float min_carbs_percent : The minimum percentage of carbs the food must have ( between 0 and 100 ) . : param float max_carbs_percent : The maximum percentage of carbs the food can have ( between 0 and 100 ) . : param bool meta_information : Whether to return more meta information about the ingredients . : param str intolerances : A comma - separated list of intolerances . All recipes returned must not contain ingredients that are not suitable for people with the intolerances entered . See a full list of supported intolerances . : param str sort : The strategy to sort recipes by . See a full list of supported sorting options . : param str sort_direction : The direction in which to sort . Must be either ' asc ' ( ascending ) or ' desc ' ( descending ) . : param float offset : The number of results to skip ( between 0 and 990 ) . : param float number : The number of expected results ( between 1 and 100 ) . : return : object If the method is called asynchronously returns the request thread .
def ingredient_search_with_http_info(self, query, **kwargs):  
        """Ingredient Search  
        Search for simple whole foods (e.g. fruits, vegetables, nuts, grains, meat, fish, dairy etc.).  
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.ingredient_search_with_http_info(query, async_req=True)
        >>> result = thread.get()
        :param async_req bool
        :param str query: The partial or full ingredient name. (required)
        :param bool add_children: Whether to add children of found foods.
        :param float min_protein_percent: The minimum percentage of protein the food must have (between 0 and 100).
        :param float max_protein_percent: The maximum percentage of protein the food can have (between 0 and 100).
        :param float min_fat_percent: The minimum percentage of fat the food must have (between 0 and 100).
        :param float max_fat_percent: The maximum percentage of fat the food can have (between 0 and 100).
        :param float min_carbs_percent: The minimum percentage of carbs the food must have (between 0 and 100).
        :param float max_carbs_percent: The maximum percentage of carbs the food can have (between 0 and 100).
        :param bool meta_information: Whether to return more meta information about the ingredients.
        :param str intolerances: A comma-separated list of intolerances. All recipes returned must not contain ingredients that are not suitable for people with the intolerances entered. See a full list of supported intolerances.
        :param str sort: The strategy to sort recipes by. See a full list of supported sorting options.
        :param str sort_direction: The direction in which to sort. Must be either 'asc' (ascending) or 'desc' (descending).
        :param float offset: The number of results to skip (between 0 and 990).
        :param float number: The number of expected results (between 1 and 100).
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        local_var_params = locals()
        all_params = ['query', 'add_children', 'min_protein_percent', 'max_protein_percent', 'min_fat_percent', 'max_fat_percent', 'min_carbs_percent', 'max_carbs_percent', 'meta_information', 'intolerances', 'sort', 'sort_direction', 'offset', 'number']  
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method ingredient_search" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        if ('query' not in local_var_params or
                local_var_params['query'] is None):
            raise ApiValueError("Missing the required parameter `query` when calling `ingredient_search`")  
        collection_formats = {}
        path_params = {}
        query_params = []
        if 'query' in local_var_params:
            query_params.append(('query', local_var_params['query']))  
        if 'add_children' in local_var_params:
            query_params.append(('addChildren', local_var_params['add_children']))  
        if 'min_protein_percent' in local_var_params:
            query_params.append(('minProteinPercent', local_var_params['min_protein_percent']))  
        if 'max_protein_percent' in local_var_params:
            query_params.append(('maxProteinPercent', local_var_params['max_protein_percent']))  
        if 'min_fat_percent' in local_var_params:
            query_params.append(('minFatPercent', local_var_params['min_fat_percent']))  
        if 'max_fat_percent' in local_var_params:
            query_params.append(('maxFatPercent', local_var_params['max_fat_percent']))  
        if 'min_carbs_percent' in local_var_params:
            query_params.append(('minCarbsPercent', local_var_params['min_carbs_percent']))  
        if 'max_carbs_percent' in local_var_params:
            query_params.append(('maxCarbsPercent', local_var_params['max_carbs_percent']))  
        if 'meta_information' in local_var_params:
            query_params.append(('metaInformation', local_var_params['meta_information']))  
        if 'intolerances' in local_var_params:
            query_params.append(('intolerances', local_var_params['intolerances']))  
        if 'sort' in local_var_params:
            query_params.append(('sort', local_var_params['sort']))  
        if 'sort_direction' in local_var_params:
            query_params.append(('sortDirection', local_var_params['sort_direction']))  
        if 'offset' in local_var_params:
            query_params.append(('offset', local_var_params['offset']))  
        if 'number' in local_var_params:
            query_params.append(('number', local_var_params['number']))  
        header_params = {}
        form_params = []
        local_var_files = {}
        body_params = None
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  
        auth_settings = []  
        return self.api_client.call_api(
            '/food/ingredients/search', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
def ingredient_search_with_http_info ( self , query , ** kwargs ) : local_var_params = locals ( ) all_params = [ 'query' , 'add_children' , 'min_protein_percent' , 'max_protein_percent' , 'min_fat_percent' , 'max_fat_percent' , 'min_carbs_percent' , 'max_carbs_percent' , 'meta_information' , 'intolerances' , 'sort' , 'sort_direction' , 'offset' , 'number' ] all_params . append ( 'async_req' ) all_params . append ( '_return_http_data_only' ) all_params . append ( '_preload_content' ) all_params . append ( '_request_timeout' ) for key , val in six . iteritems ( local_var_params [ 'kwargs' ] ) : if key not in all_params : raise ApiTypeError ( "Got an unexpected keyword argument '%s'" " to method ingredient_search" % key ) local_var_params [ key ] = val del local_var_params [ 'kwargs' ] if ( 'query' not in local_var_params or local_var_params [ 'query' ] is None ) : raise ApiValueError ( "Missing the required parameter `query` when calling `ingredient_search`" ) collection_formats = { } path_params = { } query_params = [ ] if 'query' in local_var_params : query_params . append ( ( 'query' , local_var_params [ 'query' ] ) ) if 'add_children' in local_var_params : query_params . append ( ( 'addChildren' , local_var_params [ 'add_children' ] ) ) if 'min_protein_percent' in local_var_params : query_params . append ( ( 'minProteinPercent' , local_var_params [ 'min_protein_percent' ] ) ) if 'max_protein_percent' in local_var_params : query_params . append ( ( 'maxProteinPercent' , local_var_params [ 'max_protein_percent' ] ) ) if 'min_fat_percent' in local_var_params : query_params . append ( ( 'minFatPercent' , local_var_params [ 'min_fat_percent' ] ) ) if 'max_fat_percent' in local_var_params : query_params . append ( ( 'maxFatPercent' , local_var_params [ 'max_fat_percent' ] ) ) if 'min_carbs_percent' in local_var_params : query_params . append ( ( 'minCarbsPercent' , local_var_params [ 'min_carbs_percent' ] ) ) if 'max_carbs_percent' in local_var_params : query_params . append ( ( 'maxCarbsPercent' , local_var_params [ 'max_carbs_percent' ] ) ) if 'meta_information' in local_var_params : query_params . append ( ( 'metaInformation' , local_var_params [ 'meta_information' ] ) ) if 'intolerances' in local_var_params : query_params . append ( ( 'intolerances' , local_var_params [ 'intolerances' ] ) ) if 'sort' in local_var_params : query_params . append ( ( 'sort' , local_var_params [ 'sort' ] ) ) if 'sort_direction' in local_var_params : query_params . append ( ( 'sortDirection' , local_var_params [ 'sort_direction' ] ) ) if 'offset' in local_var_params : query_params . append ( ( 'offset' , local_var_params [ 'offset' ] ) ) if 'number' in local_var_params : query_params . append ( ( 'number' , local_var_params [ 'number' ] ) ) header_params = { } form_params = [ ] local_var_files = { } body_params = None header_params [ 'Accept' ] = self . api_client . select_header_accept ( [ 'application/json' ] ) auth_settings = [ ] return self . api_client . call_api ( '/food/ingredients/search' , 'GET' , path_params , query_params , header_params , body = body_params , post_params = form_params , files = local_var_files , response_type = 'object' , auth_settings = auth_settings , async_req = local_var_params . get ( 'async_req' ) , _return_http_data_only = local_var_params . get ( '_return_http_data_only' ) , _preload_content = local_var_params . get ( '_preload_content' , True ) , _request_timeout = local_var_params . get ( '_request_timeout' ) , collection_formats = collection_formats )
Ingredient Search  # noqa: E501
Search for simple whole foods (e.g.
Ingredient Search # noqa : E501 Search for simple whole foods ( e . g .
# noqa: E501 """Ingredient Search  # noqa: E501

        Search for simple whole foods (e.g. fruits, vegetables, nuts, grains, meat, fish, dairy etc.).  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.ingredient_search_with_http_info(query, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str query: The partial or full ingredient name. (required)
        :param bool add_children: Whether to add children of found foods.
        :param float min_protein_percent: The minimum percentage of protein the food must have (between 0 and 100).
        :param float max_protein_percent: The maximum percentage of protein the food can have (between 0 and 100).
        :param float min_fat_percent: The minimum percentage of fat the food must have (between 0 and 100).
        :param float max_fat_percent: The maximum percentage of fat the food can have (between 0 and 100).
        :param float min_carbs_percent: The minimum percentage of carbs the food must have (between 0 and 100).
        :param float max_carbs_percent: The maximum percentage of carbs the food can have (between 0 and 100).
        :param bool meta_information: Whether to return more meta information about the ingredients.
        :param str intolerances: A comma-separated list of intolerances. All recipes returned must not contain ingredients that are not suitable for people with the intolerances entered. See a full list of supported intolerances.
        :param str sort: The strategy to sort recipes by. See a full list of supported sorting options.
        :param str sort_direction: The direction in which to sort. Must be either 'asc' (ascending) or 'desc' (descending).
        :param float offset: The number of results to skip (between 0 and 990).
        :param float number: The number of expected results (between 1 and 100).
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """ # noqa: E501 # verify the required parameter 'query' is set # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 # HTTP header `Accept` # noqa: E501 # Authentication setting # noqa: E501 # noqa: E501 # noqa: E501
self
query