From 09827a9ae09cb01c89667b30942d065db1443914 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Sat, 18 Jan 2020 16:42:43 +0000 Subject: [PATCH 01/36] Generated code by SwaggerHub --- .../models/branded_food_object_items.py | 30 ++++++++++++++++++- swagger_server/swagger/swagger.yaml | 14 +++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index 64ca98a..9917e95 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -24,7 +24,7 @@ class BrandedFoodObjectItems(Model): Do not edit the class manually. """ - def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: str=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, common_name: str=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 + def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: str=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, common_name: str=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 """BrandedFoodObjectItems - a model defined in Swagger :param barcode: The barcode of this BrandedFoodObjectItems. # noqa: E501 @@ -75,6 +75,8 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :type minerals: List[str] :param traces: The traces of this BrandedFoodObjectItems. # noqa: E501 :type traces: List[str] + :param vitamins: The vitamins of this BrandedFoodObjectItems. # noqa: E501 + :type vitamins: List[str] :param common_name: The common_name of this BrandedFoodObjectItems. # noqa: E501 :type common_name: str :param description: The description of this BrandedFoodObjectItems. # noqa: E501 @@ -109,6 +111,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'has_english_ingredients': bool, 'minerals': List[str], 'traces': List[str], + 'vitamins': List[str], 'common_name': str, 'description': str, 'keywords': List[str], @@ -140,6 +143,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'has_english_ingredients': 'has_english_ingredients', 'minerals': 'minerals', 'traces': 'traces', + 'vitamins': 'vitamins', 'common_name': 'common_name', 'description': 'description', 'keywords': 'keywords', @@ -169,6 +173,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien self._has_english_ingredients = has_english_ingredients self._minerals = minerals self._traces = traces + self._vitamins = vitamins self._common_name = common_name self._description = description self._keywords = keywords @@ -721,6 +726,29 @@ def traces(self, traces: List[str]): self._traces = traces + @property + def vitamins(self) -> List[str]: + """Gets the vitamins of this BrandedFoodObjectItems. + + An array of vitamins that this item contains # noqa: E501 + + :return: The vitamins of this BrandedFoodObjectItems. + :rtype: List[str] + """ + return self._vitamins + + @vitamins.setter + def vitamins(self, vitamins: List[str]): + """Sets the vitamins of this BrandedFoodObjectItems. + + An array of vitamins that this item contains # noqa: E501 + + :param vitamins: The vitamins of this BrandedFoodObjectItems. + :type vitamins: List[str] + """ + + self._vitamins = vitamins + @property def common_name(self) -> str: """Gets the common_name of this BrandedFoodObjectItems. diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 307dee3..003b8bf 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -706,6 +706,9 @@ components: ingredient_list: - ingredient_list - ingredient_list + vitamins: + - vitamins + - vitamins name: name brand_list: - brand_list @@ -863,6 +866,9 @@ components: ingredient_list: - ingredient_list - ingredient_list + vitamins: + - vitamins + - vitamins name: name brand_list: - brand_list @@ -1616,6 +1622,11 @@ components: description: An array of trace ingredients that may be found in this item items: type: string + vitamins: + type: array + description: An array of vitamins that this item contains + items: + type: string common_name: type: string description: Common names associated with this item. These generally clarify @@ -1788,6 +1799,9 @@ components: ingredient_list: - ingredient_list - ingredient_list + vitamins: + - vitamins + - vitamins name: name brand_list: - brand_list From d2c00700b03fb3654f6b22bf923c7c677d3f81a8 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Sat, 18 Jan 2020 16:45:47 +0000 Subject: [PATCH 02/36] Generated code by SwaggerHub --- swagger_server/models/branded_food_object_items.py | 4 ++-- swagger_server/swagger/swagger.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index 9917e95..22955d4 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -730,7 +730,7 @@ def traces(self, traces: List[str]): def vitamins(self) -> List[str]: """Gets the vitamins of this BrandedFoodObjectItems. - An array of vitamins that this item contains # noqa: E501 + An array of vitamins that can be found in this item # noqa: E501 :return: The vitamins of this BrandedFoodObjectItems. :rtype: List[str] @@ -741,7 +741,7 @@ def vitamins(self) -> List[str]: def vitamins(self, vitamins: List[str]): """Sets the vitamins of this BrandedFoodObjectItems. - An array of vitamins that this item contains # noqa: E501 + An array of vitamins that can be found in this item # noqa: E501 :param vitamins: The vitamins of this BrandedFoodObjectItems. :type vitamins: List[str] diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 003b8bf..56c2215 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -1624,7 +1624,7 @@ components: type: string vitamins: type: array - description: An array of vitamins that this item contains + description: An array of vitamins that can be found in this item items: type: string common_name: From 3935128f22898b0077cd6fecf731f8d1d8e36aa7 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Sat, 18 Jan 2020 16:52:13 +0000 Subject: [PATCH 03/36] Generated code by SwaggerHub From 2f75640acc2989846039e1715e2d80ed3a7c06ee Mon Sep 17 00:00:00 2001 From: petermerrill Date: Sat, 18 Jan 2020 16:53:39 +0000 Subject: [PATCH 04/36] Generated code by SwaggerHub --- swagger_server/models/branded_food_object_items.py | 4 ++-- swagger_server/swagger/swagger.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index 22955d4..cc0583d 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -730,7 +730,7 @@ def traces(self, traces: List[str]): def vitamins(self) -> List[str]: """Gets the vitamins of this BrandedFoodObjectItems. - An array of vitamins that can be found in this item # noqa: E501 + An array of vitamins that are found in this item # noqa: E501 :return: The vitamins of this BrandedFoodObjectItems. :rtype: List[str] @@ -741,7 +741,7 @@ def vitamins(self) -> List[str]: def vitamins(self, vitamins: List[str]): """Sets the vitamins of this BrandedFoodObjectItems. - An array of vitamins that can be found in this item # noqa: E501 + An array of vitamins that are found in this item # noqa: E501 :param vitamins: The vitamins of this BrandedFoodObjectItems. :type vitamins: List[str] diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 56c2215..c40dec6 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -1624,7 +1624,7 @@ components: type: string vitamins: type: array - description: An array of vitamins that can be found in this item + description: An array of vitamins that are found in this item items: type: string common_name: From c64e6b0e4ad5762a3e9ef60bbce1ca0afc0861c5 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Mon, 20 Jan 2020 16:28:38 +0000 Subject: [PATCH 05/36] Generated code by SwaggerHub --- swagger_server/controllers/default_controller.py | 2 +- swagger_server/swagger/swagger.yaml | 4 ++-- swagger_server/test/test_default_controller.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index 8b0fa85..4e1f4bd 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -88,7 +88,7 @@ def food_branded_search_php_get(allergen=None, brand=None, category=None, countr return 'do some magic!' -def ingredient_search_php_get(find, list, raw=None, limit=None): # noqa: E501 +def food_ingredient_search_php_get(find, list, raw=None, limit=None): # noqa: E501 """Get raw/generic food ingredient item(s) # Get data for a specific ingredient or a specific set of ingredients. __Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN``` # noqa: E501 diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index c40dec6..38b6f34 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -446,14 +446,14 @@ paths: security: - ApiKeyAuth: [] x-openapi-router-controller: swagger_server.controllers.default_controller - /ingredient/search.php: + /food/ingredient/search.php: get: summary: Get raw/generic food ingredient item(s) description: | # Get data for a specific ingredient or a specific set of ingredients. __Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN``` - operationId: ingredient_search_php_get + operationId: food_ingredient_search_php_get parameters: - name: find in: query diff --git a/swagger_server/test/test_default_controller.py b/swagger_server/test/test_default_controller.py index 5061a41..92c29d8 100644 --- a/swagger_server/test/test_default_controller.py +++ b/swagger_server/test/test_default_controller.py @@ -80,8 +80,8 @@ def test_food_branded_search_php_get(self): self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_ingredient_search_php_get(self): - """Test case for ingredient_search_php_get + def test_food_ingredient_search_php_get(self): + """Test case for food_ingredient_search_php_get Get raw/generic food ingredient item(s) """ @@ -90,7 +90,7 @@ def test_ingredient_search_php_get(self): ('raw', true), ('limit', 56)] response = self.client.open( - '/api/v2/ingredient/search.php', + '/api/v2/food/ingredient/search.php', method='GET', query_string=query_string) self.assert200(response, From 177c85757f847e53a08cc2f7a07ccbb5cc763903 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Tue, 21 Jan 2020 14:08:31 +0000 Subject: [PATCH 06/36] Generated code by SwaggerHub --- .../branded_food_object_nutrients_usda.py | 62 ++-- swagger_server/swagger/swagger.yaml | 322 +++++++++--------- 2 files changed, 192 insertions(+), 192 deletions(-) diff --git a/swagger_server/models/branded_food_object_nutrients_usda.py b/swagger_server/models/branded_food_object_nutrients_usda.py index 18d771c..abbc4d8 100644 --- a/swagger_server/models/branded_food_object_nutrients_usda.py +++ b/swagger_server/models/branded_food_object_nutrients_usda.py @@ -14,7 +14,7 @@ class BrandedFoodObjectNutrientsUsda(Model): Do not edit the class manually. """ - def __init__(self, id: int=None, name: str=None, per_100g: float=None, measurement_unit: str=None, min: float=None, max: float=None, median: float=None, data_points: int=None, footnote: str=None, source: str=None, description: str=None): # noqa: E501 + def __init__(self, id: int=None, name: str=None, per_100g: float=None, measurement_unit: str=None, min: float=None, max: float=None, median: float=None, rank: int=None, data_points: int=None, footnote: str=None, description: str=None): # noqa: E501 """BrandedFoodObjectNutrientsUsda - a model defined in Swagger :param id: The id of this BrandedFoodObjectNutrientsUsda. # noqa: E501 @@ -31,12 +31,12 @@ def __init__(self, id: int=None, name: str=None, per_100g: float=None, measureme :type max: float :param median: The median of this BrandedFoodObjectNutrientsUsda. # noqa: E501 :type median: float + :param rank: The rank of this BrandedFoodObjectNutrientsUsda. # noqa: E501 + :type rank: int :param data_points: The data_points of this BrandedFoodObjectNutrientsUsda. # noqa: E501 :type data_points: int :param footnote: The footnote of this BrandedFoodObjectNutrientsUsda. # noqa: E501 :type footnote: str - :param source: The source of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type source: str :param description: The description of this BrandedFoodObjectNutrientsUsda. # noqa: E501 :type description: str """ @@ -48,9 +48,9 @@ def __init__(self, id: int=None, name: str=None, per_100g: float=None, measureme 'min': float, 'max': float, 'median': float, + 'rank': int, 'data_points': int, 'footnote': str, - 'source': str, 'description': str } @@ -62,9 +62,9 @@ def __init__(self, id: int=None, name: str=None, per_100g: float=None, measureme 'min': 'min', 'max': 'max', 'median': 'median', + 'rank': 'rank', 'data_points': 'data_points', 'footnote': 'footnote', - 'source': 'source', 'description': 'description' } self._id = id @@ -74,9 +74,9 @@ def __init__(self, id: int=None, name: str=None, per_100g: float=None, measureme self._min = min self._max = max self._median = median + self._rank = rank self._data_points = data_points self._footnote = footnote - self._source = source self._description = description @classmethod @@ -251,6 +251,29 @@ def median(self, median: float): self._median = median + @property + def rank(self) -> int: + """Gets the rank of this BrandedFoodObjectNutrientsUsda. + + Nutrient rank # noqa: E501 + + :return: The rank of this BrandedFoodObjectNutrientsUsda. + :rtype: int + """ + return self._rank + + @rank.setter + def rank(self, rank: int): + """Sets the rank of this BrandedFoodObjectNutrientsUsda. + + Nutrient rank # noqa: E501 + + :param rank: The rank of this BrandedFoodObjectNutrientsUsda. + :type rank: int + """ + + self._rank = rank + @property def data_points(self) -> int: """Gets the data_points of this BrandedFoodObjectNutrientsUsda. @@ -297,34 +320,11 @@ def footnote(self, footnote: str): self._footnote = footnote - @property - def source(self) -> str: - """Gets the source of this BrandedFoodObjectNutrientsUsda. - - Description of the nutrient source # noqa: E501 - - :return: The source of this BrandedFoodObjectNutrientsUsda. - :rtype: str - """ - return self._source - - @source.setter - def source(self, source: str): - """Sets the source of this BrandedFoodObjectNutrientsUsda. - - Description of the nutrient source # noqa: E501 - - :param source: The source of this BrandedFoodObjectNutrientsUsda. - :type source: str - """ - - self._source = source - @property def description(self) -> str: """Gets the description of this BrandedFoodObjectNutrientsUsda. - Description of how the food nutrient value was obtained # noqa: E501 + Description of the nutrient source # noqa: E501 :return: The description of this BrandedFoodObjectNutrientsUsda. :rtype: str @@ -335,7 +335,7 @@ def description(self) -> str: def description(self, description: str): """Sets the description of this BrandedFoodObjectNutrientsUsda. - Description of how the food nutrient value was obtained # noqa: E501 + Description of the nutrient source # noqa: E501 :param description: The description of this BrandedFoodObjectNutrientsUsda. :type description: str diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 38b6f34..e8dc22c 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -557,21 +557,21 @@ components: - minerals - minerals components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 2 + english_speaking: 6 non_english_speaking: 6 description: description has_english_ingredients: true @@ -602,23 +602,23 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 median: 7.3862819483858839220147274318151175975799560546875 max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 + protein_conversion_factor: 1.173074250955943309548956676735542714595794677734375 packaging_photos: nutrition: small: small @@ -637,19 +637,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 5 + compatibility_level: 9 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 5 name: name - compatibility_level: 1 + compatibility_level: 4 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 8 name: name - compatibility_level: 9 + compatibility_level: 6 is_compatible: true ingredients: ingredients categories: @@ -659,15 +659,15 @@ components: barcode: barcode brand: brand portions: - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote @@ -681,14 +681,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -700,9 +700,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 + protein_value: 1.489415909854170383397331534069962799549102783203125 + fat_value: 6.8468526983526398765889098285697400569915771484375 ingredient_list: - ingredient_list - ingredient_list @@ -717,21 +717,21 @@ components: - minerals - minerals components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 2 + english_speaking: 6 non_english_speaking: 6 description: description has_english_ingredients: true @@ -762,23 +762,23 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 median: 7.3862819483858839220147274318151175975799560546875 max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 + protein_conversion_factor: 1.173074250955943309548956676735542714595794677734375 packaging_photos: nutrition: small: small @@ -797,19 +797,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 5 + compatibility_level: 9 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 5 name: name - compatibility_level: 1 + compatibility_level: 4 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 8 name: name - compatibility_level: 9 + compatibility_level: 6 is_compatible: true ingredients: ingredients categories: @@ -819,15 +819,15 @@ components: barcode: barcode brand: brand portions: - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote @@ -841,14 +841,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -860,9 +860,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 + protein_value: 1.489415909854170383397331534069962799549102783203125 + fat_value: 6.8468526983526398765889098285697400569915771484375 ingredient_list: - ingredient_list - ingredient_list @@ -889,18 +889,18 @@ components: items: - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 + protein_value: 1.489415909854170383397331534069962799549102783203125 + fat_value: 6.8468526983526398765889098285697400569915771484375 components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true diet_labels: @@ -908,19 +908,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 5 + compatibility_level: 9 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 5 name: name - compatibility_level: 1 + compatibility_level: 4 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 8 name: name - compatibility_level: 9 + compatibility_level: 6 is_compatible: true name: name description: description @@ -937,49 +937,49 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 median: 7.3862819483858839220147274318151175975799560546875 max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source portions: - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 + protein_value: 1.489415909854170383397331534069962799549102783203125 + fat_value: 6.8468526983526398765889098285697400569915771484375 components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true diet_labels: @@ -987,19 +987,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 5 + compatibility_level: 9 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 5 name: name - compatibility_level: 1 + compatibility_level: 4 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 8 name: name - compatibility_level: 9 + compatibility_level: 6 is_compatible: true name: name description: description @@ -1016,32 +1016,32 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 median: 7.3862819483858839220147274318151175975799560546875 max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source portions: - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote @@ -1129,6 +1129,9 @@ components: median: type: number description: Median nutrient value + rank: + type: integer + description: Nutrient rank data_points: type: integer description: Number of observations on which the value is based @@ -1136,12 +1139,9 @@ components: type: string description: Comments on any unusual aspect of the food nutrient. Examples might include why a nutrient value is different than typically expected. - source: - type: string - description: Description of the nutrient source description: type: string - description: Description of how the food nutrient value was obtained + description: Description of the nutrient source example: data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 @@ -1149,11 +1149,11 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source BrandedFoodObject_nutrients: type: object properties: @@ -1188,22 +1188,22 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 median: 7.3862819483858839220147274318151175975799560546875 max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source BrandedFoodObject_calorie_conversion_factor: type: object properties: @@ -1219,9 +1219,9 @@ components: description: An object containing the multiplication factors to be used when calculating energy from macronutrients for a specific food. example: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 + protein_value: 1.489415909854170383397331534069962799549102783203125 + fat_value: 6.8468526983526398765889098285697400569915771484375 BrandedFoodObject_diet_labels_vegan: type: object properties: @@ -1246,9 +1246,9 @@ components: the Vegan diets example: confidence_description: confidence_description - confidence: 4 + confidence: 5 name: name - compatibility_level: 1 + compatibility_level: 4 is_compatible: true BrandedFoodObject_diet_labels_vegetarian: type: object @@ -1276,7 +1276,7 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 5 + compatibility_level: 9 is_compatible: true BrandedFoodObject_diet_labels_gluten_free: type: object @@ -1302,9 +1302,9 @@ components: Gluten Free diets example: confidence_description: confidence_description - confidence: 6 + confidence: 8 name: name - compatibility_level: 9 + compatibility_level: 6 is_compatible: true BrandedFoodObject_diet_labels: type: object @@ -1322,19 +1322,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 5 + compatibility_level: 9 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 5 name: name - compatibility_level: 1 + compatibility_level: 4 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 8 name: name - compatibility_level: 9 + compatibility_level: 6 is_compatible: true BrandedFoodObject_diet_flags: type: object @@ -1369,7 +1369,7 @@ components: ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1469,9 +1469,9 @@ components: description: An object containing information on a specific component of this food item example: - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true BrandedFoodObject_portions: @@ -1504,9 +1504,9 @@ components: description: An object containing information on a specific food portion found in this item example: - data_points: 1 + data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote @@ -1524,7 +1524,7 @@ components: description: An object containing additional information on the countries where this item is found example: - english_speaking: 2 + english_speaking: 6 non_english_speaking: 6 BrandedFoodObject_items: type: object @@ -1650,21 +1650,21 @@ components: - minerals - minerals components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 2 + english_speaking: 6 non_english_speaking: 6 description: description has_english_ingredients: true @@ -1695,23 +1695,23 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 median: 7.3862819483858839220147274318151175975799560546875 max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 + protein_conversion_factor: 1.173074250955943309548956676735542714595794677734375 packaging_photos: nutrition: small: small @@ -1730,19 +1730,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 5 + compatibility_level: 9 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 5 name: name - compatibility_level: 1 + compatibility_level: 4 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 8 name: name - compatibility_level: 9 + compatibility_level: 6 is_compatible: true ingredients: ingredients categories: @@ -1752,15 +1752,15 @@ components: barcode: barcode brand: brand portions: - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote @@ -1774,14 +1774,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1793,9 +1793,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 + protein_value: 1.489415909854170383397331534069962799549102783203125 + fat_value: 6.8468526983526398765889098285697400569915771484375 ingredient_list: - ingredient_list - ingredient_list @@ -1824,22 +1824,22 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 median: 7.3862819483858839220147274318151175975799560546875 max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source IngredientObject_items: type: object properties: @@ -1888,18 +1888,18 @@ components: example: protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 + protein_value: 1.489415909854170383397331534069962799549102783203125 + fat_value: 6.8468526983526398765889098285697400569915771484375 components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 3.557195227068097320710649000830017030239105224609375 name: name is_refuse: true diet_labels: @@ -1907,19 +1907,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 5 + compatibility_level: 9 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 5 name: name - compatibility_level: 1 + compatibility_level: 4 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 8 name: name - compatibility_level: 9 + compatibility_level: 6 is_compatible: true name: name description: description @@ -1936,32 +1936,32 @@ components: max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source - data_points: 1 min: 2.027123023002321833274663731572218239307403564453125 median: 7.3862819483858839220147274318151175975799560546875 max: 4.1456080298839363962315474054776132106781005859375 name: name measurement_unit: measurement_unit + rank: 1 description: description id: 9 per_100g: 3.61607674925191080461672754609026014804840087890625 footnote: footnote - source: source portions: - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 2 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 1.2846590061165319429647979632136411964893341064453125 measurement_unit: measurement_unit description: description footnote: footnote From 995b667728eeee0ff848435ed9692059e2413d31 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Tue, 21 Jan 2020 14:14:30 +0000 Subject: [PATCH 07/36] Generated code by SwaggerHub --- setup.py | 2 +- swagger_server/swagger/swagger.yaml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 846fcc1..92c1fe7 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,6 @@ entry_points={ 'console_scripts': ['swagger_server=swagger_server.__main__:main']}, long_description="""\ - __Important:__ - An __[API key](https://chompthis.com/api/)__ is required for access to this API. - Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__. ----- __Getting Started:__ - __[Subscribe](https://chompthis.com/api/#pricing)__ to the API. - Scroll down and click the \"__Authorize__\" button. - Enter your API key into the \"__value__\" input, click the \"__Authorize__\" button, then click the \"__Close__\" button. - Scroll down to the section titled \"__default__\" and click on the API endpoint you wish to use. - Click the \"__Try it out__\" button. - Enter the information the endpoint requires. - Click the \"__Execute__\" button. __Example:__ - __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/response-object.json)__ API response object. ----- __How Do I Find My API Key?__ - Your API key was sent to the email address you used to create your subscription. - You will also find your API key in the __[Client Center](https://chompthis.com/api/manage.php)__. - _Read __[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)__ for more information._ ||| | ------- | -------- | | [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp) | [Pricing](https://chompthis.com/api/) | | [Attribution](https://chompthis.com/api/docs/attribution.php) | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) | | [Terms & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php) | | [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php) | | [Client Center](https://chompthis.com/api/manage.php) | | + __Important:__ - An __[API key](https://chompthis.com/api/)__ is required for access to this API. - Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__. ----- __Getting Started:__ - __[Subscribe](https://chompthis.com/api/#pricing)__ to the API. - Scroll down and click the \"__Authorize__\" button. - Enter your API key into the \"__value__\" input, click the \"__Authorize__\" button, then click the \"__Close__\" button. - Scroll down to the section titled \"__default__\" and click on the API endpoint you wish to use. - Click the \"__Try it out__\" button. - Enter the information the endpoint requires. - Click the \"__Execute__\" button. __Example:__ - Branded Food: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)__ API response object. - Ingredient: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)__ API response object. ----- __How Do I Find My API Key?__ - Your API key was sent to the email address you used to create your subscription. - You will also find your API key in the __[Client Center](https://chompthis.com/api/manage.php)__. - _Read __[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)__ for more information._ ||| | ------- | -------- | | [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp) | [Pricing](https://chompthis.com/api/) | | [Attribution](https://chompthis.com/api/docs/attribution.php) | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) | | [Terms & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php) | | [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php) | | [Client Center](https://chompthis.com/api/manage.php) | | """ ) diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index e8dc22c..c220298 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -9,7 +9,9 @@ info: \ then click the \"__Close__\" button.\n - Scroll down to the section titled\ \ \"__default__\" and click on the API endpoint you wish to use.\n - Click the\ \ \"__Try it out__\" button.\n - Enter the information the endpoint requires.\n\ - \ - Click the \"__Execute__\" button.\n\n__Example:__ \n - __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/response-object.json)__\ + \ - Click the \"__Execute__\" button.\n\n__Example:__ \n - Branded Food: __[View\ + \ example](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)__\ + \ API response object.\n - Ingredient: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)__\ \ API response object.\n\n-----\n\n__How Do I Find My API Key?__\n - Your API\ \ key was sent to the email address you used to create your subscription.\n -\ \ You will also find your API key in the __[Client Center](https://chompthis.com/api/manage.php)__.\n\ From d5ff2fa06d5ecddef966cfccbbb2f1115241f433 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Tue, 21 Jan 2020 23:19:13 +0000 Subject: [PATCH 08/36] Generated code by SwaggerHub --- .../controllers/default_controller.py | 56 ++--- swagger_server/swagger/swagger.yaml | 196 ++++++++---------- .../test/test_default_controller.py | 3 +- 3 files changed, 120 insertions(+), 135 deletions(-) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index 4e1f4bd..fe98753 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -11,7 +11,7 @@ def food_branded_barcode_php_get(code): # noqa: E501 # Get data for a branded food using the food's UPC/EAN barcode. __Example:__ ```https://chompthis.com/api/v2/food/branded/barcode.php?api_key=API_KEY&code=CODE``` # noqa: E501 - :param code: UPC/EAN barcode __Example:__ 0842234000988 __Resources:__ [Database search](https://chompthis.com/api/lookup.php) _Read [this article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do) for tips and tricks._ + :param code: UPC/EAN barcode __Example:__ &code=0842234000988 __Tips:__ - Use our [food lookup tool](https://chompthis.com/api/lookup.php). - Read [this article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do) for general tips and tricks. :type code: str :rtype: BrandedFoodObject @@ -24,9 +24,9 @@ def food_branded_id_php_get(id, source=None): # noqa: E501 # Get data for a branded food using Chomp's internal ID number. _Alternatively, set the \"source\" parameter to \"USDA\" and use the food's FDC ID._ __Example:__ ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID``` # noqa: E501 - :param id: Chomp branded food ID. _Set \"source=USDA\" if you wish to pass in the food's FoodData Central ID (fdc_id)._ __Example #1:__ 15 __Resources:__ [Find branded food IDs](https://chompthis.com/api/lookup.php) + :param id: The ID number of a branded food item. __Example #1:__ &id=15 __Example #2:__ &id=FDC_ID&source=USDA ___Tip:__ Get started by using our [ood lookup tool](https://chompthis.com/api/lookup.php)._ :type id: int - :param source: Specify the data source (optional). You must pass in \"USDA\" if you want to look up a food item using a USDA FDC ID. __Example:__ USDA _(defaults to \"Chomp\")_ + :param source: Configure the endpoint to accept food IDs from various data sources. This endpoint defaults to Chomp but can accept FDC IDs. __Example:__ &source=Chomp ___Important Note:__ Pass in &source=USDA if you want to look up food items using a USDA FDC ID._ :type source: str :rtype: BrandedFoodObject @@ -34,15 +34,17 @@ def food_branded_id_php_get(id, source=None): # noqa: E501 return 'do some magic!' -def food_branded_name_php_get(name, limit=None): # noqa: E501 +def food_branded_name_php_get(name, limit=None, page=None): # noqa: E501 """Get a branded food item by name - # Search for branded food items by name. __Example:__ ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` # noqa: E501 + # Search for branded food items by name. This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ __Example:__ ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` # noqa: E501 - :param name: Branded food name __Example:__ Starburst __Resources:__ [Find branded food names](https://chompthis.com/api/lookup.php) + :param name: Search for branded food items using a general food name keyword. This does not have to exactly match the \"official\" name for the food. __Example:__ &name=Starburst ___Tip:__ Get started by using our [food lookup tool](https://chompthis.com/api/lookup.php)._ :type name: str - :param limit: Set maximum number of records you want the API to return. ___Note:__ The maximum value is 10._ __Example:__ 3 _(defaults to 10)_ + :param limit: Set maximum number of records you want the API to return. __Example:__ &limit=10 :type limit: int + :param page: This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. __Example__: &page=1 + :type page: int :rtype: BrandedFoodObject """ @@ -52,35 +54,35 @@ def food_branded_name_php_get(name, limit=None): # noqa: E501 def food_branded_search_php_get(allergen=None, brand=None, category=None, country=None, diet=None, ingredient=None, keyword=None, mineral=None, nutrient=None, palm_oil=None, trace=None, vitamin=None, limit=None, page=None): # noqa: E501 """Get data for branded food items using various search parameters - # Search for branded food items using various parameters. __Example:__ ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1``` ___Tip:__ Get started by using the [Query Builder](https://chompthis.com/api/build.php)._ # noqa: E501 + # Search for branded food items using various parameters. This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ __Example:__ ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1``` ___Tip:__ Get started by using the [Query Builder](https://chompthis.com/api/build.php)._ # noqa: E501 - :param allergen: Specify a required allergen ingredient (optional) __Example__: Peanuts __Resources__: [List of allergens](https://chompthis.com/api/data/allergen.php) + :param allergen: Filter the search to only include branded foods that contain a specific allergen. __Example__: &allergen=Peanuts ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ :type allergen: str - :param brand: Specify a required brand (optional) __Example__: Starbucks __Resources__: [List of brands](https://chompthis.com/api/data/brand.php) + :param brand: Filter the search to only include branded foods that are owned by a specific brand. __Example__: &brand=Starbucks :type brand: str - :param category: Specify a required category (optional) __Example__: Pasta Dishes __Resources__: [List of categories](https://chompthis.com/api/data/category.php) + :param category: Filter the search to only include branded foods from a specific category. __Example__: &category=Plant Based Foods :type category: str - :param country: Specify a required country (optional) __Example__: United States __Resources__: [List of countries](https://chompthis.com/api/data/country.php) + :param country: Filter the search to only include branded foods that are sold in a specific country. __Example__: &country=United States ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ :type country: str - :param diet: Specify a required diet (optional) _Filters the search to only include food items that are considered compatible with the following diets: Vegan, Vegetarian, Gluten Free_ __Example__: Gluten Free __Resources__: [List of diets](https://chompthis.com/api/data/lifestyle.php) + :param diet: Filter the search to only include branded foods that are considered compatible with a specific diet. ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ :type diet: str - :param ingredient: Specify a required ingredient (optional) __Example__: Salt __Resources__: [List of ingredients](https://chompthis.com/api/data/ingredient.php) + :param ingredient: Filter the search to only include branded foods that contain a specific ingredient. __Example__: &ingredient=Salt :type ingredient: str - :param keyword: Specify a required keyword (optional) __Example__: Starbucks __Resources__: [List of brands](https://chompthis.com/api/data/brand.php) + :param keyword: Filter the search to only include branded foods that are associated with a specific keyword. __Example__: &keyword=Organic ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ :type keyword: str - :param mineral: Specify a required mineral (optional) __Example__: Potassium __Resources__: [List of minerals](https://chompthis.com/api/data/mineral.php) + :param mineral: Filter the search to only include branded foods that contain a specific mineral. __Example__: &mineral=Potassium :type mineral: str - :param nutrient: Specify a required nutrition label item (optional) __Example__: Caffeine __Resources__: [List of nutrition label items](https://chompthis.com/api/data/nutrition.php) + :param nutrient: Filter the search to only include branded foods that contain a specific nutrient. __Example__: &nutrient=Caffeine ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ :type nutrient: str - :param palm_oil: Specify a required palm oil ingredient (optional) __Example__: E160a Beta Carotene __Resources__: [List of palm oil ingredients](https://chompthis.com/api/data/palm-oil.php) + :param palm_oil: Filter the search to only include branded foods that contain a specific ingredient made using palm oil. __Example__: &palm_oil=E160a Beta Carotene :type palm_oil: str - :param trace: Specify a required trace ingredient (optional) __Example__: Tree Nuts __Resources__: [List of trace ingredients](https://chompthis.com/api/data/trace.php) + :param trace: Filter the search to only include branded foods that contain a specific trace ingredient. __Example__: &trace=Tree Nuts ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ :type trace: str - :param vitamin: Specify a required vitamin (optional) __Example__: Biotin __Resources__: [List of vitamins](https://chompthis.com/api/data/vitamin.php) + :param vitamin: Filter the search to only include branded foods that contain a specific vitamin. __Example__: &vitamin=Biotin :type vitamin: str - :param limit: Set maximum number of records you want the API to return. ___Note:__ The maximum value is 10._ __Example:__ 3 _(defaults to 10)_ + :param limit: Set maximum number of records you want the API to return. __Example:__ &limit=10 :type limit: int - :param page: Specify the search response page number. _Each page will contain up to 10 items._ __Example__: 1 _(default)_ + :param page: This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. __Example__: &page=1 :type page: int :rtype: BrandedFoodObject @@ -91,15 +93,15 @@ def food_branded_search_php_get(allergen=None, brand=None, category=None, countr def food_ingredient_search_php_get(find, list, raw=None, limit=None): # noqa: E501 """Get raw/generic food ingredient item(s) - # Get data for a specific ingredient or a specific set of ingredients. __Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN``` # noqa: E501 + # Get data for a specific ingredient or a specific set of ingredients. This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ __Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN``` # noqa: E501 - :param find: Specify the ingredient name(s). __Example #1:__ broccoli __Example #2:__ broccoli,cauliflower,spinach ___Important Note:__ Set the \"is_list\" parameter to true before passing in a comma-separated list of ingredients._ + :param find: Search our database for a single ingredient or a specific set of ingredients. __Example #1:__ &find=broccoli __Example #2:__ &find=broccoli,cauliflower,spinach&list=true __Important List Notes:__ - Set the \"list\" parameter to \"true\" before passing in a comma-separated list of ingredients. - Comma-separated lists cannot contain more than __15 ingredients__. You must perform additional API calls if you are looking up more than 15 ingredients. :type find: int - :param list: Specify if you are searching for multiple ingredients. _Setting this to true will configure this endpoint so that it accepts a comma-separated list of ingredients._ _By default, this endpoint expects a single ingredient._ __Example:__ true _(defaults to false)_ + :param list: Setting _&list=true_ will configure this endpoint to allow searching for ingredients using a comma-separated list. By default, this endpoint will __only__ return results for the first ingredient. __Example:__ &list=true :type list: bool - :param raw: Specify if you only want data for raw ingredients. __Example:__ true _(defaults to true)_ + :param raw: Optionally filter the search result to only include raw ingredients. __Example:__ &raw=true :type raw: bool - :param limit: Set maximum number of records you want the API to return. ___Important Note:__ Setting this to \"1\" will return 1 record per search term._ __Example:__ 1 _(defaults to 1, max is 3)_ + :param limit: Set maximum number of records you want the API to return, per search term. __Example:__ &limit=3 :type limit: int :rtype: IngredientObject diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index c220298..f27247d 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -38,14 +38,10 @@ paths: parameters: - name: code in: query - description: | - UPC/EAN barcode - - __Example:__ 0842234000988 - - __Resources:__ [Database search](https://chompthis.com/api/lookup.php) - - _Read [this article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do) for tips and tricks._ + description: "UPC/EAN barcode\n\n__Example:__ &code=0842234000988\n\n__Tips:__\ + \ \n - Use our [food lookup tool](https://chompthis.com/api/lookup.php).\n\ + \ - Read [this article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do)\ + \ for general tips and tricks.\n" required: true style: form explode: true @@ -88,14 +84,13 @@ paths: - name: id in: query description: | - Chomp branded food ID. + The ID number of a branded food item. - _Set "source=USDA" if you wish to pass in the food's FoodData Central ID (fdc_id)._ + __Example #1:__ &id=15 - __Example #1:__ 15 + __Example #2:__ &id=FDC_ID&source=USDA - __Resources:__ [Find branded food - IDs](https://chompthis.com/api/lookup.php) + ___Tip:__ Get started by using our [ood lookup tool](https://chompthis.com/api/lookup.php)._ required: true style: form explode: true @@ -104,16 +99,19 @@ paths: - name: source in: query description: | - Specify the data source (optional). + Configure the endpoint to accept food IDs from various data sources. This endpoint defaults to Chomp but can accept FDC IDs. - You must pass in "USDA" if you want to look up a food item using a USDA FDC ID. + __Example:__ &source=Chomp - __Example:__ USDA _(defaults to "Chomp")_ + ___Important Note:__ Pass in &source=USDA if you want to look up food items using a USDA FDC ID._ required: false style: form explode: true schema: type: string + enum: + - Chomp + - USDA responses: "200": description: __Valid__ - Will return an object containing any matching foods. @@ -143,18 +141,19 @@ paths: description: | # Search for branded food items by name. + This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ + __Example:__ ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` operationId: food_branded_name_php_get parameters: - name: name in: query description: | - Branded food name + Search for branded food items using a general food name keyword. This does not have to exactly match the "official" name for the food. - __Example:__ Starburst + __Example:__ &name=Starburst - __Resources:__ [Find branded food - names](https://chompthis.com/api/lookup.php) + ___Tip:__ Get started by using our [food lookup tool](https://chompthis.com/api/lookup.php)._ required: true style: form explode: true @@ -165,9 +164,7 @@ paths: description: | Set maximum number of records you want the API to return. - ___Note:__ The maximum value is 10._ - - __Example:__ 3 _(defaults to 10)_ + __Example:__ &limit=10 required: false style: form explode: true @@ -184,6 +181,17 @@ paths: - 8 - 9 - 10 + - name: page + in: query + description: | + This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. + + __Example__: &page=1 + required: false + style: form + explode: true + schema: + type: integer responses: "200": description: __Valid__ - Will return an object containing any matching foods. @@ -213,6 +221,8 @@ paths: description: | # Search for branded food items using various parameters. + This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ + __Example:__ ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1``` ___Tip:__ Get started by using the [Query Builder](https://chompthis.com/api/build.php)._ @@ -221,12 +231,11 @@ paths: - name: allergen in: query description: | - Specify a required allergen ingredient (optional) + Filter the search to only include branded foods that contain a specific allergen. - __Example__: Peanuts + __Example__: &allergen=Peanuts - __Resources__: [List of - allergens](https://chompthis.com/api/data/allergen.php) + ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ required: false style: form explode: true @@ -235,12 +244,9 @@ paths: - name: brand in: query description: | - Specify a required brand (optional) - - __Example__: Starbucks + Filter the search to only include branded foods that are owned by a specific brand. - __Resources__: [List of - brands](https://chompthis.com/api/data/brand.php) + __Example__: &brand=Starbucks required: false style: form explode: true @@ -249,12 +255,9 @@ paths: - name: category in: query description: | - Specify a required category (optional) + Filter the search to only include branded foods from a specific category. - __Example__: Pasta Dishes - - __Resources__: [List of - categories](https://chompthis.com/api/data/category.php) + __Example__: &category=Plant Based Foods required: false style: form explode: true @@ -263,12 +266,11 @@ paths: - name: country in: query description: | - Specify a required country (optional) + Filter the search to only include branded foods that are sold in a specific country. - __Example__: United States + __Example__: &country=United States - __Resources__: [List of - countries](https://chompthis.com/api/data/country.php) + ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ required: false style: form explode: true @@ -277,28 +279,24 @@ paths: - name: diet in: query description: | - Specify a required diet (optional) - - _Filters the search to only include food items that are considered compatible with the following diets: Vegan, Vegetarian, Gluten Free_ + Filter the search to only include branded foods that are considered compatible with a specific diet. - __Example__: Gluten Free - - __Resources__: [List of - diets](https://chompthis.com/api/data/lifestyle.php) + ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ required: false style: form explode: true schema: type: string + enum: + - Vegan + - Vegetarian + - Gluten Free - name: ingredient in: query description: | - Specify a required ingredient (optional) - - __Example__: Salt + Filter the search to only include branded foods that contain a specific ingredient. - __Resources__: [List of - ingredients](https://chompthis.com/api/data/ingredient.php) + __Example__: &ingredient=Salt required: false style: form explode: true @@ -307,12 +305,11 @@ paths: - name: keyword in: query description: | - Specify a required keyword (optional) + Filter the search to only include branded foods that are associated with a specific keyword. - __Example__: Starbucks + __Example__: &keyword=Organic - __Resources__: [List of - brands](https://chompthis.com/api/data/brand.php) + ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ required: false style: form explode: true @@ -321,12 +318,9 @@ paths: - name: mineral in: query description: | - Specify a required mineral (optional) + Filter the search to only include branded foods that contain a specific mineral. - __Example__: Potassium - - __Resources__: [List of - minerals](https://chompthis.com/api/data/mineral.php) + __Example__: &mineral=Potassium required: false style: form explode: true @@ -335,12 +329,11 @@ paths: - name: nutrient in: query description: | - Specify a required nutrition label item (optional) + Filter the search to only include branded foods that contain a specific nutrient. - __Example__: Caffeine + __Example__: &nutrient=Caffeine - __Resources__: [List of nutrition label - items](https://chompthis.com/api/data/nutrition.php) + ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ required: false style: form explode: true @@ -349,12 +342,9 @@ paths: - name: palm_oil in: query description: | - Specify a required palm oil ingredient (optional) - - __Example__: E160a Beta Carotene + Filter the search to only include branded foods that contain a specific ingredient made using palm oil. - __Resources__: [List of palm oil - ingredients](https://chompthis.com/api/data/palm-oil.php) + __Example__: &palm_oil=E160a Beta Carotene required: false style: form explode: true @@ -363,12 +353,11 @@ paths: - name: trace in: query description: | - Specify a required trace ingredient (optional) + Filter the search to only include branded foods that contain a specific trace ingredient. - __Example__: Tree Nuts + __Example__: &trace=Tree Nuts - __Resources__: [List of trace - ingredients](https://chompthis.com/api/data/trace.php) + ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ required: false style: form explode: true @@ -377,12 +366,9 @@ paths: - name: vitamin in: query description: | - Specify a required vitamin (optional) + Filter the search to only include branded foods that contain a specific vitamin. - __Example__: Biotin - - __Resources__: [List of - vitamins](https://chompthis.com/api/data/vitamin.php) + __Example__: &vitamin=Biotin required: false style: form explode: true @@ -393,9 +379,7 @@ paths: description: | Set maximum number of records you want the API to return. - ___Note:__ The maximum value is 10._ - - __Example:__ 3 _(defaults to 10)_ + __Example:__ &limit=10 required: false style: form explode: true @@ -415,11 +399,9 @@ paths: - name: page in: query description: | - Specify the search response page number. - - _Each page will contain up to 10 items._ + This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. - __Example__: 1 _(default)_ + __Example__: &page=1 required: false style: form explode: true @@ -454,19 +436,19 @@ paths: description: | # Get data for a specific ingredient or a specific set of ingredients. + This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ + __Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN``` operationId: food_ingredient_search_php_get parameters: - name: find in: query - description: | - Specify the ingredient name(s). - - __Example #1:__ broccoli - - __Example #2:__ broccoli,cauliflower,spinach - - ___Important Note:__ Set the "is_list" parameter to true before passing in a comma-separated list of ingredients._ + description: "Search our database for a single ingredient or a specific set\ + \ of ingredients.\n\n__Example #1:__ &find=broccoli\n\n__Example #2:__ &find=broccoli,cauliflower,spinach&list=true\n\ + \n__Important List Notes:__ \n - Set the \"list\" parameter to \"true\"\ + \ before passing in a comma-separated list of ingredients.\n - Comma-separated\ + \ lists cannot contain more than __15 ingredients__. You must perform additional\ + \ API calls if you are looking up more than 15 ingredients.\n" required: true style: form explode: true @@ -475,37 +457,37 @@ paths: - name: list in: query description: | - Specify if you are searching for multiple ingredients. - - _Setting this to true will configure this endpoint so that it accepts a comma-separated list of ingredients._ - - _By default, this endpoint expects a single ingredient._ + Setting _&list=true_ will configure this endpoint to allow searching for ingredients using a comma-separated list. By default, this endpoint will __only__ return results for the first ingredient. - __Example:__ true _(defaults to false)_ + __Example:__ &list=true required: true style: form explode: true schema: type: boolean + enum: + - true + - false - name: raw in: query description: | - Specify if you only want data for raw ingredients. + Optionally filter the search result to only include raw ingredients. - __Example:__ true _(defaults to true)_ + __Example:__ &raw=true required: false style: form explode: true schema: type: boolean + enum: + - true + - false - name: limit in: query description: | - Set maximum number of records you want the API to return. - - ___Important Note:__ Setting this to "1" will return 1 record per search term._ + Set maximum number of records you want the API to return, per search term. - __Example:__ 1 _(defaults to 1, max is 3)_ + __Example:__ &limit=3 required: false style: form explode: true diff --git a/swagger_server/test/test_default_controller.py b/swagger_server/test/test_default_controller.py index 92c29d8..85554f3 100644 --- a/swagger_server/test/test_default_controller.py +++ b/swagger_server/test/test_default_controller.py @@ -46,7 +46,8 @@ def test_food_branded_name_php_get(self): Get a branded food item by name """ query_string = [('name', 'name_example'), - ('limit', 56)] + ('limit', 56), + ('page', 56)] response = self.client.open( '/api/v2/food/branded/name.php', method='GET', From 31d072be11f2aefe84e8a683b76fc234f4fc0969 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Wed, 22 Jan 2020 12:50:41 +0000 Subject: [PATCH 09/36] Generated code by SwaggerHub --- swagger_server/models/__init__.py | 1 + .../models/branded_food_object_ingredients.py | 92 +++ .../models/branded_food_object_items.py | 17 +- .../models/branded_food_object_package.py | 14 +- swagger_server/swagger/swagger.yaml | 593 +++++++++--------- 5 files changed, 414 insertions(+), 303 deletions(-) create mode 100644 swagger_server/models/branded_food_object_ingredients.py diff --git a/swagger_server/models/__init__.py b/swagger_server/models/__init__.py index 868c956..9360b2c 100644 --- a/swagger_server/models/__init__.py +++ b/swagger_server/models/__init__.py @@ -12,6 +12,7 @@ from swagger_server.models.branded_food_object_diet_labels_gluten_free import BrandedFoodObjectDietLabelsGlutenFree from swagger_server.models.branded_food_object_diet_labels_vegan import BrandedFoodObjectDietLabelsVegan from swagger_server.models.branded_food_object_diet_labels_vegetarian import BrandedFoodObjectDietLabelsVegetarian +from swagger_server.models.branded_food_object_ingredients import BrandedFoodObjectIngredients from swagger_server.models.branded_food_object_items import BrandedFoodObjectItems from swagger_server.models.branded_food_object_nutrients import BrandedFoodObjectNutrients from swagger_server.models.branded_food_object_nutrients_chomp import BrandedFoodObjectNutrientsChomp diff --git a/swagger_server/models/branded_food_object_ingredients.py b/swagger_server/models/branded_food_object_ingredients.py new file mode 100644 index 0000000..f0b83d8 --- /dev/null +++ b/swagger_server/models/branded_food_object_ingredients.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class BrandedFoodObjectIngredients(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, chomp: str=None, usda: str=None): # noqa: E501 + """BrandedFoodObjectIngredients - a model defined in Swagger + + :param chomp: The chomp of this BrandedFoodObjectIngredients. # noqa: E501 + :type chomp: str + :param usda: The usda of this BrandedFoodObjectIngredients. # noqa: E501 + :type usda: str + """ + self.swagger_types = { + 'chomp': str, + 'usda': str + } + + self.attribute_map = { + 'chomp': 'chomp', + 'usda': 'usda' + } + self._chomp = chomp + self._usda = usda + + @classmethod + def from_dict(cls, dikt) -> 'BrandedFoodObjectIngredients': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The BrandedFoodObject_ingredients of this BrandedFoodObjectIngredients. # noqa: E501 + :rtype: BrandedFoodObjectIngredients + """ + return util.deserialize_model(dikt, cls) + + @property + def chomp(self) -> str: + """Gets the chomp of this BrandedFoodObjectIngredients. + + This item's ingredients as seen on ChompThis.com # noqa: E501 + + :return: The chomp of this BrandedFoodObjectIngredients. + :rtype: str + """ + return self._chomp + + @chomp.setter + def chomp(self, chomp: str): + """Sets the chomp of this BrandedFoodObjectIngredients. + + This item's ingredients as seen on ChompThis.com # noqa: E501 + + :param chomp: The chomp of this BrandedFoodObjectIngredients. + :type chomp: str + """ + + self._chomp = chomp + + @property + def usda(self) -> str: + """Gets the usda of this BrandedFoodObjectIngredients. + + This branded food item's ingredients according to the USDA # noqa: E501 + + :return: The usda of this BrandedFoodObjectIngredients. + :rtype: str + """ + return self._usda + + @usda.setter + def usda(self, usda: str): + """Sets the usda of this BrandedFoodObjectIngredients. + + This branded food item's ingredients according to the USDA # noqa: E501 + + :param usda: The usda of this BrandedFoodObjectIngredients. + :type usda: str + """ + + self._usda = usda diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index cc0583d..9b5d467 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -11,6 +11,7 @@ from swagger_server.models.branded_food_object_country_details import BrandedFoodObjectCountryDetails # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_flags import BrandedFoodObjectDietFlags # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels # noqa: F401,E501 +from swagger_server.models.branded_food_object_ingredients import BrandedFoodObjectIngredients # noqa: F401,E501 from swagger_server.models.branded_food_object_nutrients import BrandedFoodObjectNutrients # noqa: F401,E501 from swagger_server.models.branded_food_object_package import BrandedFoodObjectPackage # noqa: F401,E501 from swagger_server.models.branded_food_object_packaging_photos import BrandedFoodObjectPackagingPhotos # noqa: F401,E501 @@ -24,7 +25,7 @@ class BrandedFoodObjectItems(Model): Do not edit the class manually. """ - def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: str=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, common_name: str=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 + def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, common_name: str=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 """BrandedFoodObjectItems - a model defined in Swagger :param barcode: The barcode of this BrandedFoodObjectItems. # noqa: E501 @@ -34,7 +35,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :param brand: The brand of this BrandedFoodObjectItems. # noqa: E501 :type brand: str :param ingredients: The ingredients of this BrandedFoodObjectItems. # noqa: E501 - :type ingredients: str + :type ingredients: BrandedFoodObjectIngredients :param package: The package of this BrandedFoodObjectItems. # noqa: E501 :type package: BrandedFoodObjectPackage :param serving: The serving of this BrandedFoodObjectItems. # noqa: E501 @@ -90,7 +91,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'barcode': str, 'name': str, 'brand': str, - 'ingredients': str, + 'ingredients': BrandedFoodObjectIngredients, 'package': BrandedFoodObjectPackage, 'serving': BrandedFoodObjectServing, 'categories': List[str], @@ -260,24 +261,22 @@ def brand(self, brand: str): self._brand = brand @property - def ingredients(self) -> str: + def ingredients(self) -> BrandedFoodObjectIngredients: """Gets the ingredients of this BrandedFoodObjectItems. - Ingredients in order of highest value to least # noqa: E501 :return: The ingredients of this BrandedFoodObjectItems. - :rtype: str + :rtype: BrandedFoodObjectIngredients """ return self._ingredients @ingredients.setter - def ingredients(self, ingredients: str): + def ingredients(self, ingredients: BrandedFoodObjectIngredients): """Sets the ingredients of this BrandedFoodObjectItems. - Ingredients in order of highest value to least # noqa: E501 :param ingredients: The ingredients of this BrandedFoodObjectItems. - :type ingredients: str + :type ingredients: BrandedFoodObjectIngredients """ self._ingredients = ingredients diff --git a/swagger_server/models/branded_food_object_package.py b/swagger_server/models/branded_food_object_package.py index dfdcfbc..ea46af6 100644 --- a/swagger_server/models/branded_food_object_package.py +++ b/swagger_server/models/branded_food_object_package.py @@ -14,17 +14,17 @@ class BrandedFoodObjectPackage(Model): Do not edit the class manually. """ - def __init__(self, quantity: int=None, size: int=None): # noqa: E501 + def __init__(self, quantity: int=None, size: str=None): # noqa: E501 """BrandedFoodObjectPackage - a model defined in Swagger :param quantity: The quantity of this BrandedFoodObjectPackage. # noqa: E501 :type quantity: int :param size: The size of this BrandedFoodObjectPackage. # noqa: E501 - :type size: int + :type size: str """ self.swagger_types = { 'quantity': int, - 'size': int + 'size': str } self.attribute_map = { @@ -69,24 +69,24 @@ def quantity(self, quantity: int): self._quantity = quantity @property - def size(self) -> int: + def size(self) -> str: """Gets the size of this BrandedFoodObjectPackage. Package size # noqa: E501 :return: The size of this BrandedFoodObjectPackage. - :rtype: int + :rtype: str """ return self._size @size.setter - def size(self, size: int): + def size(self, size: str): """Sets the size of this BrandedFoodObjectPackage. Package size # noqa: E501 :param size: The size of this BrandedFoodObjectPackage. - :type size: int + :type size: str """ self._size = size diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index f27247d..e5ecbd6 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -541,21 +541,21 @@ components: - minerals - minerals components: - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 6 + english_speaking: 2 non_english_speaking: 6 description: description has_english_ingredients: true @@ -563,46 +563,46 @@ components: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 5 + total: 1 size_fulltext: size_fulltext - size: 1 + size: 6 measurement_unit: measurement_unit nutrients: chomp: - - total: 7.061401241503109105224211816675961017608642578125 + - total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 - - total: 7.061401241503109105224211816675961017608642578125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 + - total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 usda: - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - protein_conversion_factor: 1.173074250955943309548956676735542714595794677734375 + protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 packaging_photos: nutrition: small: small @@ -621,21 +621,23 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true vegan: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 8 + confidence: 6 name: name - compatibility_level: 6 + compatibility_level: 9 is_compatible: true - ingredients: ingredients + ingredients: + chomp: chomp + usda: usda categories: - categories - categories @@ -643,21 +645,21 @@ components: barcode: barcode brand: brand portions: - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote package: quantity: 0 - size: 6 + size: size traces: - traces - traces @@ -665,14 +667,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 8 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 8 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -684,9 +686,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 - protein_value: 1.489415909854170383397331534069962799549102783203125 - fat_value: 6.8468526983526398765889098285697400569915771484375 + carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 + protein_value: 1.024645700144157789424070870154537260532379150390625 + fat_value: 1.489415909854170383397331534069962799549102783203125 ingredient_list: - ingredient_list - ingredient_list @@ -701,21 +703,21 @@ components: - minerals - minerals components: - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 6 + english_speaking: 2 non_english_speaking: 6 description: description has_english_ingredients: true @@ -723,46 +725,46 @@ components: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 5 + total: 1 size_fulltext: size_fulltext - size: 1 + size: 6 measurement_unit: measurement_unit nutrients: chomp: - - total: 7.061401241503109105224211816675961017608642578125 + - total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 - - total: 7.061401241503109105224211816675961017608642578125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 + - total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 usda: - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - protein_conversion_factor: 1.173074250955943309548956676735542714595794677734375 + protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 packaging_photos: nutrition: small: small @@ -781,21 +783,23 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true vegan: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 8 + confidence: 6 name: name - compatibility_level: 6 + compatibility_level: 9 is_compatible: true - ingredients: ingredients + ingredients: + chomp: chomp + usda: usda categories: - categories - categories @@ -803,21 +807,21 @@ components: barcode: barcode brand: brand portions: - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote package: quantity: 0 - size: 6 + size: size traces: - traces - traces @@ -825,14 +829,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 8 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 8 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -844,9 +848,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 - protein_value: 1.489415909854170383397331534069962799549102783203125 - fat_value: 6.8468526983526398765889098285697400569915771484375 + carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 + protein_value: 1.024645700144157789424070870154537260532379150390625 + fat_value: 1.489415909854170383397331534069962799549102783203125 ingredient_list: - ingredient_list - ingredient_list @@ -873,18 +877,18 @@ components: items: - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 - protein_value: 1.489415909854170383397331534069962799549102783203125 - fat_value: 6.8468526983526398765889098285697400569915771484375 + carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 + protein_value: 1.024645700144157789424070870154537260532379150390625 + fat_value: 1.489415909854170383397331534069962799549102783203125 components: - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true diet_labels: @@ -892,19 +896,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true vegan: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 8 + confidence: 6 name: name - compatibility_level: 6 + compatibility_level: 9 is_compatible: true name: name description: description @@ -916,54 +920,54 @@ components: nutrients: usda: - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote portions: - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 - protein_value: 1.489415909854170383397331534069962799549102783203125 - fat_value: 6.8468526983526398765889098285697400569915771484375 + carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 + protein_value: 1.024645700144157789424070870154537260532379150390625 + fat_value: 1.489415909854170383397331534069962799549102783203125 components: - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true diet_labels: @@ -971,19 +975,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true vegan: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 8 + confidence: 6 name: name - compatibility_level: 6 + compatibility_level: 9 is_compatible: true name: name description: description @@ -995,40 +999,54 @@ components: nutrients: usda: - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote portions: - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote + BrandedFoodObject_ingredients: + type: object + properties: + chomp: + type: string + description: This item's ingredients as seen on ChompThis.com + usda: + type: string + description: This branded food item's ingredients according to the USDA + description: An object containing this item's ingredients in order of highest + value to least + example: + chomp: chomp + usda: usda BrandedFoodObject_package: type: object properties: @@ -1036,12 +1054,12 @@ components: type: integer description: Package quantity size: - type: integer + type: string description: Package size description: An object containing basic packaging information about this item example: quantity: 0 - size: 6 + size: size BrandedFoodObject_serving: type: object properties: @@ -1060,9 +1078,9 @@ components: description: Total servings description: An object containing serving information for this item example: - total: 5 + total: 1 size_fulltext: size_fulltext - size: 1 + size: 6 measurement_unit: measurement_unit BrandedFoodObject_nutrients_chomp: type: object @@ -1084,11 +1102,11 @@ components: type: number description: Total nutrient value example: - total: 7.061401241503109105224211816675961017608642578125 + total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 BrandedFoodObject_nutrients_usda: type: object properties: @@ -1128,15 +1146,15 @@ components: description: Description of the nutrient source example: data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote BrandedFoodObject_nutrients: type: object @@ -1155,38 +1173,38 @@ components: description: An object containing nutrient information from multiple sources example: chomp: - - total: 7.061401241503109105224211816675961017608642578125 + - total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 - - total: 7.061401241503109105224211816675961017608642578125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 + - total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 usda: - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote BrandedFoodObject_calorie_conversion_factor: type: object @@ -1203,9 +1221,9 @@ components: description: An object containing the multiplication factors to be used when calculating energy from macronutrients for a specific food. example: - carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 - protein_value: 1.489415909854170383397331534069962799549102783203125 - fat_value: 6.8468526983526398765889098285697400569915771484375 + carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 + protein_value: 1.024645700144157789424070870154537260532379150390625 + fat_value: 1.489415909854170383397331534069962799549102783203125 BrandedFoodObject_diet_labels_vegan: type: object properties: @@ -1230,9 +1248,9 @@ components: the Vegan diets example: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true BrandedFoodObject_diet_labels_vegetarian: type: object @@ -1260,7 +1278,7 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true BrandedFoodObject_diet_labels_gluten_free: type: object @@ -1286,9 +1304,9 @@ components: Gluten Free diets example: confidence_description: confidence_description - confidence: 8 + confidence: 6 name: name - compatibility_level: 6 + compatibility_level: 9 is_compatible: true BrandedFoodObject_diet_labels: type: object @@ -1306,19 +1324,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true vegan: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 8 + confidence: 6 name: name - compatibility_level: 6 + compatibility_level: 9 is_compatible: true BrandedFoodObject_diet_flags: type: object @@ -1353,7 +1371,7 @@ components: ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 8 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1453,9 +1471,9 @@ components: description: An object containing information on a specific component of this food item example: - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true BrandedFoodObject_portions: @@ -1488,9 +1506,9 @@ components: description: An object containing information on a specific food portion found in this item example: - data_points: 2 + data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote @@ -1508,7 +1526,7 @@ components: description: An object containing additional information on the countries where this item is found example: - english_speaking: 6 + english_speaking: 2 non_english_speaking: 6 BrandedFoodObject_items: type: object @@ -1523,8 +1541,7 @@ components: type: string description: The brand name that owns this item ingredients: - type: string - description: Ingredients in order of highest value to least + $ref: '#/components/schemas/BrandedFoodObject_ingredients' package: $ref: '#/components/schemas/BrandedFoodObject_package' serving: @@ -1634,21 +1651,21 @@ components: - minerals - minerals components: - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 6 + english_speaking: 2 non_english_speaking: 6 description: description has_english_ingredients: true @@ -1656,46 +1673,46 @@ components: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 5 + total: 1 size_fulltext: size_fulltext - size: 1 + size: 6 measurement_unit: measurement_unit nutrients: chomp: - - total: 7.061401241503109105224211816675961017608642578125 + - total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 - - total: 7.061401241503109105224211816675961017608642578125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 + - total: 2.3021358869347654518833223846741020679473876953125 name: name measurement_unit: measurement_unit - per_100g: 5.63737665663332876420099637471139430999755859375 - per_serving: 2.3021358869347654518833223846741020679473876953125 + per_100g: 5.962133916683182377482808078639209270477294921875 + per_serving: 5.63737665663332876420099637471139430999755859375 usda: - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - protein_conversion_factor: 1.173074250955943309548956676735542714595794677734375 + protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 packaging_photos: nutrition: small: small @@ -1714,21 +1731,23 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true vegan: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 8 + confidence: 6 name: name - compatibility_level: 6 + compatibility_level: 9 is_compatible: true - ingredients: ingredients + ingredients: + chomp: chomp + usda: usda categories: - categories - categories @@ -1736,21 +1755,21 @@ components: barcode: barcode brand: brand portions: - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote package: quantity: 0 - size: 6 + size: size traces: - traces - traces @@ -1758,14 +1777,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 8 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 8 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1777,9 +1796,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 - protein_value: 1.489415909854170383397331534069962799549102783203125 - fat_value: 6.8468526983526398765889098285697400569915771484375 + carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 + protein_value: 1.024645700144157789424070870154537260532379150390625 + fat_value: 1.489415909854170383397331534069962799549102783203125 ingredient_list: - ingredient_list - ingredient_list @@ -1803,26 +1822,26 @@ components: example: usda: - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote IngredientObject_items: type: object @@ -1872,18 +1891,18 @@ components: example: protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 7.4577447736837658709418974467553198337554931640625 - protein_value: 1.489415909854170383397331534069962799549102783203125 - fat_value: 6.8468526983526398765889098285697400569915771484375 + carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 + protein_value: 1.024645700144157789424070870154537260532379150390625 + fat_value: 1.489415909854170383397331534069962799549102783203125 components: - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true - - data_points: 6 - pct_weight: 6.438423552598546706349225132726132869720458984375 - gram_weight: 3.557195227068097320710649000830017030239105224609375 + - data_points: 3 + pct_weight: 9.0183481860707832566959041287191212177276611328125 + gram_weight: 6.438423552598546706349225132726132869720458984375 name: name is_refuse: true diet_labels: @@ -1891,19 +1910,19 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true vegan: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 8 + confidence: 6 name: name - compatibility_level: 6 + compatibility_level: 9 is_compatible: true name: name description: description @@ -1915,37 +1934,37 @@ components: nutrients: usda: - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote - data_points: 1 - min: 2.027123023002321833274663731572218239307403564453125 - median: 7.3862819483858839220147274318151175975799560546875 - max: 4.1456080298839363962315474054776132106781005859375 + min: 3.61607674925191080461672754609026014804840087890625 + median: 4.1456080298839363962315474054776132106781005859375 + max: 2.027123023002321833274663731572218239307403564453125 name: name measurement_unit: measurement_unit - rank: 1 + rank: 7 description: description - id: 9 - per_100g: 3.61607674925191080461672754609026014804840087890625 + id: 7 + per_100g: 9.301444243932575517419536481611430644989013671875 footnote: footnote portions: - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 1 modifier: modifier - gram_weight: 1.2846590061165319429647979632136411964893341064453125 + gram_weight: 6.96511769763884558415156789124011993408203125 measurement_unit: measurement_unit description: description footnote: footnote From a5a63e070e1175d0fef158627c5e24554a98257d Mon Sep 17 00:00:00 2001 From: petermerrill Date: Wed, 22 Jan 2020 12:55:45 +0000 Subject: [PATCH 10/36] Generated code by SwaggerHub --- .../models/branded_food_object_serving.py | 46 +- swagger_server/swagger/swagger.yaml | 607 +++++++++--------- 2 files changed, 309 insertions(+), 344 deletions(-) diff --git a/swagger_server/models/branded_food_object_serving.py b/swagger_server/models/branded_food_object_serving.py index fb39fd1..6847e00 100644 --- a/swagger_server/models/branded_food_object_serving.py +++ b/swagger_server/models/branded_food_object_serving.py @@ -14,33 +14,28 @@ class BrandedFoodObjectServing(Model): Do not edit the class manually. """ - def __init__(self, size: int=None, measurement_unit: str=None, size_fulltext: str=None, total: int=None): # noqa: E501 + def __init__(self, size: str=None, size_fulltext: str=None, total: int=None): # noqa: E501 """BrandedFoodObjectServing - a model defined in Swagger :param size: The size of this BrandedFoodObjectServing. # noqa: E501 - :type size: int - :param measurement_unit: The measurement_unit of this BrandedFoodObjectServing. # noqa: E501 - :type measurement_unit: str + :type size: str :param size_fulltext: The size_fulltext of this BrandedFoodObjectServing. # noqa: E501 :type size_fulltext: str :param total: The total of this BrandedFoodObjectServing. # noqa: E501 :type total: int """ self.swagger_types = { - 'size': int, - 'measurement_unit': str, + 'size': str, 'size_fulltext': str, 'total': int } self.attribute_map = { 'size': 'size', - 'measurement_unit': 'measurement_unit', 'size_fulltext': 'size_fulltext', 'total': 'total' } self._size = size - self._measurement_unit = measurement_unit self._size_fulltext = size_fulltext self._total = total @@ -56,51 +51,28 @@ def from_dict(cls, dikt) -> 'BrandedFoodObjectServing': return util.deserialize_model(dikt, cls) @property - def size(self) -> int: + def size(self) -> str: """Gets the size of this BrandedFoodObjectServing. - Serving size # noqa: E501 + Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 :return: The size of this BrandedFoodObjectServing. - :rtype: int + :rtype: str """ return self._size @size.setter - def size(self, size: int): + def size(self, size: str): """Sets the size of this BrandedFoodObjectServing. - Serving size # noqa: E501 + Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 :param size: The size of this BrandedFoodObjectServing. - :type size: int + :type size: str """ self._size = size - @property - def measurement_unit(self) -> str: - """Gets the measurement_unit of this BrandedFoodObjectServing. - - Serving measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - - :return: The measurement_unit of this BrandedFoodObjectServing. - :rtype: str - """ - return self._measurement_unit - - @measurement_unit.setter - def measurement_unit(self, measurement_unit: str): - """Sets the measurement_unit of this BrandedFoodObjectServing. - - Serving measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - - :param measurement_unit: The measurement_unit of this BrandedFoodObjectServing. - :type measurement_unit: str - """ - - self._measurement_unit = measurement_unit - @property def size_fulltext(self) -> str: """Gets the size_fulltext of this BrandedFoodObjectServing. diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index e5ecbd6..af7f3dc 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -541,68 +541,67 @@ components: - minerals - minerals components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 2 - non_english_speaking: 6 + english_speaking: 1 + non_english_speaking: 2 description: description has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 1 + total: 6 size_fulltext: size_fulltext - size: 6 - measurement_unit: measurement_unit + size: size nutrients: chomp: - - total: 2.3021358869347654518833223846741020679473876953125 + - total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 - - total: 2.3021358869347654518833223846741020679473876953125 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 + - total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 usda: - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 + protein_conversion_factor: 6.8468526983526398765889098285697400569915771484375 packaging_photos: nutrition: small: small @@ -619,19 +618,19 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 9 + confidence: 5 name: name - compatibility_level: 5 + compatibility_level: 4 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 9 name: name compatibility_level: 9 is_compatible: true @@ -645,15 +644,15 @@ components: barcode: barcode brand: brand portions: - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote @@ -667,14 +666,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 6 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 6 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -686,9 +685,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 + protein_value: 1.231513536777255612975068288506008684635162353515625 + fat_value: 1.024645700144157789424070870154537260532379150390625 ingredient_list: - ingredient_list - ingredient_list @@ -703,68 +702,67 @@ components: - minerals - minerals components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 2 - non_english_speaking: 6 + english_speaking: 1 + non_english_speaking: 2 description: description has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 1 + total: 6 size_fulltext: size_fulltext - size: 6 - measurement_unit: measurement_unit + size: size nutrients: chomp: - - total: 2.3021358869347654518833223846741020679473876953125 + - total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 - - total: 2.3021358869347654518833223846741020679473876953125 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 + - total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 usda: - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 + protein_conversion_factor: 6.8468526983526398765889098285697400569915771484375 packaging_photos: nutrition: small: small @@ -781,19 +779,19 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 9 + confidence: 5 name: name - compatibility_level: 5 + compatibility_level: 4 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 9 name: name compatibility_level: 9 is_compatible: true @@ -807,15 +805,15 @@ components: barcode: barcode brand: brand portions: - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote @@ -829,14 +827,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 6 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 6 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -848,9 +846,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 + protein_value: 1.231513536777255612975068288506008684635162353515625 + fat_value: 1.024645700144157789424070870154537260532379150390625 ingredient_list: - ingredient_list - ingredient_list @@ -877,36 +875,36 @@ components: items: - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 + protein_value: 1.231513536777255612975068288506008684635162353515625 + fat_value: 1.024645700144157789424070870154537260532379150390625 components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 9 + confidence: 5 name: name - compatibility_level: 5 + compatibility_level: 4 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 9 name: name compatibility_level: 9 is_compatible: true @@ -919,73 +917,73 @@ components: common_name: common_name nutrients: usda: - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote portions: - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 + protein_value: 1.231513536777255612975068288506008684635162353515625 + fat_value: 1.024645700144157789424070870154537260532379150390625 components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 9 + confidence: 5 name: name - compatibility_level: 5 + compatibility_level: 4 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 9 name: name compatibility_level: 9 is_compatible: true @@ -998,38 +996,38 @@ components: common_name: common_name nutrients: usda: - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote portions: - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote @@ -1064,12 +1062,9 @@ components: type: object properties: size: - type: integer - description: Serving size - measurement_unit: type: string - description: Serving measurement unit (e.g. if measure is 3 tsp, the unit - is tsp) + description: Serving size with measurement unit (e.g. if measure is 3 tsp, + the unit is tsp) size_fulltext: type: string description: Serving size description @@ -1078,10 +1073,9 @@ components: description: Total servings description: An object containing serving information for this item example: - total: 1 + total: 6 size_fulltext: size_fulltext - size: 6 - measurement_unit: measurement_unit + size: size BrandedFoodObject_nutrients_chomp: type: object properties: @@ -1102,11 +1096,11 @@ components: type: number description: Total nutrient value example: - total: 2.3021358869347654518833223846741020679473876953125 + total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 BrandedFoodObject_nutrients_usda: type: object properties: @@ -1145,16 +1139,16 @@ components: type: string description: Description of the nutrient source example: - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote BrandedFoodObject_nutrients: type: object @@ -1173,38 +1167,38 @@ components: description: An object containing nutrient information from multiple sources example: chomp: - - total: 2.3021358869347654518833223846741020679473876953125 + - total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 - - total: 2.3021358869347654518833223846741020679473876953125 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 + - total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 usda: - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote BrandedFoodObject_calorie_conversion_factor: type: object @@ -1221,9 +1215,9 @@ components: description: An object containing the multiplication factors to be used when calculating energy from macronutrients for a specific food. example: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 + protein_value: 1.231513536777255612975068288506008684635162353515625 + fat_value: 1.024645700144157789424070870154537260532379150390625 BrandedFoodObject_diet_labels_vegan: type: object properties: @@ -1248,9 +1242,9 @@ components: the Vegan diets example: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true BrandedFoodObject_diet_labels_vegetarian: type: object @@ -1276,9 +1270,9 @@ components: Vegetarian diets example: confidence_description: confidence_description - confidence: 9 + confidence: 5 name: name - compatibility_level: 5 + compatibility_level: 4 is_compatible: true BrandedFoodObject_diet_labels_gluten_free: type: object @@ -1304,7 +1298,7 @@ components: Gluten Free diets example: confidence_description: confidence_description - confidence: 6 + confidence: 9 name: name compatibility_level: 9 is_compatible: true @@ -1322,19 +1316,19 @@ components: example: vegetarian: confidence_description: confidence_description - confidence: 9 + confidence: 5 name: name - compatibility_level: 5 + compatibility_level: 4 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 9 name: name compatibility_level: 9 is_compatible: true @@ -1371,7 +1365,7 @@ components: ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 6 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1471,9 +1465,9 @@ components: description: An object containing information on a specific component of this food item example: - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true BrandedFoodObject_portions: @@ -1506,9 +1500,9 @@ components: description: An object containing information on a specific food portion found in this item example: - data_points: 1 + data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote @@ -1526,8 +1520,8 @@ components: description: An object containing additional information on the countries where this item is found example: - english_speaking: 2 - non_english_speaking: 6 + english_speaking: 1 + non_english_speaking: 2 BrandedFoodObject_items: type: object properties: @@ -1651,68 +1645,67 @@ components: - minerals - minerals components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 2 - non_english_speaking: 6 + english_speaking: 1 + non_english_speaking: 2 description: description has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 1 + total: 6 size_fulltext: size_fulltext - size: 6 - measurement_unit: measurement_unit + size: size nutrients: chomp: - - total: 2.3021358869347654518833223846741020679473876953125 + - total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 - - total: 2.3021358869347654518833223846741020679473876953125 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 + - total: 5.63737665663332876420099637471139430999755859375 name: name measurement_unit: measurement_unit - per_100g: 5.962133916683182377482808078639209270477294921875 - per_serving: 5.63737665663332876420099637471139430999755859375 + per_100g: 1.46581298050294517310021547018550336360931396484375 + per_serving: 5.962133916683182377482808078639209270477294921875 usda: - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - protein_conversion_factor: 7.4577447736837658709418974467553198337554931640625 + protein_conversion_factor: 6.8468526983526398765889098285697400569915771484375 packaging_photos: nutrition: small: small @@ -1729,19 +1722,19 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 9 + confidence: 5 name: name - compatibility_level: 5 + compatibility_level: 4 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 9 name: name compatibility_level: 9 is_compatible: true @@ -1755,15 +1748,15 @@ components: barcode: barcode brand: brand portions: - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote @@ -1777,14 +1770,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 6 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 8 + compatibility_level: 6 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1796,9 +1789,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 + protein_value: 1.231513536777255612975068288506008684635162353515625 + fat_value: 1.024645700144157789424070870154537260532379150390625 ingredient_list: - ingredient_list - ingredient_list @@ -1821,27 +1814,27 @@ components: description: An object containing nutrient information from each source example: usda: - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote IngredientObject_items: type: object @@ -1891,36 +1884,36 @@ components: example: protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 6.8468526983526398765889098285697400569915771484375 - protein_value: 1.024645700144157789424070870154537260532379150390625 - fat_value: 1.489415909854170383397331534069962799549102783203125 + carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 + protein_value: 1.231513536777255612975068288506008684635162353515625 + fat_value: 1.024645700144157789424070870154537260532379150390625 components: - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true - - data_points: 3 - pct_weight: 9.0183481860707832566959041287191212177276611328125 - gram_weight: 6.438423552598546706349225132726132869720458984375 + - data_points: 6 + pct_weight: 8.7620420127490010742121739895083010196685791015625 + gram_weight: 9.0183481860707832566959041287191212177276611328125 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 9 + confidence: 5 name: name - compatibility_level: 5 + compatibility_level: 4 is_compatible: true vegan: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 6 + confidence: 9 name: name compatibility_level: 9 is_compatible: true @@ -1933,38 +1926,38 @@ components: common_name: common_name nutrients: usda: - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote - - data_points: 1 - min: 3.61607674925191080461672754609026014804840087890625 - median: 4.1456080298839363962315474054776132106781005859375 - max: 2.027123023002321833274663731572218239307403564453125 + - data_points: 7 + min: 9.301444243932575517419536481611430644989013671875 + median: 2.027123023002321833274663731572218239307403564453125 + max: 3.61607674925191080461672754609026014804840087890625 name: name measurement_unit: measurement_unit - rank: 7 + rank: 4 description: description - id: 7 - per_100g: 9.301444243932575517419536481611430644989013671875 + id: 2 + per_100g: 7.061401241503109105224211816675961017608642578125 footnote: footnote portions: - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 1 + - data_points: 6 modifier: modifier - gram_weight: 6.96511769763884558415156789124011993408203125 + gram_weight: 3.557195227068097320710649000830017030239105224609375 measurement_unit: measurement_unit description: description footnote: footnote From 370d7e38c708eaf034a67172b4f8a27779212372 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Wed, 22 Jan 2020 13:02:23 +0000 Subject: [PATCH 11/36] Generated code by SwaggerHub --- swagger_server/models/branded_food_object_items.py | 4 ++-- swagger_server/swagger/swagger.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index 9b5d467..ce41d5b 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -752,7 +752,7 @@ def vitamins(self, vitamins: List[str]): def common_name(self) -> str: """Gets the common_name of this BrandedFoodObjectItems. - Common names associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 + Other names commonly associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 :return: The common_name of this BrandedFoodObjectItems. :rtype: str @@ -763,7 +763,7 @@ def common_name(self) -> str: def common_name(self, common_name: str): """Sets the common_name of this BrandedFoodObjectItems. - Common names associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 + Other names commonly associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 :param common_name: The common_name of this BrandedFoodObjectItems. :type common_name: str diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index af7f3dc..0781f71 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -1624,8 +1624,8 @@ components: type: string common_name: type: string - description: Common names associated with this item. These generally clarify - what the item is (e.g. when the brand name is "BRAND's Spicy Enchilada" + description: Other names commonly associated with this item. These generally + clarify what the item is (e.g. when the brand name is "BRAND's Spicy Enchilada" the common name may be "Chicken enchilada") description: type: string From 69529108993fe606a4b4ebc246daf6582b552a5b Mon Sep 17 00:00:00 2001 From: petermerrill Date: Wed, 22 Jan 2020 13:41:43 +0000 Subject: [PATCH 12/36] Generated code by SwaggerHub --- swagger_server/models/__init__.py | 2 + .../models/branded_food_object_items.py | 38 +- .../models/branded_food_object_serving.py | 100 +-- .../branded_food_object_serving_chomp.py | 64 ++ .../branded_food_object_serving_usda.py | 120 ++++ swagger_server/swagger/swagger.yaml | 668 ++++++++++-------- 6 files changed, 595 insertions(+), 397 deletions(-) create mode 100644 swagger_server/models/branded_food_object_serving_chomp.py create mode 100644 swagger_server/models/branded_food_object_serving_usda.py diff --git a/swagger_server/models/__init__.py b/swagger_server/models/__init__.py index 9360b2c..dd7d24b 100644 --- a/swagger_server/models/__init__.py +++ b/swagger_server/models/__init__.py @@ -24,6 +24,8 @@ from swagger_server.models.branded_food_object_packaging_photos_nutrition import BrandedFoodObjectPackagingPhotosNutrition from swagger_server.models.branded_food_object_portions import BrandedFoodObjectPortions from swagger_server.models.branded_food_object_serving import BrandedFoodObjectServing +from swagger_server.models.branded_food_object_serving_chomp import BrandedFoodObjectServingChomp +from swagger_server.models.branded_food_object_serving_usda import BrandedFoodObjectServingUsda from swagger_server.models.ingredient_object import IngredientObject from swagger_server.models.ingredient_object_items import IngredientObjectItems from swagger_server.models.ingredient_object_nutrients import IngredientObjectNutrients diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index ce41d5b..98b2f05 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -25,7 +25,7 @@ class BrandedFoodObjectItems(Model): Do not edit the class manually. """ - def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, common_name: str=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 + def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, common_names: List[str]=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 """BrandedFoodObjectItems - a model defined in Swagger :param barcode: The barcode of this BrandedFoodObjectItems. # noqa: E501 @@ -78,8 +78,8 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :type traces: List[str] :param vitamins: The vitamins of this BrandedFoodObjectItems. # noqa: E501 :type vitamins: List[str] - :param common_name: The common_name of this BrandedFoodObjectItems. # noqa: E501 - :type common_name: str + :param common_names: The common_names of this BrandedFoodObjectItems. # noqa: E501 + :type common_names: List[str] :param description: The description of this BrandedFoodObjectItems. # noqa: E501 :type description: str :param keywords: The keywords of this BrandedFoodObjectItems. # noqa: E501 @@ -113,7 +113,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'minerals': List[str], 'traces': List[str], 'vitamins': List[str], - 'common_name': str, + 'common_names': List[str], 'description': str, 'keywords': List[str], 'footnote': str @@ -145,7 +145,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'minerals': 'minerals', 'traces': 'traces', 'vitamins': 'vitamins', - 'common_name': 'common_name', + 'common_names': 'common_names', 'description': 'description', 'keywords': 'keywords', 'footnote': 'footnote' @@ -175,7 +175,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien self._minerals = minerals self._traces = traces self._vitamins = vitamins - self._common_name = common_name + self._common_names = common_names self._description = description self._keywords = keywords self._footnote = footnote @@ -749,27 +749,27 @@ def vitamins(self, vitamins: List[str]): self._vitamins = vitamins @property - def common_name(self) -> str: - """Gets the common_name of this BrandedFoodObjectItems. + def common_names(self) -> List[str]: + """Gets the common_names of this BrandedFoodObjectItems. - Other names commonly associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 + An array containing other names commonly associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" a common name may be \"Chicken enchilada\") # noqa: E501 - :return: The common_name of this BrandedFoodObjectItems. - :rtype: str + :return: The common_names of this BrandedFoodObjectItems. + :rtype: List[str] """ - return self._common_name + return self._common_names - @common_name.setter - def common_name(self, common_name: str): - """Sets the common_name of this BrandedFoodObjectItems. + @common_names.setter + def common_names(self, common_names: List[str]): + """Sets the common_names of this BrandedFoodObjectItems. - Other names commonly associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 + An array containing other names commonly associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" a common name may be \"Chicken enchilada\") # noqa: E501 - :param common_name: The common_name of this BrandedFoodObjectItems. - :type common_name: str + :param common_names: The common_names of this BrandedFoodObjectItems. + :type common_names: List[str] """ - self._common_name = common_name + self._common_names = common_names @property def description(self) -> str: diff --git a/swagger_server/models/branded_food_object_serving.py b/swagger_server/models/branded_food_object_serving.py index 6847e00..93a0942 100644 --- a/swagger_server/models/branded_food_object_serving.py +++ b/swagger_server/models/branded_food_object_serving.py @@ -6,6 +6,8 @@ from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model +from swagger_server.models.branded_food_object_serving_chomp import BrandedFoodObjectServingChomp # noqa: F401,E501 +from swagger_server.models.branded_food_object_serving_usda import BrandedFoodObjectServingUsda # noqa: F401,E501 from swagger_server import util @@ -14,30 +16,25 @@ class BrandedFoodObjectServing(Model): Do not edit the class manually. """ - def __init__(self, size: str=None, size_fulltext: str=None, total: int=None): # noqa: E501 + def __init__(self, chomp: BrandedFoodObjectServingChomp=None, usda: BrandedFoodObjectServingUsda=None): # noqa: E501 """BrandedFoodObjectServing - a model defined in Swagger - :param size: The size of this BrandedFoodObjectServing. # noqa: E501 - :type size: str - :param size_fulltext: The size_fulltext of this BrandedFoodObjectServing. # noqa: E501 - :type size_fulltext: str - :param total: The total of this BrandedFoodObjectServing. # noqa: E501 - :type total: int + :param chomp: The chomp of this BrandedFoodObjectServing. # noqa: E501 + :type chomp: BrandedFoodObjectServingChomp + :param usda: The usda of this BrandedFoodObjectServing. # noqa: E501 + :type usda: BrandedFoodObjectServingUsda """ self.swagger_types = { - 'size': str, - 'size_fulltext': str, - 'total': int + 'chomp': BrandedFoodObjectServingChomp, + 'usda': BrandedFoodObjectServingUsda } self.attribute_map = { - 'size': 'size', - 'size_fulltext': 'size_fulltext', - 'total': 'total' + 'chomp': 'chomp', + 'usda': 'usda' } - self._size = size - self._size_fulltext = size_fulltext - self._total = total + self._chomp = chomp + self._usda = usda @classmethod def from_dict(cls, dikt) -> 'BrandedFoodObjectServing': @@ -51,70 +48,43 @@ def from_dict(cls, dikt) -> 'BrandedFoodObjectServing': return util.deserialize_model(dikt, cls) @property - def size(self) -> str: - """Gets the size of this BrandedFoodObjectServing. + def chomp(self) -> BrandedFoodObjectServingChomp: + """Gets the chomp of this BrandedFoodObjectServing. - Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - :return: The size of this BrandedFoodObjectServing. - :rtype: str + :return: The chomp of this BrandedFoodObjectServing. + :rtype: BrandedFoodObjectServingChomp """ - return self._size + return self._chomp - @size.setter - def size(self, size: str): - """Sets the size of this BrandedFoodObjectServing. + @chomp.setter + def chomp(self, chomp: BrandedFoodObjectServingChomp): + """Sets the chomp of this BrandedFoodObjectServing. - Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - :param size: The size of this BrandedFoodObjectServing. - :type size: str + :param chomp: The chomp of this BrandedFoodObjectServing. + :type chomp: BrandedFoodObjectServingChomp """ - self._size = size + self._chomp = chomp @property - def size_fulltext(self) -> str: - """Gets the size_fulltext of this BrandedFoodObjectServing. + def usda(self) -> BrandedFoodObjectServingUsda: + """Gets the usda of this BrandedFoodObjectServing. - Serving size description # noqa: E501 - :return: The size_fulltext of this BrandedFoodObjectServing. - :rtype: str + :return: The usda of this BrandedFoodObjectServing. + :rtype: BrandedFoodObjectServingUsda """ - return self._size_fulltext + return self._usda - @size_fulltext.setter - def size_fulltext(self, size_fulltext: str): - """Sets the size_fulltext of this BrandedFoodObjectServing. + @usda.setter + def usda(self, usda: BrandedFoodObjectServingUsda): + """Sets the usda of this BrandedFoodObjectServing. - Serving size description # noqa: E501 - :param size_fulltext: The size_fulltext of this BrandedFoodObjectServing. - :type size_fulltext: str + :param usda: The usda of this BrandedFoodObjectServing. + :type usda: BrandedFoodObjectServingUsda """ - self._size_fulltext = size_fulltext - - @property - def total(self) -> int: - """Gets the total of this BrandedFoodObjectServing. - - Total servings # noqa: E501 - - :return: The total of this BrandedFoodObjectServing. - :rtype: int - """ - return self._total - - @total.setter - def total(self, total: int): - """Sets the total of this BrandedFoodObjectServing. - - Total servings # noqa: E501 - - :param total: The total of this BrandedFoodObjectServing. - :type total: int - """ - - self._total = total + self._usda = usda diff --git a/swagger_server/models/branded_food_object_serving_chomp.py b/swagger_server/models/branded_food_object_serving_chomp.py new file mode 100644 index 0000000..3d1a8e0 --- /dev/null +++ b/swagger_server/models/branded_food_object_serving_chomp.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class BrandedFoodObjectServingChomp(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, size: str=None): # noqa: E501 + """BrandedFoodObjectServingChomp - a model defined in Swagger + + :param size: The size of this BrandedFoodObjectServingChomp. # noqa: E501 + :type size: str + """ + self.swagger_types = { + 'size': str + } + + self.attribute_map = { + 'size': 'size' + } + self._size = size + + @classmethod + def from_dict(cls, dikt) -> 'BrandedFoodObjectServingChomp': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The BrandedFoodObject_serving_chomp of this BrandedFoodObjectServingChomp. # noqa: E501 + :rtype: BrandedFoodObjectServingChomp + """ + return util.deserialize_model(dikt, cls) + + @property + def size(self) -> str: + """Gets the size of this BrandedFoodObjectServingChomp. + + Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 + + :return: The size of this BrandedFoodObjectServingChomp. + :rtype: str + """ + return self._size + + @size.setter + def size(self, size: str): + """Sets the size of this BrandedFoodObjectServingChomp. + + Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 + + :param size: The size of this BrandedFoodObjectServingChomp. + :type size: str + """ + + self._size = size diff --git a/swagger_server/models/branded_food_object_serving_usda.py b/swagger_server/models/branded_food_object_serving_usda.py new file mode 100644 index 0000000..e29c418 --- /dev/null +++ b/swagger_server/models/branded_food_object_serving_usda.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class BrandedFoodObjectServingUsda(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, size: str=None, measurement_unit: str=None, size_fulltext: str=None): # noqa: E501 + """BrandedFoodObjectServingUsda - a model defined in Swagger + + :param size: The size of this BrandedFoodObjectServingUsda. # noqa: E501 + :type size: str + :param measurement_unit: The measurement_unit of this BrandedFoodObjectServingUsda. # noqa: E501 + :type measurement_unit: str + :param size_fulltext: The size_fulltext of this BrandedFoodObjectServingUsda. # noqa: E501 + :type size_fulltext: str + """ + self.swagger_types = { + 'size': str, + 'measurement_unit': str, + 'size_fulltext': str + } + + self.attribute_map = { + 'size': 'size', + 'measurement_unit': 'measurement_unit', + 'size_fulltext': 'size_fulltext' + } + self._size = size + self._measurement_unit = measurement_unit + self._size_fulltext = size_fulltext + + @classmethod + def from_dict(cls, dikt) -> 'BrandedFoodObjectServingUsda': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The BrandedFoodObject_serving_usda of this BrandedFoodObjectServingUsda. # noqa: E501 + :rtype: BrandedFoodObjectServingUsda + """ + return util.deserialize_model(dikt, cls) + + @property + def size(self) -> str: + """Gets the size of this BrandedFoodObjectServingUsda. + + Serving size # noqa: E501 + + :return: The size of this BrandedFoodObjectServingUsda. + :rtype: str + """ + return self._size + + @size.setter + def size(self, size: str): + """Sets the size of this BrandedFoodObjectServingUsda. + + Serving size # noqa: E501 + + :param size: The size of this BrandedFoodObjectServingUsda. + :type size: str + """ + + self._size = size + + @property + def measurement_unit(self) -> str: + """Gets the measurement_unit of this BrandedFoodObjectServingUsda. + + Measurement unit for each serving (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 + + :return: The measurement_unit of this BrandedFoodObjectServingUsda. + :rtype: str + """ + return self._measurement_unit + + @measurement_unit.setter + def measurement_unit(self, measurement_unit: str): + """Sets the measurement_unit of this BrandedFoodObjectServingUsda. + + Measurement unit for each serving (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 + + :param measurement_unit: The measurement_unit of this BrandedFoodObjectServingUsda. + :type measurement_unit: str + """ + + self._measurement_unit = measurement_unit + + @property + def size_fulltext(self) -> str: + """Gets the size_fulltext of this BrandedFoodObjectServingUsda. + + Serving size description # noqa: E501 + + :return: The size_fulltext of this BrandedFoodObjectServingUsda. + :rtype: str + """ + return self._size_fulltext + + @size_fulltext.setter + def size_fulltext(self, size_fulltext: str): + """Sets the size_fulltext of this BrandedFoodObjectServingUsda. + + Serving size description # noqa: E501 + + :param size_fulltext: The size_fulltext of this BrandedFoodObjectServingUsda. + :type size_fulltext: str + """ + + self._size_fulltext = size_fulltext diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 0781f71..332b3dd 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -541,67 +541,70 @@ components: - minerals - minerals components: - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 1 - non_english_speaking: 2 + english_speaking: 6 + non_english_speaking: 1 description: description has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 6 - size_fulltext: size_fulltext - size: size + chomp: + size: size + usda: + size_fulltext: size_fulltext + size: size + measurement_unit: measurement_unit nutrients: chomp: - - total: 5.63737665663332876420099637471139430999755859375 + - total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 - - total: 5.63737665663332876420099637471139430999755859375 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 + - total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 usda: - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - protein_conversion_factor: 6.8468526983526398765889098285697400569915771484375 + protein_conversion_factor: 1.489415909854170383397331534069962799549102783203125 packaging_photos: nutrition: small: small @@ -618,41 +621,43 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 7 name: name - compatibility_level: 7 + compatibility_level: 6 is_compatible: true gluten_free: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true ingredients: chomp: chomp usda: usda + common_names: + - common_names + - common_names categories: - categories - categories - common_name: common_name barcode: barcode brand: brand portions: - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote @@ -666,14 +671,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 6 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 6 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -685,9 +690,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 - protein_value: 1.231513536777255612975068288506008684635162353515625 - fat_value: 1.024645700144157789424070870154537260532379150390625 + carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 + protein_value: 7.3862819483858839220147274318151175975799560546875 + fat_value: 1.231513536777255612975068288506008684635162353515625 ingredient_list: - ingredient_list - ingredient_list @@ -702,67 +707,70 @@ components: - minerals - minerals components: - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 1 - non_english_speaking: 2 + english_speaking: 6 + non_english_speaking: 1 description: description has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 6 - size_fulltext: size_fulltext - size: size + chomp: + size: size + usda: + size_fulltext: size_fulltext + size: size + measurement_unit: measurement_unit nutrients: chomp: - - total: 5.63737665663332876420099637471139430999755859375 + - total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 - - total: 5.63737665663332876420099637471139430999755859375 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 + - total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 usda: - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - protein_conversion_factor: 6.8468526983526398765889098285697400569915771484375 + protein_conversion_factor: 1.489415909854170383397331534069962799549102783203125 packaging_photos: nutrition: small: small @@ -779,41 +787,43 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 7 name: name - compatibility_level: 7 + compatibility_level: 6 is_compatible: true gluten_free: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true ingredients: chomp: chomp usda: usda + common_names: + - common_names + - common_names categories: - categories - categories - common_name: common_name barcode: barcode brand: brand portions: - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote @@ -827,14 +837,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 6 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 6 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -846,9 +856,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 - protein_value: 1.231513536777255612975068288506008684635162353515625 - fat_value: 1.024645700144157789424070870154537260532379150390625 + carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 + protein_value: 7.3862819483858839220147274318151175975799560546875 + fat_value: 1.231513536777255612975068288506008684635162353515625 ingredient_list: - ingredient_list - ingredient_list @@ -875,38 +885,38 @@ components: items: - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 - protein_value: 1.231513536777255612975068288506008684635162353515625 - fat_value: 1.024645700144157789424070870154537260532379150390625 + carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 + protein_value: 7.3862819483858839220147274318151175975799560546875 + fat_value: 1.231513536777255612975068288506008684635162353515625 components: - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 7 name: name - compatibility_level: 7 + compatibility_level: 6 is_compatible: true gluten_free: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true name: name description: description @@ -917,75 +927,75 @@ components: common_name: common_name nutrients: usda: - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 - protein_value: 1.231513536777255612975068288506008684635162353515625 - fat_value: 1.024645700144157789424070870154537260532379150390625 + carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 + protein_value: 7.3862819483858839220147274318151175975799560546875 + fat_value: 1.231513536777255612975068288506008684635162353515625 components: - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 7 name: name - compatibility_level: 7 + compatibility_level: 6 is_compatible: true gluten_free: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true name: name description: description @@ -996,38 +1006,38 @@ components: common_name: common_name nutrients: usda: - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote @@ -1058,24 +1068,49 @@ components: example: quantity: 0 size: size - BrandedFoodObject_serving: + BrandedFoodObject_serving_chomp: type: object properties: size: type: string description: Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) + description: Serving information from as seen on ChompThis.com + example: + size: size + BrandedFoodObject_serving_usda: + type: object + properties: + size: + type: string + description: Serving size + measurement_unit: + type: string + description: Measurement unit for each serving (e.g. if measure is 3 tsp, + the unit is tsp) size_fulltext: type: string description: Serving size description - total: - type: integer - description: Total servings - description: An object containing serving information for this item + description: Serving information from the USDA example: - total: 6 size_fulltext: size_fulltext size: size + measurement_unit: measurement_unit + BrandedFoodObject_serving: + type: object + properties: + chomp: + $ref: '#/components/schemas/BrandedFoodObject_serving_chomp' + usda: + $ref: '#/components/schemas/BrandedFoodObject_serving_usda' + description: An object containing serving information for this item + example: + chomp: + size: size + usda: + size_fulltext: size_fulltext + size: size + measurement_unit: measurement_unit BrandedFoodObject_nutrients_chomp: type: object properties: @@ -1096,11 +1131,11 @@ components: type: number description: Total nutrient value example: - total: 5.63737665663332876420099637471139430999755859375 + total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 BrandedFoodObject_nutrients_usda: type: object properties: @@ -1139,16 +1174,16 @@ components: type: string description: Description of the nutrient source example: - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote BrandedFoodObject_nutrients: type: object @@ -1167,38 +1202,38 @@ components: description: An object containing nutrient information from multiple sources example: chomp: - - total: 5.63737665663332876420099637471139430999755859375 + - total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 - - total: 5.63737665663332876420099637471139430999755859375 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 + - total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 usda: - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote BrandedFoodObject_calorie_conversion_factor: type: object @@ -1215,9 +1250,9 @@ components: description: An object containing the multiplication factors to be used when calculating energy from macronutrients for a specific food. example: - carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 - protein_value: 1.231513536777255612975068288506008684635162353515625 - fat_value: 1.024645700144157789424070870154537260532379150390625 + carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 + protein_value: 7.3862819483858839220147274318151175975799560546875 + fat_value: 1.231513536777255612975068288506008684635162353515625 BrandedFoodObject_diet_labels_vegan: type: object properties: @@ -1242,9 +1277,9 @@ components: the Vegan diets example: confidence_description: confidence_description - confidence: 1 + confidence: 7 name: name - compatibility_level: 7 + compatibility_level: 6 is_compatible: true BrandedFoodObject_diet_labels_vegetarian: type: object @@ -1270,9 +1305,9 @@ components: Vegetarian diets example: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true BrandedFoodObject_diet_labels_gluten_free: type: object @@ -1300,7 +1335,7 @@ components: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true BrandedFoodObject_diet_labels: type: object @@ -1316,21 +1351,21 @@ components: example: vegetarian: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 7 name: name - compatibility_level: 7 + compatibility_level: 6 is_compatible: true gluten_free: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true BrandedFoodObject_diet_flags: type: object @@ -1365,7 +1400,7 @@ components: ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 6 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1465,9 +1500,9 @@ components: description: An object containing information on a specific component of this food item example: - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true BrandedFoodObject_portions: @@ -1500,9 +1535,9 @@ components: description: An object containing information on a specific food portion found in this item example: - data_points: 6 + data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote @@ -1520,8 +1555,8 @@ components: description: An object containing additional information on the countries where this item is found example: - english_speaking: 1 - non_english_speaking: 2 + english_speaking: 6 + non_english_speaking: 1 BrandedFoodObject_items: type: object properties: @@ -1622,11 +1657,13 @@ components: description: An array of vitamins that are found in this item items: type: string - common_name: - type: string - description: Other names commonly associated with this item. These generally - clarify what the item is (e.g. when the brand name is "BRAND's Spicy Enchilada" - the common name may be "Chicken enchilada") + common_names: + type: array + description: An array containing other names commonly associated with this + item. These generally clarify what the item is (e.g. when the brand name + is "BRAND's Spicy Enchilada" a common name may be "Chicken enchilada") + items: + type: string description: type: string description: A description of this item @@ -1645,67 +1682,70 @@ components: - minerals - minerals components: - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true keywords: - keywords - keywords country_details: - english_speaking: 1 - non_english_speaking: 2 + english_speaking: 6 + non_english_speaking: 1 description: description has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients - palm_oil_ingredients serving: - total: 6 - size_fulltext: size_fulltext - size: size + chomp: + size: size + usda: + size_fulltext: size_fulltext + size: size + measurement_unit: measurement_unit nutrients: chomp: - - total: 5.63737665663332876420099637471139430999755859375 + - total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 - - total: 5.63737665663332876420099637471139430999755859375 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 + - total: 5.962133916683182377482808078639209270477294921875 name: name measurement_unit: measurement_unit - per_100g: 1.46581298050294517310021547018550336360931396484375 - per_serving: 5.962133916683182377482808078639209270477294921875 + per_100g: 6.02745618307040320615897144307382404804229736328125 + per_serving: 1.46581298050294517310021547018550336360931396484375 usda: - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - protein_conversion_factor: 6.8468526983526398765889098285697400569915771484375 + protein_conversion_factor: 1.489415909854170383397331534069962799549102783203125 packaging_photos: nutrition: small: small @@ -1722,41 +1762,43 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 7 name: name - compatibility_level: 7 + compatibility_level: 6 is_compatible: true gluten_free: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true ingredients: chomp: chomp usda: usda + common_names: + - common_names + - common_names categories: - categories - categories - common_name: common_name barcode: barcode brand: brand portions: - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote @@ -1770,14 +1812,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 6 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 6 + compatibility_level: 9 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1789,9 +1831,9 @@ components: - allergens - allergens calorie_conversion_factor: - carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 - protein_value: 1.231513536777255612975068288506008684635162353515625 - fat_value: 1.024645700144157789424070870154537260532379150390625 + carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 + protein_value: 7.3862819483858839220147274318151175975799560546875 + fat_value: 1.231513536777255612975068288506008684635162353515625 ingredient_list: - ingredient_list - ingredient_list @@ -1814,27 +1856,27 @@ components: description: An object containing nutrient information from each source example: usda: - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote IngredientObject_items: type: object @@ -1884,38 +1926,38 @@ components: example: protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 calorie_conversion_factor: - carbohydrate_value: 1.489415909854170383397331534069962799549102783203125 - protein_value: 1.231513536777255612975068288506008684635162353515625 - fat_value: 1.024645700144157789424070870154537260532379150390625 + carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 + protein_value: 7.3862819483858839220147274318151175975799560546875 + fat_value: 1.231513536777255612975068288506008684635162353515625 components: - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true - - data_points: 6 - pct_weight: 8.7620420127490010742121739895083010196685791015625 - gram_weight: 9.0183481860707832566959041287191212177276611328125 + - data_points: 9 + pct_weight: 6.683562403749608193948006373830139636993408203125 + gram_weight: 8.7620420127490010742121739895083010196685791015625 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 5 + confidence: 4 name: name - compatibility_level: 4 + compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 7 name: name - compatibility_level: 7 + compatibility_level: 6 is_compatible: true gluten_free: confidence_description: confidence_description confidence: 9 name: name - compatibility_level: 9 + compatibility_level: 5 is_compatible: true name: name description: description @@ -1926,38 +1968,38 @@ components: common_name: common_name nutrients: usda: - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - - data_points: 7 - min: 9.301444243932575517419536481611430644989013671875 - median: 2.027123023002321833274663731572218239307403564453125 - max: 3.61607674925191080461672754609026014804840087890625 + - data_points: 4 + min: 7.061401241503109105224211816675961017608642578125 + median: 3.61607674925191080461672754609026014804840087890625 + max: 9.301444243932575517419536481611430644989013671875 name: name measurement_unit: measurement_unit - rank: 4 + rank: 2 description: description - id: 2 - per_100g: 7.061401241503109105224211816675961017608642578125 + id: 5 + per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 6 + - data_points: 3 modifier: modifier - gram_weight: 3.557195227068097320710649000830017030239105224609375 + gram_weight: 6.438423552598546706349225132726132869720458984375 measurement_unit: measurement_unit description: description footnote: footnote From c7d710bc4774cc773af8c9f5ff96072b6f551f96 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Wed, 22 Jan 2020 14:07:35 +0000 Subject: [PATCH 13/36] Generated code by SwaggerHub --- swagger_server/models/branded_food_object_ingredients.py | 4 ++-- swagger_server/swagger/swagger.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/swagger_server/models/branded_food_object_ingredients.py b/swagger_server/models/branded_food_object_ingredients.py index f0b83d8..1bed38a 100644 --- a/swagger_server/models/branded_food_object_ingredients.py +++ b/swagger_server/models/branded_food_object_ingredients.py @@ -49,7 +49,7 @@ def from_dict(cls, dikt) -> 'BrandedFoodObjectIngredients': def chomp(self) -> str: """Gets the chomp of this BrandedFoodObjectIngredients. - This item's ingredients as seen on ChompThis.com # noqa: E501 + Ingredients for this item from Chomp's internal database # noqa: E501 :return: The chomp of this BrandedFoodObjectIngredients. :rtype: str @@ -60,7 +60,7 @@ def chomp(self) -> str: def chomp(self, chomp: str): """Sets the chomp of this BrandedFoodObjectIngredients. - This item's ingredients as seen on ChompThis.com # noqa: E501 + Ingredients for this item from Chomp's internal database # noqa: E501 :param chomp: The chomp of this BrandedFoodObjectIngredients. :type chomp: str diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 332b3dd..db05d8a 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -1046,7 +1046,7 @@ components: properties: chomp: type: string - description: This item's ingredients as seen on ChompThis.com + description: Ingredients for this item from Chomp's internal database usda: type: string description: This branded food item's ingredients according to the USDA @@ -1075,7 +1075,7 @@ components: type: string description: Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) - description: Serving information from as seen on ChompThis.com + description: Serving information from Chomp's internal database example: size: size BrandedFoodObject_serving_usda: From 74ffc9f5084768674e10116e0beb5df6a1260753 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Wed, 22 Jan 2020 15:36:21 +0000 Subject: [PATCH 14/36] Generated code by SwaggerHub --- setup.py | 2 +- .../models/branded_food_object_ingredients.py | 4 +-- .../models/ingredient_object_items.py | 32 +++++++++---------- swagger_server/swagger/swagger.yaml | 12 +++---- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/setup.py b/setup.py index 92c1fe7..3325b2c 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,6 @@ entry_points={ 'console_scripts': ['swagger_server=swagger_server.__main__:main']}, long_description="""\ - __Important:__ - An __[API key](https://chompthis.com/api/)__ is required for access to this API. - Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__. ----- __Getting Started:__ - __[Subscribe](https://chompthis.com/api/#pricing)__ to the API. - Scroll down and click the \"__Authorize__\" button. - Enter your API key into the \"__value__\" input, click the \"__Authorize__\" button, then click the \"__Close__\" button. - Scroll down to the section titled \"__default__\" and click on the API endpoint you wish to use. - Click the \"__Try it out__\" button. - Enter the information the endpoint requires. - Click the \"__Execute__\" button. __Example:__ - Branded Food: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)__ API response object. - Ingredient: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)__ API response object. ----- __How Do I Find My API Key?__ - Your API key was sent to the email address you used to create your subscription. - You will also find your API key in the __[Client Center](https://chompthis.com/api/manage.php)__. - _Read __[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)__ for more information._ ||| | ------- | -------- | | [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp) | [Pricing](https://chompthis.com/api/) | | [Attribution](https://chompthis.com/api/docs/attribution.php) | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) | | [Terms & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php) | | [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php) | | [Client Center](https://chompthis.com/api/manage.php) | | + __Important:__ - An __[API key](https://chompthis.com/api/)__ is required for access to this API. Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__. ----- __Getting Started:__ - __[Subscribe](https://chompthis.com/api/#pricing)__ to the API. - Scroll down and click the \"__Authorize__\" button. - Enter your API key into the \"__value__\" input, click the \"__Authorize__\" button, then click the \"__Close__\" button. - Scroll down to the section titled \"__default__\" and click on the API endpoint you wish to use. - Click the \"__Try it out__\" button. - Enter the information the endpoint requires. - Click the \"__Execute__\" button. __Example:__ - Branded Food: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)__ API response object. - Ingredient: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)__ API response object. ----- __How Do I Find My API Key?__ - Your API key was sent to the email address you used to create your subscription. - You will also find your API key in the __[Client Center](https://chompthis.com/api/manage.php)__. - _Read __[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)__ for more information._ ||| | ------- | -------- | | [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp) | [Pricing](https://chompthis.com/api/) | | [Attribution](https://chompthis.com/api/docs/attribution.php) | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) | | [Terms & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php) | | [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php) | | [Client Center](https://chompthis.com/api/manage.php) | | """ ) diff --git a/swagger_server/models/branded_food_object_ingredients.py b/swagger_server/models/branded_food_object_ingredients.py index 1bed38a..04f153b 100644 --- a/swagger_server/models/branded_food_object_ingredients.py +++ b/swagger_server/models/branded_food_object_ingredients.py @@ -72,7 +72,7 @@ def chomp(self, chomp: str): def usda(self) -> str: """Gets the usda of this BrandedFoodObjectIngredients. - This branded food item's ingredients according to the USDA # noqa: E501 + This branded food item's ingredients, according to the USDA # noqa: E501 :return: The usda of this BrandedFoodObjectIngredients. :rtype: str @@ -83,7 +83,7 @@ def usda(self) -> str: def usda(self, usda: str): """Sets the usda of this BrandedFoodObjectIngredients. - This branded food item's ingredients according to the USDA # noqa: E501 + This branded food item's ingredients, according to the USDA # noqa: E501 :param usda: The usda of this BrandedFoodObjectIngredients. :type usda: str diff --git a/swagger_server/models/ingredient_object_items.py b/swagger_server/models/ingredient_object_items.py index 88fdd41..ad75070 100644 --- a/swagger_server/models/ingredient_object_items.py +++ b/swagger_server/models/ingredient_object_items.py @@ -19,7 +19,7 @@ class IngredientObjectItems(Model): Do not edit the class manually. """ - def __init__(self, name: str=None, categories: List[str]=None, nutrients: IngredientObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, common_name: str=None, description: str=None, footnote: str=None): # noqa: E501 + def __init__(self, name: str=None, categories: List[str]=None, nutrients: IngredientObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, common_names: str=None, description: str=None, footnote: str=None): # noqa: E501 """IngredientObjectItems - a model defined in Swagger :param name: The name of this IngredientObjectItems. # noqa: E501 @@ -38,8 +38,8 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred :type components: List[BrandedFoodObjectComponents] :param portions: The portions of this IngredientObjectItems. # noqa: E501 :type portions: List[BrandedFoodObjectPortions] - :param common_name: The common_name of this IngredientObjectItems. # noqa: E501 - :type common_name: str + :param common_names: The common_names of this IngredientObjectItems. # noqa: E501 + :type common_names: str :param description: The description of this IngredientObjectItems. # noqa: E501 :type description: str :param footnote: The footnote of this IngredientObjectItems. # noqa: E501 @@ -54,7 +54,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred 'diet_labels': BrandedFoodObjectDietLabels, 'components': List[BrandedFoodObjectComponents], 'portions': List[BrandedFoodObjectPortions], - 'common_name': str, + 'common_names': str, 'description': str, 'footnote': str } @@ -68,7 +68,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred 'diet_labels': 'diet_labels', 'components': 'components', 'portions': 'portions', - 'common_name': 'common_name', + 'common_names': 'common_names', 'description': 'description', 'footnote': 'footnote' } @@ -80,7 +80,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred self._diet_labels = diet_labels self._components = components self._portions = portions - self._common_name = common_name + self._common_names = common_names self._description = description self._footnote = footnote @@ -272,27 +272,27 @@ def portions(self, portions: List[BrandedFoodObjectPortions]): self._portions = portions @property - def common_name(self) -> str: - """Gets the common_name of this IngredientObjectItems. + def common_names(self) -> str: + """Gets the common_names of this IngredientObjectItems. Common names associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 - :return: The common_name of this IngredientObjectItems. + :return: The common_names of this IngredientObjectItems. :rtype: str """ - return self._common_name + return self._common_names - @common_name.setter - def common_name(self, common_name: str): - """Sets the common_name of this IngredientObjectItems. + @common_names.setter + def common_names(self, common_names: str): + """Sets the common_names of this IngredientObjectItems. Common names associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 - :param common_name: The common_name of this IngredientObjectItems. - :type common_name: str + :param common_names: The common_names of this IngredientObjectItems. + :type common_names: str """ - self._common_name = common_name + self._common_names = common_names @property def description(self) -> str: diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index db05d8a..b401270 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Chomp Food Database API Documentation description: "__Important:__\n - An __[API key](https://chompthis.com/api/)__ is\ - \ required for access to this API.\n - Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__.\n\ + \ required for access to this API. Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__.\n\ \n-----\n\n__Getting Started:__\n - __[Subscribe](https://chompthis.com/api/#pricing)__\ \ to the API.\n - Scroll down and click the \"__Authorize__\" button.\n - Enter\ \ your API key into the \"__value__\" input, click the \"__Authorize__\" button,\ @@ -919,12 +919,12 @@ components: compatibility_level: 5 is_compatible: true name: name + common_names: common_names description: description categories: - categories - categories footnote: footnote - common_name: common_name nutrients: usda: - data_points: 4 @@ -998,12 +998,12 @@ components: compatibility_level: 5 is_compatible: true name: name + common_names: common_names description: description categories: - categories - categories footnote: footnote - common_name: common_name nutrients: usda: - data_points: 4 @@ -1049,7 +1049,7 @@ components: description: Ingredients for this item from Chomp's internal database usda: type: string - description: This branded food item's ingredients according to the USDA + description: This branded food item's ingredients, according to the USDA description: An object containing this item's ingredients in order of highest value to least example: @@ -1910,7 +1910,7 @@ components: of a food found in this item items: $ref: '#/components/schemas/BrandedFoodObject_portions' - common_name: + common_names: type: string description: Common names associated with this item. These generally clarify what the item is (e.g. when the brand name is "BRAND's Spicy Enchilada" @@ -1960,12 +1960,12 @@ components: compatibility_level: 5 is_compatible: true name: name + common_names: common_names description: description categories: - categories - categories footnote: footnote - common_name: common_name nutrients: usda: - data_points: 4 From a01a692df33d4411fe75151fbfabda80af92b83b Mon Sep 17 00:00:00 2001 From: petermerrill Date: Wed, 22 Jan 2020 19:40:26 +0000 Subject: [PATCH 15/36] Generated code by SwaggerHub --- setup.py | 2 +- .../controllers/default_controller.py | 58 +-- swagger_server/swagger/swagger.yaml | 369 ++++++++++-------- 3 files changed, 240 insertions(+), 189 deletions(-) diff --git a/setup.py b/setup.py index 3325b2c..01439bd 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,6 @@ entry_points={ 'console_scripts': ['swagger_server=swagger_server.__main__:main']}, long_description="""\ - __Important:__ - An __[API key](https://chompthis.com/api/)__ is required for access to this API. Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__. ----- __Getting Started:__ - __[Subscribe](https://chompthis.com/api/#pricing)__ to the API. - Scroll down and click the \"__Authorize__\" button. - Enter your API key into the \"__value__\" input, click the \"__Authorize__\" button, then click the \"__Close__\" button. - Scroll down to the section titled \"__default__\" and click on the API endpoint you wish to use. - Click the \"__Try it out__\" button. - Enter the information the endpoint requires. - Click the \"__Execute__\" button. __Example:__ - Branded Food: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)__ API response object. - Ingredient: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)__ API response object. ----- __How Do I Find My API Key?__ - Your API key was sent to the email address you used to create your subscription. - You will also find your API key in the __[Client Center](https://chompthis.com/api/manage.php)__. - _Read __[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)__ for more information._ ||| | ------- | -------- | | [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp) | [Pricing](https://chompthis.com/api/) | | [Attribution](https://chompthis.com/api/docs/attribution.php) | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) | | [Terms & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php) | | [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php) | | [Client Center](https://chompthis.com/api/manage.php) | | + ## Important An **[API key](https://chompthis.com/api/)** is required for access to this API. Get yours at **[https://chompthis.com/api](https://chompthis.com/api/)**. ### Getting Started * **[Subscribe](https://chompthis.com/api/#pricing)** to the API. * Scroll down and click the \"**Authorize**\" button. * Enter your API key into the \"**value**\" input, click the \"**Authorize**\" button, then click the \"**Close**\" button. * Scroll down to the section titled \"**default**\" and click on the API endpoint you wish to use. * Click the \"**Try it out**\" button. * Enter the information the endpoint requires. * Click the \"**Execute**\" button. ### Example * Branded food response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)** * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)** ### How Do I Find My API Key? * Your API key was sent to the email address you used to create your subscription. * You will also find your API key in the **[Client Center](https://chompthis.com/api/manage.php)**. * Read **[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)** for more information. ||| | ------- | -------- | | [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp) | [Pricing](https://chompthis.com/api/) | | [Attribution](https://chompthis.com/api/docs/attribution.php) | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) | | [Terms & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php) | | [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php) | | [Client Center](https://chompthis.com/api/manage.php) | | """ ) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index fe98753..f943e72 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -9,9 +9,9 @@ def food_branded_barcode_php_get(code): # noqa: E501 """Get a branded food item using a barcode - # Get data for a branded food using the food's UPC/EAN barcode. __Example:__ ```https://chompthis.com/api/v2/food/branded/barcode.php?api_key=API_KEY&code=CODE``` # noqa: E501 + ## Get data for a branded food using the food's UPC/EAN barcode. **Example** > ```https://chompthis.com/api/v2/food/branded/barcode.php?api_key=API_KEY&code=CODE``` **Tips** * Read our **[Knowledge Base article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do)** for helpful tips and tricks. # noqa: E501 - :param code: UPC/EAN barcode __Example:__ &code=0842234000988 __Tips:__ - Use our [food lookup tool](https://chompthis.com/api/lookup.php). - Read [this article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do) for general tips and tricks. + :param code: #### UPC/EAN barcode **Example** > ```&code=0842234000988``` :type code: str :rtype: BrandedFoodObject @@ -22,11 +22,11 @@ def food_branded_barcode_php_get(code): # noqa: E501 def food_branded_id_php_get(id, source=None): # noqa: E501 """Get a branded food item using an ID number - # Get data for a branded food using Chomp's internal ID number. _Alternatively, set the \"source\" parameter to \"USDA\" and use the food's FDC ID._ __Example:__ ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID``` # noqa: E501 + ## Get data for a branded food using Chomp's internal ID number. **Example** > ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID``` **Tips** * Find a food's ID by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. * Alternatively, set the \"source\" parameter to \"USDA\" and use the food's FDC ID. # noqa: E501 - :param id: The ID number of a branded food item. __Example #1:__ &id=15 __Example #2:__ &id=FDC_ID&source=USDA ___Tip:__ Get started by using our [ood lookup tool](https://chompthis.com/api/lookup.php)._ + :param id: #### The ID number of a branded food item. **Example #1: Using Chomp ID** > ```&id=15``` **Example #2: Using FDC ID** > ```&id=FDC_ID&source=USDA``` :type id: int - :param source: Configure the endpoint to accept food IDs from various data sources. This endpoint defaults to Chomp but can accept FDC IDs. __Example:__ &source=Chomp ___Important Note:__ Pass in &source=USDA if you want to look up food items using a USDA FDC ID._ + :param source: #### Configure the endpoint to accept food IDs from various data sources. This endpoint defaults to Chomp but can accept FDC IDs. **Example** > ```&source=Chomp``` **Tips** * Pass in ```&source=USDA``` if you want to look up food items using a USDA FDC ID. :type source: str :rtype: BrandedFoodObject @@ -37,13 +37,13 @@ def food_branded_id_php_get(id, source=None): # noqa: E501 def food_branded_name_php_get(name, limit=None, page=None): # noqa: E501 """Get a branded food item by name - # Search for branded food items by name. This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ __Example:__ ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` # noqa: E501 + ## Search for branded food items by name. **Example** > ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` **Tips** * Get started by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 - :param name: Search for branded food items using a general food name keyword. This does not have to exactly match the \"official\" name for the food. __Example:__ &name=Starburst ___Tip:__ Get started by using our [food lookup tool](https://chompthis.com/api/lookup.php)._ + :param name: #### Search for branded food items using a general food name keyword. This does not have to exactly match the \"official\" name for the food. **Example** > ```&name=Starburst``` :type name: str - :param limit: Set maximum number of records you want the API to return. __Example:__ &limit=10 + :param limit: #### Set maximum number of records you want the API to return. **Example** > ```&limit=10``` :type limit: int - :param page: This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. __Example__: &page=1 + :param page: #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. **Example** > ```&page=1``` :type page: int :rtype: BrandedFoodObject @@ -54,35 +54,35 @@ def food_branded_name_php_get(name, limit=None, page=None): # noqa: E501 def food_branded_search_php_get(allergen=None, brand=None, category=None, country=None, diet=None, ingredient=None, keyword=None, mineral=None, nutrient=None, palm_oil=None, trace=None, vitamin=None, limit=None, page=None): # noqa: E501 """Get data for branded food items using various search parameters - # Search for branded food items using various parameters. This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ __Example:__ ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1``` ___Tip:__ Get started by using the [Query Builder](https://chompthis.com/api/build.php)._ # noqa: E501 + ## Search for branded food items using various parameters. **Example** > ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1``` **Tips** * Get started by using the **[Query Builder](https://chompthis.com/api/build.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 - :param allergen: Filter the search to only include branded foods that contain a specific allergen. __Example__: &allergen=Peanuts ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + :param allergen: #### Filter the search to only include branded foods that contain a specific allergen. **Example** > ```&allergen=Peanuts``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. :type allergen: str - :param brand: Filter the search to only include branded foods that are owned by a specific brand. __Example__: &brand=Starbucks + :param brand: #### Filter the search to only include branded foods that are owned by a specific brand. **Example** > ```&brand=Starbucks``` :type brand: str - :param category: Filter the search to only include branded foods from a specific category. __Example__: &category=Plant Based Foods + :param category: #### Filter the search to only include branded foods from a specific category. **Example** > ```&category=Plant Based Foods``` :type category: str - :param country: Filter the search to only include branded foods that are sold in a specific country. __Example__: &country=United States ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + :param country: #### Filter the search to only include branded foods that are sold in a specific country. **Example** > ```&country=United States``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. :type country: str - :param diet: Filter the search to only include branded foods that are considered compatible with a specific diet. ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + :param diet: #### Filter the search to only include branded foods that are considered compatible with a specific diet. **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. :type diet: str - :param ingredient: Filter the search to only include branded foods that contain a specific ingredient. __Example__: &ingredient=Salt + :param ingredient: #### Filter the search to only include branded foods that contain a specific ingredient. **Example** > ```&ingredient=Salt``` :type ingredient: str - :param keyword: Filter the search to only include branded foods that are associated with a specific keyword. __Example__: &keyword=Organic ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + :param keyword: #### Filter the search to only include branded foods that are associated with a specific keyword. **Example** > ```&keyword=Organic``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. :type keyword: str - :param mineral: Filter the search to only include branded foods that contain a specific mineral. __Example__: &mineral=Potassium + :param mineral: #### Filter the search to only include branded foods that contain a specific mineral. **Example** > ```&mineral=Potassium``` :type mineral: str - :param nutrient: Filter the search to only include branded foods that contain a specific nutrient. __Example__: &nutrient=Caffeine ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + :param nutrient: #### Filter the search to only include branded foods that contain a specific nutrient. **Example** > ```&nutrient=Caffeine``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. :type nutrient: str - :param palm_oil: Filter the search to only include branded foods that contain a specific ingredient made using palm oil. __Example__: &palm_oil=E160a Beta Carotene + :param palm_oil: #### Filter the search to only include branded foods that contain a specific ingredient made using palm oil. **Example** > ```&palm_oil=E160a Beta Carotene``` :type palm_oil: str - :param trace: Filter the search to only include branded foods that contain a specific trace ingredient. __Example__: &trace=Tree Nuts ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + :param trace: ### Filter the search to only include branded foods that contain a specific trace ingredient. **Example** > ```&trace=Tree Nuts``` **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. :type trace: str - :param vitamin: Filter the search to only include branded foods that contain a specific vitamin. __Example__: &vitamin=Biotin + :param vitamin: #### Filter the search to only include branded foods that contain a specific vitamin. **Example** > ```&vitamin=Biotin``` :type vitamin: str - :param limit: Set maximum number of records you want the API to return. __Example:__ &limit=10 + :param limit: #### Set maximum number of records you want the API to return. **Example** > ```&limit=10``` :type limit: int - :param page: This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. __Example__: &page=1 + :param page: #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. **Example** > ```&page=1``` :type page: int :rtype: BrandedFoodObject @@ -93,15 +93,15 @@ def food_branded_search_php_get(allergen=None, brand=None, category=None, countr def food_ingredient_search_php_get(find, list, raw=None, limit=None): # noqa: E501 """Get raw/generic food ingredient item(s) - # Get data for a specific ingredient or a specific set of ingredients. This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ __Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN``` # noqa: E501 + ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli&raw=true``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach&list=true&raw=true``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 - :param find: Search our database for a single ingredient or a specific set of ingredients. __Example #1:__ &find=broccoli __Example #2:__ &find=broccoli,cauliflower,spinach&list=true __Important List Notes:__ - Set the \"list\" parameter to \"true\" before passing in a comma-separated list of ingredients. - Comma-separated lists cannot contain more than __15 ingredients__. You must perform additional API calls if you are looking up more than 15 ingredients. + :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=broccoli``` **Example #2: Set of Ingredients** > ```&find=broccoli,cauliflower,spinach&list=true``` **Important Notes** * Set the \"list\" parameter to \"true\" before passing in a comma-separated list of ingredients. * Comma-separated lists cannot contain more than **15 ingredients**. You must perform additional API calls if you are looking up more than 15 ingredients. :type find: int - :param list: Setting _&list=true_ will configure this endpoint to allow searching for ingredients using a comma-separated list. By default, this endpoint will __only__ return results for the first ingredient. __Example:__ &list=true + :param list: #### Setting ```&list=true``` will configure this endpoint to allow searching for ingredients using a comma-separated list. By default, this endpoint will **only** return results for the first ingredient. **Example** > ```&list=true``` :type list: bool - :param raw: Optionally filter the search result to only include raw ingredients. __Example:__ &raw=true + :param raw: #### Optionally filter the search result to only include raw ingredients. **Example** > ```&raw=true``` :type raw: bool - :param limit: Set maximum number of records you want the API to return, per search term. __Example:__ &limit=3 + :param limit: #### Set maximum number of records you want the API to return, per search term. **Example** > ```&limit=3``` :type limit: int :rtype: IngredientObject diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index b401270..c107311 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -1,22 +1,22 @@ openapi: 3.0.0 info: title: Chomp Food Database API Documentation - description: "__Important:__\n - An __[API key](https://chompthis.com/api/)__ is\ - \ required for access to this API. Get yours at __[https://chompthis.com/api](https://chompthis.com/api/)__.\n\ - \n-----\n\n__Getting Started:__\n - __[Subscribe](https://chompthis.com/api/#pricing)__\ - \ to the API.\n - Scroll down and click the \"__Authorize__\" button.\n - Enter\ - \ your API key into the \"__value__\" input, click the \"__Authorize__\" button,\ - \ then click the \"__Close__\" button.\n - Scroll down to the section titled\ - \ \"__default__\" and click on the API endpoint you wish to use.\n - Click the\ - \ \"__Try it out__\" button.\n - Enter the information the endpoint requires.\n\ - \ - Click the \"__Execute__\" button.\n\n__Example:__ \n - Branded Food: __[View\ - \ example](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)__\ - \ API response object.\n - Ingredient: __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)__\ - \ API response object.\n\n-----\n\n__How Do I Find My API Key?__\n - Your API\ - \ key was sent to the email address you used to create your subscription.\n -\ - \ You will also find your API key in the __[Client Center](https://chompthis.com/api/manage.php)__.\n\ - \ - _Read __[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)__\ - \ for more information._\n\n|||\n| ------- | -------- |\n| [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp)\ + description: "## Important\nAn **[API key](https://chompthis.com/api/)** is required\ + \ for access to this API. Get yours at **[https://chompthis.com/api](https://chompthis.com/api/)**.\n\ + \n### Getting Started\n * **[Subscribe](https://chompthis.com/api/#pricing)**\ + \ to the API.\n * Scroll down and click the \"**Authorize**\" button.\n * Enter\ + \ your API key into the \"**value**\" input, click the \"**Authorize**\" button,\ + \ then click the \"**Close**\" button.\n * Scroll down to the section titled\ + \ \"**default**\" and click on the API endpoint you wish to use.\n * Click the\ + \ \"**Try it out**\" button.\n * Enter the information the endpoint requires.\n\ + \ * Click the \"**Execute**\" button.\n\n### Example \n * Branded food response\ + \ object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)**\n\ + \ * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)**\n\ + \n### How Do I Find My API Key?\n * Your API key was sent to the email address\ + \ you used to create your subscription.\n * You will also find your API key in\ + \ the **[Client Center](https://chompthis.com/api/manage.php)**.\n * Read **[this\ + \ article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)**\ + \ for more information.\n\n|||\n| ------- | -------- |\n| [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp)\ \ | [Pricing](https://chompthis.com/api/) |\n| [Attribution](https://chompthis.com/api/docs/attribution.php)\ \ | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) |\n| [Terms\ \ & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php)\ @@ -30,18 +30,19 @@ paths: /food/branded/barcode.php: get: summary: Get a branded food item using a barcode - description: | - # Get data for a branded food using the food's UPC/EAN barcode. - - __Example:__ ```https://chompthis.com/api/v2/food/branded/barcode.php?api_key=API_KEY&code=CODE``` + description: "## Get data for a branded food using the food's UPC/EAN barcode.\n\ + \n**Example** \n> ```https://chompthis.com/api/v2/food/branded/barcode.php?api_key=API_KEY&code=CODE```\n\ + \n**Tips**\n * Read our **[Knowledge Base article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do)**\ + \ for helpful tips and tricks.\n" operationId: food_branded_barcode_php_get parameters: - name: code in: query - description: "UPC/EAN barcode\n\n__Example:__ &code=0842234000988\n\n__Tips:__\ - \ \n - Use our [food lookup tool](https://chompthis.com/api/lookup.php).\n\ - \ - Read [this article](https://desk.zoho.com/portal/chompthis/kb/articles/im-having-trouble-getting-matches-for-barcodes-what-can-id-do)\ - \ for general tips and tricks.\n" + description: | + #### UPC/EAN barcode + + **Example** + > ```&code=0842234000988``` required: true style: form explode: true @@ -49,24 +50,27 @@ paths: type: string responses: "200": - description: __Valid__ - Will return an object containing any matching foods. + description: "**Valid** - Will return an object containing any matching\ + \ foods. \n" content: application/json: schema: $ref: '#/components/schemas/BrandedFoodObject' "400": - description: __Validation error__ - Invalid parameters or request. + description: | + **Validation error** - Invalid parameters or request. "401": - description: __Unauthorized__ - Invalid API key or usage limits exceeded. - _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + description: | + **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: __Forbidden__ - Disallowed entity. + description: | + **Forbidden** - Disallowed entity. "404": - description: __Not found__ - No food items exist that match your query parameters. + description: | + **Not found** - No food items exist that match your query parameters. "500": - description: __Server error__ - Internal server error, request failed, or - base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if - you see this._ + description: | + **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* security: - ApiKeyAuth: [] x-openapi-router-controller: swagger_server.controllers.default_controller @@ -74,23 +78,26 @@ paths: get: summary: Get a branded food item using an ID number description: | - # Get data for a branded food using Chomp's internal ID number. + ## Get data for a branded food using Chomp's internal ID number. - _Alternatively, set the "source" parameter to "USDA" and use the food's FDC ID._ + **Example** + > ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID``` - __Example:__ ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID``` + **Tips** + * Find a food's ID by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. + * Alternatively, set the "source" parameter to "USDA" and use the food's FDC ID. operationId: food_branded_id_php_get parameters: - name: id in: query description: | - The ID number of a branded food item. - - __Example #1:__ &id=15 + #### The ID number of a branded food item. - __Example #2:__ &id=FDC_ID&source=USDA + **Example #1: Using Chomp ID** + > ```&id=15``` - ___Tip:__ Get started by using our [ood lookup tool](https://chompthis.com/api/lookup.php)._ + **Example #2: Using FDC ID** + > ```&id=FDC_ID&source=USDA``` required: true style: form explode: true @@ -99,11 +106,13 @@ paths: - name: source in: query description: | - Configure the endpoint to accept food IDs from various data sources. This endpoint defaults to Chomp but can accept FDC IDs. + #### Configure the endpoint to accept food IDs from various data sources. This endpoint defaults to Chomp but can accept FDC IDs. - __Example:__ &source=Chomp + **Example** + > ```&source=Chomp``` - ___Important Note:__ Pass in &source=USDA if you want to look up food items using a USDA FDC ID._ + **Tips** + * Pass in ```&source=USDA``` if you want to look up food items using a USDA FDC ID. required: false style: form explode: true @@ -114,24 +123,27 @@ paths: - USDA responses: "200": - description: __Valid__ - Will return an object containing any matching foods. + description: "**Valid** - Will return an object containing any matching\ + \ foods. \n" content: application/json: schema: $ref: '#/components/schemas/BrandedFoodObject' "400": - description: __Validation error__ - Invalid parameters or request. + description: | + **Validation error** - Invalid parameters or request. "401": - description: __Unauthorized__ - Invalid API key or usage limits exceeded. - _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + description: | + **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: __Forbidden__ - Disallowed entity. + description: | + **Forbidden** - Disallowed entity. "404": - description: __Not found__ - No food items exist that match your query parameters. + description: | + **Not found** - No food items exist that match your query parameters. "500": - description: __Server error__ - Internal server error, request failed, or - base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if - you see this._ + description: | + **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* security: - ApiKeyAuth: [] x-openapi-router-controller: swagger_server.controllers.default_controller @@ -139,21 +151,24 @@ paths: get: summary: Get a branded food item by name description: | - # Search for branded food items by name. + ## Search for branded food items by name. - This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ + **Example** + > ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` - __Example:__ ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME``` + **Tips** + * Get started by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. + + > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. operationId: food_branded_name_php_get parameters: - name: name in: query description: | - Search for branded food items using a general food name keyword. This does not have to exactly match the "official" name for the food. - - __Example:__ &name=Starburst + #### Search for branded food items using a general food name keyword. This does not have to exactly match the "official" name for the food. - ___Tip:__ Get started by using our [food lookup tool](https://chompthis.com/api/lookup.php)._ + **Example** + > ```&name=Starburst``` required: true style: form explode: true @@ -162,9 +177,10 @@ paths: - name: limit in: query description: | - Set maximum number of records you want the API to return. + #### Set maximum number of records you want the API to return. - __Example:__ &limit=10 + **Example** + > ```&limit=10``` required: false style: form explode: true @@ -184,9 +200,10 @@ paths: - name: page in: query description: | - This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. + #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. - __Example__: &page=1 + **Example** + > ```&page=1``` required: false style: form explode: true @@ -194,48 +211,51 @@ paths: type: integer responses: "200": - description: __Valid__ - Will return an object containing any matching foods. + description: "**Valid** - Will return an object containing any matching\ + \ foods. \n" content: application/json: schema: $ref: '#/components/schemas/BrandedFoodObject' "400": - description: __Validation error__ - Invalid parameters or request. + description: | + **Validation error** - Invalid parameters or request. "401": - description: __Unauthorized__ - Invalid API key or usage limits exceeded. - _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + description: | + **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: __Forbidden__ - Disallowed entity. + description: | + **Forbidden** - Disallowed entity. "404": - description: __Not found__ - No food items exist that match your query parameters. + description: | + **Not found** - No food items exist that match your query parameters. "500": - description: __Server error__ - Internal server error, request failed, or - base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if - you see this._ + description: | + **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* security: - ApiKeyAuth: [] x-openapi-router-controller: swagger_server.controllers.default_controller /food/branded/search.php: get: summary: Get data for branded food items using various search parameters - description: | - # Search for branded food items using various parameters. - - This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ - - __Example:__ ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1``` - - ___Tip:__ Get started by using the [Query Builder](https://chompthis.com/api/build.php)._ + description: "## Search for branded food items using various parameters.\n\n\ + **Example**\n> ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1```\n\ + \n**Tips** \n * Get started by using the **[Query Builder](https://chompthis.com/api/build.php)**.\n\ + \n> This API endpoint is only available to Standard and Premium API subscribers.\ + \ Please consider upgrading your subscription if you are subscribed to the\ + \ Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)**\ + \ if you aren't sure how to upgrade your subscription.\n" operationId: food_branded_search_php_get parameters: - name: allergen in: query description: | - Filter the search to only include branded foods that contain a specific allergen. + #### Filter the search to only include branded foods that contain a specific allergen. - __Example__: &allergen=Peanuts + **Example** + > ```&allergen=Peanuts``` - ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. required: false style: form explode: true @@ -244,9 +264,10 @@ paths: - name: brand in: query description: | - Filter the search to only include branded foods that are owned by a specific brand. + #### Filter the search to only include branded foods that are owned by a specific brand. - __Example__: &brand=Starbucks + **Example** + > ```&brand=Starbucks``` required: false style: form explode: true @@ -255,9 +276,10 @@ paths: - name: category in: query description: | - Filter the search to only include branded foods from a specific category. + #### Filter the search to only include branded foods from a specific category. - __Example__: &category=Plant Based Foods + **Example** + > ```&category=Plant Based Foods``` required: false style: form explode: true @@ -266,11 +288,12 @@ paths: - name: country in: query description: | - Filter the search to only include branded foods that are sold in a specific country. + #### Filter the search to only include branded foods that are sold in a specific country. - __Example__: &country=United States + **Example** + > ```&country=United States``` - ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. required: false style: form explode: true @@ -279,9 +302,9 @@ paths: - name: diet in: query description: | - Filter the search to only include branded foods that are considered compatible with a specific diet. + #### Filter the search to only include branded foods that are considered compatible with a specific diet. - ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. required: false style: form explode: true @@ -294,9 +317,10 @@ paths: - name: ingredient in: query description: | - Filter the search to only include branded foods that contain a specific ingredient. + #### Filter the search to only include branded foods that contain a specific ingredient. - __Example__: &ingredient=Salt + **Example** + > ```&ingredient=Salt``` required: false style: form explode: true @@ -305,11 +329,12 @@ paths: - name: keyword in: query description: | - Filter the search to only include branded foods that are associated with a specific keyword. + #### Filter the search to only include branded foods that are associated with a specific keyword. - __Example__: &keyword=Organic + **Example** + > ```&keyword=Organic``` - ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. required: false style: form explode: true @@ -318,9 +343,10 @@ paths: - name: mineral in: query description: | - Filter the search to only include branded foods that contain a specific mineral. + #### Filter the search to only include branded foods that contain a specific mineral. - __Example__: &mineral=Potassium + **Example** + > ```&mineral=Potassium``` required: false style: form explode: true @@ -329,11 +355,12 @@ paths: - name: nutrient in: query description: | - Filter the search to only include branded foods that contain a specific nutrient. + #### Filter the search to only include branded foods that contain a specific nutrient. - __Example__: &nutrient=Caffeine + **Example** + > ```&nutrient=Caffeine``` - ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. required: false style: form explode: true @@ -342,9 +369,10 @@ paths: - name: palm_oil in: query description: | - Filter the search to only include branded foods that contain a specific ingredient made using palm oil. + #### Filter the search to only include branded foods that contain a specific ingredient made using palm oil. - __Example__: &palm_oil=E160a Beta Carotene + **Example** + > ```&palm_oil=E160a Beta Carotene``` required: false style: form explode: true @@ -353,11 +381,12 @@ paths: - name: trace in: query description: | - Filter the search to only include branded foods that contain a specific trace ingredient. + ### Filter the search to only include branded foods that contain a specific trace ingredient. - __Example__: &trace=Tree Nuts + **Example** + > ```&trace=Tree Nuts``` - ___Important Note:__ This parameter cannot be used alone. It must be paired with at least 1 additional parameter._ + **Important Note**: This parameter cannot be used alone. It must be paired with at least 1 additional parameter. required: false style: form explode: true @@ -366,9 +395,10 @@ paths: - name: vitamin in: query description: | - Filter the search to only include branded foods that contain a specific vitamin. + #### Filter the search to only include branded foods that contain a specific vitamin. - __Example__: &vitamin=Biotin + **Example** + > ```&vitamin=Biotin``` required: false style: form explode: true @@ -377,9 +407,10 @@ paths: - name: limit in: query description: | - Set maximum number of records you want the API to return. + #### Set maximum number of records you want the API to return. - __Example:__ &limit=10 + **Example** + > ```&limit=10``` required: false style: form explode: true @@ -399,9 +430,10 @@ paths: - name: page in: query description: | - This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. + #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. - __Example__: &page=1 + **Example** + > ```&page=1``` required: false style: form explode: true @@ -409,24 +441,27 @@ paths: type: integer responses: "200": - description: __Valid__ - Will return an object containing any matching foods. + description: "**Valid** - Will return an object containing any matching\ + \ foods. \n" content: application/json: schema: $ref: '#/components/schemas/BrandedFoodObject' "400": - description: __Validation error__ - Invalid parameters or request. + description: | + **Validation error** - Invalid parameters or request. "401": - description: __Unauthorized__ - Invalid API key or usage limits exceeded. - _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + description: | + **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: __Forbidden__ - Disallowed entity. + description: | + **Forbidden** - Disallowed entity. "404": - description: __Not found__ - No food items exist that match your query parameters. + description: | + **Not found** - No food items exist that match your query parameters. "500": - description: __Server error__ - Internal server error, request failed, or - base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if - you see this._ + description: | + **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* security: - ApiKeyAuth: [] x-openapi-router-controller: swagger_server.controllers.default_controller @@ -434,20 +469,28 @@ paths: get: summary: Get raw/generic food ingredient item(s) description: | - # Get data for a specific ingredient or a specific set of ingredients. + ## Get data for a specific ingredient or a specific set of ingredients. + + **Example #1: Single Ingredient** + > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli&raw=true``` - This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. _[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription) if you aren't sure how to upgrade your subscription._ + **Example #2: Set of Ingredients** + > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach&list=true&raw=true``` - __Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN``` + **Tips** + * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. + + > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. operationId: food_ingredient_search_php_get parameters: - name: find in: query description: "Search our database for a single ingredient or a specific set\ - \ of ingredients.\n\n__Example #1:__ &find=broccoli\n\n__Example #2:__ &find=broccoli,cauliflower,spinach&list=true\n\ - \n__Important List Notes:__ \n - Set the \"list\" parameter to \"true\"\ - \ before passing in a comma-separated list of ingredients.\n - Comma-separated\ - \ lists cannot contain more than __15 ingredients__. You must perform additional\ + \ of ingredients.\n\n**Example #1: Single Ingredient**\n> ```&find=broccoli```\n\ + \n**Example #2: Set of Ingredients**\n> ```&find=broccoli,cauliflower,spinach&list=true```\n\ + \n**Important Notes** \n * Set the \"list\" parameter to \"true\" before\ + \ passing in a comma-separated list of ingredients.\n * Comma-separated\ + \ lists cannot contain more than **15 ingredients**. You must perform additional\ \ API calls if you are looking up more than 15 ingredients.\n" required: true style: form @@ -457,9 +500,10 @@ paths: - name: list in: query description: | - Setting _&list=true_ will configure this endpoint to allow searching for ingredients using a comma-separated list. By default, this endpoint will __only__ return results for the first ingredient. + #### Setting ```&list=true``` will configure this endpoint to allow searching for ingredients using a comma-separated list. By default, this endpoint will **only** return results for the first ingredient. - __Example:__ &list=true + **Example** + > ```&list=true``` required: true style: form explode: true @@ -471,9 +515,10 @@ paths: - name: raw in: query description: | - Optionally filter the search result to only include raw ingredients. + #### Optionally filter the search result to only include raw ingredients. - __Example:__ &raw=true + **Example** + > ```&raw=true``` required: false style: form explode: true @@ -485,9 +530,10 @@ paths: - name: limit in: query description: | - Set maximum number of records you want the API to return, per search term. + #### Set maximum number of records you want the API to return, per search term. - __Example:__ &limit=3 + **Example** + > ```&limit=3``` required: false style: form explode: true @@ -499,25 +545,27 @@ paths: - 3 responses: "200": - description: __Valid__ - Will return an object containing any matching ingredient - foods. + description: "**Valid** - Will return an object containing any matching\ + \ ingredient foods. \n" content: application/json: schema: $ref: '#/components/schemas/IngredientObject' "400": - description: __Validation error__ - Invalid parameters or request. + description: | + **Validation error** - Invalid parameters or request. "401": - description: __Unauthorized__ - Invalid API key or usage limits exceeded. - _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + description: | + **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: __Forbidden__ - Disallowed entity. + description: | + **Forbidden** - Disallowed entity. "404": - description: __Not found__ - No food items exist that match your query parameters. + description: | + **Not found** - No food items exist that match your query parameters. "500": - description: __Server error__ - Internal server error, request failed, or - base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if - you see this._ + description: | + **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* security: - ApiKeyAuth: [] x-openapi-router-controller: swagger_server.controllers.default_controller @@ -533,7 +581,7 @@ components: items: $ref: '#/components/schemas/BrandedFoodObject_items' description: Please read the description of each field in this API response - object example. By default, the value of each field is __null__. This indicates + object example. By default, the value of each field is **null**. This indicates an unknown state or that no data exists. example: items: @@ -879,7 +927,7 @@ components: items: $ref: '#/components/schemas/IngredientObject_items' description: Please read the description of each field in this API response - object example. By default, the value of each field is __null__. This indicates + object example. By default, the value of each field is **null**. This indicates an unknown state or that no data exists. example: items: @@ -2005,31 +2053,34 @@ components: footnote: footnote responses: "200BrandedResponse": - description: __Valid__ - Will return an object containing any matching foods. + description: "**Valid** - Will return an object containing any matching foods.\ + \ \n" content: application/json: schema: $ref: '#/components/schemas/BrandedFoodObject' "200IngredientResponse": - description: __Valid__ - Will return an object containing any matching ingredient - foods. + description: "**Valid** - Will return an object containing any matching ingredient\ + \ foods. \n" content: application/json: schema: $ref: '#/components/schemas/IngredientObject' "400Error": - description: __Validation error__ - Invalid parameters or request. + description: | + **Validation error** - Invalid parameters or request. "401Error": - description: __Unauthorized__ - Invalid API key or usage limits exceeded. _[More - information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + description: | + **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403Error": - description: __Forbidden__ - Disallowed entity. + description: | + **Forbidden** - Disallowed entity. "404Error": - description: __Not found__ - No food items exist that match your query parameters. + description: | + **Not found** - No food items exist that match your query parameters. "500Error": - description: __Server error__ - Internal server error, request failed, or base - error. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see - this._ + description: | + **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* securitySchemes: ApiKeyAuth: type: apiKey From b3e48cdb3d97e0567928d165de9369a82581e83a Mon Sep 17 00:00:00 2001 From: petermerrill Date: Thu, 23 Jan 2020 13:08:01 +0000 Subject: [PATCH 16/36] Generated code by SwaggerHub --- .../models/branded_food_object_items.py | 30 +------------------ swagger_server/swagger/swagger.yaml | 16 ---------- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index 98b2f05..cf2548c 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -25,7 +25,7 @@ class BrandedFoodObjectItems(Model): Do not edit the class manually. """ - def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, common_names: List[str]=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 + def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 """BrandedFoodObjectItems - a model defined in Swagger :param barcode: The barcode of this BrandedFoodObjectItems. # noqa: E501 @@ -78,8 +78,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :type traces: List[str] :param vitamins: The vitamins of this BrandedFoodObjectItems. # noqa: E501 :type vitamins: List[str] - :param common_names: The common_names of this BrandedFoodObjectItems. # noqa: E501 - :type common_names: List[str] :param description: The description of this BrandedFoodObjectItems. # noqa: E501 :type description: str :param keywords: The keywords of this BrandedFoodObjectItems. # noqa: E501 @@ -113,7 +111,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'minerals': List[str], 'traces': List[str], 'vitamins': List[str], - 'common_names': List[str], 'description': str, 'keywords': List[str], 'footnote': str @@ -145,7 +142,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'minerals': 'minerals', 'traces': 'traces', 'vitamins': 'vitamins', - 'common_names': 'common_names', 'description': 'description', 'keywords': 'keywords', 'footnote': 'footnote' @@ -175,7 +171,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien self._minerals = minerals self._traces = traces self._vitamins = vitamins - self._common_names = common_names self._description = description self._keywords = keywords self._footnote = footnote @@ -748,29 +743,6 @@ def vitamins(self, vitamins: List[str]): self._vitamins = vitamins - @property - def common_names(self) -> List[str]: - """Gets the common_names of this BrandedFoodObjectItems. - - An array containing other names commonly associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" a common name may be \"Chicken enchilada\") # noqa: E501 - - :return: The common_names of this BrandedFoodObjectItems. - :rtype: List[str] - """ - return self._common_names - - @common_names.setter - def common_names(self, common_names: List[str]): - """Sets the common_names of this BrandedFoodObjectItems. - - An array containing other names commonly associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" a common name may be \"Chicken enchilada\") # noqa: E501 - - :param common_names: The common_names of this BrandedFoodObjectItems. - :type common_names: List[str] - """ - - self._common_names = common_names - @property def description(self) -> str: """Gets the description of this BrandedFoodObjectItems. diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index c107311..b4e17b1 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -688,9 +688,6 @@ components: ingredients: chomp: chomp usda: usda - common_names: - - common_names - - common_names categories: - categories - categories @@ -854,9 +851,6 @@ components: ingredients: chomp: chomp usda: usda - common_names: - - common_names - - common_names categories: - categories - categories @@ -1705,13 +1699,6 @@ components: description: An array of vitamins that are found in this item items: type: string - common_names: - type: array - description: An array containing other names commonly associated with this - item. These generally clarify what the item is (e.g. when the brand name - is "BRAND's Spicy Enchilada" a common name may be "Chicken enchilada") - items: - type: string description: type: string description: A description of this item @@ -1829,9 +1816,6 @@ components: ingredients: chomp: chomp usda: usda - common_names: - - common_names - - common_names categories: - categories - categories From e39d077af27c5720dc3b51c60f9c99fbca22f4e1 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jan 2020 13:12:55 +0000 Subject: [PATCH 17/36] Removed files managed by codegen --- .../models/branded_food_object_components.py | 176 --------------- .../models/branded_food_object_portions.py | 204 ------------------ 2 files changed, 380 deletions(-) delete mode 100644 swagger_server/models/branded_food_object_components.py delete mode 100644 swagger_server/models/branded_food_object_portions.py diff --git a/swagger_server/models/branded_food_object_components.py b/swagger_server/models/branded_food_object_components.py deleted file mode 100644 index ce99247..0000000 --- a/swagger_server/models/branded_food_object_components.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from swagger_server.models.base_model_ import Model -from swagger_server import util - - -class BrandedFoodObjectComponents(Model): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - def __init__(self, name: str=None, pct_weight: float=None, gram_weight: float=None, is_refuse: bool=None, data_points: int=None): # noqa: E501 - """BrandedFoodObjectComponents - a model defined in Swagger - - :param name: The name of this BrandedFoodObjectComponents. # noqa: E501 - :type name: str - :param pct_weight: The pct_weight of this BrandedFoodObjectComponents. # noqa: E501 - :type pct_weight: float - :param gram_weight: The gram_weight of this BrandedFoodObjectComponents. # noqa: E501 - :type gram_weight: float - :param is_refuse: The is_refuse of this BrandedFoodObjectComponents. # noqa: E501 - :type is_refuse: bool - :param data_points: The data_points of this BrandedFoodObjectComponents. # noqa: E501 - :type data_points: int - """ - self.swagger_types = { - 'name': str, - 'pct_weight': float, - 'gram_weight': float, - 'is_refuse': bool, - 'data_points': int - } - - self.attribute_map = { - 'name': 'name', - 'pct_weight': 'pct_weight', - 'gram_weight': 'gram_weight', - 'is_refuse': 'is_refuse', - 'data_points': 'data_points' - } - self._name = name - self._pct_weight = pct_weight - self._gram_weight = gram_weight - self._is_refuse = is_refuse - self._data_points = data_points - - @classmethod - def from_dict(cls, dikt) -> 'BrandedFoodObjectComponents': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The BrandedFoodObject_components of this BrandedFoodObjectComponents. # noqa: E501 - :rtype: BrandedFoodObjectComponents - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this BrandedFoodObjectComponents. - - The kind of component, e.g. bone # noqa: E501 - - :return: The name of this BrandedFoodObjectComponents. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this BrandedFoodObjectComponents. - - The kind of component, e.g. bone # noqa: E501 - - :param name: The name of this BrandedFoodObjectComponents. - :type name: str - """ - - self._name = name - - @property - def pct_weight(self) -> float: - """Gets the pct_weight of this BrandedFoodObjectComponents. - - The weight of the component as a percentage of the total weight of the food # noqa: E501 - - :return: The pct_weight of this BrandedFoodObjectComponents. - :rtype: float - """ - return self._pct_weight - - @pct_weight.setter - def pct_weight(self, pct_weight: float): - """Sets the pct_weight of this BrandedFoodObjectComponents. - - The weight of the component as a percentage of the total weight of the food # noqa: E501 - - :param pct_weight: The pct_weight of this BrandedFoodObjectComponents. - :type pct_weight: float - """ - - self._pct_weight = pct_weight - - @property - def gram_weight(self) -> float: - """Gets the gram_weight of this BrandedFoodObjectComponents. - - The weight of the component in grams # noqa: E501 - - :return: The gram_weight of this BrandedFoodObjectComponents. - :rtype: float - """ - return self._gram_weight - - @gram_weight.setter - def gram_weight(self, gram_weight: float): - """Sets the gram_weight of this BrandedFoodObjectComponents. - - The weight of the component in grams # noqa: E501 - - :param gram_weight: The gram_weight of this BrandedFoodObjectComponents. - :type gram_weight: float - """ - - self._gram_weight = gram_weight - - @property - def is_refuse(self) -> bool: - """Gets the is_refuse of this BrandedFoodObjectComponents. - - Whether the component is refuse, i.e. not edible # noqa: E501 - - :return: The is_refuse of this BrandedFoodObjectComponents. - :rtype: bool - """ - return self._is_refuse - - @is_refuse.setter - def is_refuse(self, is_refuse: bool): - """Sets the is_refuse of this BrandedFoodObjectComponents. - - Whether the component is refuse, i.e. not edible # noqa: E501 - - :param is_refuse: The is_refuse of this BrandedFoodObjectComponents. - :type is_refuse: bool - """ - - self._is_refuse = is_refuse - - @property - def data_points(self) -> int: - """Gets the data_points of this BrandedFoodObjectComponents. - - The number of obersvations on which the measure is based # noqa: E501 - - :return: The data_points of this BrandedFoodObjectComponents. - :rtype: int - """ - return self._data_points - - @data_points.setter - def data_points(self, data_points: int): - """Sets the data_points of this BrandedFoodObjectComponents. - - The number of obersvations on which the measure is based # noqa: E501 - - :param data_points: The data_points of this BrandedFoodObjectComponents. - :type data_points: int - """ - - self._data_points = data_points diff --git a/swagger_server/models/branded_food_object_portions.py b/swagger_server/models/branded_food_object_portions.py deleted file mode 100644 index 74d6625..0000000 --- a/swagger_server/models/branded_food_object_portions.py +++ /dev/null @@ -1,204 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from swagger_server.models.base_model_ import Model -from swagger_server import util - - -class BrandedFoodObjectPortions(Model): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - def __init__(self, measurement_unit: str=None, description: str=None, modifier: str=None, gram_weight: float=None, data_points: int=None, footnote: str=None): # noqa: E501 - """BrandedFoodObjectPortions - a model defined in Swagger - - :param measurement_unit: The measurement_unit of this BrandedFoodObjectPortions. # noqa: E501 - :type measurement_unit: str - :param description: The description of this BrandedFoodObjectPortions. # noqa: E501 - :type description: str - :param modifier: The modifier of this BrandedFoodObjectPortions. # noqa: E501 - :type modifier: str - :param gram_weight: The gram_weight of this BrandedFoodObjectPortions. # noqa: E501 - :type gram_weight: float - :param data_points: The data_points of this BrandedFoodObjectPortions. # noqa: E501 - :type data_points: int - :param footnote: The footnote of this BrandedFoodObjectPortions. # noqa: E501 - :type footnote: str - """ - self.swagger_types = { - 'measurement_unit': str, - 'description': str, - 'modifier': str, - 'gram_weight': float, - 'data_points': int, - 'footnote': str - } - - self.attribute_map = { - 'measurement_unit': 'measurement_unit', - 'description': 'description', - 'modifier': 'modifier', - 'gram_weight': 'gram_weight', - 'data_points': 'data_points', - 'footnote': 'footnote' - } - self._measurement_unit = measurement_unit - self._description = description - self._modifier = modifier - self._gram_weight = gram_weight - self._data_points = data_points - self._footnote = footnote - - @classmethod - def from_dict(cls, dikt) -> 'BrandedFoodObjectPortions': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The BrandedFoodObject_portions of this BrandedFoodObjectPortions. # noqa: E501 - :rtype: BrandedFoodObjectPortions - """ - return util.deserialize_model(dikt, cls) - - @property - def measurement_unit(self) -> str: - """Gets the measurement_unit of this BrandedFoodObjectPortions. - - The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) # noqa: E501 - - :return: The measurement_unit of this BrandedFoodObjectPortions. - :rtype: str - """ - return self._measurement_unit - - @measurement_unit.setter - def measurement_unit(self, measurement_unit: str): - """Sets the measurement_unit of this BrandedFoodObjectPortions. - - The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) # noqa: E501 - - :param measurement_unit: The measurement_unit of this BrandedFoodObjectPortions. - :type measurement_unit: str - """ - - self._measurement_unit = measurement_unit - - @property - def description(self) -> str: - """Gets the description of this BrandedFoodObjectPortions. - - Comments that provide more specificity on the measure. For example, for a pizza measure the dissemination text might be 1 slice is 1/8th of a 14 inch pizza. # noqa: E501 - - :return: The description of this BrandedFoodObjectPortions. - :rtype: str - """ - return self._description - - @description.setter - def description(self, description: str): - """Sets the description of this BrandedFoodObjectPortions. - - Comments that provide more specificity on the measure. For example, for a pizza measure the dissemination text might be 1 slice is 1/8th of a 14 inch pizza. # noqa: E501 - - :param description: The description of this BrandedFoodObjectPortions. - :type description: str - """ - - self._description = description - - @property - def modifier(self) -> str: - """Gets the modifier of this BrandedFoodObjectPortions. - - Qualifier of the measure (e.g. related to food shape or form) (e.g. melted, crushed, diced) # noqa: E501 - - :return: The modifier of this BrandedFoodObjectPortions. - :rtype: str - """ - return self._modifier - - @modifier.setter - def modifier(self, modifier: str): - """Sets the modifier of this BrandedFoodObjectPortions. - - Qualifier of the measure (e.g. related to food shape or form) (e.g. melted, crushed, diced) # noqa: E501 - - :param modifier: The modifier of this BrandedFoodObjectPortions. - :type modifier: str - """ - - self._modifier = modifier - - @property - def gram_weight(self) -> float: - """Gets the gram_weight of this BrandedFoodObjectPortions. - - The weight of the measure in grams # noqa: E501 - - :return: The gram_weight of this BrandedFoodObjectPortions. - :rtype: float - """ - return self._gram_weight - - @gram_weight.setter - def gram_weight(self, gram_weight: float): - """Sets the gram_weight of this BrandedFoodObjectPortions. - - The weight of the measure in grams # noqa: E501 - - :param gram_weight: The gram_weight of this BrandedFoodObjectPortions. - :type gram_weight: float - """ - - self._gram_weight = gram_weight - - @property - def data_points(self) -> int: - """Gets the data_points of this BrandedFoodObjectPortions. - - The number of observations on which the measure is based # noqa: E501 - - :return: The data_points of this BrandedFoodObjectPortions. - :rtype: int - """ - return self._data_points - - @data_points.setter - def data_points(self, data_points: int): - """Sets the data_points of this BrandedFoodObjectPortions. - - The number of observations on which the measure is based # noqa: E501 - - :param data_points: The data_points of this BrandedFoodObjectPortions. - :type data_points: int - """ - - self._data_points = data_points - - @property - def footnote(self) -> str: - """Gets the footnote of this BrandedFoodObjectPortions. - - Comments on any unusual aspects of the measure. Examples might includes caveats on the usage of a measure, or reasons why a measure gram weight is an unexpected value. # noqa: E501 - - :return: The footnote of this BrandedFoodObjectPortions. - :rtype: str - """ - return self._footnote - - @footnote.setter - def footnote(self, footnote: str): - """Sets the footnote of this BrandedFoodObjectPortions. - - Comments on any unusual aspects of the measure. Examples might includes caveats on the usage of a measure, or reasons why a measure gram weight is an unexpected value. # noqa: E501 - - :param footnote: The footnote of this BrandedFoodObjectPortions. - :type footnote: str - """ - - self._footnote = footnote From e2c5c7110e16d8146932b03ce51ef4c861ebee6e Mon Sep 17 00:00:00 2001 From: petermerrill Date: Thu, 23 Jan 2020 13:12:57 +0000 Subject: [PATCH 18/36] Generated code by SwaggerHub --- swagger_server/models/__init__.py | 4 +- .../models/branded_food_object_items.py | 60 +--- .../models/ingredient_object_components.py | 176 +++++++++++ .../models/ingredient_object_items.py | 30 +- .../models/ingredient_object_portions.py | 204 +++++++++++++ swagger_server/swagger/swagger.yaml | 282 ++++++------------ 6 files changed, 497 insertions(+), 259 deletions(-) create mode 100644 swagger_server/models/ingredient_object_components.py create mode 100644 swagger_server/models/ingredient_object_portions.py diff --git a/swagger_server/models/__init__.py b/swagger_server/models/__init__.py index dd7d24b..344f3b8 100644 --- a/swagger_server/models/__init__.py +++ b/swagger_server/models/__init__.py @@ -5,7 +5,6 @@ # import models into model package from swagger_server.models.branded_food_object import BrandedFoodObject from swagger_server.models.branded_food_object_calorie_conversion_factor import BrandedFoodObjectCalorieConversionFactor -from swagger_server.models.branded_food_object_components import BrandedFoodObjectComponents from swagger_server.models.branded_food_object_country_details import BrandedFoodObjectCountryDetails from swagger_server.models.branded_food_object_diet_flags import BrandedFoodObjectDietFlags from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels @@ -22,10 +21,11 @@ from swagger_server.models.branded_food_object_packaging_photos_front import BrandedFoodObjectPackagingPhotosFront from swagger_server.models.branded_food_object_packaging_photos_ingredients import BrandedFoodObjectPackagingPhotosIngredients from swagger_server.models.branded_food_object_packaging_photos_nutrition import BrandedFoodObjectPackagingPhotosNutrition -from swagger_server.models.branded_food_object_portions import BrandedFoodObjectPortions from swagger_server.models.branded_food_object_serving import BrandedFoodObjectServing from swagger_server.models.branded_food_object_serving_chomp import BrandedFoodObjectServingChomp from swagger_server.models.branded_food_object_serving_usda import BrandedFoodObjectServingUsda from swagger_server.models.ingredient_object import IngredientObject +from swagger_server.models.ingredient_object_components import IngredientObjectComponents from swagger_server.models.ingredient_object_items import IngredientObjectItems from swagger_server.models.ingredient_object_nutrients import IngredientObjectNutrients +from swagger_server.models.ingredient_object_portions import IngredientObjectPortions diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index cf2548c..7fe1c1d 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -7,7 +7,6 @@ from swagger_server.models.base_model_ import Model from swagger_server.models.branded_food_object_calorie_conversion_factor import BrandedFoodObjectCalorieConversionFactor # noqa: F401,E501 -from swagger_server.models.branded_food_object_components import BrandedFoodObjectComponents # noqa: F401,E501 from swagger_server.models.branded_food_object_country_details import BrandedFoodObjectCountryDetails # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_flags import BrandedFoodObjectDietFlags # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels # noqa: F401,E501 @@ -15,7 +14,6 @@ from swagger_server.models.branded_food_object_nutrients import BrandedFoodObjectNutrients # noqa: F401,E501 from swagger_server.models.branded_food_object_package import BrandedFoodObjectPackage # noqa: F401,E501 from swagger_server.models.branded_food_object_packaging_photos import BrandedFoodObjectPackagingPhotos # noqa: F401,E501 -from swagger_server.models.branded_food_object_portions import BrandedFoodObjectPortions # noqa: F401,E501 from swagger_server.models.branded_food_object_serving import BrandedFoodObjectServing # noqa: F401,E501 from swagger_server import util @@ -25,7 +23,7 @@ class BrandedFoodObjectItems(Model): Do not edit the class manually. """ - def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 + def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 """BrandedFoodObjectItems - a model defined in Swagger :param barcode: The barcode of this BrandedFoodObjectItems. # noqa: E501 @@ -54,10 +52,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :type diet_flags: List[BrandedFoodObjectDietFlags] :param packaging_photos: The packaging_photos of this BrandedFoodObjectItems. # noqa: E501 :type packaging_photos: BrandedFoodObjectPackagingPhotos - :param components: The components of this BrandedFoodObjectItems. # noqa: E501 - :type components: List[BrandedFoodObjectComponents] - :param portions: The portions of this BrandedFoodObjectItems. # noqa: E501 - :type portions: List[BrandedFoodObjectPortions] :param allergens: The allergens of this BrandedFoodObjectItems. # noqa: E501 :type allergens: List[str] :param brand_list: The brand_list of this BrandedFoodObjectItems. # noqa: E501 @@ -99,8 +93,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'diet_labels': BrandedFoodObjectDietLabels, 'diet_flags': List[BrandedFoodObjectDietFlags], 'packaging_photos': BrandedFoodObjectPackagingPhotos, - 'components': List[BrandedFoodObjectComponents], - 'portions': List[BrandedFoodObjectPortions], 'allergens': List[str], 'brand_list': List[str], 'countries': List[str], @@ -130,8 +122,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'diet_labels': 'diet_labels', 'diet_flags': 'diet_flags', 'packaging_photos': 'packaging_photos', - 'components': 'components', - 'portions': 'portions', 'allergens': 'allergens', 'brand_list': 'brand_list', 'countries': 'countries', @@ -159,8 +149,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien self._diet_labels = diet_labels self._diet_flags = diet_flags self._packaging_photos = packaging_photos - self._components = components - self._portions = portions self._allergens = allergens self._brand_list = brand_list self._countries = countries @@ -469,52 +457,6 @@ def packaging_photos(self, packaging_photos: BrandedFoodObjectPackagingPhotos): self._packaging_photos = packaging_photos - @property - def components(self) -> List[BrandedFoodObjectComponents]: - """Gets the components of this BrandedFoodObjectItems. - - An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) # noqa: E501 - - :return: The components of this BrandedFoodObjectItems. - :rtype: List[BrandedFoodObjectComponents] - """ - return self._components - - @components.setter - def components(self, components: List[BrandedFoodObjectComponents]): - """Sets the components of this BrandedFoodObjectItems. - - An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) # noqa: E501 - - :param components: The components of this BrandedFoodObjectItems. - :type components: List[BrandedFoodObjectComponents] - """ - - self._components = components - - @property - def portions(self) -> List[BrandedFoodObjectPortions]: - """Gets the portions of this BrandedFoodObjectItems. - - An array of objects containing information on discrete amounts of a food found in this item # noqa: E501 - - :return: The portions of this BrandedFoodObjectItems. - :rtype: List[BrandedFoodObjectPortions] - """ - return self._portions - - @portions.setter - def portions(self, portions: List[BrandedFoodObjectPortions]): - """Sets the portions of this BrandedFoodObjectItems. - - An array of objects containing information on discrete amounts of a food found in this item # noqa: E501 - - :param portions: The portions of this BrandedFoodObjectItems. - :type portions: List[BrandedFoodObjectPortions] - """ - - self._portions = portions - @property def allergens(self) -> List[str]: """Gets the allergens of this BrandedFoodObjectItems. diff --git a/swagger_server/models/ingredient_object_components.py b/swagger_server/models/ingredient_object_components.py new file mode 100644 index 0000000..6af0e9a --- /dev/null +++ b/swagger_server/models/ingredient_object_components.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class IngredientObjectComponents(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: str=None, pct_weight: float=None, gram_weight: float=None, is_refuse: bool=None, data_points: int=None): # noqa: E501 + """IngredientObjectComponents - a model defined in Swagger + + :param name: The name of this IngredientObjectComponents. # noqa: E501 + :type name: str + :param pct_weight: The pct_weight of this IngredientObjectComponents. # noqa: E501 + :type pct_weight: float + :param gram_weight: The gram_weight of this IngredientObjectComponents. # noqa: E501 + :type gram_weight: float + :param is_refuse: The is_refuse of this IngredientObjectComponents. # noqa: E501 + :type is_refuse: bool + :param data_points: The data_points of this IngredientObjectComponents. # noqa: E501 + :type data_points: int + """ + self.swagger_types = { + 'name': str, + 'pct_weight': float, + 'gram_weight': float, + 'is_refuse': bool, + 'data_points': int + } + + self.attribute_map = { + 'name': 'name', + 'pct_weight': 'pct_weight', + 'gram_weight': 'gram_weight', + 'is_refuse': 'is_refuse', + 'data_points': 'data_points' + } + self._name = name + self._pct_weight = pct_weight + self._gram_weight = gram_weight + self._is_refuse = is_refuse + self._data_points = data_points + + @classmethod + def from_dict(cls, dikt) -> 'IngredientObjectComponents': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The IngredientObject_components of this IngredientObjectComponents. # noqa: E501 + :rtype: IngredientObjectComponents + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this IngredientObjectComponents. + + The kind of component, e.g. bone # noqa: E501 + + :return: The name of this IngredientObjectComponents. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this IngredientObjectComponents. + + The kind of component, e.g. bone # noqa: E501 + + :param name: The name of this IngredientObjectComponents. + :type name: str + """ + + self._name = name + + @property + def pct_weight(self) -> float: + """Gets the pct_weight of this IngredientObjectComponents. + + The weight of the component as a percentage of the total weight of the food # noqa: E501 + + :return: The pct_weight of this IngredientObjectComponents. + :rtype: float + """ + return self._pct_weight + + @pct_weight.setter + def pct_weight(self, pct_weight: float): + """Sets the pct_weight of this IngredientObjectComponents. + + The weight of the component as a percentage of the total weight of the food # noqa: E501 + + :param pct_weight: The pct_weight of this IngredientObjectComponents. + :type pct_weight: float + """ + + self._pct_weight = pct_weight + + @property + def gram_weight(self) -> float: + """Gets the gram_weight of this IngredientObjectComponents. + + The weight of the component in grams # noqa: E501 + + :return: The gram_weight of this IngredientObjectComponents. + :rtype: float + """ + return self._gram_weight + + @gram_weight.setter + def gram_weight(self, gram_weight: float): + """Sets the gram_weight of this IngredientObjectComponents. + + The weight of the component in grams # noqa: E501 + + :param gram_weight: The gram_weight of this IngredientObjectComponents. + :type gram_weight: float + """ + + self._gram_weight = gram_weight + + @property + def is_refuse(self) -> bool: + """Gets the is_refuse of this IngredientObjectComponents. + + Whether the component is refuse, i.e. not edible # noqa: E501 + + :return: The is_refuse of this IngredientObjectComponents. + :rtype: bool + """ + return self._is_refuse + + @is_refuse.setter + def is_refuse(self, is_refuse: bool): + """Sets the is_refuse of this IngredientObjectComponents. + + Whether the component is refuse, i.e. not edible # noqa: E501 + + :param is_refuse: The is_refuse of this IngredientObjectComponents. + :type is_refuse: bool + """ + + self._is_refuse = is_refuse + + @property + def data_points(self) -> int: + """Gets the data_points of this IngredientObjectComponents. + + The number of obersvations on which the measure is based # noqa: E501 + + :return: The data_points of this IngredientObjectComponents. + :rtype: int + """ + return self._data_points + + @data_points.setter + def data_points(self, data_points: int): + """Sets the data_points of this IngredientObjectComponents. + + The number of obersvations on which the measure is based # noqa: E501 + + :param data_points: The data_points of this IngredientObjectComponents. + :type data_points: int + """ + + self._data_points = data_points diff --git a/swagger_server/models/ingredient_object_items.py b/swagger_server/models/ingredient_object_items.py index ad75070..347ef77 100644 --- a/swagger_server/models/ingredient_object_items.py +++ b/swagger_server/models/ingredient_object_items.py @@ -7,10 +7,10 @@ from swagger_server.models.base_model_ import Model from swagger_server.models.branded_food_object_calorie_conversion_factor import BrandedFoodObjectCalorieConversionFactor # noqa: F401,E501 -from swagger_server.models.branded_food_object_components import BrandedFoodObjectComponents # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels # noqa: F401,E501 -from swagger_server.models.branded_food_object_portions import BrandedFoodObjectPortions # noqa: F401,E501 +from swagger_server.models.ingredient_object_components import IngredientObjectComponents # noqa: F401,E501 from swagger_server.models.ingredient_object_nutrients import IngredientObjectNutrients # noqa: F401,E501 +from swagger_server.models.ingredient_object_portions import IngredientObjectPortions # noqa: F401,E501 from swagger_server import util @@ -19,7 +19,7 @@ class IngredientObjectItems(Model): Do not edit the class manually. """ - def __init__(self, name: str=None, categories: List[str]=None, nutrients: IngredientObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[BrandedFoodObjectComponents]=None, portions: List[BrandedFoodObjectPortions]=None, common_names: str=None, description: str=None, footnote: str=None): # noqa: E501 + def __init__(self, name: str=None, categories: List[str]=None, nutrients: IngredientObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_names: str=None, description: str=None, footnote: str=None): # noqa: E501 """IngredientObjectItems - a model defined in Swagger :param name: The name of this IngredientObjectItems. # noqa: E501 @@ -35,9 +35,9 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred :param diet_labels: The diet_labels of this IngredientObjectItems. # noqa: E501 :type diet_labels: BrandedFoodObjectDietLabels :param components: The components of this IngredientObjectItems. # noqa: E501 - :type components: List[BrandedFoodObjectComponents] + :type components: List[IngredientObjectComponents] :param portions: The portions of this IngredientObjectItems. # noqa: E501 - :type portions: List[BrandedFoodObjectPortions] + :type portions: List[IngredientObjectPortions] :param common_names: The common_names of this IngredientObjectItems. # noqa: E501 :type common_names: str :param description: The description of this IngredientObjectItems. # noqa: E501 @@ -52,8 +52,8 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred 'calorie_conversion_factor': BrandedFoodObjectCalorieConversionFactor, 'protein_conversion_factor': float, 'diet_labels': BrandedFoodObjectDietLabels, - 'components': List[BrandedFoodObjectComponents], - 'portions': List[BrandedFoodObjectPortions], + 'components': List[IngredientObjectComponents], + 'portions': List[IngredientObjectPortions], 'common_names': str, 'description': str, 'footnote': str @@ -226,47 +226,47 @@ def diet_labels(self, diet_labels: BrandedFoodObjectDietLabels): self._diet_labels = diet_labels @property - def components(self) -> List[BrandedFoodObjectComponents]: + def components(self) -> List[IngredientObjectComponents]: """Gets the components of this IngredientObjectItems. An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) # noqa: E501 :return: The components of this IngredientObjectItems. - :rtype: List[BrandedFoodObjectComponents] + :rtype: List[IngredientObjectComponents] """ return self._components @components.setter - def components(self, components: List[BrandedFoodObjectComponents]): + def components(self, components: List[IngredientObjectComponents]): """Sets the components of this IngredientObjectItems. An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) # noqa: E501 :param components: The components of this IngredientObjectItems. - :type components: List[BrandedFoodObjectComponents] + :type components: List[IngredientObjectComponents] """ self._components = components @property - def portions(self) -> List[BrandedFoodObjectPortions]: + def portions(self) -> List[IngredientObjectPortions]: """Gets the portions of this IngredientObjectItems. An array of objects containing information on discrete amounts of a food found in this item # noqa: E501 :return: The portions of this IngredientObjectItems. - :rtype: List[BrandedFoodObjectPortions] + :rtype: List[IngredientObjectPortions] """ return self._portions @portions.setter - def portions(self, portions: List[BrandedFoodObjectPortions]): + def portions(self, portions: List[IngredientObjectPortions]): """Sets the portions of this IngredientObjectItems. An array of objects containing information on discrete amounts of a food found in this item # noqa: E501 :param portions: The portions of this IngredientObjectItems. - :type portions: List[BrandedFoodObjectPortions] + :type portions: List[IngredientObjectPortions] """ self._portions = portions diff --git a/swagger_server/models/ingredient_object_portions.py b/swagger_server/models/ingredient_object_portions.py new file mode 100644 index 0000000..644529d --- /dev/null +++ b/swagger_server/models/ingredient_object_portions.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class IngredientObjectPortions(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, measurement_unit: str=None, description: str=None, modifier: str=None, gram_weight: float=None, data_points: int=None, footnote: str=None): # noqa: E501 + """IngredientObjectPortions - a model defined in Swagger + + :param measurement_unit: The measurement_unit of this IngredientObjectPortions. # noqa: E501 + :type measurement_unit: str + :param description: The description of this IngredientObjectPortions. # noqa: E501 + :type description: str + :param modifier: The modifier of this IngredientObjectPortions. # noqa: E501 + :type modifier: str + :param gram_weight: The gram_weight of this IngredientObjectPortions. # noqa: E501 + :type gram_weight: float + :param data_points: The data_points of this IngredientObjectPortions. # noqa: E501 + :type data_points: int + :param footnote: The footnote of this IngredientObjectPortions. # noqa: E501 + :type footnote: str + """ + self.swagger_types = { + 'measurement_unit': str, + 'description': str, + 'modifier': str, + 'gram_weight': float, + 'data_points': int, + 'footnote': str + } + + self.attribute_map = { + 'measurement_unit': 'measurement_unit', + 'description': 'description', + 'modifier': 'modifier', + 'gram_weight': 'gram_weight', + 'data_points': 'data_points', + 'footnote': 'footnote' + } + self._measurement_unit = measurement_unit + self._description = description + self._modifier = modifier + self._gram_weight = gram_weight + self._data_points = data_points + self._footnote = footnote + + @classmethod + def from_dict(cls, dikt) -> 'IngredientObjectPortions': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The IngredientObject_portions of this IngredientObjectPortions. # noqa: E501 + :rtype: IngredientObjectPortions + """ + return util.deserialize_model(dikt, cls) + + @property + def measurement_unit(self) -> str: + """Gets the measurement_unit of this IngredientObjectPortions. + + The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) # noqa: E501 + + :return: The measurement_unit of this IngredientObjectPortions. + :rtype: str + """ + return self._measurement_unit + + @measurement_unit.setter + def measurement_unit(self, measurement_unit: str): + """Sets the measurement_unit of this IngredientObjectPortions. + + The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) # noqa: E501 + + :param measurement_unit: The measurement_unit of this IngredientObjectPortions. + :type measurement_unit: str + """ + + self._measurement_unit = measurement_unit + + @property + def description(self) -> str: + """Gets the description of this IngredientObjectPortions. + + Comments that provide more specificity on the measure. For example, for a pizza measure the dissemination text might be 1 slice is 1/8th of a 14 inch pizza. # noqa: E501 + + :return: The description of this IngredientObjectPortions. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this IngredientObjectPortions. + + Comments that provide more specificity on the measure. For example, for a pizza measure the dissemination text might be 1 slice is 1/8th of a 14 inch pizza. # noqa: E501 + + :param description: The description of this IngredientObjectPortions. + :type description: str + """ + + self._description = description + + @property + def modifier(self) -> str: + """Gets the modifier of this IngredientObjectPortions. + + Qualifier of the measure (e.g. related to food shape or form) (e.g. melted, crushed, diced) # noqa: E501 + + :return: The modifier of this IngredientObjectPortions. + :rtype: str + """ + return self._modifier + + @modifier.setter + def modifier(self, modifier: str): + """Sets the modifier of this IngredientObjectPortions. + + Qualifier of the measure (e.g. related to food shape or form) (e.g. melted, crushed, diced) # noqa: E501 + + :param modifier: The modifier of this IngredientObjectPortions. + :type modifier: str + """ + + self._modifier = modifier + + @property + def gram_weight(self) -> float: + """Gets the gram_weight of this IngredientObjectPortions. + + The weight of the measure in grams # noqa: E501 + + :return: The gram_weight of this IngredientObjectPortions. + :rtype: float + """ + return self._gram_weight + + @gram_weight.setter + def gram_weight(self, gram_weight: float): + """Sets the gram_weight of this IngredientObjectPortions. + + The weight of the measure in grams # noqa: E501 + + :param gram_weight: The gram_weight of this IngredientObjectPortions. + :type gram_weight: float + """ + + self._gram_weight = gram_weight + + @property + def data_points(self) -> int: + """Gets the data_points of this IngredientObjectPortions. + + The number of observations on which the measure is based # noqa: E501 + + :return: The data_points of this IngredientObjectPortions. + :rtype: int + """ + return self._data_points + + @data_points.setter + def data_points(self, data_points: int): + """Sets the data_points of this IngredientObjectPortions. + + The number of observations on which the measure is based # noqa: E501 + + :param data_points: The data_points of this IngredientObjectPortions. + :type data_points: int + """ + + self._data_points = data_points + + @property + def footnote(self) -> str: + """Gets the footnote of this IngredientObjectPortions. + + Comments on any unusual aspects of the measure. Examples might includes caveats on the usage of a measure, or reasons why a measure gram weight is an unexpected value. # noqa: E501 + + :return: The footnote of this IngredientObjectPortions. + :rtype: str + """ + return self._footnote + + @footnote.setter + def footnote(self, footnote: str): + """Sets the footnote of this IngredientObjectPortions. + + Comments on any unusual aspects of the measure. Examples might includes caveats on the usage of a measure, or reasons why a measure gram weight is an unexpected value. # noqa: E501 + + :param footnote: The footnote of this IngredientObjectPortions. + :type footnote: str + """ + + self._footnote = footnote diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index b4e17b1..15b5feb 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -588,23 +588,12 @@ components: - minerals: - minerals - minerals - components: - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 - name: name - is_refuse: true - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 - name: name - is_refuse: true keywords: - keywords - keywords country_details: english_speaking: 6 - non_english_speaking: 1 + non_english_speaking: 8 description: description has_english_ingredients: true palm_oil_ingredients: @@ -693,19 +682,6 @@ components: - categories barcode: barcode brand: brand - portions: - - data_points: 3 - modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 - measurement_unit: measurement_unit - description: description - footnote: footnote - - data_points: 3 - modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 - measurement_unit: measurement_unit - description: description - footnote: footnote package: quantity: 0 size: size @@ -751,23 +727,12 @@ components: - minerals: - minerals - minerals - components: - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 - name: name - is_refuse: true - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 - name: name - is_refuse: true keywords: - keywords - keywords country_details: english_speaking: 6 - non_english_speaking: 1 + non_english_speaking: 8 description: description has_english_ingredients: true palm_oil_ingredients: @@ -856,19 +821,6 @@ components: - categories barcode: barcode brand: brand - portions: - - data_points: 3 - modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 - measurement_unit: measurement_unit - description: description - footnote: footnote - - data_points: 3 - modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 - measurement_unit: measurement_unit - description: description - footnote: footnote package: quantity: 0 size: size @@ -931,14 +883,14 @@ components: protein_value: 7.3862819483858839220147274318151175975799560546875 fat_value: 1.231513536777255612975068288506008684635162353515625 components: - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 + - data_points: 5 + pct_weight: 6.02745618307040320615897144307382404804229736328125 + gram_weight: 1.46581298050294517310021547018550336360931396484375 name: name is_refuse: true - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 + - data_points: 5 + pct_weight: 6.02745618307040320615897144307382404804229736328125 + gram_weight: 1.46581298050294517310021547018550336360931396484375 name: name is_refuse: true diet_labels: @@ -992,15 +944,15 @@ components: per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 3 + - data_points: 2 modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 5.63737665663332876420099637471139430999755859375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 3 + - data_points: 2 modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 5.63737665663332876420099637471139430999755859375 measurement_unit: measurement_unit description: description footnote: footnote @@ -1010,14 +962,14 @@ components: protein_value: 7.3862819483858839220147274318151175975799560546875 fat_value: 1.231513536777255612975068288506008684635162353515625 components: - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 + - data_points: 5 + pct_weight: 6.02745618307040320615897144307382404804229736328125 + gram_weight: 1.46581298050294517310021547018550336360931396484375 name: name is_refuse: true - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 + - data_points: 5 + pct_weight: 6.02745618307040320615897144307382404804229736328125 + gram_weight: 1.46581298050294517310021547018550336360931396484375 name: name is_refuse: true diet_labels: @@ -1071,15 +1023,15 @@ components: per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 3 + - data_points: 2 modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 5.63737665663332876420099637471139430999755859375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 3 + - data_points: 2 modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 5.63737665663332876420099637471139430999755859375 measurement_unit: measurement_unit description: description footnote: footnote @@ -1520,69 +1472,6 @@ components: small: small thumb: thumb display: display - BrandedFoodObject_components: - type: object - properties: - name: - type: string - description: The kind of component, e.g. bone - pct_weight: - type: number - description: The weight of the component as a percentage of the total weight - of the food - gram_weight: - type: number - description: The weight of the component in grams - is_refuse: - type: boolean - description: Whether the component is refuse, i.e. not edible - data_points: - type: integer - description: The number of obersvations on which the measure is based - description: An object containing information on a specific component of this - food item - example: - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 - name: name - is_refuse: true - BrandedFoodObject_portions: - type: object - properties: - measurement_unit: - type: string - description: The unit used for measure (e.g. if mesure is 3 tsp, the unit - is tsp) - description: - type: string - description: Comments that provide more specificity on the measure. For - example, for a pizza measure the dissemination text might be 1 slice is - 1/8th of a 14 inch pizza. - modifier: - type: string - description: Qualifier of the measure (e.g. related to food shape or form) - (e.g. melted, crushed, diced) - gram_weight: - type: number - description: The weight of the measure in grams - data_points: - type: integer - description: The number of observations on which the measure is based - footnote: - type: string - description: Comments on any unusual aspects of the measure. Examples might - includes caveats on the usage of a measure, or reasons why a measure gram - weight is an unexpected value. - description: An object containing information on a specific food portion found - in this item - example: - data_points: 3 - modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 - measurement_unit: measurement_unit - description: description - footnote: footnote BrandedFoodObject_country_details: type: object properties: @@ -1598,7 +1487,7 @@ components: this item is found example: english_speaking: 6 - non_english_speaking: 1 + non_english_speaking: 8 BrandedFoodObject_items: type: object properties: @@ -1639,18 +1528,6 @@ components: $ref: '#/components/schemas/BrandedFoodObject_diet_flags' packaging_photos: $ref: '#/components/schemas/BrandedFoodObject_packaging_photos' - components: - type: array - description: An array of objects containing the constituent parts of a food - (e.g. bone is a component of meat) - items: - $ref: '#/components/schemas/BrandedFoodObject_components' - portions: - type: array - description: An array of objects containing information on discrete amounts - of a food found in this item - items: - $ref: '#/components/schemas/BrandedFoodObject_portions' allergens: type: array description: An array of ingredients in this item that may cause allergic @@ -1716,23 +1593,12 @@ components: minerals: - minerals - minerals - components: - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 - name: name - is_refuse: true - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 - name: name - is_refuse: true keywords: - keywords - keywords country_details: english_speaking: 6 - non_english_speaking: 1 + non_english_speaking: 8 description: description has_english_ingredients: true palm_oil_ingredients: @@ -1821,19 +1687,6 @@ components: - categories barcode: barcode brand: brand - portions: - - data_points: 3 - modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 - measurement_unit: measurement_unit - description: description - footnote: footnote - - data_points: 3 - modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 - measurement_unit: measurement_unit - description: description - footnote: footnote package: quantity: 0 size: size @@ -1910,6 +1763,69 @@ components: id: 5 per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote + IngredientObject_components: + type: object + properties: + name: + type: string + description: The kind of component, e.g. bone + pct_weight: + type: number + description: The weight of the component as a percentage of the total weight + of the food + gram_weight: + type: number + description: The weight of the component in grams + is_refuse: + type: boolean + description: Whether the component is refuse, i.e. not edible + data_points: + type: integer + description: The number of obersvations on which the measure is based + description: An object containing information on a specific component of this + food item + example: + data_points: 5 + pct_weight: 6.02745618307040320615897144307382404804229736328125 + gram_weight: 1.46581298050294517310021547018550336360931396484375 + name: name + is_refuse: true + IngredientObject_portions: + type: object + properties: + measurement_unit: + type: string + description: The unit used for measure (e.g. if mesure is 3 tsp, the unit + is tsp) + description: + type: string + description: Comments that provide more specificity on the measure. For + example, for a pizza measure the dissemination text might be 1 slice is + 1/8th of a 14 inch pizza. + modifier: + type: string + description: Qualifier of the measure (e.g. related to food shape or form) + (e.g. melted, crushed, diced) + gram_weight: + type: number + description: The weight of the measure in grams + data_points: + type: integer + description: The number of observations on which the measure is based + footnote: + type: string + description: Comments on any unusual aspects of the measure. Examples might + includes caveats on the usage of a measure, or reasons why a measure gram + weight is an unexpected value. + description: An object containing information on a specific food portion found + in this item + example: + data_points: 2 + modifier: modifier + gram_weight: 5.63737665663332876420099637471139430999755859375 + measurement_unit: measurement_unit + description: description + footnote: footnote IngredientObject_items: type: object properties: @@ -1935,13 +1851,13 @@ components: description: An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) items: - $ref: '#/components/schemas/BrandedFoodObject_components' + $ref: '#/components/schemas/IngredientObject_components' portions: type: array description: An array of objects containing information on discrete amounts of a food found in this item items: - $ref: '#/components/schemas/BrandedFoodObject_portions' + $ref: '#/components/schemas/IngredientObject_portions' common_names: type: string description: Common names associated with this item. These generally clarify @@ -1962,14 +1878,14 @@ components: protein_value: 7.3862819483858839220147274318151175975799560546875 fat_value: 1.231513536777255612975068288506008684635162353515625 components: - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 + - data_points: 5 + pct_weight: 6.02745618307040320615897144307382404804229736328125 + gram_weight: 1.46581298050294517310021547018550336360931396484375 name: name is_refuse: true - - data_points: 9 - pct_weight: 6.683562403749608193948006373830139636993408203125 - gram_weight: 8.7620420127490010742121739895083010196685791015625 + - data_points: 5 + pct_weight: 6.02745618307040320615897144307382404804229736328125 + gram_weight: 1.46581298050294517310021547018550336360931396484375 name: name is_refuse: true diet_labels: @@ -2023,15 +1939,15 @@ components: per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 3 + - data_points: 2 modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 5.63737665663332876420099637471139430999755859375 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 3 + - data_points: 2 modifier: modifier - gram_weight: 6.438423552598546706349225132726132869720458984375 + gram_weight: 5.63737665663332876420099637471139430999755859375 measurement_unit: measurement_unit description: description footnote: footnote From 70c17b3b9c5c99944388e97c4f28ec7037525f86 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Thu, 23 Jan 2020 13:13:53 +0000 Subject: [PATCH 19/36] Generated code by SwaggerHub --- .../models/branded_food_object_items.py | 34 ++----------------- swagger_server/swagger/swagger.yaml | 7 ---- 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index 7fe1c1d..5b50134 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -23,7 +23,7 @@ class BrandedFoodObjectItems(Model): Do not edit the class manually. """ - def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None, footnote: str=None): # noqa: E501 + def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None): # noqa: E501 """BrandedFoodObjectItems - a model defined in Swagger :param barcode: The barcode of this BrandedFoodObjectItems. # noqa: E501 @@ -76,8 +76,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :type description: str :param keywords: The keywords of this BrandedFoodObjectItems. # noqa: E501 :type keywords: List[str] - :param footnote: The footnote of this BrandedFoodObjectItems. # noqa: E501 - :type footnote: str """ self.swagger_types = { 'barcode': str, @@ -104,8 +102,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'traces': List[str], 'vitamins': List[str], 'description': str, - 'keywords': List[str], - 'footnote': str + 'keywords': List[str] } self.attribute_map = { @@ -133,8 +130,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'traces': 'traces', 'vitamins': 'vitamins', 'description': 'description', - 'keywords': 'keywords', - 'footnote': 'footnote' + 'keywords': 'keywords' } self._barcode = barcode self._name = name @@ -161,7 +157,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien self._vitamins = vitamins self._description = description self._keywords = keywords - self._footnote = footnote @classmethod def from_dict(cls, dikt) -> 'BrandedFoodObjectItems': @@ -730,26 +725,3 @@ def keywords(self, keywords: List[str]): """ self._keywords = keywords - - @property - def footnote(self) -> str: - """Gets the footnote of this BrandedFoodObjectItems. - - Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. # noqa: E501 - - :return: The footnote of this BrandedFoodObjectItems. - :rtype: str - """ - return self._footnote - - @footnote.setter - def footnote(self, footnote: str): - """Sets the footnote of this BrandedFoodObjectItems. - - Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. # noqa: E501 - - :param footnote: The footnote of this BrandedFoodObjectItems. - :type footnote: str - """ - - self._footnote = footnote diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 15b5feb..a35a4b1 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -706,7 +706,6 @@ components: countries: - countries - countries - footnote: footnote allergens: - allergens - allergens @@ -845,7 +844,6 @@ components: countries: - countries - countries - footnote: footnote allergens: - allergens - allergens @@ -1584,10 +1582,6 @@ components: description: An array of keywords that can be used to describe this item items: type: string - footnote: - type: string - description: Comments on any unusual aspects of this item. Examples might - include unusual aspects of the food overall. description: An object containing information for this specific item. example: minerals: @@ -1711,7 +1705,6 @@ components: countries: - countries - countries - footnote: footnote allergens: - allergens - allergens From 475f59a67dcba55c58e5806ba88aa3fff5414cb7 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jan 2020 13:15:59 +0000 Subject: [PATCH 20/36] Removed files managed by codegen --- ...d_food_object_calorie_conversion_factor.py | 120 ------------------ 1 file changed, 120 deletions(-) delete mode 100644 swagger_server/models/branded_food_object_calorie_conversion_factor.py diff --git a/swagger_server/models/branded_food_object_calorie_conversion_factor.py b/swagger_server/models/branded_food_object_calorie_conversion_factor.py deleted file mode 100644 index bf2e09f..0000000 --- a/swagger_server/models/branded_food_object_calorie_conversion_factor.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from swagger_server.models.base_model_ import Model -from swagger_server import util - - -class BrandedFoodObjectCalorieConversionFactor(Model): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - def __init__(self, protein_value: float=None, fat_value: float=None, carbohydrate_value: float=None): # noqa: E501 - """BrandedFoodObjectCalorieConversionFactor - a model defined in Swagger - - :param protein_value: The protein_value of this BrandedFoodObjectCalorieConversionFactor. # noqa: E501 - :type protein_value: float - :param fat_value: The fat_value of this BrandedFoodObjectCalorieConversionFactor. # noqa: E501 - :type fat_value: float - :param carbohydrate_value: The carbohydrate_value of this BrandedFoodObjectCalorieConversionFactor. # noqa: E501 - :type carbohydrate_value: float - """ - self.swagger_types = { - 'protein_value': float, - 'fat_value': float, - 'carbohydrate_value': float - } - - self.attribute_map = { - 'protein_value': 'protein_value', - 'fat_value': 'fat_value', - 'carbohydrate_value': 'carbohydrate_value' - } - self._protein_value = protein_value - self._fat_value = fat_value - self._carbohydrate_value = carbohydrate_value - - @classmethod - def from_dict(cls, dikt) -> 'BrandedFoodObjectCalorieConversionFactor': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The BrandedFoodObject_calorie_conversion_factor of this BrandedFoodObjectCalorieConversionFactor. # noqa: E501 - :rtype: BrandedFoodObjectCalorieConversionFactor - """ - return util.deserialize_model(dikt, cls) - - @property - def protein_value(self) -> float: - """Gets the protein_value of this BrandedFoodObjectCalorieConversionFactor. - - The multiplication factor for protein # noqa: E501 - - :return: The protein_value of this BrandedFoodObjectCalorieConversionFactor. - :rtype: float - """ - return self._protein_value - - @protein_value.setter - def protein_value(self, protein_value: float): - """Sets the protein_value of this BrandedFoodObjectCalorieConversionFactor. - - The multiplication factor for protein # noqa: E501 - - :param protein_value: The protein_value of this BrandedFoodObjectCalorieConversionFactor. - :type protein_value: float - """ - - self._protein_value = protein_value - - @property - def fat_value(self) -> float: - """Gets the fat_value of this BrandedFoodObjectCalorieConversionFactor. - - The multiplication factor for fat # noqa: E501 - - :return: The fat_value of this BrandedFoodObjectCalorieConversionFactor. - :rtype: float - """ - return self._fat_value - - @fat_value.setter - def fat_value(self, fat_value: float): - """Sets the fat_value of this BrandedFoodObjectCalorieConversionFactor. - - The multiplication factor for fat # noqa: E501 - - :param fat_value: The fat_value of this BrandedFoodObjectCalorieConversionFactor. - :type fat_value: float - """ - - self._fat_value = fat_value - - @property - def carbohydrate_value(self) -> float: - """Gets the carbohydrate_value of this BrandedFoodObjectCalorieConversionFactor. - - The multiplication factor for carbohydrates # noqa: E501 - - :return: The carbohydrate_value of this BrandedFoodObjectCalorieConversionFactor. - :rtype: float - """ - return self._carbohydrate_value - - @carbohydrate_value.setter - def carbohydrate_value(self, carbohydrate_value: float): - """Sets the carbohydrate_value of this BrandedFoodObjectCalorieConversionFactor. - - The multiplication factor for carbohydrates # noqa: E501 - - :param carbohydrate_value: The carbohydrate_value of this BrandedFoodObjectCalorieConversionFactor. - :type carbohydrate_value: float - """ - - self._carbohydrate_value = carbohydrate_value From 1f21dcf3138bbb1f04ee4e24448c304edede08db Mon Sep 17 00:00:00 2001 From: petermerrill Date: Thu, 23 Jan 2020 13:16:02 +0000 Subject: [PATCH 21/36] Generated code by SwaggerHub --- swagger_server/models/__init__.py | 2 +- .../models/branded_food_object_items.py | 57 +-- ...edient_object_calorie_conversion_factor.py | 120 +++++ .../models/ingredient_object_items.py | 16 +- swagger_server/swagger/swagger.yaml | 432 +++++++++--------- 5 files changed, 336 insertions(+), 291 deletions(-) create mode 100644 swagger_server/models/ingredient_object_calorie_conversion_factor.py diff --git a/swagger_server/models/__init__.py b/swagger_server/models/__init__.py index 344f3b8..d71714a 100644 --- a/swagger_server/models/__init__.py +++ b/swagger_server/models/__init__.py @@ -4,7 +4,6 @@ from __future__ import absolute_import # import models into model package from swagger_server.models.branded_food_object import BrandedFoodObject -from swagger_server.models.branded_food_object_calorie_conversion_factor import BrandedFoodObjectCalorieConversionFactor from swagger_server.models.branded_food_object_country_details import BrandedFoodObjectCountryDetails from swagger_server.models.branded_food_object_diet_flags import BrandedFoodObjectDietFlags from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels @@ -25,6 +24,7 @@ from swagger_server.models.branded_food_object_serving_chomp import BrandedFoodObjectServingChomp from swagger_server.models.branded_food_object_serving_usda import BrandedFoodObjectServingUsda from swagger_server.models.ingredient_object import IngredientObject +from swagger_server.models.ingredient_object_calorie_conversion_factor import IngredientObjectCalorieConversionFactor from swagger_server.models.ingredient_object_components import IngredientObjectComponents from swagger_server.models.ingredient_object_items import IngredientObjectItems from swagger_server.models.ingredient_object_nutrients import IngredientObjectNutrients diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index 5b50134..d9cc82b 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -6,7 +6,6 @@ from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model -from swagger_server.models.branded_food_object_calorie_conversion_factor import BrandedFoodObjectCalorieConversionFactor # noqa: F401,E501 from swagger_server.models.branded_food_object_country_details import BrandedFoodObjectCountryDetails # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_flags import BrandedFoodObjectDietFlags # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels # noqa: F401,E501 @@ -23,7 +22,7 @@ class BrandedFoodObjectItems(Model): Do not edit the class manually. """ - def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None): # noqa: E501 + def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None): # noqa: E501 """BrandedFoodObjectItems - a model defined in Swagger :param barcode: The barcode of this BrandedFoodObjectItems. # noqa: E501 @@ -42,10 +41,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :type categories: List[str] :param nutrients: The nutrients of this BrandedFoodObjectItems. # noqa: E501 :type nutrients: BrandedFoodObjectNutrients - :param calorie_conversion_factor: The calorie_conversion_factor of this BrandedFoodObjectItems. # noqa: E501 - :type calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor - :param protein_conversion_factor: The protein_conversion_factor of this BrandedFoodObjectItems. # noqa: E501 - :type protein_conversion_factor: float :param diet_labels: The diet_labels of this BrandedFoodObjectItems. # noqa: E501 :type diet_labels: BrandedFoodObjectDietLabels :param diet_flags: The diet_flags of this BrandedFoodObjectItems. # noqa: E501 @@ -86,8 +81,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'serving': BrandedFoodObjectServing, 'categories': List[str], 'nutrients': BrandedFoodObjectNutrients, - 'calorie_conversion_factor': BrandedFoodObjectCalorieConversionFactor, - 'protein_conversion_factor': float, 'diet_labels': BrandedFoodObjectDietLabels, 'diet_flags': List[BrandedFoodObjectDietFlags], 'packaging_photos': BrandedFoodObjectPackagingPhotos, @@ -114,8 +107,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'serving': 'serving', 'categories': 'categories', 'nutrients': 'nutrients', - 'calorie_conversion_factor': 'calorie_conversion_factor', - 'protein_conversion_factor': 'protein_conversion_factor', 'diet_labels': 'diet_labels', 'diet_flags': 'diet_flags', 'packaging_photos': 'packaging_photos', @@ -140,8 +131,6 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien self._serving = serving self._categories = categories self._nutrients = nutrients - self._calorie_conversion_factor = calorie_conversion_factor - self._protein_conversion_factor = protein_conversion_factor self._diet_labels = diet_labels self._diet_flags = diet_flags self._packaging_photos = packaging_photos @@ -343,50 +332,6 @@ def nutrients(self, nutrients: BrandedFoodObjectNutrients): self._nutrients = nutrients - @property - def calorie_conversion_factor(self) -> BrandedFoodObjectCalorieConversionFactor: - """Gets the calorie_conversion_factor of this BrandedFoodObjectItems. - - - :return: The calorie_conversion_factor of this BrandedFoodObjectItems. - :rtype: BrandedFoodObjectCalorieConversionFactor - """ - return self._calorie_conversion_factor - - @calorie_conversion_factor.setter - def calorie_conversion_factor(self, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor): - """Sets the calorie_conversion_factor of this BrandedFoodObjectItems. - - - :param calorie_conversion_factor: The calorie_conversion_factor of this BrandedFoodObjectItems. - :type calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor - """ - - self._calorie_conversion_factor = calorie_conversion_factor - - @property - def protein_conversion_factor(self) -> float: - """Gets the protein_conversion_factor of this BrandedFoodObjectItems. - - The multiplication factor used to calculate protein from nitrogen # noqa: E501 - - :return: The protein_conversion_factor of this BrandedFoodObjectItems. - :rtype: float - """ - return self._protein_conversion_factor - - @protein_conversion_factor.setter - def protein_conversion_factor(self, protein_conversion_factor: float): - """Sets the protein_conversion_factor of this BrandedFoodObjectItems. - - The multiplication factor used to calculate protein from nitrogen # noqa: E501 - - :param protein_conversion_factor: The protein_conversion_factor of this BrandedFoodObjectItems. - :type protein_conversion_factor: float - """ - - self._protein_conversion_factor = protein_conversion_factor - @property def diet_labels(self) -> BrandedFoodObjectDietLabels: """Gets the diet_labels of this BrandedFoodObjectItems. diff --git a/swagger_server/models/ingredient_object_calorie_conversion_factor.py b/swagger_server/models/ingredient_object_calorie_conversion_factor.py new file mode 100644 index 0000000..5edb181 --- /dev/null +++ b/swagger_server/models/ingredient_object_calorie_conversion_factor.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class IngredientObjectCalorieConversionFactor(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, protein_value: float=None, fat_value: float=None, carbohydrate_value: float=None): # noqa: E501 + """IngredientObjectCalorieConversionFactor - a model defined in Swagger + + :param protein_value: The protein_value of this IngredientObjectCalorieConversionFactor. # noqa: E501 + :type protein_value: float + :param fat_value: The fat_value of this IngredientObjectCalorieConversionFactor. # noqa: E501 + :type fat_value: float + :param carbohydrate_value: The carbohydrate_value of this IngredientObjectCalorieConversionFactor. # noqa: E501 + :type carbohydrate_value: float + """ + self.swagger_types = { + 'protein_value': float, + 'fat_value': float, + 'carbohydrate_value': float + } + + self.attribute_map = { + 'protein_value': 'protein_value', + 'fat_value': 'fat_value', + 'carbohydrate_value': 'carbohydrate_value' + } + self._protein_value = protein_value + self._fat_value = fat_value + self._carbohydrate_value = carbohydrate_value + + @classmethod + def from_dict(cls, dikt) -> 'IngredientObjectCalorieConversionFactor': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The IngredientObject_calorie_conversion_factor of this IngredientObjectCalorieConversionFactor. # noqa: E501 + :rtype: IngredientObjectCalorieConversionFactor + """ + return util.deserialize_model(dikt, cls) + + @property + def protein_value(self) -> float: + """Gets the protein_value of this IngredientObjectCalorieConversionFactor. + + The multiplication factor for protein # noqa: E501 + + :return: The protein_value of this IngredientObjectCalorieConversionFactor. + :rtype: float + """ + return self._protein_value + + @protein_value.setter + def protein_value(self, protein_value: float): + """Sets the protein_value of this IngredientObjectCalorieConversionFactor. + + The multiplication factor for protein # noqa: E501 + + :param protein_value: The protein_value of this IngredientObjectCalorieConversionFactor. + :type protein_value: float + """ + + self._protein_value = protein_value + + @property + def fat_value(self) -> float: + """Gets the fat_value of this IngredientObjectCalorieConversionFactor. + + The multiplication factor for fat # noqa: E501 + + :return: The fat_value of this IngredientObjectCalorieConversionFactor. + :rtype: float + """ + return self._fat_value + + @fat_value.setter + def fat_value(self, fat_value: float): + """Sets the fat_value of this IngredientObjectCalorieConversionFactor. + + The multiplication factor for fat # noqa: E501 + + :param fat_value: The fat_value of this IngredientObjectCalorieConversionFactor. + :type fat_value: float + """ + + self._fat_value = fat_value + + @property + def carbohydrate_value(self) -> float: + """Gets the carbohydrate_value of this IngredientObjectCalorieConversionFactor. + + The multiplication factor for carbohydrates # noqa: E501 + + :return: The carbohydrate_value of this IngredientObjectCalorieConversionFactor. + :rtype: float + """ + return self._carbohydrate_value + + @carbohydrate_value.setter + def carbohydrate_value(self, carbohydrate_value: float): + """Sets the carbohydrate_value of this IngredientObjectCalorieConversionFactor. + + The multiplication factor for carbohydrates # noqa: E501 + + :param carbohydrate_value: The carbohydrate_value of this IngredientObjectCalorieConversionFactor. + :type carbohydrate_value: float + """ + + self._carbohydrate_value = carbohydrate_value diff --git a/swagger_server/models/ingredient_object_items.py b/swagger_server/models/ingredient_object_items.py index 347ef77..ecd997e 100644 --- a/swagger_server/models/ingredient_object_items.py +++ b/swagger_server/models/ingredient_object_items.py @@ -6,8 +6,8 @@ from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model -from swagger_server.models.branded_food_object_calorie_conversion_factor import BrandedFoodObjectCalorieConversionFactor # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels # noqa: F401,E501 +from swagger_server.models.ingredient_object_calorie_conversion_factor import IngredientObjectCalorieConversionFactor # noqa: F401,E501 from swagger_server.models.ingredient_object_components import IngredientObjectComponents # noqa: F401,E501 from swagger_server.models.ingredient_object_nutrients import IngredientObjectNutrients # noqa: F401,E501 from swagger_server.models.ingredient_object_portions import IngredientObjectPortions # noqa: F401,E501 @@ -19,7 +19,7 @@ class IngredientObjectItems(Model): Do not edit the class manually. """ - def __init__(self, name: str=None, categories: List[str]=None, nutrients: IngredientObjectNutrients=None, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_names: str=None, description: str=None, footnote: str=None): # noqa: E501 + def __init__(self, name: str=None, categories: List[str]=None, nutrients: IngredientObjectNutrients=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_names: str=None, description: str=None, footnote: str=None): # noqa: E501 """IngredientObjectItems - a model defined in Swagger :param name: The name of this IngredientObjectItems. # noqa: E501 @@ -29,7 +29,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred :param nutrients: The nutrients of this IngredientObjectItems. # noqa: E501 :type nutrients: IngredientObjectNutrients :param calorie_conversion_factor: The calorie_conversion_factor of this IngredientObjectItems. # noqa: E501 - :type calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor + :type calorie_conversion_factor: IngredientObjectCalorieConversionFactor :param protein_conversion_factor: The protein_conversion_factor of this IngredientObjectItems. # noqa: E501 :type protein_conversion_factor: float :param diet_labels: The diet_labels of this IngredientObjectItems. # noqa: E501 @@ -49,7 +49,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred 'name': str, 'categories': List[str], 'nutrients': IngredientObjectNutrients, - 'calorie_conversion_factor': BrandedFoodObjectCalorieConversionFactor, + 'calorie_conversion_factor': IngredientObjectCalorieConversionFactor, 'protein_conversion_factor': float, 'diet_labels': BrandedFoodObjectDietLabels, 'components': List[IngredientObjectComponents], @@ -161,22 +161,22 @@ def nutrients(self, nutrients: IngredientObjectNutrients): self._nutrients = nutrients @property - def calorie_conversion_factor(self) -> BrandedFoodObjectCalorieConversionFactor: + def calorie_conversion_factor(self) -> IngredientObjectCalorieConversionFactor: """Gets the calorie_conversion_factor of this IngredientObjectItems. :return: The calorie_conversion_factor of this IngredientObjectItems. - :rtype: BrandedFoodObjectCalorieConversionFactor + :rtype: IngredientObjectCalorieConversionFactor """ return self._calorie_conversion_factor @calorie_conversion_factor.setter - def calorie_conversion_factor(self, calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor): + def calorie_conversion_factor(self, calorie_conversion_factor: IngredientObjectCalorieConversionFactor): """Sets the calorie_conversion_factor of this IngredientObjectItems. :param calorie_conversion_factor: The calorie_conversion_factor of this IngredientObjectItems. - :type calorie_conversion_factor: BrandedFoodObjectCalorieConversionFactor + :type calorie_conversion_factor: IngredientObjectCalorieConversionFactor """ self._calorie_conversion_factor = calorie_conversion_factor diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index a35a4b1..ae419bf 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -588,13 +588,37 @@ components: - minerals: - minerals - minerals + package: + quantity: 0 + size: size keywords: - keywords - keywords country_details: - english_speaking: 6 - non_english_speaking: 8 + english_speaking: 4 + non_english_speaking: 5 + traces: + - traces + - traces description: description + diet_flags: + - ingredient: ingredient + is_allergen: true + ingredient_description: ingredient_description + compatibility_level: 1 + is_compatible: is_compatible + diet_label: diet_label + compatibility_description: compatibility_description + - ingredient: ingredient + is_allergen: true + ingredient_description: ingredient_description + compatibility_level: 1 + is_compatible: is_compatible + diet_label: diet_label + compatibility_description: compatibility_description + countries: + - countries + - countries has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients @@ -641,7 +665,9 @@ components: id: 5 per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - protein_conversion_factor: 1.489415909854170383397331534069962799549102783203125 + allergens: + - allergens + - allergens packaging_photos: nutrition: small: small @@ -655,25 +681,32 @@ components: small: small thumb: thumb display: display + ingredient_list: + - ingredient_list + - ingredient_list + vitamins: + - vitamins + - vitamins diet_labels: vegetarian: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 7 + confidence: 1 name: name - compatibility_level: 6 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 9 + confidence: 7 name: name - compatibility_level: 5 + compatibility_level: 6 is_compatible: true + name: name ingredients: chomp: chomp usda: usda @@ -682,57 +715,43 @@ components: - categories barcode: barcode brand: brand + brand_list: + - brand_list + - brand_list + - minerals: + - minerals + - minerals package: quantity: 0 size: size + keywords: + - keywords + - keywords + country_details: + english_speaking: 4 + non_english_speaking: 5 traces: - traces - traces + description: description diet_flags: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 1 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 1 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description countries: - countries - countries - allergens: - - allergens - - allergens - calorie_conversion_factor: - carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 - protein_value: 7.3862819483858839220147274318151175975799560546875 - fat_value: 1.231513536777255612975068288506008684635162353515625 - ingredient_list: - - ingredient_list - - ingredient_list - vitamins: - - vitamins - - vitamins - name: name - brand_list: - - brand_list - - brand_list - - minerals: - - minerals - - minerals - keywords: - - keywords - - keywords - country_details: - english_speaking: 6 - non_english_speaking: 8 - description: description has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients @@ -779,7 +798,9 @@ components: id: 5 per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - protein_conversion_factor: 1.489415909854170383397331534069962799549102783203125 + allergens: + - allergens + - allergens packaging_photos: nutrition: small: small @@ -793,25 +814,32 @@ components: small: small thumb: thumb display: display + ingredient_list: + - ingredient_list + - ingredient_list + vitamins: + - vitamins + - vitamins diet_labels: vegetarian: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 7 + confidence: 1 name: name - compatibility_level: 6 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 9 + confidence: 7 name: name - compatibility_level: 5 + compatibility_level: 6 is_compatible: true + name: name ingredients: chomp: chomp usda: usda @@ -820,44 +848,6 @@ components: - categories barcode: barcode brand: brand - package: - quantity: 0 - size: size - traces: - - traces - - traces - diet_flags: - - ingredient: ingredient - is_allergen: true - ingredient_description: ingredient_description - compatibility_level: 9 - is_compatible: is_compatible - diet_label: diet_label - compatibility_description: compatibility_description - - ingredient: ingredient - is_allergen: true - ingredient_description: ingredient_description - compatibility_level: 9 - is_compatible: is_compatible - diet_label: diet_label - compatibility_description: compatibility_description - countries: - - countries - - countries - allergens: - - allergens - - allergens - calorie_conversion_factor: - carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 - protein_value: 7.3862819483858839220147274318151175975799560546875 - fat_value: 1.231513536777255612975068288506008684635162353515625 - ingredient_list: - - ingredient_list - - ingredient_list - vitamins: - - vitamins - - vitamins - name: name brand_list: - brand_list - brand_list @@ -875,40 +865,40 @@ components: an unknown state or that no data exists. example: items: - - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 + - protein_conversion_factor: 5.962133916683182377482808078639209270477294921875 calorie_conversion_factor: - carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 - protein_value: 7.3862819483858839220147274318151175975799560546875 - fat_value: 1.231513536777255612975068288506008684635162353515625 + carbohydrate_value: 1.46581298050294517310021547018550336360931396484375 + protein_value: 0.80082819046101150206595775671303272247314453125 + fat_value: 6.02745618307040320615897144307382404804229736328125 components: - - data_points: 5 - pct_weight: 6.02745618307040320615897144307382404804229736328125 - gram_weight: 1.46581298050294517310021547018550336360931396484375 + - data_points: 7 + pct_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 2.3021358869347654518833223846741020679473876953125 name: name is_refuse: true - - data_points: 5 - pct_weight: 6.02745618307040320615897144307382404804229736328125 - gram_weight: 1.46581298050294517310021547018550336360931396484375 + - data_points: 7 + pct_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 2.3021358869347654518833223846741020679473876953125 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 7 + confidence: 1 name: name - compatibility_level: 6 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 9 + confidence: 7 name: name - compatibility_level: 5 + compatibility_level: 6 is_compatible: true name: name common_names: common_names @@ -942,52 +932,52 @@ components: per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 2 + - data_points: 3 modifier: modifier - gram_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 9.301444243932575517419536481611430644989013671875 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 3 modifier: modifier - gram_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 9.301444243932575517419536481611430644989013671875 measurement_unit: measurement_unit description: description footnote: footnote - - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 + - protein_conversion_factor: 5.962133916683182377482808078639209270477294921875 calorie_conversion_factor: - carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 - protein_value: 7.3862819483858839220147274318151175975799560546875 - fat_value: 1.231513536777255612975068288506008684635162353515625 + carbohydrate_value: 1.46581298050294517310021547018550336360931396484375 + protein_value: 0.80082819046101150206595775671303272247314453125 + fat_value: 6.02745618307040320615897144307382404804229736328125 components: - - data_points: 5 - pct_weight: 6.02745618307040320615897144307382404804229736328125 - gram_weight: 1.46581298050294517310021547018550336360931396484375 + - data_points: 7 + pct_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 2.3021358869347654518833223846741020679473876953125 name: name is_refuse: true - - data_points: 5 - pct_weight: 6.02745618307040320615897144307382404804229736328125 - gram_weight: 1.46581298050294517310021547018550336360931396484375 + - data_points: 7 + pct_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 2.3021358869347654518833223846741020679473876953125 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 7 + confidence: 1 name: name - compatibility_level: 6 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 9 + confidence: 7 name: name - compatibility_level: 5 + compatibility_level: 6 is_compatible: true name: name common_names: common_names @@ -1021,15 +1011,15 @@ components: per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 2 + - data_points: 3 modifier: modifier - gram_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 9.301444243932575517419536481611430644989013671875 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 3 modifier: modifier - gram_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 9.301444243932575517419536481611430644989013671875 measurement_unit: measurement_unit description: description footnote: footnote @@ -1227,24 +1217,6 @@ components: id: 5 per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - BrandedFoodObject_calorie_conversion_factor: - type: object - properties: - protein_value: - type: number - description: The multiplication factor for protein - fat_value: - type: number - description: The multiplication factor for fat - carbohydrate_value: - type: number - description: The multiplication factor for carbohydrates - description: An object containing the multiplication factors to be used when - calculating energy from macronutrients for a specific food. - example: - carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 - protein_value: 7.3862819483858839220147274318151175975799560546875 - fat_value: 1.231513536777255612975068288506008684635162353515625 BrandedFoodObject_diet_labels_vegan: type: object properties: @@ -1269,9 +1241,9 @@ components: the Vegan diets example: confidence_description: confidence_description - confidence: 7 + confidence: 1 name: name - compatibility_level: 6 + compatibility_level: 7 is_compatible: true BrandedFoodObject_diet_labels_vegetarian: type: object @@ -1297,7 +1269,7 @@ components: Vegetarian diets example: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name compatibility_level: 1 is_compatible: true @@ -1325,9 +1297,9 @@ components: Gluten Free diets example: confidence_description: confidence_description - confidence: 9 + confidence: 7 name: name - compatibility_level: 5 + compatibility_level: 6 is_compatible: true BrandedFoodObject_diet_labels: type: object @@ -1343,21 +1315,21 @@ components: example: vegetarian: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 7 + confidence: 1 name: name - compatibility_level: 6 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 9 + confidence: 7 name: name - compatibility_level: 5 + compatibility_level: 6 is_compatible: true BrandedFoodObject_diet_flags: type: object @@ -1392,7 +1364,7 @@ components: ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 9 + compatibility_level: 1 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1484,8 +1456,8 @@ components: description: An object containing additional information on the countries where this item is found example: - english_speaking: 6 - non_english_speaking: 8 + english_speaking: 4 + non_english_speaking: 5 BrandedFoodObject_items: type: object properties: @@ -1511,11 +1483,6 @@ components: description: An array of categories for this item nutrients: $ref: '#/components/schemas/BrandedFoodObject_nutrients' - calorie_conversion_factor: - $ref: '#/components/schemas/BrandedFoodObject_calorie_conversion_factor' - protein_conversion_factor: - type: number - description: The multiplication factor used to calculate protein from nitrogen diet_labels: $ref: '#/components/schemas/BrandedFoodObject_diet_labels' diet_flags: @@ -1587,13 +1554,37 @@ components: minerals: - minerals - minerals + package: + quantity: 0 + size: size keywords: - keywords - keywords country_details: - english_speaking: 6 - non_english_speaking: 8 + english_speaking: 4 + non_english_speaking: 5 + traces: + - traces + - traces description: description + diet_flags: + - ingredient: ingredient + is_allergen: true + ingredient_description: ingredient_description + compatibility_level: 1 + is_compatible: is_compatible + diet_label: diet_label + compatibility_description: compatibility_description + - ingredient: ingredient + is_allergen: true + ingredient_description: ingredient_description + compatibility_level: 1 + is_compatible: is_compatible + diet_label: diet_label + compatibility_description: compatibility_description + countries: + - countries + - countries has_english_ingredients: true palm_oil_ingredients: - palm_oil_ingredients @@ -1640,7 +1631,9 @@ components: id: 5 per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote - protein_conversion_factor: 1.489415909854170383397331534069962799549102783203125 + allergens: + - allergens + - allergens packaging_photos: nutrition: small: small @@ -1654,25 +1647,32 @@ components: small: small thumb: thumb display: display + ingredient_list: + - ingredient_list + - ingredient_list + vitamins: + - vitamins + - vitamins diet_labels: vegetarian: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 7 + confidence: 1 name: name - compatibility_level: 6 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 9 + confidence: 7 name: name - compatibility_level: 5 + compatibility_level: 6 is_compatible: true + name: name ingredients: chomp: chomp usda: usda @@ -1681,44 +1681,6 @@ components: - categories barcode: barcode brand: brand - package: - quantity: 0 - size: size - traces: - - traces - - traces - diet_flags: - - ingredient: ingredient - is_allergen: true - ingredient_description: ingredient_description - compatibility_level: 9 - is_compatible: is_compatible - diet_label: diet_label - compatibility_description: compatibility_description - - ingredient: ingredient - is_allergen: true - ingredient_description: ingredient_description - compatibility_level: 9 - is_compatible: is_compatible - diet_label: diet_label - compatibility_description: compatibility_description - countries: - - countries - - countries - allergens: - - allergens - - allergens - calorie_conversion_factor: - carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 - protein_value: 7.3862819483858839220147274318151175975799560546875 - fat_value: 1.231513536777255612975068288506008684635162353515625 - ingredient_list: - - ingredient_list - - ingredient_list - vitamins: - - vitamins - - vitamins - name: name brand_list: - brand_list - brand_list @@ -1756,6 +1718,24 @@ components: id: 5 per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote + IngredientObject_calorie_conversion_factor: + type: object + properties: + protein_value: + type: number + description: The multiplication factor for protein + fat_value: + type: number + description: The multiplication factor for fat + carbohydrate_value: + type: number + description: The multiplication factor for carbohydrates + description: An object containing the multiplication factors to be used when + calculating energy from macronutrients for a specific food. + example: + carbohydrate_value: 1.46581298050294517310021547018550336360931396484375 + protein_value: 0.80082819046101150206595775671303272247314453125 + fat_value: 6.02745618307040320615897144307382404804229736328125 IngredientObject_components: type: object properties: @@ -1778,9 +1758,9 @@ components: description: An object containing information on a specific component of this food item example: - data_points: 5 - pct_weight: 6.02745618307040320615897144307382404804229736328125 - gram_weight: 1.46581298050294517310021547018550336360931396484375 + data_points: 7 + pct_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 2.3021358869347654518833223846741020679473876953125 name: name is_refuse: true IngredientObject_portions: @@ -1813,9 +1793,9 @@ components: description: An object containing information on a specific food portion found in this item example: - data_points: 2 + data_points: 3 modifier: modifier - gram_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 9.301444243932575517419536481611430644989013671875 measurement_unit: measurement_unit description: description footnote: footnote @@ -1833,7 +1813,7 @@ components: nutrients: $ref: '#/components/schemas/IngredientObject_nutrients' calorie_conversion_factor: - $ref: '#/components/schemas/BrandedFoodObject_calorie_conversion_factor' + $ref: '#/components/schemas/IngredientObject_calorie_conversion_factor' protein_conversion_factor: type: number description: The multiplication factor used to calculate protein from nitrogen @@ -1865,40 +1845,40 @@ components: include unusual aspects of the food overall. description: An object containing information for this specific item. example: - protein_conversion_factor: 0.80082819046101150206595775671303272247314453125 + protein_conversion_factor: 5.962133916683182377482808078639209270477294921875 calorie_conversion_factor: - carbohydrate_value: 1.024645700144157789424070870154537260532379150390625 - protein_value: 7.3862819483858839220147274318151175975799560546875 - fat_value: 1.231513536777255612975068288506008684635162353515625 + carbohydrate_value: 1.46581298050294517310021547018550336360931396484375 + protein_value: 0.80082819046101150206595775671303272247314453125 + fat_value: 6.02745618307040320615897144307382404804229736328125 components: - - data_points: 5 - pct_weight: 6.02745618307040320615897144307382404804229736328125 - gram_weight: 1.46581298050294517310021547018550336360931396484375 + - data_points: 7 + pct_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 2.3021358869347654518833223846741020679473876953125 name: name is_refuse: true - - data_points: 5 - pct_weight: 6.02745618307040320615897144307382404804229736328125 - gram_weight: 1.46581298050294517310021547018550336360931396484375 + - data_points: 7 + pct_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 2.3021358869347654518833223846741020679473876953125 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 4 + confidence: 1 name: name compatibility_level: 1 is_compatible: true vegan: confidence_description: confidence_description - confidence: 7 + confidence: 1 name: name - compatibility_level: 6 + compatibility_level: 7 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 9 + confidence: 7 name: name - compatibility_level: 5 + compatibility_level: 6 is_compatible: true name: name common_names: common_names @@ -1932,15 +1912,15 @@ components: per_100g: 2.3021358869347654518833223846741020679473876953125 footnote: footnote portions: - - data_points: 2 + - data_points: 3 modifier: modifier - gram_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 9.301444243932575517419536481611430644989013671875 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 2 + - data_points: 3 modifier: modifier - gram_weight: 5.63737665663332876420099637471139430999755859375 + gram_weight: 9.301444243932575517419536481611430644989013671875 measurement_unit: measurement_unit description: description footnote: footnote From d800ea8f51230c9010178f80ca3352d2d1eb9b6e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jan 2020 13:57:42 +0000 Subject: [PATCH 22/36] Removed files managed by codegen --- .../models/branded_food_object_ingredients.py | 92 ----- .../branded_food_object_nutrients_chomp.py | 176 --------- .../branded_food_object_nutrients_usda.py | 344 ------------------ .../branded_food_object_serving_chomp.py | 64 ---- .../branded_food_object_serving_usda.py | 120 ------ 5 files changed, 796 deletions(-) delete mode 100644 swagger_server/models/branded_food_object_ingredients.py delete mode 100644 swagger_server/models/branded_food_object_nutrients_chomp.py delete mode 100644 swagger_server/models/branded_food_object_nutrients_usda.py delete mode 100644 swagger_server/models/branded_food_object_serving_chomp.py delete mode 100644 swagger_server/models/branded_food_object_serving_usda.py diff --git a/swagger_server/models/branded_food_object_ingredients.py b/swagger_server/models/branded_food_object_ingredients.py deleted file mode 100644 index 04f153b..0000000 --- a/swagger_server/models/branded_food_object_ingredients.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from swagger_server.models.base_model_ import Model -from swagger_server import util - - -class BrandedFoodObjectIngredients(Model): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - def __init__(self, chomp: str=None, usda: str=None): # noqa: E501 - """BrandedFoodObjectIngredients - a model defined in Swagger - - :param chomp: The chomp of this BrandedFoodObjectIngredients. # noqa: E501 - :type chomp: str - :param usda: The usda of this BrandedFoodObjectIngredients. # noqa: E501 - :type usda: str - """ - self.swagger_types = { - 'chomp': str, - 'usda': str - } - - self.attribute_map = { - 'chomp': 'chomp', - 'usda': 'usda' - } - self._chomp = chomp - self._usda = usda - - @classmethod - def from_dict(cls, dikt) -> 'BrandedFoodObjectIngredients': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The BrandedFoodObject_ingredients of this BrandedFoodObjectIngredients. # noqa: E501 - :rtype: BrandedFoodObjectIngredients - """ - return util.deserialize_model(dikt, cls) - - @property - def chomp(self) -> str: - """Gets the chomp of this BrandedFoodObjectIngredients. - - Ingredients for this item from Chomp's internal database # noqa: E501 - - :return: The chomp of this BrandedFoodObjectIngredients. - :rtype: str - """ - return self._chomp - - @chomp.setter - def chomp(self, chomp: str): - """Sets the chomp of this BrandedFoodObjectIngredients. - - Ingredients for this item from Chomp's internal database # noqa: E501 - - :param chomp: The chomp of this BrandedFoodObjectIngredients. - :type chomp: str - """ - - self._chomp = chomp - - @property - def usda(self) -> str: - """Gets the usda of this BrandedFoodObjectIngredients. - - This branded food item's ingredients, according to the USDA # noqa: E501 - - :return: The usda of this BrandedFoodObjectIngredients. - :rtype: str - """ - return self._usda - - @usda.setter - def usda(self, usda: str): - """Sets the usda of this BrandedFoodObjectIngredients. - - This branded food item's ingredients, according to the USDA # noqa: E501 - - :param usda: The usda of this BrandedFoodObjectIngredients. - :type usda: str - """ - - self._usda = usda diff --git a/swagger_server/models/branded_food_object_nutrients_chomp.py b/swagger_server/models/branded_food_object_nutrients_chomp.py deleted file mode 100644 index ba4eb9d..0000000 --- a/swagger_server/models/branded_food_object_nutrients_chomp.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from swagger_server.models.base_model_ import Model -from swagger_server import util - - -class BrandedFoodObjectNutrientsChomp(Model): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - def __init__(self, name: str=None, measurement_unit: str=None, per_100g: float=None, per_serving: float=None, total: float=None): # noqa: E501 - """BrandedFoodObjectNutrientsChomp - a model defined in Swagger - - :param name: The name of this BrandedFoodObjectNutrientsChomp. # noqa: E501 - :type name: str - :param measurement_unit: The measurement_unit of this BrandedFoodObjectNutrientsChomp. # noqa: E501 - :type measurement_unit: str - :param per_100g: The per_100g of this BrandedFoodObjectNutrientsChomp. # noqa: E501 - :type per_100g: float - :param per_serving: The per_serving of this BrandedFoodObjectNutrientsChomp. # noqa: E501 - :type per_serving: float - :param total: The total of this BrandedFoodObjectNutrientsChomp. # noqa: E501 - :type total: float - """ - self.swagger_types = { - 'name': str, - 'measurement_unit': str, - 'per_100g': float, - 'per_serving': float, - 'total': float - } - - self.attribute_map = { - 'name': 'name', - 'measurement_unit': 'measurement_unit', - 'per_100g': 'per_100g', - 'per_serving': 'per_serving', - 'total': 'total' - } - self._name = name - self._measurement_unit = measurement_unit - self._per_100g = per_100g - self._per_serving = per_serving - self._total = total - - @classmethod - def from_dict(cls, dikt) -> 'BrandedFoodObjectNutrientsChomp': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The BrandedFoodObject_nutrients_chomp of this BrandedFoodObjectNutrientsChomp. # noqa: E501 - :rtype: BrandedFoodObjectNutrientsChomp - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this BrandedFoodObjectNutrientsChomp. - - Nutrient name # noqa: E501 - - :return: The name of this BrandedFoodObjectNutrientsChomp. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this BrandedFoodObjectNutrientsChomp. - - Nutrient name # noqa: E501 - - :param name: The name of this BrandedFoodObjectNutrientsChomp. - :type name: str - """ - - self._name = name - - @property - def measurement_unit(self) -> str: - """Gets the measurement_unit of this BrandedFoodObjectNutrientsChomp. - - The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) # noqa: E501 - - :return: The measurement_unit of this BrandedFoodObjectNutrientsChomp. - :rtype: str - """ - return self._measurement_unit - - @measurement_unit.setter - def measurement_unit(self, measurement_unit: str): - """Sets the measurement_unit of this BrandedFoodObjectNutrientsChomp. - - The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) # noqa: E501 - - :param measurement_unit: The measurement_unit of this BrandedFoodObjectNutrientsChomp. - :type measurement_unit: str - """ - - self._measurement_unit = measurement_unit - - @property - def per_100g(self) -> float: - """Gets the per_100g of this BrandedFoodObjectNutrientsChomp. - - Amount of the nutrient per 100g of food # noqa: E501 - - :return: The per_100g of this BrandedFoodObjectNutrientsChomp. - :rtype: float - """ - return self._per_100g - - @per_100g.setter - def per_100g(self, per_100g: float): - """Sets the per_100g of this BrandedFoodObjectNutrientsChomp. - - Amount of the nutrient per 100g of food # noqa: E501 - - :param per_100g: The per_100g of this BrandedFoodObjectNutrientsChomp. - :type per_100g: float - """ - - self._per_100g = per_100g - - @property - def per_serving(self) -> float: - """Gets the per_serving of this BrandedFoodObjectNutrientsChomp. - - Nutrient value per serving # noqa: E501 - - :return: The per_serving of this BrandedFoodObjectNutrientsChomp. - :rtype: float - """ - return self._per_serving - - @per_serving.setter - def per_serving(self, per_serving: float): - """Sets the per_serving of this BrandedFoodObjectNutrientsChomp. - - Nutrient value per serving # noqa: E501 - - :param per_serving: The per_serving of this BrandedFoodObjectNutrientsChomp. - :type per_serving: float - """ - - self._per_serving = per_serving - - @property - def total(self) -> float: - """Gets the total of this BrandedFoodObjectNutrientsChomp. - - Total nutrient value # noqa: E501 - - :return: The total of this BrandedFoodObjectNutrientsChomp. - :rtype: float - """ - return self._total - - @total.setter - def total(self, total: float): - """Sets the total of this BrandedFoodObjectNutrientsChomp. - - Total nutrient value # noqa: E501 - - :param total: The total of this BrandedFoodObjectNutrientsChomp. - :type total: float - """ - - self._total = total diff --git a/swagger_server/models/branded_food_object_nutrients_usda.py b/swagger_server/models/branded_food_object_nutrients_usda.py deleted file mode 100644 index abbc4d8..0000000 --- a/swagger_server/models/branded_food_object_nutrients_usda.py +++ /dev/null @@ -1,344 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from swagger_server.models.base_model_ import Model -from swagger_server import util - - -class BrandedFoodObjectNutrientsUsda(Model): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - def __init__(self, id: int=None, name: str=None, per_100g: float=None, measurement_unit: str=None, min: float=None, max: float=None, median: float=None, rank: int=None, data_points: int=None, footnote: str=None, description: str=None): # noqa: E501 - """BrandedFoodObjectNutrientsUsda - a model defined in Swagger - - :param id: The id of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type id: int - :param name: The name of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type name: str - :param per_100g: The per_100g of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type per_100g: float - :param measurement_unit: The measurement_unit of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type measurement_unit: str - :param min: The min of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type min: float - :param max: The max of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type max: float - :param median: The median of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type median: float - :param rank: The rank of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type rank: int - :param data_points: The data_points of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type data_points: int - :param footnote: The footnote of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type footnote: str - :param description: The description of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :type description: str - """ - self.swagger_types = { - 'id': int, - 'name': str, - 'per_100g': float, - 'measurement_unit': str, - 'min': float, - 'max': float, - 'median': float, - 'rank': int, - 'data_points': int, - 'footnote': str, - 'description': str - } - - self.attribute_map = { - 'id': 'id', - 'name': 'name', - 'per_100g': 'per_100g', - 'measurement_unit': 'measurement_unit', - 'min': 'min', - 'max': 'max', - 'median': 'median', - 'rank': 'rank', - 'data_points': 'data_points', - 'footnote': 'footnote', - 'description': 'description' - } - self._id = id - self._name = name - self._per_100g = per_100g - self._measurement_unit = measurement_unit - self._min = min - self._max = max - self._median = median - self._rank = rank - self._data_points = data_points - self._footnote = footnote - self._description = description - - @classmethod - def from_dict(cls, dikt) -> 'BrandedFoodObjectNutrientsUsda': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The BrandedFoodObject_nutrients_usda of this BrandedFoodObjectNutrientsUsda. # noqa: E501 - :rtype: BrandedFoodObjectNutrientsUsda - """ - return util.deserialize_model(dikt, cls) - - @property - def id(self) -> int: - """Gets the id of this BrandedFoodObjectNutrientsUsda. - - Nutrient ID # noqa: E501 - - :return: The id of this BrandedFoodObjectNutrientsUsda. - :rtype: int - """ - return self._id - - @id.setter - def id(self, id: int): - """Sets the id of this BrandedFoodObjectNutrientsUsda. - - Nutrient ID # noqa: E501 - - :param id: The id of this BrandedFoodObjectNutrientsUsda. - :type id: int - """ - - self._id = id - - @property - def name(self) -> str: - """Gets the name of this BrandedFoodObjectNutrientsUsda. - - Nutrient name # noqa: E501 - - :return: The name of this BrandedFoodObjectNutrientsUsda. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this BrandedFoodObjectNutrientsUsda. - - Nutrient name # noqa: E501 - - :param name: The name of this BrandedFoodObjectNutrientsUsda. - :type name: str - """ - - self._name = name - - @property - def per_100g(self) -> float: - """Gets the per_100g of this BrandedFoodObjectNutrientsUsda. - - Amount of the nutrient per 100g of food # noqa: E501 - - :return: The per_100g of this BrandedFoodObjectNutrientsUsda. - :rtype: float - """ - return self._per_100g - - @per_100g.setter - def per_100g(self, per_100g: float): - """Sets the per_100g of this BrandedFoodObjectNutrientsUsda. - - Amount of the nutrient per 100g of food # noqa: E501 - - :param per_100g: The per_100g of this BrandedFoodObjectNutrientsUsda. - :type per_100g: float - """ - - self._per_100g = per_100g - - @property - def measurement_unit(self) -> str: - """Gets the measurement_unit of this BrandedFoodObjectNutrientsUsda. - - The unit used for the measure of this nutrient # noqa: E501 - - :return: The measurement_unit of this BrandedFoodObjectNutrientsUsda. - :rtype: str - """ - return self._measurement_unit - - @measurement_unit.setter - def measurement_unit(self, measurement_unit: str): - """Sets the measurement_unit of this BrandedFoodObjectNutrientsUsda. - - The unit used for the measure of this nutrient # noqa: E501 - - :param measurement_unit: The measurement_unit of this BrandedFoodObjectNutrientsUsda. - :type measurement_unit: str - """ - - self._measurement_unit = measurement_unit - - @property - def min(self) -> float: - """Gets the min of this BrandedFoodObjectNutrientsUsda. - - Minimum nutrient value # noqa: E501 - - :return: The min of this BrandedFoodObjectNutrientsUsda. - :rtype: float - """ - return self._min - - @min.setter - def min(self, min: float): - """Sets the min of this BrandedFoodObjectNutrientsUsda. - - Minimum nutrient value # noqa: E501 - - :param min: The min of this BrandedFoodObjectNutrientsUsda. - :type min: float - """ - - self._min = min - - @property - def max(self) -> float: - """Gets the max of this BrandedFoodObjectNutrientsUsda. - - Maximum nutrient value # noqa: E501 - - :return: The max of this BrandedFoodObjectNutrientsUsda. - :rtype: float - """ - return self._max - - @max.setter - def max(self, max: float): - """Sets the max of this BrandedFoodObjectNutrientsUsda. - - Maximum nutrient value # noqa: E501 - - :param max: The max of this BrandedFoodObjectNutrientsUsda. - :type max: float - """ - - self._max = max - - @property - def median(self) -> float: - """Gets the median of this BrandedFoodObjectNutrientsUsda. - - Median nutrient value # noqa: E501 - - :return: The median of this BrandedFoodObjectNutrientsUsda. - :rtype: float - """ - return self._median - - @median.setter - def median(self, median: float): - """Sets the median of this BrandedFoodObjectNutrientsUsda. - - Median nutrient value # noqa: E501 - - :param median: The median of this BrandedFoodObjectNutrientsUsda. - :type median: float - """ - - self._median = median - - @property - def rank(self) -> int: - """Gets the rank of this BrandedFoodObjectNutrientsUsda. - - Nutrient rank # noqa: E501 - - :return: The rank of this BrandedFoodObjectNutrientsUsda. - :rtype: int - """ - return self._rank - - @rank.setter - def rank(self, rank: int): - """Sets the rank of this BrandedFoodObjectNutrientsUsda. - - Nutrient rank # noqa: E501 - - :param rank: The rank of this BrandedFoodObjectNutrientsUsda. - :type rank: int - """ - - self._rank = rank - - @property - def data_points(self) -> int: - """Gets the data_points of this BrandedFoodObjectNutrientsUsda. - - Number of observations on which the value is based # noqa: E501 - - :return: The data_points of this BrandedFoodObjectNutrientsUsda. - :rtype: int - """ - return self._data_points - - @data_points.setter - def data_points(self, data_points: int): - """Sets the data_points of this BrandedFoodObjectNutrientsUsda. - - Number of observations on which the value is based # noqa: E501 - - :param data_points: The data_points of this BrandedFoodObjectNutrientsUsda. - :type data_points: int - """ - - self._data_points = data_points - - @property - def footnote(self) -> str: - """Gets the footnote of this BrandedFoodObjectNutrientsUsda. - - Comments on any unusual aspect of the food nutrient. Examples might include why a nutrient value is different than typically expected. # noqa: E501 - - :return: The footnote of this BrandedFoodObjectNutrientsUsda. - :rtype: str - """ - return self._footnote - - @footnote.setter - def footnote(self, footnote: str): - """Sets the footnote of this BrandedFoodObjectNutrientsUsda. - - Comments on any unusual aspect of the food nutrient. Examples might include why a nutrient value is different than typically expected. # noqa: E501 - - :param footnote: The footnote of this BrandedFoodObjectNutrientsUsda. - :type footnote: str - """ - - self._footnote = footnote - - @property - def description(self) -> str: - """Gets the description of this BrandedFoodObjectNutrientsUsda. - - Description of the nutrient source # noqa: E501 - - :return: The description of this BrandedFoodObjectNutrientsUsda. - :rtype: str - """ - return self._description - - @description.setter - def description(self, description: str): - """Sets the description of this BrandedFoodObjectNutrientsUsda. - - Description of the nutrient source # noqa: E501 - - :param description: The description of this BrandedFoodObjectNutrientsUsda. - :type description: str - """ - - self._description = description diff --git a/swagger_server/models/branded_food_object_serving_chomp.py b/swagger_server/models/branded_food_object_serving_chomp.py deleted file mode 100644 index 3d1a8e0..0000000 --- a/swagger_server/models/branded_food_object_serving_chomp.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from swagger_server.models.base_model_ import Model -from swagger_server import util - - -class BrandedFoodObjectServingChomp(Model): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - def __init__(self, size: str=None): # noqa: E501 - """BrandedFoodObjectServingChomp - a model defined in Swagger - - :param size: The size of this BrandedFoodObjectServingChomp. # noqa: E501 - :type size: str - """ - self.swagger_types = { - 'size': str - } - - self.attribute_map = { - 'size': 'size' - } - self._size = size - - @classmethod - def from_dict(cls, dikt) -> 'BrandedFoodObjectServingChomp': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The BrandedFoodObject_serving_chomp of this BrandedFoodObjectServingChomp. # noqa: E501 - :rtype: BrandedFoodObjectServingChomp - """ - return util.deserialize_model(dikt, cls) - - @property - def size(self) -> str: - """Gets the size of this BrandedFoodObjectServingChomp. - - Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - - :return: The size of this BrandedFoodObjectServingChomp. - :rtype: str - """ - return self._size - - @size.setter - def size(self, size: str): - """Sets the size of this BrandedFoodObjectServingChomp. - - Serving size with measurement unit (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - - :param size: The size of this BrandedFoodObjectServingChomp. - :type size: str - """ - - self._size = size diff --git a/swagger_server/models/branded_food_object_serving_usda.py b/swagger_server/models/branded_food_object_serving_usda.py deleted file mode 100644 index e29c418..0000000 --- a/swagger_server/models/branded_food_object_serving_usda.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from swagger_server.models.base_model_ import Model -from swagger_server import util - - -class BrandedFoodObjectServingUsda(Model): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - def __init__(self, size: str=None, measurement_unit: str=None, size_fulltext: str=None): # noqa: E501 - """BrandedFoodObjectServingUsda - a model defined in Swagger - - :param size: The size of this BrandedFoodObjectServingUsda. # noqa: E501 - :type size: str - :param measurement_unit: The measurement_unit of this BrandedFoodObjectServingUsda. # noqa: E501 - :type measurement_unit: str - :param size_fulltext: The size_fulltext of this BrandedFoodObjectServingUsda. # noqa: E501 - :type size_fulltext: str - """ - self.swagger_types = { - 'size': str, - 'measurement_unit': str, - 'size_fulltext': str - } - - self.attribute_map = { - 'size': 'size', - 'measurement_unit': 'measurement_unit', - 'size_fulltext': 'size_fulltext' - } - self._size = size - self._measurement_unit = measurement_unit - self._size_fulltext = size_fulltext - - @classmethod - def from_dict(cls, dikt) -> 'BrandedFoodObjectServingUsda': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The BrandedFoodObject_serving_usda of this BrandedFoodObjectServingUsda. # noqa: E501 - :rtype: BrandedFoodObjectServingUsda - """ - return util.deserialize_model(dikt, cls) - - @property - def size(self) -> str: - """Gets the size of this BrandedFoodObjectServingUsda. - - Serving size # noqa: E501 - - :return: The size of this BrandedFoodObjectServingUsda. - :rtype: str - """ - return self._size - - @size.setter - def size(self, size: str): - """Sets the size of this BrandedFoodObjectServingUsda. - - Serving size # noqa: E501 - - :param size: The size of this BrandedFoodObjectServingUsda. - :type size: str - """ - - self._size = size - - @property - def measurement_unit(self) -> str: - """Gets the measurement_unit of this BrandedFoodObjectServingUsda. - - Measurement unit for each serving (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - - :return: The measurement_unit of this BrandedFoodObjectServingUsda. - :rtype: str - """ - return self._measurement_unit - - @measurement_unit.setter - def measurement_unit(self, measurement_unit: str): - """Sets the measurement_unit of this BrandedFoodObjectServingUsda. - - Measurement unit for each serving (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - - :param measurement_unit: The measurement_unit of this BrandedFoodObjectServingUsda. - :type measurement_unit: str - """ - - self._measurement_unit = measurement_unit - - @property - def size_fulltext(self) -> str: - """Gets the size_fulltext of this BrandedFoodObjectServingUsda. - - Serving size description # noqa: E501 - - :return: The size_fulltext of this BrandedFoodObjectServingUsda. - :rtype: str - """ - return self._size_fulltext - - @size_fulltext.setter - def size_fulltext(self, size_fulltext: str): - """Sets the size_fulltext of this BrandedFoodObjectServingUsda. - - Serving size description # noqa: E501 - - :param size_fulltext: The size_fulltext of this BrandedFoodObjectServingUsda. - :type size_fulltext: str - """ - - self._size_fulltext = size_fulltext From 1f433d004c4cef68e4d8ddd021d8044008e9085c Mon Sep 17 00:00:00 2001 From: petermerrill Date: Thu, 23 Jan 2020 13:57:45 +0000 Subject: [PATCH 23/36] Generated code by SwaggerHub --- .../controllers/default_controller.py | 15 - swagger_server/models/__init__.py | 5 - .../models/branded_food_object_items.py | 31 +- .../models/branded_food_object_nutrients.py | 188 +++- .../models/branded_food_object_serving.py | 100 ++- .../models/ingredient_object_items.py | 16 +- .../models/ingredient_object_nutrients.py | 291 +++++- swagger_server/swagger/swagger.yaml | 842 ++++++------------ .../test/test_default_controller.py | 14 - 9 files changed, 795 insertions(+), 707 deletions(-) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index f943e72..bf90219 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -19,21 +19,6 @@ def food_branded_barcode_php_get(code): # noqa: E501 return 'do some magic!' -def food_branded_id_php_get(id, source=None): # noqa: E501 - """Get a branded food item using an ID number - - ## Get data for a branded food using Chomp's internal ID number. **Example** > ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID``` **Tips** * Find a food's ID by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. * Alternatively, set the \"source\" parameter to \"USDA\" and use the food's FDC ID. # noqa: E501 - - :param id: #### The ID number of a branded food item. **Example #1: Using Chomp ID** > ```&id=15``` **Example #2: Using FDC ID** > ```&id=FDC_ID&source=USDA``` - :type id: int - :param source: #### Configure the endpoint to accept food IDs from various data sources. This endpoint defaults to Chomp but can accept FDC IDs. **Example** > ```&source=Chomp``` **Tips** * Pass in ```&source=USDA``` if you want to look up food items using a USDA FDC ID. - :type source: str - - :rtype: BrandedFoodObject - """ - return 'do some magic!' - - def food_branded_name_php_get(name, limit=None, page=None): # noqa: E501 """Get a branded food item by name diff --git a/swagger_server/models/__init__.py b/swagger_server/models/__init__.py index d71714a..abdbcd0 100644 --- a/swagger_server/models/__init__.py +++ b/swagger_server/models/__init__.py @@ -10,19 +10,14 @@ from swagger_server.models.branded_food_object_diet_labels_gluten_free import BrandedFoodObjectDietLabelsGlutenFree from swagger_server.models.branded_food_object_diet_labels_vegan import BrandedFoodObjectDietLabelsVegan from swagger_server.models.branded_food_object_diet_labels_vegetarian import BrandedFoodObjectDietLabelsVegetarian -from swagger_server.models.branded_food_object_ingredients import BrandedFoodObjectIngredients from swagger_server.models.branded_food_object_items import BrandedFoodObjectItems from swagger_server.models.branded_food_object_nutrients import BrandedFoodObjectNutrients -from swagger_server.models.branded_food_object_nutrients_chomp import BrandedFoodObjectNutrientsChomp -from swagger_server.models.branded_food_object_nutrients_usda import BrandedFoodObjectNutrientsUsda from swagger_server.models.branded_food_object_package import BrandedFoodObjectPackage from swagger_server.models.branded_food_object_packaging_photos import BrandedFoodObjectPackagingPhotos from swagger_server.models.branded_food_object_packaging_photos_front import BrandedFoodObjectPackagingPhotosFront from swagger_server.models.branded_food_object_packaging_photos_ingredients import BrandedFoodObjectPackagingPhotosIngredients from swagger_server.models.branded_food_object_packaging_photos_nutrition import BrandedFoodObjectPackagingPhotosNutrition from swagger_server.models.branded_food_object_serving import BrandedFoodObjectServing -from swagger_server.models.branded_food_object_serving_chomp import BrandedFoodObjectServingChomp -from swagger_server.models.branded_food_object_serving_usda import BrandedFoodObjectServingUsda from swagger_server.models.ingredient_object import IngredientObject from swagger_server.models.ingredient_object_calorie_conversion_factor import IngredientObjectCalorieConversionFactor from swagger_server.models.ingredient_object_components import IngredientObjectComponents diff --git a/swagger_server/models/branded_food_object_items.py b/swagger_server/models/branded_food_object_items.py index d9cc82b..f8c9302 100644 --- a/swagger_server/models/branded_food_object_items.py +++ b/swagger_server/models/branded_food_object_items.py @@ -9,7 +9,6 @@ from swagger_server.models.branded_food_object_country_details import BrandedFoodObjectCountryDetails # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_flags import BrandedFoodObjectDietFlags # noqa: F401,E501 from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels # noqa: F401,E501 -from swagger_server.models.branded_food_object_ingredients import BrandedFoodObjectIngredients # noqa: F401,E501 from swagger_server.models.branded_food_object_nutrients import BrandedFoodObjectNutrients # noqa: F401,E501 from swagger_server.models.branded_food_object_package import BrandedFoodObjectPackage # noqa: F401,E501 from swagger_server.models.branded_food_object_packaging_photos import BrandedFoodObjectPackagingPhotos # noqa: F401,E501 @@ -22,7 +21,7 @@ class BrandedFoodObjectItems(Model): Do not edit the class manually. """ - def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: BrandedFoodObjectIngredients=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: BrandedFoodObjectNutrients=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None): # noqa: E501 + def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredients: str=None, package: BrandedFoodObjectPackage=None, serving: BrandedFoodObjectServing=None, categories: List[str]=None, nutrients: List[BrandedFoodObjectNutrients]=None, diet_labels: BrandedFoodObjectDietLabels=None, diet_flags: List[BrandedFoodObjectDietFlags]=None, packaging_photos: BrandedFoodObjectPackagingPhotos=None, allergens: List[str]=None, brand_list: List[str]=None, countries: List[str]=None, country_details: BrandedFoodObjectCountryDetails=None, palm_oil_ingredients: List[str]=None, ingredient_list: List[str]=None, has_english_ingredients: bool=None, minerals: List[str]=None, traces: List[str]=None, vitamins: List[str]=None, description: str=None, keywords: List[str]=None): # noqa: E501 """BrandedFoodObjectItems - a model defined in Swagger :param barcode: The barcode of this BrandedFoodObjectItems. # noqa: E501 @@ -32,7 +31,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :param brand: The brand of this BrandedFoodObjectItems. # noqa: E501 :type brand: str :param ingredients: The ingredients of this BrandedFoodObjectItems. # noqa: E501 - :type ingredients: BrandedFoodObjectIngredients + :type ingredients: str :param package: The package of this BrandedFoodObjectItems. # noqa: E501 :type package: BrandedFoodObjectPackage :param serving: The serving of this BrandedFoodObjectItems. # noqa: E501 @@ -40,7 +39,7 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien :param categories: The categories of this BrandedFoodObjectItems. # noqa: E501 :type categories: List[str] :param nutrients: The nutrients of this BrandedFoodObjectItems. # noqa: E501 - :type nutrients: BrandedFoodObjectNutrients + :type nutrients: List[BrandedFoodObjectNutrients] :param diet_labels: The diet_labels of this BrandedFoodObjectItems. # noqa: E501 :type diet_labels: BrandedFoodObjectDietLabels :param diet_flags: The diet_flags of this BrandedFoodObjectItems. # noqa: E501 @@ -76,11 +75,11 @@ def __init__(self, barcode: str=None, name: str=None, brand: str=None, ingredien 'barcode': str, 'name': str, 'brand': str, - 'ingredients': BrandedFoodObjectIngredients, + 'ingredients': str, 'package': BrandedFoodObjectPackage, 'serving': BrandedFoodObjectServing, 'categories': List[str], - 'nutrients': BrandedFoodObjectNutrients, + 'nutrients': List[BrandedFoodObjectNutrients], 'diet_labels': BrandedFoodObjectDietLabels, 'diet_flags': List[BrandedFoodObjectDietFlags], 'packaging_photos': BrandedFoodObjectPackagingPhotos, @@ -228,22 +227,24 @@ def brand(self, brand: str): self._brand = brand @property - def ingredients(self) -> BrandedFoodObjectIngredients: + def ingredients(self) -> str: """Gets the ingredients of this BrandedFoodObjectItems. + This food item's ingredients from greatest quantity to least # noqa: E501 :return: The ingredients of this BrandedFoodObjectItems. - :rtype: BrandedFoodObjectIngredients + :rtype: str """ return self._ingredients @ingredients.setter - def ingredients(self, ingredients: BrandedFoodObjectIngredients): + def ingredients(self, ingredients: str): """Sets the ingredients of this BrandedFoodObjectItems. + This food item's ingredients from greatest quantity to least # noqa: E501 :param ingredients: The ingredients of this BrandedFoodObjectItems. - :type ingredients: BrandedFoodObjectIngredients + :type ingredients: str """ self._ingredients = ingredients @@ -312,22 +313,24 @@ def categories(self, categories: List[str]): self._categories = categories @property - def nutrients(self) -> BrandedFoodObjectNutrients: + def nutrients(self) -> List[BrandedFoodObjectNutrients]: """Gets the nutrients of this BrandedFoodObjectItems. + An array containing nutrient informatio objects for this food item # noqa: E501 :return: The nutrients of this BrandedFoodObjectItems. - :rtype: BrandedFoodObjectNutrients + :rtype: List[BrandedFoodObjectNutrients] """ return self._nutrients @nutrients.setter - def nutrients(self, nutrients: BrandedFoodObjectNutrients): + def nutrients(self, nutrients: List[BrandedFoodObjectNutrients]): """Sets the nutrients of this BrandedFoodObjectItems. + An array containing nutrient informatio objects for this food item # noqa: E501 :param nutrients: The nutrients of this BrandedFoodObjectItems. - :type nutrients: BrandedFoodObjectNutrients + :type nutrients: List[BrandedFoodObjectNutrients] """ self._nutrients = nutrients diff --git a/swagger_server/models/branded_food_object_nutrients.py b/swagger_server/models/branded_food_object_nutrients.py index ef08507..156056c 100644 --- a/swagger_server/models/branded_food_object_nutrients.py +++ b/swagger_server/models/branded_food_object_nutrients.py @@ -6,8 +6,6 @@ from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model -from swagger_server.models.branded_food_object_nutrients_chomp import BrandedFoodObjectNutrientsChomp # noqa: F401,E501 -from swagger_server.models.branded_food_object_nutrients_usda import BrandedFoodObjectNutrientsUsda # noqa: F401,E501 from swagger_server import util @@ -16,25 +14,45 @@ class BrandedFoodObjectNutrients(Model): Do not edit the class manually. """ - def __init__(self, chomp: List[BrandedFoodObjectNutrientsChomp]=None, usda: List[BrandedFoodObjectNutrientsUsda]=None): # noqa: E501 + def __init__(self, name: str=None, per_100g: float=None, measurement_unit: str=None, rank: int=None, data_points: int=None, description: str=None): # noqa: E501 """BrandedFoodObjectNutrients - a model defined in Swagger - :param chomp: The chomp of this BrandedFoodObjectNutrients. # noqa: E501 - :type chomp: List[BrandedFoodObjectNutrientsChomp] - :param usda: The usda of this BrandedFoodObjectNutrients. # noqa: E501 - :type usda: List[BrandedFoodObjectNutrientsUsda] + :param name: The name of this BrandedFoodObjectNutrients. # noqa: E501 + :type name: str + :param per_100g: The per_100g of this BrandedFoodObjectNutrients. # noqa: E501 + :type per_100g: float + :param measurement_unit: The measurement_unit of this BrandedFoodObjectNutrients. # noqa: E501 + :type measurement_unit: str + :param rank: The rank of this BrandedFoodObjectNutrients. # noqa: E501 + :type rank: int + :param data_points: The data_points of this BrandedFoodObjectNutrients. # noqa: E501 + :type data_points: int + :param description: The description of this BrandedFoodObjectNutrients. # noqa: E501 + :type description: str """ self.swagger_types = { - 'chomp': List[BrandedFoodObjectNutrientsChomp], - 'usda': List[BrandedFoodObjectNutrientsUsda] + 'name': str, + 'per_100g': float, + 'measurement_unit': str, + 'rank': int, + 'data_points': int, + 'description': str } self.attribute_map = { - 'chomp': 'chomp', - 'usda': 'usda' + 'name': 'name', + 'per_100g': 'per_100g', + 'measurement_unit': 'measurement_unit', + 'rank': 'rank', + 'data_points': 'data_points', + 'description': 'description' } - self._chomp = chomp - self._usda = usda + self._name = name + self._per_100g = per_100g + self._measurement_unit = measurement_unit + self._rank = rank + self._data_points = data_points + self._description = description @classmethod def from_dict(cls, dikt) -> 'BrandedFoodObjectNutrients': @@ -48,47 +66,139 @@ def from_dict(cls, dikt) -> 'BrandedFoodObjectNutrients': return util.deserialize_model(dikt, cls) @property - def chomp(self) -> List[BrandedFoodObjectNutrientsChomp]: - """Gets the chomp of this BrandedFoodObjectNutrients. + def name(self) -> str: + """Gets the name of this BrandedFoodObjectNutrients. - An array containing an object for each nutrient data point # noqa: E501 + Nutrient name # noqa: E501 - :return: The chomp of this BrandedFoodObjectNutrients. - :rtype: List[BrandedFoodObjectNutrientsChomp] + :return: The name of this BrandedFoodObjectNutrients. + :rtype: str """ - return self._chomp + return self._name - @chomp.setter - def chomp(self, chomp: List[BrandedFoodObjectNutrientsChomp]): - """Sets the chomp of this BrandedFoodObjectNutrients. + @name.setter + def name(self, name: str): + """Sets the name of this BrandedFoodObjectNutrients. - An array containing an object for each nutrient data point # noqa: E501 + Nutrient name # noqa: E501 - :param chomp: The chomp of this BrandedFoodObjectNutrients. - :type chomp: List[BrandedFoodObjectNutrientsChomp] + :param name: The name of this BrandedFoodObjectNutrients. + :type name: str """ - self._chomp = chomp + self._name = name @property - def usda(self) -> List[BrandedFoodObjectNutrientsUsda]: - """Gets the usda of this BrandedFoodObjectNutrients. + def per_100g(self) -> float: + """Gets the per_100g of this BrandedFoodObjectNutrients. - An array containing an object for each nutrient data point as found in the USDA database # noqa: E501 + Amount of the nutrient per 100g of food # noqa: E501 - :return: The usda of this BrandedFoodObjectNutrients. - :rtype: List[BrandedFoodObjectNutrientsUsda] + :return: The per_100g of this BrandedFoodObjectNutrients. + :rtype: float """ - return self._usda + return self._per_100g - @usda.setter - def usda(self, usda: List[BrandedFoodObjectNutrientsUsda]): - """Sets the usda of this BrandedFoodObjectNutrients. + @per_100g.setter + def per_100g(self, per_100g: float): + """Sets the per_100g of this BrandedFoodObjectNutrients. - An array containing an object for each nutrient data point as found in the USDA database # noqa: E501 + Amount of the nutrient per 100g of food # noqa: E501 - :param usda: The usda of this BrandedFoodObjectNutrients. - :type usda: List[BrandedFoodObjectNutrientsUsda] + :param per_100g: The per_100g of this BrandedFoodObjectNutrients. + :type per_100g: float """ - self._usda = usda + self._per_100g = per_100g + + @property + def measurement_unit(self) -> str: + """Gets the measurement_unit of this BrandedFoodObjectNutrients. + + The unit used for the measure of this nutrient # noqa: E501 + + :return: The measurement_unit of this BrandedFoodObjectNutrients. + :rtype: str + """ + return self._measurement_unit + + @measurement_unit.setter + def measurement_unit(self, measurement_unit: str): + """Sets the measurement_unit of this BrandedFoodObjectNutrients. + + The unit used for the measure of this nutrient # noqa: E501 + + :param measurement_unit: The measurement_unit of this BrandedFoodObjectNutrients. + :type measurement_unit: str + """ + + self._measurement_unit = measurement_unit + + @property + def rank(self) -> int: + """Gets the rank of this BrandedFoodObjectNutrients. + + Nutrient rank # noqa: E501 + + :return: The rank of this BrandedFoodObjectNutrients. + :rtype: int + """ + return self._rank + + @rank.setter + def rank(self, rank: int): + """Sets the rank of this BrandedFoodObjectNutrients. + + Nutrient rank # noqa: E501 + + :param rank: The rank of this BrandedFoodObjectNutrients. + :type rank: int + """ + + self._rank = rank + + @property + def data_points(self) -> int: + """Gets the data_points of this BrandedFoodObjectNutrients. + + Number of observations on which the value is based # noqa: E501 + + :return: The data_points of this BrandedFoodObjectNutrients. + :rtype: int + """ + return self._data_points + + @data_points.setter + def data_points(self, data_points: int): + """Sets the data_points of this BrandedFoodObjectNutrients. + + Number of observations on which the value is based # noqa: E501 + + :param data_points: The data_points of this BrandedFoodObjectNutrients. + :type data_points: int + """ + + self._data_points = data_points + + @property + def description(self) -> str: + """Gets the description of this BrandedFoodObjectNutrients. + + Description of the nutrient source # noqa: E501 + + :return: The description of this BrandedFoodObjectNutrients. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this BrandedFoodObjectNutrients. + + Description of the nutrient source # noqa: E501 + + :param description: The description of this BrandedFoodObjectNutrients. + :type description: str + """ + + self._description = description diff --git a/swagger_server/models/branded_food_object_serving.py b/swagger_server/models/branded_food_object_serving.py index 93a0942..c5ac4aa 100644 --- a/swagger_server/models/branded_food_object_serving.py +++ b/swagger_server/models/branded_food_object_serving.py @@ -6,8 +6,6 @@ from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model -from swagger_server.models.branded_food_object_serving_chomp import BrandedFoodObjectServingChomp # noqa: F401,E501 -from swagger_server.models.branded_food_object_serving_usda import BrandedFoodObjectServingUsda # noqa: F401,E501 from swagger_server import util @@ -16,25 +14,30 @@ class BrandedFoodObjectServing(Model): Do not edit the class manually. """ - def __init__(self, chomp: BrandedFoodObjectServingChomp=None, usda: BrandedFoodObjectServingUsda=None): # noqa: E501 + def __init__(self, size: str=None, measurement_unit: str=None, size_fulltext: str=None): # noqa: E501 """BrandedFoodObjectServing - a model defined in Swagger - :param chomp: The chomp of this BrandedFoodObjectServing. # noqa: E501 - :type chomp: BrandedFoodObjectServingChomp - :param usda: The usda of this BrandedFoodObjectServing. # noqa: E501 - :type usda: BrandedFoodObjectServingUsda + :param size: The size of this BrandedFoodObjectServing. # noqa: E501 + :type size: str + :param measurement_unit: The measurement_unit of this BrandedFoodObjectServing. # noqa: E501 + :type measurement_unit: str + :param size_fulltext: The size_fulltext of this BrandedFoodObjectServing. # noqa: E501 + :type size_fulltext: str """ self.swagger_types = { - 'chomp': BrandedFoodObjectServingChomp, - 'usda': BrandedFoodObjectServingUsda + 'size': str, + 'measurement_unit': str, + 'size_fulltext': str } self.attribute_map = { - 'chomp': 'chomp', - 'usda': 'usda' + 'size': 'size', + 'measurement_unit': 'measurement_unit', + 'size_fulltext': 'size_fulltext' } - self._chomp = chomp - self._usda = usda + self._size = size + self._measurement_unit = measurement_unit + self._size_fulltext = size_fulltext @classmethod def from_dict(cls, dikt) -> 'BrandedFoodObjectServing': @@ -48,43 +51,70 @@ def from_dict(cls, dikt) -> 'BrandedFoodObjectServing': return util.deserialize_model(dikt, cls) @property - def chomp(self) -> BrandedFoodObjectServingChomp: - """Gets the chomp of this BrandedFoodObjectServing. + def size(self) -> str: + """Gets the size of this BrandedFoodObjectServing. + Serving size # noqa: E501 - :return: The chomp of this BrandedFoodObjectServing. - :rtype: BrandedFoodObjectServingChomp + :return: The size of this BrandedFoodObjectServing. + :rtype: str """ - return self._chomp + return self._size - @chomp.setter - def chomp(self, chomp: BrandedFoodObjectServingChomp): - """Sets the chomp of this BrandedFoodObjectServing. + @size.setter + def size(self, size: str): + """Sets the size of this BrandedFoodObjectServing. + Serving size # noqa: E501 - :param chomp: The chomp of this BrandedFoodObjectServing. - :type chomp: BrandedFoodObjectServingChomp + :param size: The size of this BrandedFoodObjectServing. + :type size: str """ - self._chomp = chomp + self._size = size @property - def usda(self) -> BrandedFoodObjectServingUsda: - """Gets the usda of this BrandedFoodObjectServing. + def measurement_unit(self) -> str: + """Gets the measurement_unit of this BrandedFoodObjectServing. + Measurement unit for each serving (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - :return: The usda of this BrandedFoodObjectServing. - :rtype: BrandedFoodObjectServingUsda + :return: The measurement_unit of this BrandedFoodObjectServing. + :rtype: str """ - return self._usda + return self._measurement_unit - @usda.setter - def usda(self, usda: BrandedFoodObjectServingUsda): - """Sets the usda of this BrandedFoodObjectServing. + @measurement_unit.setter + def measurement_unit(self, measurement_unit: str): + """Sets the measurement_unit of this BrandedFoodObjectServing. + Measurement unit for each serving (e.g. if measure is 3 tsp, the unit is tsp) # noqa: E501 - :param usda: The usda of this BrandedFoodObjectServing. - :type usda: BrandedFoodObjectServingUsda + :param measurement_unit: The measurement_unit of this BrandedFoodObjectServing. + :type measurement_unit: str """ - self._usda = usda + self._measurement_unit = measurement_unit + + @property + def size_fulltext(self) -> str: + """Gets the size_fulltext of this BrandedFoodObjectServing. + + Serving size description # noqa: E501 + + :return: The size_fulltext of this BrandedFoodObjectServing. + :rtype: str + """ + return self._size_fulltext + + @size_fulltext.setter + def size_fulltext(self, size_fulltext: str): + """Sets the size_fulltext of this BrandedFoodObjectServing. + + Serving size description # noqa: E501 + + :param size_fulltext: The size_fulltext of this BrandedFoodObjectServing. + :type size_fulltext: str + """ + + self._size_fulltext = size_fulltext diff --git a/swagger_server/models/ingredient_object_items.py b/swagger_server/models/ingredient_object_items.py index ecd997e..889d394 100644 --- a/swagger_server/models/ingredient_object_items.py +++ b/swagger_server/models/ingredient_object_items.py @@ -19,7 +19,7 @@ class IngredientObjectItems(Model): Do not edit the class manually. """ - def __init__(self, name: str=None, categories: List[str]=None, nutrients: IngredientObjectNutrients=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_names: str=None, description: str=None, footnote: str=None): # noqa: E501 + def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[IngredientObjectNutrients]=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_names: str=None, description: str=None, footnote: str=None): # noqa: E501 """IngredientObjectItems - a model defined in Swagger :param name: The name of this IngredientObjectItems. # noqa: E501 @@ -27,7 +27,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred :param categories: The categories of this IngredientObjectItems. # noqa: E501 :type categories: List[str] :param nutrients: The nutrients of this IngredientObjectItems. # noqa: E501 - :type nutrients: IngredientObjectNutrients + :type nutrients: List[IngredientObjectNutrients] :param calorie_conversion_factor: The calorie_conversion_factor of this IngredientObjectItems. # noqa: E501 :type calorie_conversion_factor: IngredientObjectCalorieConversionFactor :param protein_conversion_factor: The protein_conversion_factor of this IngredientObjectItems. # noqa: E501 @@ -48,7 +48,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: Ingred self.swagger_types = { 'name': str, 'categories': List[str], - 'nutrients': IngredientObjectNutrients, + 'nutrients': List[IngredientObjectNutrients], 'calorie_conversion_factor': IngredientObjectCalorieConversionFactor, 'protein_conversion_factor': float, 'diet_labels': BrandedFoodObjectDietLabels, @@ -140,22 +140,24 @@ def categories(self, categories: List[str]): self._categories = categories @property - def nutrients(self) -> IngredientObjectNutrients: + def nutrients(self) -> List[IngredientObjectNutrients]: """Gets the nutrients of this IngredientObjectItems. + An array containing nutrient informatio objects for this food item # noqa: E501 :return: The nutrients of this IngredientObjectItems. - :rtype: IngredientObjectNutrients + :rtype: List[IngredientObjectNutrients] """ return self._nutrients @nutrients.setter - def nutrients(self, nutrients: IngredientObjectNutrients): + def nutrients(self, nutrients: List[IngredientObjectNutrients]): """Sets the nutrients of this IngredientObjectItems. + An array containing nutrient informatio objects for this food item # noqa: E501 :param nutrients: The nutrients of this IngredientObjectItems. - :type nutrients: IngredientObjectNutrients + :type nutrients: List[IngredientObjectNutrients] """ self._nutrients = nutrients diff --git a/swagger_server/models/ingredient_object_nutrients.py b/swagger_server/models/ingredient_object_nutrients.py index b9153ef..e625573 100644 --- a/swagger_server/models/ingredient_object_nutrients.py +++ b/swagger_server/models/ingredient_object_nutrients.py @@ -6,7 +6,6 @@ from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model -from swagger_server.models.branded_food_object_nutrients_usda import BrandedFoodObjectNutrientsUsda # noqa: F401,E501 from swagger_server import util @@ -15,20 +14,65 @@ class IngredientObjectNutrients(Model): Do not edit the class manually. """ - def __init__(self, usda: List[BrandedFoodObjectNutrientsUsda]=None): # noqa: E501 + def __init__(self, name: str=None, per_100g: float=None, measurement_unit: str=None, min: float=None, max: float=None, median: float=None, rank: int=None, data_points: int=None, footnote: str=None, description: str=None): # noqa: E501 """IngredientObjectNutrients - a model defined in Swagger - :param usda: The usda of this IngredientObjectNutrients. # noqa: E501 - :type usda: List[BrandedFoodObjectNutrientsUsda] + :param name: The name of this IngredientObjectNutrients. # noqa: E501 + :type name: str + :param per_100g: The per_100g of this IngredientObjectNutrients. # noqa: E501 + :type per_100g: float + :param measurement_unit: The measurement_unit of this IngredientObjectNutrients. # noqa: E501 + :type measurement_unit: str + :param min: The min of this IngredientObjectNutrients. # noqa: E501 + :type min: float + :param max: The max of this IngredientObjectNutrients. # noqa: E501 + :type max: float + :param median: The median of this IngredientObjectNutrients. # noqa: E501 + :type median: float + :param rank: The rank of this IngredientObjectNutrients. # noqa: E501 + :type rank: int + :param data_points: The data_points of this IngredientObjectNutrients. # noqa: E501 + :type data_points: int + :param footnote: The footnote of this IngredientObjectNutrients. # noqa: E501 + :type footnote: str + :param description: The description of this IngredientObjectNutrients. # noqa: E501 + :type description: str """ self.swagger_types = { - 'usda': List[BrandedFoodObjectNutrientsUsda] + 'name': str, + 'per_100g': float, + 'measurement_unit': str, + 'min': float, + 'max': float, + 'median': float, + 'rank': int, + 'data_points': int, + 'footnote': str, + 'description': str } self.attribute_map = { - 'usda': 'usda' + 'name': 'name', + 'per_100g': 'per_100g', + 'measurement_unit': 'measurement_unit', + 'min': 'min', + 'max': 'max', + 'median': 'median', + 'rank': 'rank', + 'data_points': 'data_points', + 'footnote': 'footnote', + 'description': 'description' } - self._usda = usda + self._name = name + self._per_100g = per_100g + self._measurement_unit = measurement_unit + self._min = min + self._max = max + self._median = median + self._rank = rank + self._data_points = data_points + self._footnote = footnote + self._description = description @classmethod def from_dict(cls, dikt) -> 'IngredientObjectNutrients': @@ -42,24 +86,231 @@ def from_dict(cls, dikt) -> 'IngredientObjectNutrients': return util.deserialize_model(dikt, cls) @property - def usda(self) -> List[BrandedFoodObjectNutrientsUsda]: - """Gets the usda of this IngredientObjectNutrients. + def name(self) -> str: + """Gets the name of this IngredientObjectNutrients. - An array containing an object for each nutrient data point as found in the USDA database # noqa: E501 + Nutrient name # noqa: E501 - :return: The usda of this IngredientObjectNutrients. - :rtype: List[BrandedFoodObjectNutrientsUsda] + :return: The name of this IngredientObjectNutrients. + :rtype: str """ - return self._usda + return self._name - @usda.setter - def usda(self, usda: List[BrandedFoodObjectNutrientsUsda]): - """Sets the usda of this IngredientObjectNutrients. + @name.setter + def name(self, name: str): + """Sets the name of this IngredientObjectNutrients. - An array containing an object for each nutrient data point as found in the USDA database # noqa: E501 + Nutrient name # noqa: E501 - :param usda: The usda of this IngredientObjectNutrients. - :type usda: List[BrandedFoodObjectNutrientsUsda] + :param name: The name of this IngredientObjectNutrients. + :type name: str """ - self._usda = usda + self._name = name + + @property + def per_100g(self) -> float: + """Gets the per_100g of this IngredientObjectNutrients. + + Amount of the nutrient per 100g of food # noqa: E501 + + :return: The per_100g of this IngredientObjectNutrients. + :rtype: float + """ + return self._per_100g + + @per_100g.setter + def per_100g(self, per_100g: float): + """Sets the per_100g of this IngredientObjectNutrients. + + Amount of the nutrient per 100g of food # noqa: E501 + + :param per_100g: The per_100g of this IngredientObjectNutrients. + :type per_100g: float + """ + + self._per_100g = per_100g + + @property + def measurement_unit(self) -> str: + """Gets the measurement_unit of this IngredientObjectNutrients. + + The unit used for the measure of this nutrient # noqa: E501 + + :return: The measurement_unit of this IngredientObjectNutrients. + :rtype: str + """ + return self._measurement_unit + + @measurement_unit.setter + def measurement_unit(self, measurement_unit: str): + """Sets the measurement_unit of this IngredientObjectNutrients. + + The unit used for the measure of this nutrient # noqa: E501 + + :param measurement_unit: The measurement_unit of this IngredientObjectNutrients. + :type measurement_unit: str + """ + + self._measurement_unit = measurement_unit + + @property + def min(self) -> float: + """Gets the min of this IngredientObjectNutrients. + + Minimum nutrient value # noqa: E501 + + :return: The min of this IngredientObjectNutrients. + :rtype: float + """ + return self._min + + @min.setter + def min(self, min: float): + """Sets the min of this IngredientObjectNutrients. + + Minimum nutrient value # noqa: E501 + + :param min: The min of this IngredientObjectNutrients. + :type min: float + """ + + self._min = min + + @property + def max(self) -> float: + """Gets the max of this IngredientObjectNutrients. + + Maximum nutrient value # noqa: E501 + + :return: The max of this IngredientObjectNutrients. + :rtype: float + """ + return self._max + + @max.setter + def max(self, max: float): + """Sets the max of this IngredientObjectNutrients. + + Maximum nutrient value # noqa: E501 + + :param max: The max of this IngredientObjectNutrients. + :type max: float + """ + + self._max = max + + @property + def median(self) -> float: + """Gets the median of this IngredientObjectNutrients. + + Median nutrient value # noqa: E501 + + :return: The median of this IngredientObjectNutrients. + :rtype: float + """ + return self._median + + @median.setter + def median(self, median: float): + """Sets the median of this IngredientObjectNutrients. + + Median nutrient value # noqa: E501 + + :param median: The median of this IngredientObjectNutrients. + :type median: float + """ + + self._median = median + + @property + def rank(self) -> int: + """Gets the rank of this IngredientObjectNutrients. + + Nutrient rank # noqa: E501 + + :return: The rank of this IngredientObjectNutrients. + :rtype: int + """ + return self._rank + + @rank.setter + def rank(self, rank: int): + """Sets the rank of this IngredientObjectNutrients. + + Nutrient rank # noqa: E501 + + :param rank: The rank of this IngredientObjectNutrients. + :type rank: int + """ + + self._rank = rank + + @property + def data_points(self) -> int: + """Gets the data_points of this IngredientObjectNutrients. + + Number of observations on which the value is based # noqa: E501 + + :return: The data_points of this IngredientObjectNutrients. + :rtype: int + """ + return self._data_points + + @data_points.setter + def data_points(self, data_points: int): + """Sets the data_points of this IngredientObjectNutrients. + + Number of observations on which the value is based # noqa: E501 + + :param data_points: The data_points of this IngredientObjectNutrients. + :type data_points: int + """ + + self._data_points = data_points + + @property + def footnote(self) -> str: + """Gets the footnote of this IngredientObjectNutrients. + + Comments on any unusual aspect of the food nutrient. Examples might include why a nutrient value is different than typically expected. # noqa: E501 + + :return: The footnote of this IngredientObjectNutrients. + :rtype: str + """ + return self._footnote + + @footnote.setter + def footnote(self, footnote: str): + """Sets the footnote of this IngredientObjectNutrients. + + Comments on any unusual aspect of the food nutrient. Examples might include why a nutrient value is different than typically expected. # noqa: E501 + + :param footnote: The footnote of this IngredientObjectNutrients. + :type footnote: str + """ + + self._footnote = footnote + + @property + def description(self) -> str: + """Gets the description of this IngredientObjectNutrients. + + Description of the nutrient source # noqa: E501 + + :return: The description of this IngredientObjectNutrients. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this IngredientObjectNutrients. + + Description of the nutrient source # noqa: E501 + + :param description: The description of this IngredientObjectNutrients. + :type description: str + """ + + self._description = description diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index ae419bf..fe6a72b 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -74,79 +74,6 @@ paths: security: - ApiKeyAuth: [] x-openapi-router-controller: swagger_server.controllers.default_controller - /food/branded/id.php: - get: - summary: Get a branded food item using an ID number - description: | - ## Get data for a branded food using Chomp's internal ID number. - - **Example** - > ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID``` - - **Tips** - * Find a food's ID by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. - * Alternatively, set the "source" parameter to "USDA" and use the food's FDC ID. - operationId: food_branded_id_php_get - parameters: - - name: id - in: query - description: | - #### The ID number of a branded food item. - - **Example #1: Using Chomp ID** - > ```&id=15``` - - **Example #2: Using FDC ID** - > ```&id=FDC_ID&source=USDA``` - required: true - style: form - explode: true - schema: - type: integer - - name: source - in: query - description: | - #### Configure the endpoint to accept food IDs from various data sources. This endpoint defaults to Chomp but can accept FDC IDs. - - **Example** - > ```&source=Chomp``` - - **Tips** - * Pass in ```&source=USDA``` if you want to look up food items using a USDA FDC ID. - required: false - style: form - explode: true - schema: - type: string - enum: - - Chomp - - USDA - responses: - "200": - description: "**Valid** - Will return an object containing any matching\ - \ foods. \n" - content: - application/json: - schema: - $ref: '#/components/schemas/BrandedFoodObject' - "400": - description: | - **Validation error** - Invalid parameters or request. - "401": - description: | - **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** - "403": - description: | - **Forbidden** - Disallowed entity. - "404": - description: | - **Not found** - No food items exist that match your query parameters. - "500": - description: | - **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* - security: - - ApiKeyAuth: [] - x-openapi-router-controller: swagger_server.controllers.default_controller /food/branded/name.php: get: summary: Get a branded food item by name @@ -595,8 +522,8 @@ components: - keywords - keywords country_details: - english_speaking: 4 - non_english_speaking: 5 + english_speaking: 7 + non_english_speaking: 1 traces: - traces - traces @@ -605,14 +532,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 1 + compatibility_level: 4 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 1 + compatibility_level: 4 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -624,47 +551,22 @@ components: - palm_oil_ingredients - palm_oil_ingredients serving: - chomp: - size: size - usda: - size_fulltext: size_fulltext - size: size - measurement_unit: measurement_unit + size_fulltext: size_fulltext + size: size + measurement_unit: measurement_unit nutrients: - chomp: - - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - usda: - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote + - data_points: 5 + name: name + measurement_unit: measurement_unit + rank: 1 + description: description + per_100g: 6.02745618307040320615897144307382404804229736328125 + - data_points: 5 + name: name + measurement_unit: measurement_unit + rank: 1 + description: description + per_100g: 6.02745618307040320615897144307382404804229736328125 allergens: - allergens - allergens @@ -690,26 +592,24 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 1 + confidence: 9 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 2 name: name - compatibility_level: 7 + compatibility_level: 5 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 7 + confidence: 2 name: name - compatibility_level: 6 + compatibility_level: 3 is_compatible: true name: name - ingredients: - chomp: chomp - usda: usda + ingredients: ingredients categories: - categories - categories @@ -728,8 +628,8 @@ components: - keywords - keywords country_details: - english_speaking: 4 - non_english_speaking: 5 + english_speaking: 7 + non_english_speaking: 1 traces: - traces - traces @@ -738,14 +638,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 1 + compatibility_level: 4 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 1 + compatibility_level: 4 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -757,47 +657,22 @@ components: - palm_oil_ingredients - palm_oil_ingredients serving: - chomp: - size: size - usda: - size_fulltext: size_fulltext - size: size - measurement_unit: measurement_unit + size_fulltext: size_fulltext + size: size + measurement_unit: measurement_unit nutrients: - chomp: - - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - usda: - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote + - data_points: 5 + name: name + measurement_unit: measurement_unit + rank: 1 + description: description + per_100g: 6.02745618307040320615897144307382404804229736328125 + - data_points: 5 + name: name + measurement_unit: measurement_unit + rank: 1 + description: description + per_100g: 6.02745618307040320615897144307382404804229736328125 allergens: - allergens - allergens @@ -823,26 +698,24 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 1 + confidence: 9 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 2 name: name - compatibility_level: 7 + compatibility_level: 5 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 7 + confidence: 2 name: name - compatibility_level: 6 + compatibility_level: 3 is_compatible: true name: name - ingredients: - chomp: chomp - usda: usda + ingredients: ingredients categories: - categories - categories @@ -865,40 +738,40 @@ components: an unknown state or that no data exists. example: items: - - protein_conversion_factor: 5.962133916683182377482808078639209270477294921875 + - protein_conversion_factor: 2.027123023002321833274663731572218239307403564453125 calorie_conversion_factor: - carbohydrate_value: 1.46581298050294517310021547018550336360931396484375 - protein_value: 0.80082819046101150206595775671303272247314453125 - fat_value: 6.02745618307040320615897144307382404804229736328125 + carbohydrate_value: 3.61607674925191080461672754609026014804840087890625 + protein_value: 7.061401241503109105224211816675961017608642578125 + fat_value: 9.301444243932575517419536481611430644989013671875 components: - - data_points: 7 - pct_weight: 5.63737665663332876420099637471139430999755859375 - gram_weight: 2.3021358869347654518833223846741020679473876953125 + - data_points: 1 + pct_weight: 4.1456080298839363962315474054776132106781005859375 + gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true - - data_points: 7 - pct_weight: 5.63737665663332876420099637471139430999755859375 - gram_weight: 2.3021358869347654518833223846741020679473876953125 + - data_points: 1 + pct_weight: 4.1456080298839363962315474054776132106781005859375 + gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 1 + confidence: 9 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 2 name: name - compatibility_level: 7 + compatibility_level: 5 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 7 + confidence: 2 name: name - compatibility_level: 6 + compatibility_level: 3 is_compatible: true name: name common_names: common_names @@ -908,76 +781,73 @@ components: - categories footnote: footnote nutrients: - usda: - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote + - data_points: 2 + min: 6.02745618307040320615897144307382404804229736328125 + median: 5.962133916683182377482808078639209270477294921875 + max: 1.46581298050294517310021547018550336360931396484375 + name: name + measurement_unit: measurement_unit + rank: 5 + description: description + per_100g: 0.80082819046101150206595775671303272247314453125 + footnote: footnote + - data_points: 2 + min: 6.02745618307040320615897144307382404804229736328125 + median: 5.962133916683182377482808078639209270477294921875 + max: 1.46581298050294517310021547018550336360931396484375 + name: name + measurement_unit: measurement_unit + rank: 5 + description: description + per_100g: 0.80082819046101150206595775671303272247314453125 + footnote: footnote portions: - - data_points: 3 + - data_points: 1 modifier: modifier - gram_weight: 9.301444243932575517419536481611430644989013671875 + gram_weight: 1.024645700144157789424070870154537260532379150390625 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 3 + - data_points: 1 modifier: modifier - gram_weight: 9.301444243932575517419536481611430644989013671875 + gram_weight: 1.024645700144157789424070870154537260532379150390625 measurement_unit: measurement_unit description: description footnote: footnote - - protein_conversion_factor: 5.962133916683182377482808078639209270477294921875 + - protein_conversion_factor: 2.027123023002321833274663731572218239307403564453125 calorie_conversion_factor: - carbohydrate_value: 1.46581298050294517310021547018550336360931396484375 - protein_value: 0.80082819046101150206595775671303272247314453125 - fat_value: 6.02745618307040320615897144307382404804229736328125 + carbohydrate_value: 3.61607674925191080461672754609026014804840087890625 + protein_value: 7.061401241503109105224211816675961017608642578125 + fat_value: 9.301444243932575517419536481611430644989013671875 components: - - data_points: 7 - pct_weight: 5.63737665663332876420099637471139430999755859375 - gram_weight: 2.3021358869347654518833223846741020679473876953125 + - data_points: 1 + pct_weight: 4.1456080298839363962315474054776132106781005859375 + gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true - - data_points: 7 - pct_weight: 5.63737665663332876420099637471139430999755859375 - gram_weight: 2.3021358869347654518833223846741020679473876953125 + - data_points: 1 + pct_weight: 4.1456080298839363962315474054776132106781005859375 + gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 1 + confidence: 9 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 2 name: name - compatibility_level: 7 + compatibility_level: 5 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 7 + confidence: 2 name: name - compatibility_level: 6 + compatibility_level: 3 is_compatible: true name: name common_names: common_names @@ -987,56 +857,39 @@ components: - categories footnote: footnote nutrients: - usda: - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote + - data_points: 2 + min: 6.02745618307040320615897144307382404804229736328125 + median: 5.962133916683182377482808078639209270477294921875 + max: 1.46581298050294517310021547018550336360931396484375 + name: name + measurement_unit: measurement_unit + rank: 5 + description: description + per_100g: 0.80082819046101150206595775671303272247314453125 + footnote: footnote + - data_points: 2 + min: 6.02745618307040320615897144307382404804229736328125 + median: 5.962133916683182377482808078639209270477294921875 + max: 1.46581298050294517310021547018550336360931396484375 + name: name + measurement_unit: measurement_unit + rank: 5 + description: description + per_100g: 0.80082819046101150206595775671303272247314453125 + footnote: footnote portions: - - data_points: 3 + - data_points: 1 modifier: modifier - gram_weight: 9.301444243932575517419536481611430644989013671875 + gram_weight: 1.024645700144157789424070870154537260532379150390625 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 3 + - data_points: 1 modifier: modifier - gram_weight: 9.301444243932575517419536481611430644989013671875 + gram_weight: 1.024645700144157789424070870154537260532379150390625 measurement_unit: measurement_unit description: description footnote: footnote - BrandedFoodObject_ingredients: - type: object - properties: - chomp: - type: string - description: Ingredients for this item from Chomp's internal database - usda: - type: string - description: This branded food item's ingredients, according to the USDA - description: An object containing this item's ingredients in order of highest - value to least - example: - chomp: chomp - usda: usda BrandedFoodObject_package: type: object properties: @@ -1050,17 +903,7 @@ components: example: quantity: 0 size: size - BrandedFoodObject_serving_chomp: - type: object - properties: - size: - type: string - description: Serving size with measurement unit (e.g. if measure is 3 tsp, - the unit is tsp) - description: Serving information from Chomp's internal database - example: - size: size - BrandedFoodObject_serving_usda: + BrandedFoodObject_serving: type: object properties: size: @@ -1073,57 +916,14 @@ components: size_fulltext: type: string description: Serving size description - description: Serving information from the USDA + description: An object containing serving information for this item example: size_fulltext: size_fulltext size: size measurement_unit: measurement_unit - BrandedFoodObject_serving: - type: object - properties: - chomp: - $ref: '#/components/schemas/BrandedFoodObject_serving_chomp' - usda: - $ref: '#/components/schemas/BrandedFoodObject_serving_usda' - description: An object containing serving information for this item - example: - chomp: - size: size - usda: - size_fulltext: size_fulltext - size: size - measurement_unit: measurement_unit - BrandedFoodObject_nutrients_chomp: - type: object - properties: - name: - type: string - description: Nutrient name - measurement_unit: - type: string - description: The unit used for measure (e.g. if mesure is 3 tsp, the unit - is tsp) - per_100g: - type: number - description: Amount of the nutrient per 100g of food - per_serving: - type: number - description: Nutrient value per serving - total: - type: number - description: Total nutrient value - example: - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - BrandedFoodObject_nutrients_usda: + BrandedFoodObject_nutrients: type: object properties: - id: - type: integer - description: Nutrient ID name: type: string description: Nutrient name @@ -1133,90 +933,24 @@ components: measurement_unit: type: string description: The unit used for the measure of this nutrient - min: - type: number - description: Minimum nutrient value - max: - type: number - description: Maximum nutrient value - median: - type: number - description: Median nutrient value rank: type: integer description: Nutrient rank data_points: type: integer description: Number of observations on which the value is based - footnote: - type: string - description: Comments on any unusual aspect of the food nutrient. Examples - might include why a nutrient value is different than typically expected. description: type: string description: Description of the nutrient source + description: An object containing information for a specific nutrient found + in this food item example: - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 + data_points: 5 name: name measurement_unit: measurement_unit - rank: 2 + rank: 1 description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - BrandedFoodObject_nutrients: - type: object - properties: - chomp: - type: array - description: An array containing an object for each nutrient data point - items: - $ref: '#/components/schemas/BrandedFoodObject_nutrients_chomp' - usda: - type: array - description: An array containing an object for each nutrient data point - as found in the USDA database - items: - $ref: '#/components/schemas/BrandedFoodObject_nutrients_usda' - description: An object containing nutrient information from multiple sources - example: - chomp: - - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - usda: - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote + per_100g: 6.02745618307040320615897144307382404804229736328125 BrandedFoodObject_diet_labels_vegan: type: object properties: @@ -1241,9 +975,9 @@ components: the Vegan diets example: confidence_description: confidence_description - confidence: 1 + confidence: 2 name: name - compatibility_level: 7 + compatibility_level: 5 is_compatible: true BrandedFoodObject_diet_labels_vegetarian: type: object @@ -1269,9 +1003,9 @@ components: Vegetarian diets example: confidence_description: confidence_description - confidence: 1 + confidence: 9 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true BrandedFoodObject_diet_labels_gluten_free: type: object @@ -1297,9 +1031,9 @@ components: Gluten Free diets example: confidence_description: confidence_description - confidence: 7 + confidence: 2 name: name - compatibility_level: 6 + compatibility_level: 3 is_compatible: true BrandedFoodObject_diet_labels: type: object @@ -1315,21 +1049,21 @@ components: example: vegetarian: confidence_description: confidence_description - confidence: 1 + confidence: 9 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 2 name: name - compatibility_level: 7 + compatibility_level: 5 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 7 + confidence: 2 name: name - compatibility_level: 6 + compatibility_level: 3 is_compatible: true BrandedFoodObject_diet_flags: type: object @@ -1364,7 +1098,7 @@ components: ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 1 + compatibility_level: 4 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1456,8 +1190,8 @@ components: description: An object containing additional information on the countries where this item is found example: - english_speaking: 4 - non_english_speaking: 5 + english_speaking: 7 + non_english_speaking: 1 BrandedFoodObject_items: type: object properties: @@ -1471,7 +1205,8 @@ components: type: string description: The brand name that owns this item ingredients: - $ref: '#/components/schemas/BrandedFoodObject_ingredients' + type: string + description: This food item's ingredients from greatest quantity to least package: $ref: '#/components/schemas/BrandedFoodObject_package' serving: @@ -1482,7 +1217,11 @@ components: type: string description: An array of categories for this item nutrients: - $ref: '#/components/schemas/BrandedFoodObject_nutrients' + type: array + description: An array containing nutrient informatio objects for this food + item + items: + $ref: '#/components/schemas/BrandedFoodObject_nutrients' diet_labels: $ref: '#/components/schemas/BrandedFoodObject_diet_labels' diet_flags: @@ -1561,8 +1300,8 @@ components: - keywords - keywords country_details: - english_speaking: 4 - non_english_speaking: 5 + english_speaking: 7 + non_english_speaking: 1 traces: - traces - traces @@ -1571,14 +1310,14 @@ components: - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 1 + compatibility_level: 4 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description - ingredient: ingredient is_allergen: true ingredient_description: ingredient_description - compatibility_level: 1 + compatibility_level: 4 is_compatible: is_compatible diet_label: diet_label compatibility_description: compatibility_description @@ -1590,47 +1329,22 @@ components: - palm_oil_ingredients - palm_oil_ingredients serving: - chomp: - size: size - usda: - size_fulltext: size_fulltext - size: size - measurement_unit: measurement_unit + size_fulltext: size_fulltext + size: size + measurement_unit: measurement_unit nutrients: - chomp: - - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - - total: 5.962133916683182377482808078639209270477294921875 - name: name - measurement_unit: measurement_unit - per_100g: 6.02745618307040320615897144307382404804229736328125 - per_serving: 1.46581298050294517310021547018550336360931396484375 - usda: - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote + - data_points: 5 + name: name + measurement_unit: measurement_unit + rank: 1 + description: description + per_100g: 6.02745618307040320615897144307382404804229736328125 + - data_points: 5 + name: name + measurement_unit: measurement_unit + rank: 1 + description: description + per_100g: 6.02745618307040320615897144307382404804229736328125 allergens: - allergens - allergens @@ -1656,26 +1370,24 @@ components: diet_labels: vegetarian: confidence_description: confidence_description - confidence: 1 + confidence: 9 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 2 name: name - compatibility_level: 7 + compatibility_level: 5 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 7 + confidence: 2 name: name - compatibility_level: 6 + compatibility_level: 3 is_compatible: true name: name - ingredients: - chomp: chomp - usda: usda + ingredients: ingredients categories: - categories - categories @@ -1687,37 +1399,50 @@ components: IngredientObject_nutrients: type: object properties: - usda: - type: array - description: An array containing an object for each nutrient data point - as found in the USDA database - items: - $ref: '#/components/schemas/BrandedFoodObject_nutrients_usda' - description: An object containing nutrient information from each source + name: + type: string + description: Nutrient name + per_100g: + type: number + description: Amount of the nutrient per 100g of food + measurement_unit: + type: string + description: The unit used for the measure of this nutrient + min: + type: number + description: Minimum nutrient value + max: + type: number + description: Maximum nutrient value + median: + type: number + description: Median nutrient value + rank: + type: integer + description: Nutrient rank + data_points: + type: integer + description: Number of observations on which the value is based + footnote: + type: string + description: Comments on any unusual aspect of the food nutrient. Examples + might include why a nutrient value is different than typically expected. + description: + type: string + description: Description of the nutrient source + description: An object containing information for a specific nutrient found + in this food item example: - usda: - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote + data_points: 2 + min: 6.02745618307040320615897144307382404804229736328125 + median: 5.962133916683182377482808078639209270477294921875 + max: 1.46581298050294517310021547018550336360931396484375 + name: name + measurement_unit: measurement_unit + rank: 5 + description: description + per_100g: 0.80082819046101150206595775671303272247314453125 + footnote: footnote IngredientObject_calorie_conversion_factor: type: object properties: @@ -1733,9 +1458,9 @@ components: description: An object containing the multiplication factors to be used when calculating energy from macronutrients for a specific food. example: - carbohydrate_value: 1.46581298050294517310021547018550336360931396484375 - protein_value: 0.80082819046101150206595775671303272247314453125 - fat_value: 6.02745618307040320615897144307382404804229736328125 + carbohydrate_value: 3.61607674925191080461672754609026014804840087890625 + protein_value: 7.061401241503109105224211816675961017608642578125 + fat_value: 9.301444243932575517419536481611430644989013671875 IngredientObject_components: type: object properties: @@ -1758,9 +1483,9 @@ components: description: An object containing information on a specific component of this food item example: - data_points: 7 - pct_weight: 5.63737665663332876420099637471139430999755859375 - gram_weight: 2.3021358869347654518833223846741020679473876953125 + data_points: 1 + pct_weight: 4.1456080298839363962315474054776132106781005859375 + gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true IngredientObject_portions: @@ -1793,9 +1518,9 @@ components: description: An object containing information on a specific food portion found in this item example: - data_points: 3 + data_points: 1 modifier: modifier - gram_weight: 9.301444243932575517419536481611430644989013671875 + gram_weight: 1.024645700144157789424070870154537260532379150390625 measurement_unit: measurement_unit description: description footnote: footnote @@ -1811,7 +1536,11 @@ components: type: string description: An array of categories for this item nutrients: - $ref: '#/components/schemas/IngredientObject_nutrients' + type: array + description: An array containing nutrient informatio objects for this food + item + items: + $ref: '#/components/schemas/IngredientObject_nutrients' calorie_conversion_factor: $ref: '#/components/schemas/IngredientObject_calorie_conversion_factor' protein_conversion_factor: @@ -1845,40 +1574,40 @@ components: include unusual aspects of the food overall. description: An object containing information for this specific item. example: - protein_conversion_factor: 5.962133916683182377482808078639209270477294921875 + protein_conversion_factor: 2.027123023002321833274663731572218239307403564453125 calorie_conversion_factor: - carbohydrate_value: 1.46581298050294517310021547018550336360931396484375 - protein_value: 0.80082819046101150206595775671303272247314453125 - fat_value: 6.02745618307040320615897144307382404804229736328125 + carbohydrate_value: 3.61607674925191080461672754609026014804840087890625 + protein_value: 7.061401241503109105224211816675961017608642578125 + fat_value: 9.301444243932575517419536481611430644989013671875 components: - - data_points: 7 - pct_weight: 5.63737665663332876420099637471139430999755859375 - gram_weight: 2.3021358869347654518833223846741020679473876953125 + - data_points: 1 + pct_weight: 4.1456080298839363962315474054776132106781005859375 + gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true - - data_points: 7 - pct_weight: 5.63737665663332876420099637471139430999755859375 - gram_weight: 2.3021358869347654518833223846741020679473876953125 + - data_points: 1 + pct_weight: 4.1456080298839363962315474054776132106781005859375 + gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true diet_labels: vegetarian: confidence_description: confidence_description - confidence: 1 + confidence: 9 name: name - compatibility_level: 1 + compatibility_level: 7 is_compatible: true vegan: confidence_description: confidence_description - confidence: 1 + confidence: 2 name: name - compatibility_level: 7 + compatibility_level: 5 is_compatible: true gluten_free: confidence_description: confidence_description - confidence: 7 + confidence: 2 name: name - compatibility_level: 6 + compatibility_level: 3 is_compatible: true name: name common_names: common_names @@ -1888,39 +1617,36 @@ components: - categories footnote: footnote nutrients: - usda: - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote - - data_points: 4 - min: 7.061401241503109105224211816675961017608642578125 - median: 3.61607674925191080461672754609026014804840087890625 - max: 9.301444243932575517419536481611430644989013671875 - name: name - measurement_unit: measurement_unit - rank: 2 - description: description - id: 5 - per_100g: 2.3021358869347654518833223846741020679473876953125 - footnote: footnote + - data_points: 2 + min: 6.02745618307040320615897144307382404804229736328125 + median: 5.962133916683182377482808078639209270477294921875 + max: 1.46581298050294517310021547018550336360931396484375 + name: name + measurement_unit: measurement_unit + rank: 5 + description: description + per_100g: 0.80082819046101150206595775671303272247314453125 + footnote: footnote + - data_points: 2 + min: 6.02745618307040320615897144307382404804229736328125 + median: 5.962133916683182377482808078639209270477294921875 + max: 1.46581298050294517310021547018550336360931396484375 + name: name + measurement_unit: measurement_unit + rank: 5 + description: description + per_100g: 0.80082819046101150206595775671303272247314453125 + footnote: footnote portions: - - data_points: 3 + - data_points: 1 modifier: modifier - gram_weight: 9.301444243932575517419536481611430644989013671875 + gram_weight: 1.024645700144157789424070870154537260532379150390625 measurement_unit: measurement_unit description: description footnote: footnote - - data_points: 3 + - data_points: 1 modifier: modifier - gram_weight: 9.301444243932575517419536481611430644989013671875 + gram_weight: 1.024645700144157789424070870154537260532379150390625 measurement_unit: measurement_unit description: description footnote: footnote diff --git a/swagger_server/test/test_default_controller.py b/swagger_server/test/test_default_controller.py index 85554f3..596680b 100644 --- a/swagger_server/test/test_default_controller.py +++ b/swagger_server/test/test_default_controller.py @@ -26,20 +26,6 @@ def test_food_branded_barcode_php_get(self): self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_food_branded_id_php_get(self): - """Test case for food_branded_id_php_get - - Get a branded food item using an ID number - """ - query_string = [('id', 56), - ('source', 'source_example')] - response = self.client.open( - '/api/v2/food/branded/id.php', - method='GET', - query_string=query_string) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - def test_food_branded_name_php_get(self): """Test case for food_branded_name_php_get From a86fe4dd57cebdd3e1afed5f686d39e9f22d95d0 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Thu, 23 Jan 2020 17:11:29 +0000 Subject: [PATCH 24/36] Generated code by SwaggerHub --- setup.py | 2 +- .../models/ingredient_object_items.py | 36 +++++++++---------- swagger_server/swagger/swagger.yaml | 23 ++++++------ 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/setup.py b/setup.py index 01439bd..50e0aed 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,6 @@ entry_points={ 'console_scripts': ['swagger_server=swagger_server.__main__:main']}, long_description="""\ - ## Important An **[API key](https://chompthis.com/api/)** is required for access to this API. Get yours at **[https://chompthis.com/api](https://chompthis.com/api/)**. ### Getting Started * **[Subscribe](https://chompthis.com/api/#pricing)** to the API. * Scroll down and click the \"**Authorize**\" button. * Enter your API key into the \"**value**\" input, click the \"**Authorize**\" button, then click the \"**Close**\" button. * Scroll down to the section titled \"**default**\" and click on the API endpoint you wish to use. * Click the \"**Try it out**\" button. * Enter the information the endpoint requires. * Click the \"**Execute**\" button. ### Example * Branded food response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)** * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)** ### How Do I Find My API Key? * Your API key was sent to the email address you used to create your subscription. * You will also find your API key in the **[Client Center](https://chompthis.com/api/manage.php)**. * Read **[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)** for more information. ||| | ------- | -------- | | [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp) | [Pricing](https://chompthis.com/api/) | | [Attribution](https://chompthis.com/api/docs/attribution.php) | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) | | [Terms & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php) | | [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php) | | [Client Center](https://chompthis.com/api/manage.php) | | + ## Important An **[API key](https://chompthis.com/api/)** is required for access to this API. Get yours at **[https://chompthis.com/api](https://chompthis.com/api/)**. ### Getting Started * **[Subscribe](https://chompthis.com/api/#pricing)** to the API. * Scroll down and click the \"**Authorize**\" button. * Enter your API key into the \"**value**\" input, click the \"**Authorize**\" button, then click the \"**Close**\" button. * Scroll down to the section titled \"**default**\" and click on the API endpoint you wish to use. * Click the \"**Try it out**\" button. * Enter the information the endpoint requires. * Click the \"**Execute**\" button. ### Example * Branded food response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)** * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)** ### How Do I Find My API Key? * Your API key was sent to the email address you used to create your subscription. * You will also find your API key in the **[Client Center](https://chompthis.com/api/manage.php)**. * Read **[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)** for more information. ### Helpful Links * **Help & Support** * [Knowledge Base »](https://desk.zoho.com/portal/chompthis/kb/chomp) * [Support »](https://chompthis.com/api/ticket-new.php) * [Client Center »](https://chompthis.com/api/manage.php) * **Pricing** * [Subscription Options »](https://chompthis.com/api/) * [Cost Calculator »](https://chompthis.com/api/cost-calculator.php) * **Guidelines** * [Terms & License »](https://chompthis.com/api/terms.php) * [Attribution »](https://chompthis.com/api/docs/attribution.php) """ ) diff --git a/swagger_server/models/ingredient_object_items.py b/swagger_server/models/ingredient_object_items.py index 889d394..6646d16 100644 --- a/swagger_server/models/ingredient_object_items.py +++ b/swagger_server/models/ingredient_object_items.py @@ -19,7 +19,7 @@ class IngredientObjectItems(Model): Do not edit the class manually. """ - def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[IngredientObjectNutrients]=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_names: str=None, description: str=None, footnote: str=None): # noqa: E501 + def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[IngredientObjectNutrients]=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_name: str=None, description: str=None, footnote: str=None): # noqa: E501 """IngredientObjectItems - a model defined in Swagger :param name: The name of this IngredientObjectItems. # noqa: E501 @@ -38,8 +38,8 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I :type components: List[IngredientObjectComponents] :param portions: The portions of this IngredientObjectItems. # noqa: E501 :type portions: List[IngredientObjectPortions] - :param common_names: The common_names of this IngredientObjectItems. # noqa: E501 - :type common_names: str + :param common_name: The common_name of this IngredientObjectItems. # noqa: E501 + :type common_name: str :param description: The description of this IngredientObjectItems. # noqa: E501 :type description: str :param footnote: The footnote of this IngredientObjectItems. # noqa: E501 @@ -54,7 +54,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I 'diet_labels': BrandedFoodObjectDietLabels, 'components': List[IngredientObjectComponents], 'portions': List[IngredientObjectPortions], - 'common_names': str, + 'common_name': str, 'description': str, 'footnote': str } @@ -68,7 +68,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I 'diet_labels': 'diet_labels', 'components': 'components', 'portions': 'portions', - 'common_names': 'common_names', + 'common_name': 'common_name', 'description': 'description', 'footnote': 'footnote' } @@ -80,7 +80,7 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I self._diet_labels = diet_labels self._components = components self._portions = portions - self._common_names = common_names + self._common_name = common_name self._description = description self._footnote = footnote @@ -274,27 +274,27 @@ def portions(self, portions: List[IngredientObjectPortions]): self._portions = portions @property - def common_names(self) -> str: - """Gets the common_names of this IngredientObjectItems. + def common_name(self) -> str: + """Gets the common_name of this IngredientObjectItems. - Common names associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 + Common name associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 - :return: The common_names of this IngredientObjectItems. + :return: The common_name of this IngredientObjectItems. :rtype: str """ - return self._common_names + return self._common_name - @common_names.setter - def common_names(self, common_names: str): - """Sets the common_names of this IngredientObjectItems. + @common_name.setter + def common_name(self, common_name: str): + """Sets the common_name of this IngredientObjectItems. - Common names associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 + Common name associated with this item. These generally clarify what the item is (e.g. when the brand name is \"BRAND's Spicy Enchilada\" the common name may be \"Chicken enchilada\") # noqa: E501 - :param common_names: The common_names of this IngredientObjectItems. - :type common_names: str + :param common_name: The common_name of this IngredientObjectItems. + :type common_name: str """ - self._common_names = common_names + self._common_name = common_name @property def description(self) -> str: diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index fe6a72b..1530318 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -16,12 +16,13 @@ info: \ you used to create your subscription.\n * You will also find your API key in\ \ the **[Client Center](https://chompthis.com/api/manage.php)**.\n * Read **[this\ \ article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)**\ - \ for more information.\n\n|||\n| ------- | -------- |\n| [Knowledge Base](https://desk.zoho.com/portal/chompthis/kb/chomp)\ - \ | [Pricing](https://chompthis.com/api/) |\n| [Attribution](https://chompthis.com/api/docs/attribution.php)\ - \ | [Cost Calculator](https://chompthis.com/api/cost-calculator.php) |\n| [Terms\ - \ & License](https://chompthis.com/api/terms.php) | [Database Search](https://chompthis.com/api/lookup.php)\ - \ |\n| [Support](https://chompthis.com/api/ticket-new.php) | [Query Builder](https://chompthis.com/api/build.php)\ - \ |\n| [Client Center](https://chompthis.com/api/manage.php) | |\n" + \ for more information.\n\n### Helpful Links\n * **Help & Support**\n * [Knowledge\ + \ Base »](https://desk.zoho.com/portal/chompthis/kb/chomp)\n * [Support\ + \ »](https://chompthis.com/api/ticket-new.php)\n * [Client Center »](https://chompthis.com/api/manage.php)\n\ + \ * **Pricing**\n * [Subscription Options »](https://chompthis.com/api/)\n\ + \ * [Cost Calculator »](https://chompthis.com/api/cost-calculator.php)\n\ + \ * **Guidelines**\n * [Terms & License »](https://chompthis.com/api/terms.php)\n\ + \ * [Attribution »](https://chompthis.com/api/docs/attribution.php)\n" version: 1.0.0-oas3 servers: - url: https://chompthis.com/api/v2 @@ -774,12 +775,12 @@ components: compatibility_level: 3 is_compatible: true name: name - common_names: common_names description: description categories: - categories - categories footnote: footnote + common_name: common_name nutrients: - data_points: 2 min: 6.02745618307040320615897144307382404804229736328125 @@ -850,12 +851,12 @@ components: compatibility_level: 3 is_compatible: true name: name - common_names: common_names description: description categories: - categories - categories footnote: footnote + common_name: common_name nutrients: - data_points: 2 min: 6.02745618307040320615897144307382404804229736328125 @@ -1560,9 +1561,9 @@ components: of a food found in this item items: $ref: '#/components/schemas/IngredientObject_portions' - common_names: + common_name: type: string - description: Common names associated with this item. These generally clarify + description: Common name associated with this item. These generally clarify what the item is (e.g. when the brand name is "BRAND's Spicy Enchilada" the common name may be "Chicken enchilada") description: @@ -1610,12 +1611,12 @@ components: compatibility_level: 3 is_compatible: true name: name - common_names: common_names description: description categories: - categories - categories footnote: footnote + common_name: common_name nutrients: - data_points: 2 min: 6.02745618307040320615897144307382404804229736328125 From c1157c402573e4ffa4aafa6320748897e90482c0 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Fri, 24 Jan 2020 13:21:53 +0000 Subject: [PATCH 25/36] Generated code by SwaggerHub --- swagger_server/swagger/swagger.yaml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 1530318..1ff9b2a 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -64,11 +64,10 @@ paths: description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: | - **Forbidden** - Disallowed entity. + $ref: '#/components/responses/403Error' "404": description: | - **Not found** - No food items exist that match your query parameters. + **Not found** - No food items were found. "500": description: | **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* @@ -152,11 +151,10 @@ paths: description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: | - **Forbidden** - Disallowed entity. + $ref: '#/components/responses/403Error' "404": description: | - **Not found** - No food items exist that match your query parameters. + **Not found** - No food items were found. "500": description: | **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* @@ -382,11 +380,10 @@ paths: description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: | - **Forbidden** - Disallowed entity. + $ref: '#/components/responses/403Error' "404": description: | - **Not found** - No food items exist that match your query parameters. + **Not found** - No food items were found. "500": description: | **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* @@ -486,11 +483,10 @@ paths: description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "403": - description: | - **Forbidden** - Disallowed entity. + $ref: '#/components/responses/403Error' "404": description: | - **Not found** - No food items exist that match your query parameters. + **Not found** - No food items were found. "500": description: | **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* @@ -1672,12 +1668,9 @@ components: "401Error": description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** - "403Error": - description: | - **Forbidden** - Disallowed entity. "404Error": description: | - **Not found** - No food items exist that match your query parameters. + **Not found** - No food items were found. "500Error": description: | **Server error** - Internal server error, request failed, or base error. *Please **[contact us](https://chompthis.com/api/ticket-new.php)** if you see this.* From 2fa375d88c6635c809d248931b7015a2a133e9f1 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Fri, 24 Jan 2020 13:22:23 +0000 Subject: [PATCH 26/36] Generated code by SwaggerHub --- swagger_server/swagger/swagger.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 1ff9b2a..e3e6316 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -63,8 +63,6 @@ paths: "401": description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** - "403": - $ref: '#/components/responses/403Error' "404": description: | **Not found** - No food items were found. @@ -150,8 +148,6 @@ paths: "401": description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** - "403": - $ref: '#/components/responses/403Error' "404": description: | **Not found** - No food items were found. @@ -379,8 +375,6 @@ paths: "401": description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** - "403": - $ref: '#/components/responses/403Error' "404": description: | **Not found** - No food items were found. @@ -482,8 +476,6 @@ paths: "401": description: | **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** - "403": - $ref: '#/components/responses/403Error' "404": description: | **Not found** - No food items were found. From dc2375858572ae040f584f5e195e315b8cb86a7c Mon Sep 17 00:00:00 2001 From: petermerrill Date: Fri, 24 Jan 2020 14:21:12 +0000 Subject: [PATCH 27/36] Generated code by SwaggerHub --- setup.py | 2 +- swagger_server/swagger/swagger.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 50e0aed..f9bd3a4 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,6 @@ entry_points={ 'console_scripts': ['swagger_server=swagger_server.__main__:main']}, long_description="""\ - ## Important An **[API key](https://chompthis.com/api/)** is required for access to this API. Get yours at **[https://chompthis.com/api](https://chompthis.com/api/)**. ### Getting Started * **[Subscribe](https://chompthis.com/api/#pricing)** to the API. * Scroll down and click the \"**Authorize**\" button. * Enter your API key into the \"**value**\" input, click the \"**Authorize**\" button, then click the \"**Close**\" button. * Scroll down to the section titled \"**default**\" and click on the API endpoint you wish to use. * Click the \"**Try it out**\" button. * Enter the information the endpoint requires. * Click the \"**Execute**\" button. ### Example * Branded food response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)** * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)** ### How Do I Find My API Key? * Your API key was sent to the email address you used to create your subscription. * You will also find your API key in the **[Client Center](https://chompthis.com/api/manage.php)**. * Read **[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)** for more information. ### Helpful Links * **Help & Support** * [Knowledge Base »](https://desk.zoho.com/portal/chompthis/kb/chomp) * [Support »](https://chompthis.com/api/ticket-new.php) * [Client Center »](https://chompthis.com/api/manage.php) * **Pricing** * [Subscription Options »](https://chompthis.com/api/) * [Cost Calculator »](https://chompthis.com/api/cost-calculator.php) * **Guidelines** * [Terms & License »](https://chompthis.com/api/terms.php) * [Attribution »](https://chompthis.com/api/docs/attribution.php) + ## Important An **[API key](https://chompthis.com/api/)** is required for access to this API. Get yours at **[https://chompthis.com/api](https://chompthis.com/api/)**. ### Getting Started * **[Subscribe](https://chompthis.com/api/#pricing)** to the API. * Scroll down and click the \"**Authorize**\" button. * Enter your API key into the \"**value**\" input, click the \"**Authorize**\" button, then click the \"**Close**\" button. * Scroll down to the section titled \"**default**\" and click on the API endpoint you wish to use. * Click the \"**Try it out**\" button. * Enter the information the endpoint requires. * Click the \"**Execute**\" button. ### Example * Branded food response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)** * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)** * Error response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/error-response-object.json)** ### How Do I Find My API Key? * Your API key was sent to the email address you used to create your subscription. * You will also find your API key in the **[Client Center](https://chompthis.com/api/manage.php)**. * Read **[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)** for more information. ### Helpful Links * **Help & Support** * [Knowledge Base »](https://desk.zoho.com/portal/chompthis/kb/chomp) * [Support »](https://chompthis.com/api/ticket-new.php) * [Client Center »](https://chompthis.com/api/manage.php) * **Pricing** * [Subscription Options »](https://chompthis.com/api/) * [Cost Calculator »](https://chompthis.com/api/cost-calculator.php) * **Guidelines** * [Terms & License »](https://chompthis.com/api/terms.php) * [Attribution »](https://chompthis.com/api/docs/attribution.php) """ ) diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index e3e6316..9e3ee8b 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -12,6 +12,7 @@ info: \ * Click the \"**Execute**\" button.\n\n### Example \n * Branded food response\ \ object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)**\n\ \ * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)**\n\ + \ * Error response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/error-response-object.json)**\n\ \n### How Do I Find My API Key?\n * Your API key was sent to the email address\ \ you used to create your subscription.\n * You will also find your API key in\ \ the **[Client Center](https://chompthis.com/api/manage.php)**.\n * Read **[this\ From 1990c46caaba8de921d0acbe57488593fbe2f48d Mon Sep 17 00:00:00 2001 From: petermerrill Date: Sat, 25 Jan 2020 22:35:04 +0000 Subject: [PATCH 28/36] Generated code by SwaggerHub --- swagger_server/swagger/swagger.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 9e3ee8b..6214210 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -63,7 +63,7 @@ paths: **Validation error** - Invalid parameters or request. "401": description: | - **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** + **Unauthorized** - Invalid API key, unauthorized access, or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "404": description: | **Not found** - No food items were found. @@ -148,7 +148,7 @@ paths: **Validation error** - Invalid parameters or request. "401": description: | - **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** + **Unauthorized** - Invalid API key, unauthorized access, or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "404": description: | **Not found** - No food items were found. @@ -375,7 +375,7 @@ paths: **Validation error** - Invalid parameters or request. "401": description: | - **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** + **Unauthorized** - Invalid API key, unauthorized access, or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "404": description: | **Not found** - No food items were found. @@ -476,7 +476,7 @@ paths: **Validation error** - Invalid parameters or request. "401": description: | - **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** + **Unauthorized** - Invalid API key, unauthorized access, or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "404": description: | **Not found** - No food items were found. @@ -1660,7 +1660,7 @@ components: **Validation error** - Invalid parameters or request. "401Error": description: | - **Unauthorized** - Invalid API key or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** + **Unauthorized** - Invalid API key, unauthorized access, or usage limits exceeded. ***[More information »](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)*** "404Error": description: | **Not found** - No food items were found. From 1a6a1f0305d396cadaaacee1ae400184f6898102 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Mon, 27 Jan 2020 21:16:23 +0000 Subject: [PATCH 29/36] Generated code by SwaggerHub --- .../controllers/default_controller.py | 8 ++---- swagger_server/swagger/swagger.yaml | 28 ++++--------------- .../test/test_default_controller.py | 1 - 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index bf90219..e51a981 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -75,15 +75,13 @@ def food_branded_search_php_get(allergen=None, brand=None, category=None, countr return 'do some magic!' -def food_ingredient_search_php_get(find, list, raw=None, limit=None): # noqa: E501 +def food_ingredient_search_php_get(find, raw=None, limit=None): # noqa: E501 """Get raw/generic food ingredient item(s) - ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli&raw=true``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach&list=true&raw=true``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 + ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 - :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=broccoli``` **Example #2: Set of Ingredients** > ```&find=broccoli,cauliflower,spinach&list=true``` **Important Notes** * Set the \"list\" parameter to \"true\" before passing in a comma-separated list of ingredients. * Comma-separated lists cannot contain more than **15 ingredients**. You must perform additional API calls if you are looking up more than 15 ingredients. + :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=broccoli``` **Example #2: Set of Ingredients** > ```&find=broccoli,cauliflower,spinach``` **Important Notes** * Comma-separated lists cannot contain more than **15 ingredients**. You must perform additional API calls if you are looking up more than 15 ingredients. :type find: int - :param list: #### Setting ```&list=true``` will configure this endpoint to allow searching for ingredients using a comma-separated list. By default, this endpoint will **only** return results for the first ingredient. **Example** > ```&list=true``` - :type list: bool :param raw: #### Optionally filter the search result to only include raw ingredients. **Example** > ```&raw=true``` :type raw: bool :param limit: #### Set maximum number of records you want the API to return, per search term. **Example** > ```&limit=3``` diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 6214210..32ec470 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -392,10 +392,10 @@ paths: ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** - > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli&raw=true``` + > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli``` **Example #2: Set of Ingredients** - > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach&list=true&raw=true``` + > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. @@ -407,31 +407,15 @@ paths: in: query description: "Search our database for a single ingredient or a specific set\ \ of ingredients.\n\n**Example #1: Single Ingredient**\n> ```&find=broccoli```\n\ - \n**Example #2: Set of Ingredients**\n> ```&find=broccoli,cauliflower,spinach&list=true```\n\ - \n**Important Notes** \n * Set the \"list\" parameter to \"true\" before\ - \ passing in a comma-separated list of ingredients.\n * Comma-separated\ - \ lists cannot contain more than **15 ingredients**. You must perform additional\ - \ API calls if you are looking up more than 15 ingredients.\n" + \n**Example #2: Set of Ingredients**\n> ```&find=broccoli,cauliflower,spinach```\n\ + \n**Important Notes** \n * Comma-separated lists cannot contain more than\ + \ **15 ingredients**. You must perform additional API calls if you are looking\ + \ up more than 15 ingredients.\n" required: true style: form explode: true schema: type: integer - - name: list - in: query - description: | - #### Setting ```&list=true``` will configure this endpoint to allow searching for ingredients using a comma-separated list. By default, this endpoint will **only** return results for the first ingredient. - - **Example** - > ```&list=true``` - required: true - style: form - explode: true - schema: - type: boolean - enum: - - true - - false - name: raw in: query description: | diff --git a/swagger_server/test/test_default_controller.py b/swagger_server/test/test_default_controller.py index 596680b..7bfbb30 100644 --- a/swagger_server/test/test_default_controller.py +++ b/swagger_server/test/test_default_controller.py @@ -73,7 +73,6 @@ def test_food_ingredient_search_php_get(self): Get raw/generic food ingredient item(s) """ query_string = [('find', 56), - ('list', true), ('raw', true), ('limit', 56)] response = self.client.open( From df700c2661ba473281745dd1a5a33d2fa3d13a14 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Mon, 27 Jan 2020 21:18:03 +0000 Subject: [PATCH 30/36] Generated code by SwaggerHub --- swagger_server/controllers/default_controller.py | 2 +- swagger_server/swagger/swagger.yaml | 2 +- swagger_server/test/test_default_controller.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index e51a981..a609e3b 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -81,7 +81,7 @@ def food_ingredient_search_php_get(find, raw=None, limit=None): # noqa: E501 ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=broccoli``` **Example #2: Set of Ingredients** > ```&find=broccoli,cauliflower,spinach``` **Important Notes** * Comma-separated lists cannot contain more than **15 ingredients**. You must perform additional API calls if you are looking up more than 15 ingredients. - :type find: int + :type find: str :param raw: #### Optionally filter the search result to only include raw ingredients. **Example** > ```&raw=true``` :type raw: bool :param limit: #### Set maximum number of records you want the API to return, per search term. **Example** > ```&limit=3``` diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 32ec470..be7b407 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -415,7 +415,7 @@ paths: style: form explode: true schema: - type: integer + type: string - name: raw in: query description: | diff --git a/swagger_server/test/test_default_controller.py b/swagger_server/test/test_default_controller.py index 7bfbb30..257cc76 100644 --- a/swagger_server/test/test_default_controller.py +++ b/swagger_server/test/test_default_controller.py @@ -72,7 +72,7 @@ def test_food_ingredient_search_php_get(self): Get raw/generic food ingredient item(s) """ - query_string = [('find', 56), + query_string = [('find', 'find_example'), ('raw', true), ('limit', 56)] response = self.client.open( From d4a3454944983bbf5e438095d5adc88f3e33c522 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Mon, 27 Jan 2020 21:27:59 +0000 Subject: [PATCH 31/36] Generated code by SwaggerHub --- swagger_server/controllers/default_controller.py | 12 ++++++------ swagger_server/swagger/swagger.yaml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index a609e3b..f61c96d 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -26,9 +26,9 @@ def food_branded_name_php_get(name, limit=None, page=None): # noqa: E501 :param name: #### Search for branded food items using a general food name keyword. This does not have to exactly match the \"official\" name for the food. **Example** > ```&name=Starburst``` :type name: str - :param limit: #### Set maximum number of records you want the API to return. **Example** > ```&limit=10``` + :param limit: #### Set maximum number of records you want the API to return. The default value is \"**10**.\" **Example** > ```&limit=10``` :type limit: int - :param page: #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. **Example** > ```&page=1``` + :param page: #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. The default value is \"**1**.\" **Example** > ```&page=1``` :type page: int :rtype: BrandedFoodObject @@ -65,9 +65,9 @@ def food_branded_search_php_get(allergen=None, brand=None, category=None, countr :type trace: str :param vitamin: #### Filter the search to only include branded foods that contain a specific vitamin. **Example** > ```&vitamin=Biotin``` :type vitamin: str - :param limit: #### Set maximum number of records you want the API to return. **Example** > ```&limit=10``` + :param limit: #### Set maximum number of records you want the API to return. The default value is \"**10**.\" **Example** > ```&limit=10``` :type limit: int - :param page: #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. **Example** > ```&page=1``` + :param page: #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. The default value is \"**1**.\" **Example** > ```&page=1``` :type page: int :rtype: BrandedFoodObject @@ -82,9 +82,9 @@ def food_ingredient_search_php_get(find, raw=None, limit=None): # noqa: E501 :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=broccoli``` **Example #2: Set of Ingredients** > ```&find=broccoli,cauliflower,spinach``` **Important Notes** * Comma-separated lists cannot contain more than **15 ingredients**. You must perform additional API calls if you are looking up more than 15 ingredients. :type find: str - :param raw: #### Optionally filter the search result to only include raw ingredients. **Example** > ```&raw=true``` + :param raw: #### Optionally filter the search result to only include raw ingredients. The default value is \"**false**.\" **Example** > ```&raw=true``` :type raw: bool - :param limit: #### Set maximum number of records you want the API to return, per search term. **Example** > ```&limit=3``` + :param limit: #### Set maximum number of records you want the API to return, per search term. The default value is \"**1**.\" **Example** > ```&limit=3``` :type limit: int :rtype: IngredientObject diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index be7b407..559a712 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -103,7 +103,7 @@ paths: - name: limit in: query description: | - #### Set maximum number of records you want the API to return. + #### Set maximum number of records you want the API to return. The default value is "**10**." **Example** > ```&limit=10``` @@ -126,7 +126,7 @@ paths: - name: page in: query description: | - #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. + #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. The default value is "**1**." **Example** > ```&page=1``` @@ -330,7 +330,7 @@ paths: - name: limit in: query description: | - #### Set maximum number of records you want the API to return. + #### Set maximum number of records you want the API to return. The default value is "**10**." **Example** > ```&limit=10``` @@ -353,7 +353,7 @@ paths: - name: page in: query description: | - #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. + #### This is how you paginate the search result. By default, you will see the first 10 records. You must increment the page number to access the next 10 records, and so on. The default value is "**1**." **Example** > ```&page=1``` @@ -419,7 +419,7 @@ paths: - name: raw in: query description: | - #### Optionally filter the search result to only include raw ingredients. + #### Optionally filter the search result to only include raw ingredients. The default value is "**false**." **Example** > ```&raw=true``` @@ -434,7 +434,7 @@ paths: - name: limit in: query description: | - #### Set maximum number of records you want the API to return, per search term. + #### Set maximum number of records you want the API to return, per search term. The default value is "**1**." **Example** > ```&limit=3``` From 12d7c5d41a2c27ac3fd0946962839254cf97095e Mon Sep 17 00:00:00 2001 From: petermerrill Date: Tue, 28 Jan 2020 13:14:15 +0000 Subject: [PATCH 32/36] Generated code by SwaggerHub --- .../controllers/default_controller.py | 8 ++--- swagger_server/swagger/swagger.yaml | 29 +++++-------------- .../test/test_default_controller.py | 1 - 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index f61c96d..02fd086 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -75,15 +75,13 @@ def food_branded_search_php_get(allergen=None, brand=None, category=None, countr return 'do some magic!' -def food_ingredient_search_php_get(find, raw=None, limit=None): # noqa: E501 +def food_ingredient_search_php_get(find, limit=None): # noqa: E501 """Get raw/generic food ingredient item(s) - ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 + ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli,mashed potatoes,raw spinach``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 - :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=broccoli``` **Example #2: Set of Ingredients** > ```&find=broccoli,cauliflower,spinach``` **Important Notes** * Comma-separated lists cannot contain more than **15 ingredients**. You must perform additional API calls if you are looking up more than 15 ingredients. + :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=raw broccoli``` **Example #2: Set of Ingredients** > ```&find=raw broccoli,raw cauliflower,mashed potatoes``` **Important Notes** * Comma-separated lists cannot contain more than **10 ingredients**. You must perform additional API calls if you are looking up more than 10 ingredients. :type find: str - :param raw: #### Optionally filter the search result to only include raw ingredients. The default value is \"**false**.\" **Example** > ```&raw=true``` - :type raw: bool :param limit: #### Set maximum number of records you want the API to return, per search term. The default value is \"**1**.\" **Example** > ```&limit=3``` :type limit: int diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 559a712..6e54060 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -392,10 +392,10 @@ paths: ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** - > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli``` + > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli``` **Example #2: Set of Ingredients** - > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=broccoli,cauliflower,spinach``` + > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli,mashed potatoes,raw spinach``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. @@ -406,31 +406,16 @@ paths: - name: find in: query description: "Search our database for a single ingredient or a specific set\ - \ of ingredients.\n\n**Example #1: Single Ingredient**\n> ```&find=broccoli```\n\ - \n**Example #2: Set of Ingredients**\n> ```&find=broccoli,cauliflower,spinach```\n\ - \n**Important Notes** \n * Comma-separated lists cannot contain more than\ - \ **15 ingredients**. You must perform additional API calls if you are looking\ - \ up more than 15 ingredients.\n" + \ of ingredients.\n\n**Example #1: Single Ingredient**\n> ```&find=raw broccoli```\n\ + \n**Example #2: Set of Ingredients**\n> ```&find=raw broccoli,raw cauliflower,mashed\ + \ potatoes```\n\n**Important Notes** \n * Comma-separated lists cannot\ + \ contain more than **10 ingredients**. You must perform additional API\ + \ calls if you are looking up more than 10 ingredients.\n" required: true style: form explode: true schema: type: string - - name: raw - in: query - description: | - #### Optionally filter the search result to only include raw ingredients. The default value is "**false**." - - **Example** - > ```&raw=true``` - required: false - style: form - explode: true - schema: - type: boolean - enum: - - true - - false - name: limit in: query description: | diff --git a/swagger_server/test/test_default_controller.py b/swagger_server/test/test_default_controller.py index 257cc76..a5c68f4 100644 --- a/swagger_server/test/test_default_controller.py +++ b/swagger_server/test/test_default_controller.py @@ -73,7 +73,6 @@ def test_food_ingredient_search_php_get(self): Get raw/generic food ingredient item(s) """ query_string = [('find', 'find_example'), - ('raw', true), ('limit', 56)] response = self.client.open( '/api/v2/food/ingredient/search.php', From 5ab5fd0777532ca8695fcdb213b9df78c64349fd Mon Sep 17 00:00:00 2001 From: petermerrill Date: Tue, 28 Jan 2020 13:53:57 +0000 Subject: [PATCH 33/36] Generated code by SwaggerHub --- .../models/ingredient_object_items.py | 57 +--------------- swagger_server/swagger/swagger.yaml | 65 ------------------- 2 files changed, 1 insertion(+), 121 deletions(-) diff --git a/swagger_server/models/ingredient_object_items.py b/swagger_server/models/ingredient_object_items.py index 6646d16..7a6ce72 100644 --- a/swagger_server/models/ingredient_object_items.py +++ b/swagger_server/models/ingredient_object_items.py @@ -6,7 +6,6 @@ from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model -from swagger_server.models.branded_food_object_diet_labels import BrandedFoodObjectDietLabels # noqa: F401,E501 from swagger_server.models.ingredient_object_calorie_conversion_factor import IngredientObjectCalorieConversionFactor # noqa: F401,E501 from swagger_server.models.ingredient_object_components import IngredientObjectComponents # noqa: F401,E501 from swagger_server.models.ingredient_object_nutrients import IngredientObjectNutrients # noqa: F401,E501 @@ -19,7 +18,7 @@ class IngredientObjectItems(Model): Do not edit the class manually. """ - def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[IngredientObjectNutrients]=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, diet_labels: BrandedFoodObjectDietLabels=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_name: str=None, description: str=None, footnote: str=None): # noqa: E501 + def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[IngredientObjectNutrients]=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_name: str=None, footnote: str=None): # noqa: E501 """IngredientObjectItems - a model defined in Swagger :param name: The name of this IngredientObjectItems. # noqa: E501 @@ -32,16 +31,12 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I :type calorie_conversion_factor: IngredientObjectCalorieConversionFactor :param protein_conversion_factor: The protein_conversion_factor of this IngredientObjectItems. # noqa: E501 :type protein_conversion_factor: float - :param diet_labels: The diet_labels of this IngredientObjectItems. # noqa: E501 - :type diet_labels: BrandedFoodObjectDietLabels :param components: The components of this IngredientObjectItems. # noqa: E501 :type components: List[IngredientObjectComponents] :param portions: The portions of this IngredientObjectItems. # noqa: E501 :type portions: List[IngredientObjectPortions] :param common_name: The common_name of this IngredientObjectItems. # noqa: E501 :type common_name: str - :param description: The description of this IngredientObjectItems. # noqa: E501 - :type description: str :param footnote: The footnote of this IngredientObjectItems. # noqa: E501 :type footnote: str """ @@ -51,11 +46,9 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I 'nutrients': List[IngredientObjectNutrients], 'calorie_conversion_factor': IngredientObjectCalorieConversionFactor, 'protein_conversion_factor': float, - 'diet_labels': BrandedFoodObjectDietLabels, 'components': List[IngredientObjectComponents], 'portions': List[IngredientObjectPortions], 'common_name': str, - 'description': str, 'footnote': str } @@ -65,11 +58,9 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I 'nutrients': 'nutrients', 'calorie_conversion_factor': 'calorie_conversion_factor', 'protein_conversion_factor': 'protein_conversion_factor', - 'diet_labels': 'diet_labels', 'components': 'components', 'portions': 'portions', 'common_name': 'common_name', - 'description': 'description', 'footnote': 'footnote' } self._name = name @@ -77,11 +68,9 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I self._nutrients = nutrients self._calorie_conversion_factor = calorie_conversion_factor self._protein_conversion_factor = protein_conversion_factor - self._diet_labels = diet_labels self._components = components self._portions = portions self._common_name = common_name - self._description = description self._footnote = footnote @classmethod @@ -206,27 +195,6 @@ def protein_conversion_factor(self, protein_conversion_factor: float): self._protein_conversion_factor = protein_conversion_factor - @property - def diet_labels(self) -> BrandedFoodObjectDietLabels: - """Gets the diet_labels of this IngredientObjectItems. - - - :return: The diet_labels of this IngredientObjectItems. - :rtype: BrandedFoodObjectDietLabels - """ - return self._diet_labels - - @diet_labels.setter - def diet_labels(self, diet_labels: BrandedFoodObjectDietLabels): - """Sets the diet_labels of this IngredientObjectItems. - - - :param diet_labels: The diet_labels of this IngredientObjectItems. - :type diet_labels: BrandedFoodObjectDietLabels - """ - - self._diet_labels = diet_labels - @property def components(self) -> List[IngredientObjectComponents]: """Gets the components of this IngredientObjectItems. @@ -296,29 +264,6 @@ def common_name(self, common_name: str): self._common_name = common_name - @property - def description(self) -> str: - """Gets the description of this IngredientObjectItems. - - A description of this item # noqa: E501 - - :return: The description of this IngredientObjectItems. - :rtype: str - """ - return self._description - - @description.setter - def description(self, description: str): - """Sets the description of this IngredientObjectItems. - - A description of this item # noqa: E501 - - :param description: The description of this IngredientObjectItems. - :type description: str - """ - - self._description = description - @property def footnote(self) -> str: """Gets the footnote of this IngredientObjectItems. diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 6e54060..cbeb044 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -713,27 +713,7 @@ components: gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true - diet_labels: - vegetarian: - confidence_description: confidence_description - confidence: 9 - name: name - compatibility_level: 7 - is_compatible: true - vegan: - confidence_description: confidence_description - confidence: 2 - name: name - compatibility_level: 5 - is_compatible: true - gluten_free: - confidence_description: confidence_description - confidence: 2 - name: name - compatibility_level: 3 - is_compatible: true name: name - description: description categories: - categories - categories @@ -789,27 +769,7 @@ components: gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true - diet_labels: - vegetarian: - confidence_description: confidence_description - confidence: 9 - name: name - compatibility_level: 7 - is_compatible: true - vegan: - confidence_description: confidence_description - confidence: 2 - name: name - compatibility_level: 5 - is_compatible: true - gluten_free: - confidence_description: confidence_description - confidence: 2 - name: name - compatibility_level: 3 - is_compatible: true name: name - description: description categories: - categories - categories @@ -1505,8 +1465,6 @@ components: protein_conversion_factor: type: number description: The multiplication factor used to calculate protein from nitrogen - diet_labels: - $ref: '#/components/schemas/BrandedFoodObject_diet_labels' components: type: array description: An array of objects containing the constituent parts of a food @@ -1524,9 +1482,6 @@ components: description: Common name associated with this item. These generally clarify what the item is (e.g. when the brand name is "BRAND's Spicy Enchilada" the common name may be "Chicken enchilada") - description: - type: string - description: A description of this item footnote: type: string description: Comments on any unusual aspects of this item. Examples might @@ -1549,27 +1504,7 @@ components: gram_weight: 7.3862819483858839220147274318151175975799560546875 name: name is_refuse: true - diet_labels: - vegetarian: - confidence_description: confidence_description - confidence: 9 - name: name - compatibility_level: 7 - is_compatible: true - vegan: - confidence_description: confidence_description - confidence: 2 - name: name - compatibility_level: 5 - is_compatible: true - gluten_free: - confidence_description: confidence_description - confidence: 2 - name: name - compatibility_level: 3 - is_compatible: true name: name - description: description categories: - categories - categories From c4d4a70db80661f2f828d8de0d0bea44d5eff672 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Tue, 28 Jan 2020 14:07:09 +0000 Subject: [PATCH 34/36] Generated code by SwaggerHub --- .../models/ingredient_object_items.py | 62 ++++++++++++++++++- swagger_server/swagger/swagger.yaml | 13 ++++ 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/swagger_server/models/ingredient_object_items.py b/swagger_server/models/ingredient_object_items.py index 7a6ce72..2394d27 100644 --- a/swagger_server/models/ingredient_object_items.py +++ b/swagger_server/models/ingredient_object_items.py @@ -18,7 +18,7 @@ class IngredientObjectItems(Model): Do not edit the class manually. """ - def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[IngredientObjectNutrients]=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_name: str=None, footnote: str=None): # noqa: E501 + def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[IngredientObjectNutrients]=None, calorie_conversion_factor: IngredientObjectCalorieConversionFactor=None, protein_conversion_factor: float=None, components: List[IngredientObjectComponents]=None, portions: List[IngredientObjectPortions]=None, common_name: str=None, footnote: str=None, search_term: str=None, score: str=None): # noqa: E501 """IngredientObjectItems - a model defined in Swagger :param name: The name of this IngredientObjectItems. # noqa: E501 @@ -39,6 +39,10 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I :type common_name: str :param footnote: The footnote of this IngredientObjectItems. # noqa: E501 :type footnote: str + :param search_term: The search_term of this IngredientObjectItems. # noqa: E501 + :type search_term: str + :param score: The score of this IngredientObjectItems. # noqa: E501 + :type score: str """ self.swagger_types = { 'name': str, @@ -49,7 +53,9 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I 'components': List[IngredientObjectComponents], 'portions': List[IngredientObjectPortions], 'common_name': str, - 'footnote': str + 'footnote': str, + 'search_term': str, + 'score': str } self.attribute_map = { @@ -61,7 +67,9 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I 'components': 'components', 'portions': 'portions', 'common_name': 'common_name', - 'footnote': 'footnote' + 'footnote': 'footnote', + 'search_term': 'search_term', + 'score': 'score' } self._name = name self._categories = categories @@ -72,6 +80,8 @@ def __init__(self, name: str=None, categories: List[str]=None, nutrients: List[I self._portions = portions self._common_name = common_name self._footnote = footnote + self._search_term = search_term + self._score = score @classmethod def from_dict(cls, dikt) -> 'IngredientObjectItems': @@ -286,3 +296,49 @@ def footnote(self, footnote: str): """ self._footnote = footnote + + @property + def search_term(self) -> str: + """Gets the search_term of this IngredientObjectItems. + + The original search term that found this food item. # noqa: E501 + + :return: The search_term of this IngredientObjectItems. + :rtype: str + """ + return self._search_term + + @search_term.setter + def search_term(self, search_term: str): + """Sets the search_term of this IngredientObjectItems. + + The original search term that found this food item. # noqa: E501 + + :param search_term: The search_term of this IngredientObjectItems. + :type search_term: str + """ + + self._search_term = search_term + + @property + def score(self) -> str: + """Gets the score of this IngredientObjectItems. + + A value that represents how similar the name of this food item is to the original search term. # noqa: E501 + + :return: The score of this IngredientObjectItems. + :rtype: str + """ + return self._score + + @score.setter + def score(self, score: str): + """Sets the score of this IngredientObjectItems. + + A value that represents how similar the name of this food item is to the original search term. # noqa: E501 + + :param score: The score of this IngredientObjectItems. + :type score: str + """ + + self._score = score diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index cbeb044..a68b303 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -698,6 +698,7 @@ components: example: items: - protein_conversion_factor: 2.027123023002321833274663731572218239307403564453125 + score: score calorie_conversion_factor: carbohydrate_value: 3.61607674925191080461672754609026014804840087890625 protein_value: 7.061401241503109105224211816675961017608642578125 @@ -714,6 +715,7 @@ components: name: name is_refuse: true name: name + search_term: search_term categories: - categories - categories @@ -754,6 +756,7 @@ components: description: description footnote: footnote - protein_conversion_factor: 2.027123023002321833274663731572218239307403564453125 + score: score calorie_conversion_factor: carbohydrate_value: 3.61607674925191080461672754609026014804840087890625 protein_value: 7.061401241503109105224211816675961017608642578125 @@ -770,6 +773,7 @@ components: name: name is_refuse: true name: name + search_term: search_term categories: - categories - categories @@ -1486,9 +1490,17 @@ components: type: string description: Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. + search_term: + type: string + description: The original search term that found this food item. + score: + type: string + description: A value that represents how similar the name of this food item + is to the original search term. description: An object containing information for this specific item. example: protein_conversion_factor: 2.027123023002321833274663731572218239307403564453125 + score: score calorie_conversion_factor: carbohydrate_value: 3.61607674925191080461672754609026014804840087890625 protein_value: 7.061401241503109105224211816675961017608642578125 @@ -1505,6 +1517,7 @@ components: name: name is_refuse: true name: name + search_term: search_term categories: - categories - categories From 03968287d188030dd664076ce9a3c24e4816f4e3 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Tue, 28 Jan 2020 14:08:56 +0000 Subject: [PATCH 35/36] Generated code by SwaggerHub --- swagger_server/models/ingredient_object_items.py | 12 ++++++------ swagger_server/swagger/swagger.yaml | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/swagger_server/models/ingredient_object_items.py b/swagger_server/models/ingredient_object_items.py index 2394d27..2f9ab11 100644 --- a/swagger_server/models/ingredient_object_items.py +++ b/swagger_server/models/ingredient_object_items.py @@ -278,7 +278,7 @@ def common_name(self, common_name: str): def footnote(self) -> str: """Gets the footnote of this IngredientObjectItems. - Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. # noqa: E501 + Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall # noqa: E501 :return: The footnote of this IngredientObjectItems. :rtype: str @@ -289,7 +289,7 @@ def footnote(self) -> str: def footnote(self, footnote: str): """Sets the footnote of this IngredientObjectItems. - Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. # noqa: E501 + Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall # noqa: E501 :param footnote: The footnote of this IngredientObjectItems. :type footnote: str @@ -301,7 +301,7 @@ def footnote(self, footnote: str): def search_term(self) -> str: """Gets the search_term of this IngredientObjectItems. - The original search term that found this food item. # noqa: E501 + The original search term that found this food item # noqa: E501 :return: The search_term of this IngredientObjectItems. :rtype: str @@ -312,7 +312,7 @@ def search_term(self) -> str: def search_term(self, search_term: str): """Sets the search_term of this IngredientObjectItems. - The original search term that found this food item. # noqa: E501 + The original search term that found this food item # noqa: E501 :param search_term: The search_term of this IngredientObjectItems. :type search_term: str @@ -324,7 +324,7 @@ def search_term(self, search_term: str): def score(self) -> str: """Gets the score of this IngredientObjectItems. - A value that represents how similar the name of this food item is to the original search term. # noqa: E501 + A value that represents how similar the name of this food item is to the original search term. The lower the value the closer this item's name is to the original search term. # noqa: E501 :return: The score of this IngredientObjectItems. :rtype: str @@ -335,7 +335,7 @@ def score(self) -> str: def score(self, score: str): """Sets the score of this IngredientObjectItems. - A value that represents how similar the name of this food item is to the original search term. # noqa: E501 + A value that represents how similar the name of this food item is to the original search term. The lower the value the closer this item's name is to the original search term. # noqa: E501 :param score: The score of this IngredientObjectItems. :type score: str diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index a68b303..9bf35c7 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -1489,14 +1489,15 @@ components: footnote: type: string description: Comments on any unusual aspects of this item. Examples might - include unusual aspects of the food overall. + include unusual aspects of the food overall search_term: type: string - description: The original search term that found this food item. + description: The original search term that found this food item score: type: string description: A value that represents how similar the name of this food item - is to the original search term. + is to the original search term. The lower the value the closer this item's + name is to the original search term. description: An object containing information for this specific item. example: protein_conversion_factor: 2.027123023002321833274663731572218239307403564453125 From 7b9ef0c12f9eed28037c159432e28bfa6b9cbc61 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Thu, 30 Jan 2020 02:08:16 +0000 Subject: [PATCH 36/36] Generated code by SwaggerHub --- swagger_server/controllers/default_controller.py | 4 ++-- swagger_server/swagger/swagger.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/swagger_server/controllers/default_controller.py b/swagger_server/controllers/default_controller.py index 02fd086..6529b4f 100644 --- a/swagger_server/controllers/default_controller.py +++ b/swagger_server/controllers/default_controller.py @@ -78,9 +78,9 @@ def food_branded_search_php_get(allergen=None, brand=None, category=None, countr def food_ingredient_search_php_get(find, limit=None): # noqa: E501 """Get raw/generic food ingredient item(s) - ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli,mashed potatoes,raw spinach``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 + ## Get data for a specific ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli``` **Example #2: Set of Ingredients** > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli,mashed potatoes,chicken drumstick``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. > This API endpoint is only available to Standard and Premium API subscribers. Please consider upgrading your subscription if you are subscribed to the Limited plan. **[Read this](https://desk.zoho.com/portal/chompthis/kb/articles/can-i-upgrade-downgrade-my-subscription)** if you aren't sure how to upgrade your subscription. # noqa: E501 - :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=raw broccoli``` **Example #2: Set of Ingredients** > ```&find=raw broccoli,raw cauliflower,mashed potatoes``` **Important Notes** * Comma-separated lists cannot contain more than **10 ingredients**. You must perform additional API calls if you are looking up more than 10 ingredients. + :param find: Search our database for a single ingredient or a specific set of ingredients. **Example #1: Single Ingredient** > ```&find=raw broccoli``` **Example #2: Set of Ingredients** > ```&find=raw broccoli,buttermilk waffle,mashed potatoes``` **Important Notes** * Comma-separated lists cannot contain more than **10 ingredients**. You must perform additional API calls if you are looking up more than 10 ingredients. :type find: str :param limit: #### Set maximum number of records you want the API to return, per search term. The default value is \"**1**.\" **Example** > ```&limit=3``` :type limit: int diff --git a/swagger_server/swagger/swagger.yaml b/swagger_server/swagger/swagger.yaml index 9bf35c7..b3a3b20 100644 --- a/swagger_server/swagger/swagger.yaml +++ b/swagger_server/swagger/swagger.yaml @@ -395,7 +395,7 @@ paths: > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli``` **Example #2: Set of Ingredients** - > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli,mashed potatoes,raw spinach``` + > ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=raw broccoli,mashed potatoes,chicken drumstick``` **Tips** * Expose ingredient endpoints by using our **[food lookup tool](https://chompthis.com/api/lookup.php)**. @@ -407,10 +407,10 @@ paths: in: query description: "Search our database for a single ingredient or a specific set\ \ of ingredients.\n\n**Example #1: Single Ingredient**\n> ```&find=raw broccoli```\n\ - \n**Example #2: Set of Ingredients**\n> ```&find=raw broccoli,raw cauliflower,mashed\ - \ potatoes```\n\n**Important Notes** \n * Comma-separated lists cannot\ - \ contain more than **10 ingredients**. You must perform additional API\ - \ calls if you are looking up more than 10 ingredients.\n" + \n**Example #2: Set of Ingredients**\n> ```&find=raw broccoli,buttermilk\ + \ waffle,mashed potatoes```\n\n**Important Notes** \n * Comma-separated\ + \ lists cannot contain more than **10 ingredients**. You must perform additional\ + \ API calls if you are looking up more than 10 ingredients.\n" required: true style: form explode: true