From 293c8eb54b4b8459222be5c1bab96d74db8c69f2 Mon Sep 17 00:00:00 2001 From: petermerrill Date: Sat, 18 Jan 2020 04:50:31 +0000 Subject: [PATCH] Generated code by SwaggerHub --- .swagger-codegen-ignore | 23 + .swagger-codegen/VERSION | 1 + IO.Swagger.sln | 21 + NuGet.Config | 9 + README.md | 27 +- build.bat | 9 + build.sh | 8 + src/IO.Swagger/.gitignore | 208 ++ .../Attributes/ValidateModelStateAttribute.cs | 61 + src/IO.Swagger/Controllers/DefaultApi.cs | 273 +++ src/IO.Swagger/Dockerfile | 18 + src/IO.Swagger/Filters/BasePathFilter.cs | 50 + .../GeneratePathParamsValidationFilter.cs | 100 + src/IO.Swagger/IO.Swagger.csproj | 19 + src/IO.Swagger/Models/BrandedFoodObject.cs | 120 + ...randedFoodObjectCalorieConversionFactor.cs | 150 ++ .../Models/BrandedFoodObjectComponents.cs | 180 ++ .../Models/BrandedFoodObjectCountryDetails.cs | 135 ++ .../Models/BrandedFoodObjectDietFlags.cs | 210 ++ .../Models/BrandedFoodObjectDietLabels.cs | 147 ++ .../BrandedFoodObjectDietLabelsGlutenFree.cs | 180 ++ .../BrandedFoodObjectDietLabelsVegan.cs | 180 ++ .../BrandedFoodObjectDietLabelsVegetarian.cs | 180 ++ .../Models/BrandedFoodObjectItems.cs | 517 ++++ .../Models/BrandedFoodObjectNutrients.cs | 135 ++ .../Models/BrandedFoodObjectNutrientsChomp.cs | 180 ++ .../Models/BrandedFoodObjectNutrientsUsda.cs | 270 +++ .../Models/BrandedFoodObjectPackage.cs | 135 ++ .../BrandedFoodObjectPackagingPhotos.cs | 147 ++ .../BrandedFoodObjectPackagingPhotosFront.cs | 150 ++ ...dedFoodObjectPackagingPhotosIngredients.cs | 150 ++ ...andedFoodObjectPackagingPhotosNutrition.cs | 150 ++ .../Models/BrandedFoodObjectPortions.cs | 195 ++ .../Models/BrandedFoodObjectServing.cs | 165 ++ src/IO.Swagger/Models/IngredientObject.cs | 120 + .../Models/IngredientObjectItems.cs | 266 +++ .../Models/IngredientObjectNutrients.cs | 120 + src/IO.Swagger/Program.cs | 30 + src/IO.Swagger/Properties/launchSettings.json | 28 + .../Security/ApiKeyAuthenticationHandler.cs | 50 + src/IO.Swagger/Startup.cs | 131 + src/IO.Swagger/appsettings.json | 10 + src/IO.Swagger/web.config | 14 + src/IO.Swagger/wwwroot/README.md | 42 + src/IO.Swagger/wwwroot/index.html | 1 + src/IO.Swagger/wwwroot/swagger-original.json | 2109 +++++++++++++++++ src/IO.Swagger/wwwroot/web.config | 9 + 47 files changed, 7431 insertions(+), 2 deletions(-) create mode 100644 .swagger-codegen-ignore create mode 100644 .swagger-codegen/VERSION create mode 100644 IO.Swagger.sln create mode 100644 NuGet.Config create mode 100644 build.bat create mode 100644 build.sh create mode 100644 src/IO.Swagger/.gitignore create mode 100644 src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs create mode 100644 src/IO.Swagger/Controllers/DefaultApi.cs create mode 100644 src/IO.Swagger/Dockerfile create mode 100644 src/IO.Swagger/Filters/BasePathFilter.cs create mode 100644 src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs create mode 100644 src/IO.Swagger/IO.Swagger.csproj create mode 100644 src/IO.Swagger/Models/BrandedFoodObject.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectCalorieConversionFactor.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectComponents.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectCountryDetails.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectDietFlags.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectDietLabels.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectDietLabelsGlutenFree.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectDietLabelsVegan.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectDietLabelsVegetarian.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectItems.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectNutrients.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectNutrientsChomp.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectNutrientsUsda.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectPackage.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotos.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosFront.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosIngredients.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosNutrition.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectPortions.cs create mode 100644 src/IO.Swagger/Models/BrandedFoodObjectServing.cs create mode 100644 src/IO.Swagger/Models/IngredientObject.cs create mode 100644 src/IO.Swagger/Models/IngredientObjectItems.cs create mode 100644 src/IO.Swagger/Models/IngredientObjectNutrients.cs create mode 100644 src/IO.Swagger/Program.cs create mode 100644 src/IO.Swagger/Properties/launchSettings.json create mode 100644 src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs create mode 100644 src/IO.Swagger/Startup.cs create mode 100644 src/IO.Swagger/appsettings.json create mode 100644 src/IO.Swagger/web.config create mode 100644 src/IO.Swagger/wwwroot/README.md create mode 100644 src/IO.Swagger/wwwroot/index.html create mode 100644 src/IO.Swagger/wwwroot/swagger-original.json create mode 100644 src/IO.Swagger/wwwroot/web.config diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION new file mode 100644 index 0000000..513cc0b --- /dev/null +++ b/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.14 \ No newline at end of file diff --git a/IO.Swagger.sln b/IO.Swagger.sln new file mode 100644 index 0000000..d50cddb --- /dev/null +++ b/IO.Swagger.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26114.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{429DCB8D-2E87-4AAA-8B61-E71904D394D5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {429DCB8D-2E87-4AAA-8B61-E71904D394D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {429DCB8D-2E87-4AAA-8B61-E71904D394D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {429DCB8D-2E87-4AAA-8B61-E71904D394D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {429DCB8D-2E87-4AAA-8B61-E71904D394D5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..01f3d1f --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/README.md b/README.md index 7a8b3d7..ad970cb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,25 @@ -# stub-asp-net-core -ASP.NET Core server stub for the Chomp Food Database API. Use our API to get high-quality data on over 875,000 branded/grocery foods plus raw ingredients. +# IO.Swagger - ASP.NET Core 2.0 Server + +__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) | | + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` + +## Run in Docker + +``` +cd src/IO.Swagger +docker build -t io.swagger . +docker run -p 5000:5000 io.swagger +``` diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..2e04123 --- /dev/null +++ b/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://github.com/swagger-api/swagger-codegen.git +:: + +@echo off + +dotnet restore src\IO.Swagger +dotnet build src\IO.Swagger +echo Now, run the following to start the project: dotnet run -p src\IO.Swagger\IO.Swagger.csproj --launch-profile web. +echo. diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..ce6063a --- /dev/null +++ b/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +dotnet restore src/IO.Swagger/ && \ + dotnet build src/IO.Swagger/ && \ + echo "Now, run the following to start the project: dotnet run -p src/IO.Swagger/IO.Swagger.csproj --launch-profile web" diff --git a/src/IO.Swagger/.gitignore b/src/IO.Swagger/.gitignore new file mode 100644 index 0000000..cd9b840 --- /dev/null +++ b/src/IO.Swagger/.gitignore @@ -0,0 +1,208 @@ +PID + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 0000000..07cfabe --- /dev/null +++ b/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,61 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ModelBinding; + +namespace IO.Swagger.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + if (descriptor != null) + { + foreach (var parameter in descriptor.MethodInfo.GetParameters()) + { + object args = null; + if (context.ActionArguments.ContainsKey(parameter.Name)) + { + args = context.ActionArguments[parameter.Name]; + } + + ValidateAttributes(parameter, args, context.ModelState); + } + } + + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + + private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) + { + foreach (var attributeData in parameter.CustomAttributes) + { + var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); + + var validationAttribute = attributeInstance as ValidationAttribute; + if (validationAttribute != null) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/src/IO.Swagger/Controllers/DefaultApi.cs b/src/IO.Swagger/Controllers/DefaultApi.cs new file mode 100644 index 0000000..c913611 --- /dev/null +++ b/src/IO.Swagger/Controllers/DefaultApi.cs @@ -0,0 +1,273 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; +using IO.Swagger.Security; +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + [ApiController] + public class DefaultApiController : ControllerBase + { + /// + /// 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``` + /// 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._ + /// __Valid__ - Will return an object containing any matching foods. + /// __Validation error__ - Invalid parameters or request. + /// __Unauthorized__ - Invalid API key or usage limits exceeded. _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + /// __Forbidden__ - Disallowed entity. + /// __Not found__ - No food items exist that match your query parameters. + /// __Server error__ - Internal server error, request failed, or base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._ + [HttpGet] + [Route("/api/v2/food/branded/barcode.php")] + [Authorize(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [ValidateModelState] + [SwaggerOperation("FoodBrandedBarcodePhpGet")] + [SwaggerResponse(statusCode: 200, type: typeof(BrandedFoodObject), description: "__Valid__ - Will return an object containing any matching foods.")] + public virtual IActionResult FoodBrandedBarcodePhpGet([FromQuery][Required()]string code) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(BrandedFoodObject)); + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + //TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(401); + + //TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(403); + + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + //TODO: Uncomment the next line to return response 500 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(500); + string exampleJson = null; + exampleJson = "{\n \"items\" : [ {\n \"minerals\" : [ \"minerals\", \"minerals\" ],\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"keywords\" : [ \"keywords\", \"keywords\" ],\n \"country_details\" : {\n \"english_speaking\" : 2,\n \"non_english_speaking\" : 6\n },\n \"description\" : \"description\",\n \"has_english_ingredients\" : true,\n \"palm_oil_ingredients\" : [ \"palm_oil_ingredients\", \"palm_oil_ingredients\" ],\n \"serving\" : {\n \"total\" : 5,\n \"size_fulltext\" : \"size_fulltext\",\n \"size\" : 1,\n \"measurement_unit\" : \"measurement_unit\"\n },\n \"nutrients\" : {\n \"chomp\" : [ {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n }, {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n } ],\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"protein_conversion_factor\" : 7.457744773683766,\n \"packaging_photos\" : {\n \"nutrition\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"ingredients\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"front\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n }\n },\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"ingredients\" : \"ingredients\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"common_name\" : \"common_name\",\n \"barcode\" : \"barcode\",\n \"brand\" : \"brand\",\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ],\n \"package\" : {\n \"quantity\" : 0,\n \"size\" : 6\n },\n \"traces\" : [ \"traces\", \"traces\" ],\n \"diet_flags\" : [ {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n }, {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n } ],\n \"countries\" : [ \"countries\", \"countries\" ],\n \"footnote\" : \"footnote\",\n \"allergens\" : [ \"allergens\", \"allergens\" ],\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"ingredient_list\" : [ \"ingredient_list\", \"ingredient_list\" ],\n \"name\" : \"name\",\n \"brand_list\" : [ \"brand_list\", \"brand_list\" ]\n }, {\n \"minerals\" : [ \"minerals\", \"minerals\" ],\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"keywords\" : [ \"keywords\", \"keywords\" ],\n \"country_details\" : {\n \"english_speaking\" : 2,\n \"non_english_speaking\" : 6\n },\n \"description\" : \"description\",\n \"has_english_ingredients\" : true,\n \"palm_oil_ingredients\" : [ \"palm_oil_ingredients\", \"palm_oil_ingredients\" ],\n \"serving\" : {\n \"total\" : 5,\n \"size_fulltext\" : \"size_fulltext\",\n \"size\" : 1,\n \"measurement_unit\" : \"measurement_unit\"\n },\n \"nutrients\" : {\n \"chomp\" : [ {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n }, {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n } ],\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"protein_conversion_factor\" : 7.457744773683766,\n \"packaging_photos\" : {\n \"nutrition\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"ingredients\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"front\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n }\n },\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"ingredients\" : \"ingredients\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"common_name\" : \"common_name\",\n \"barcode\" : \"barcode\",\n \"brand\" : \"brand\",\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ],\n \"package\" : {\n \"quantity\" : 0,\n \"size\" : 6\n },\n \"traces\" : [ \"traces\", \"traces\" ],\n \"diet_flags\" : [ {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n }, {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n } ],\n \"countries\" : [ \"countries\", \"countries\" ],\n \"footnote\" : \"footnote\",\n \"allergens\" : [ \"allergens\", \"allergens\" ],\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"ingredient_list\" : [ \"ingredient_list\", \"ingredient_list\" ],\n \"name\" : \"name\",\n \"brand_list\" : [ \"brand_list\", \"brand_list\" ]\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(BrandedFoodObject); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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``` + /// 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) + /// 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\")_ + /// __Valid__ - Will return an object containing any matching foods. + /// __Validation error__ - Invalid parameters or request. + /// __Unauthorized__ - Invalid API key or usage limits exceeded. _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + /// __Forbidden__ - Disallowed entity. + /// __Not found__ - No food items exist that match your query parameters. + /// __Server error__ - Internal server error, request failed, or base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._ + [HttpGet] + [Route("/api/v2/food/branded/id.php")] + [Authorize(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [ValidateModelState] + [SwaggerOperation("FoodBrandedIdPhpGet")] + [SwaggerResponse(statusCode: 200, type: typeof(BrandedFoodObject), description: "__Valid__ - Will return an object containing any matching foods.")] + public virtual IActionResult FoodBrandedIdPhpGet([FromQuery][Required()]int? id, [FromQuery]string source) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(BrandedFoodObject)); + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + //TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(401); + + //TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(403); + + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + //TODO: Uncomment the next line to return response 500 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(500); + string exampleJson = null; + exampleJson = "{\n \"items\" : [ {\n \"minerals\" : [ \"minerals\", \"minerals\" ],\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"keywords\" : [ \"keywords\", \"keywords\" ],\n \"country_details\" : {\n \"english_speaking\" : 2,\n \"non_english_speaking\" : 6\n },\n \"description\" : \"description\",\n \"has_english_ingredients\" : true,\n \"palm_oil_ingredients\" : [ \"palm_oil_ingredients\", \"palm_oil_ingredients\" ],\n \"serving\" : {\n \"total\" : 5,\n \"size_fulltext\" : \"size_fulltext\",\n \"size\" : 1,\n \"measurement_unit\" : \"measurement_unit\"\n },\n \"nutrients\" : {\n \"chomp\" : [ {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n }, {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n } ],\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"protein_conversion_factor\" : 7.457744773683766,\n \"packaging_photos\" : {\n \"nutrition\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"ingredients\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"front\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n }\n },\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"ingredients\" : \"ingredients\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"common_name\" : \"common_name\",\n \"barcode\" : \"barcode\",\n \"brand\" : \"brand\",\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ],\n \"package\" : {\n \"quantity\" : 0,\n \"size\" : 6\n },\n \"traces\" : [ \"traces\", \"traces\" ],\n \"diet_flags\" : [ {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n }, {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n } ],\n \"countries\" : [ \"countries\", \"countries\" ],\n \"footnote\" : \"footnote\",\n \"allergens\" : [ \"allergens\", \"allergens\" ],\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"ingredient_list\" : [ \"ingredient_list\", \"ingredient_list\" ],\n \"name\" : \"name\",\n \"brand_list\" : [ \"brand_list\", \"brand_list\" ]\n }, {\n \"minerals\" : [ \"minerals\", \"minerals\" ],\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"keywords\" : [ \"keywords\", \"keywords\" ],\n \"country_details\" : {\n \"english_speaking\" : 2,\n \"non_english_speaking\" : 6\n },\n \"description\" : \"description\",\n \"has_english_ingredients\" : true,\n \"palm_oil_ingredients\" : [ \"palm_oil_ingredients\", \"palm_oil_ingredients\" ],\n \"serving\" : {\n \"total\" : 5,\n \"size_fulltext\" : \"size_fulltext\",\n \"size\" : 1,\n \"measurement_unit\" : \"measurement_unit\"\n },\n \"nutrients\" : {\n \"chomp\" : [ {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n }, {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n } ],\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"protein_conversion_factor\" : 7.457744773683766,\n \"packaging_photos\" : {\n \"nutrition\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"ingredients\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"front\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n }\n },\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"ingredients\" : \"ingredients\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"common_name\" : \"common_name\",\n \"barcode\" : \"barcode\",\n \"brand\" : \"brand\",\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ],\n \"package\" : {\n \"quantity\" : 0,\n \"size\" : 6\n },\n \"traces\" : [ \"traces\", \"traces\" ],\n \"diet_flags\" : [ {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n }, {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n } ],\n \"countries\" : [ \"countries\", \"countries\" ],\n \"footnote\" : \"footnote\",\n \"allergens\" : [ \"allergens\", \"allergens\" ],\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"ingredient_list\" : [ \"ingredient_list\", \"ingredient_list\" ],\n \"name\" : \"name\",\n \"brand_list\" : [ \"brand_list\", \"brand_list\" ]\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(BrandedFoodObject); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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``` + /// Branded food name __Example:__ Starburst __Resources:__ [Find branded food names](https://chompthis.com/api/lookup.php) + /// Set maximum number of records you want the API to return. ___Note:__ The maximum value is 10._ __Example:__ 3 _(defaults to 10)_ + /// __Valid__ - Will return an object containing any matching foods. + /// __Validation error__ - Invalid parameters or request. + /// __Unauthorized__ - Invalid API key or usage limits exceeded. _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + /// __Forbidden__ - Disallowed entity. + /// __Not found__ - No food items exist that match your query parameters. + /// __Server error__ - Internal server error, request failed, or base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._ + [HttpGet] + [Route("/api/v2/food/branded/name.php")] + [Authorize(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [ValidateModelState] + [SwaggerOperation("FoodBrandedNamePhpGet")] + [SwaggerResponse(statusCode: 200, type: typeof(BrandedFoodObject), description: "__Valid__ - Will return an object containing any matching foods.")] + public virtual IActionResult FoodBrandedNamePhpGet([FromQuery][Required()]string name, [FromQuery]int? limit) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(BrandedFoodObject)); + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + //TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(401); + + //TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(403); + + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + //TODO: Uncomment the next line to return response 500 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(500); + string exampleJson = null; + exampleJson = "{\n \"items\" : [ {\n \"minerals\" : [ \"minerals\", \"minerals\" ],\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"keywords\" : [ \"keywords\", \"keywords\" ],\n \"country_details\" : {\n \"english_speaking\" : 2,\n \"non_english_speaking\" : 6\n },\n \"description\" : \"description\",\n \"has_english_ingredients\" : true,\n \"palm_oil_ingredients\" : [ \"palm_oil_ingredients\", \"palm_oil_ingredients\" ],\n \"serving\" : {\n \"total\" : 5,\n \"size_fulltext\" : \"size_fulltext\",\n \"size\" : 1,\n \"measurement_unit\" : \"measurement_unit\"\n },\n \"nutrients\" : {\n \"chomp\" : [ {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n }, {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n } ],\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"protein_conversion_factor\" : 7.457744773683766,\n \"packaging_photos\" : {\n \"nutrition\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"ingredients\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"front\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n }\n },\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"ingredients\" : \"ingredients\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"common_name\" : \"common_name\",\n \"barcode\" : \"barcode\",\n \"brand\" : \"brand\",\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ],\n \"package\" : {\n \"quantity\" : 0,\n \"size\" : 6\n },\n \"traces\" : [ \"traces\", \"traces\" ],\n \"diet_flags\" : [ {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n }, {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n } ],\n \"countries\" : [ \"countries\", \"countries\" ],\n \"footnote\" : \"footnote\",\n \"allergens\" : [ \"allergens\", \"allergens\" ],\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"ingredient_list\" : [ \"ingredient_list\", \"ingredient_list\" ],\n \"name\" : \"name\",\n \"brand_list\" : [ \"brand_list\", \"brand_list\" ]\n }, {\n \"minerals\" : [ \"minerals\", \"minerals\" ],\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"keywords\" : [ \"keywords\", \"keywords\" ],\n \"country_details\" : {\n \"english_speaking\" : 2,\n \"non_english_speaking\" : 6\n },\n \"description\" : \"description\",\n \"has_english_ingredients\" : true,\n \"palm_oil_ingredients\" : [ \"palm_oil_ingredients\", \"palm_oil_ingredients\" ],\n \"serving\" : {\n \"total\" : 5,\n \"size_fulltext\" : \"size_fulltext\",\n \"size\" : 1,\n \"measurement_unit\" : \"measurement_unit\"\n },\n \"nutrients\" : {\n \"chomp\" : [ {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n }, {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n } ],\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"protein_conversion_factor\" : 7.457744773683766,\n \"packaging_photos\" : {\n \"nutrition\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"ingredients\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"front\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n }\n },\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"ingredients\" : \"ingredients\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"common_name\" : \"common_name\",\n \"barcode\" : \"barcode\",\n \"brand\" : \"brand\",\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ],\n \"package\" : {\n \"quantity\" : 0,\n \"size\" : 6\n },\n \"traces\" : [ \"traces\", \"traces\" ],\n \"diet_flags\" : [ {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n }, {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n } ],\n \"countries\" : [ \"countries\", \"countries\" ],\n \"footnote\" : \"footnote\",\n \"allergens\" : [ \"allergens\", \"allergens\" ],\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"ingredient_list\" : [ \"ingredient_list\", \"ingredient_list\" ],\n \"name\" : \"name\",\n \"brand_list\" : [ \"brand_list\", \"brand_list\" ]\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(BrandedFoodObject); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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)._ + /// Specify a required allergen ingredient (optional) __Example__: Peanuts __Resources__: [List of allergens](https://chompthis.com/api/data/allergen.php) + /// Specify a required brand (optional) __Example__: Starbucks __Resources__: [List of brands](https://chompthis.com/api/data/brand.php) + /// Specify a required category (optional) __Example__: Pasta Dishes __Resources__: [List of categories](https://chompthis.com/api/data/category.php) + /// Specify a required country (optional) __Example__: United States __Resources__: [List of countries](https://chompthis.com/api/data/country.php) + /// 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) + /// Specify a required ingredient (optional) __Example__: Salt __Resources__: [List of ingredients](https://chompthis.com/api/data/ingredient.php) + /// Specify a required keyword (optional) __Example__: Starbucks __Resources__: [List of brands](https://chompthis.com/api/data/brand.php) + /// Specify a required mineral (optional) __Example__: Potassium __Resources__: [List of minerals](https://chompthis.com/api/data/mineral.php) + /// Specify a required nutrition label item (optional) __Example__: Caffeine __Resources__: [List of nutrition label items](https://chompthis.com/api/data/nutrition.php) + /// 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) + /// Specify a required trace ingredient (optional) __Example__: Tree Nuts __Resources__: [List of trace ingredients](https://chompthis.com/api/data/trace.php) + /// Specify a required vitamin (optional) __Example__: Biotin __Resources__: [List of vitamins](https://chompthis.com/api/data/vitamin.php) + /// Set maximum number of records you want the API to return. ___Note:__ The maximum value is 10._ __Example:__ 3 _(defaults to 10)_ + /// Specify the search response page number. _Each page will contain up to 10 items._ __Example__: 1 _(default)_ + /// __Valid__ - Will return an object containing any matching foods. + /// __Validation error__ - Invalid parameters or request. + /// __Unauthorized__ - Invalid API key or usage limits exceeded. _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + /// __Forbidden__ - Disallowed entity. + /// __Not found__ - No food items exist that match your query parameters. + /// __Server error__ - Internal server error, request failed, or base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._ + [HttpGet] + [Route("/api/v2/food/branded/search.php")] + [Authorize(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [ValidateModelState] + [SwaggerOperation("FoodBrandedSearchPhpGet")] + [SwaggerResponse(statusCode: 200, type: typeof(BrandedFoodObject), description: "__Valid__ - Will return an object containing any matching foods.")] + public virtual IActionResult FoodBrandedSearchPhpGet([FromQuery]string allergen, [FromQuery]string brand, [FromQuery]string category, [FromQuery]string country, [FromQuery]string diet, [FromQuery]string ingredient, [FromQuery]string keyword, [FromQuery]string mineral, [FromQuery]string nutrient, [FromQuery]string palmOil, [FromQuery]string trace, [FromQuery]string vitamin, [FromQuery]int? limit, [FromQuery]int? page) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(BrandedFoodObject)); + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + //TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(401); + + //TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(403); + + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + //TODO: Uncomment the next line to return response 500 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(500); + string exampleJson = null; + exampleJson = "{\n \"items\" : [ {\n \"minerals\" : [ \"minerals\", \"minerals\" ],\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"keywords\" : [ \"keywords\", \"keywords\" ],\n \"country_details\" : {\n \"english_speaking\" : 2,\n \"non_english_speaking\" : 6\n },\n \"description\" : \"description\",\n \"has_english_ingredients\" : true,\n \"palm_oil_ingredients\" : [ \"palm_oil_ingredients\", \"palm_oil_ingredients\" ],\n \"serving\" : {\n \"total\" : 5,\n \"size_fulltext\" : \"size_fulltext\",\n \"size\" : 1,\n \"measurement_unit\" : \"measurement_unit\"\n },\n \"nutrients\" : {\n \"chomp\" : [ {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n }, {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n } ],\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"protein_conversion_factor\" : 7.457744773683766,\n \"packaging_photos\" : {\n \"nutrition\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"ingredients\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"front\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n }\n },\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"ingredients\" : \"ingredients\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"common_name\" : \"common_name\",\n \"barcode\" : \"barcode\",\n \"brand\" : \"brand\",\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ],\n \"package\" : {\n \"quantity\" : 0,\n \"size\" : 6\n },\n \"traces\" : [ \"traces\", \"traces\" ],\n \"diet_flags\" : [ {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n }, {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n } ],\n \"countries\" : [ \"countries\", \"countries\" ],\n \"footnote\" : \"footnote\",\n \"allergens\" : [ \"allergens\", \"allergens\" ],\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"ingredient_list\" : [ \"ingredient_list\", \"ingredient_list\" ],\n \"name\" : \"name\",\n \"brand_list\" : [ \"brand_list\", \"brand_list\" ]\n }, {\n \"minerals\" : [ \"minerals\", \"minerals\" ],\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"keywords\" : [ \"keywords\", \"keywords\" ],\n \"country_details\" : {\n \"english_speaking\" : 2,\n \"non_english_speaking\" : 6\n },\n \"description\" : \"description\",\n \"has_english_ingredients\" : true,\n \"palm_oil_ingredients\" : [ \"palm_oil_ingredients\", \"palm_oil_ingredients\" ],\n \"serving\" : {\n \"total\" : 5,\n \"size_fulltext\" : \"size_fulltext\",\n \"size\" : 1,\n \"measurement_unit\" : \"measurement_unit\"\n },\n \"nutrients\" : {\n \"chomp\" : [ {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n }, {\n \"total\" : 7.061401241503109,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"per_100g\" : 5.637376656633329,\n \"per_serving\" : 2.3021358869347655\n } ],\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"protein_conversion_factor\" : 7.457744773683766,\n \"packaging_photos\" : {\n \"nutrition\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"ingredients\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n },\n \"front\" : {\n \"small\" : \"small\",\n \"thumb\" : \"thumb\",\n \"display\" : \"display\"\n }\n },\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"ingredients\" : \"ingredients\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"common_name\" : \"common_name\",\n \"barcode\" : \"barcode\",\n \"brand\" : \"brand\",\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ],\n \"package\" : {\n \"quantity\" : 0,\n \"size\" : 6\n },\n \"traces\" : [ \"traces\", \"traces\" ],\n \"diet_flags\" : [ {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n }, {\n \"ingredient\" : \"ingredient\",\n \"is_allergen\" : true,\n \"ingredient_description\" : \"ingredient_description\",\n \"compatibility_level\" : 8,\n \"is_compatible\" : \"is_compatible\",\n \"diet_label\" : \"diet_label\",\n \"compatibility_description\" : \"compatibility_description\"\n } ],\n \"countries\" : [ \"countries\", \"countries\" ],\n \"footnote\" : \"footnote\",\n \"allergens\" : [ \"allergens\", \"allergens\" ],\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"ingredient_list\" : [ \"ingredient_list\", \"ingredient_list\" ],\n \"name\" : \"name\",\n \"brand_list\" : [ \"brand_list\", \"brand_list\" ]\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(BrandedFoodObject); //TODO: Change the data returned + return new ObjectResult(example); + } + + /// + /// 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``` + /// 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._ + /// 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)_ + /// Specify if you only want data for raw ingredients. __Example:__ true _(defaults to true)_ + /// 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)_ + /// __Valid__ - Will return an object containing any matching ingredient foods. + /// __Validation error__ - Invalid parameters or request. + /// __Unauthorized__ - Invalid API key or usage limits exceeded. _[More information](https://desk.zoho.com/portal/chompthis/kb/articles/what-is-a-rate-limit)_ + /// __Forbidden__ - Disallowed entity. + /// __Not found__ - No food items exist that match your query parameters. + /// __Server error__ - Internal server error, request failed, or base error. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._ + [HttpGet] + [Route("/api/v2/ingredient/search.php")] + [Authorize(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [ValidateModelState] + [SwaggerOperation("IngredientSearchPhpGet")] + [SwaggerResponse(statusCode: 200, type: typeof(IngredientObject), description: "__Valid__ - Will return an object containing any matching ingredient foods.")] + public virtual IActionResult IngredientSearchPhpGet([FromQuery][Required()]int? find, [FromQuery][Required()]bool? list, [FromQuery]bool? raw, [FromQuery]int? limit) + { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(IngredientObject)); + + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(400); + + //TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(401); + + //TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(403); + + //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(404); + + //TODO: Uncomment the next line to return response 500 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(500); + string exampleJson = null; + exampleJson = "{\n \"items\" : [ {\n \"protein_conversion_factor\" : 0.8008281904610115,\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"name\" : \"name\",\n \"description\" : \"description\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"footnote\" : \"footnote\",\n \"common_name\" : \"common_name\",\n \"nutrients\" : {\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ]\n }, {\n \"protein_conversion_factor\" : 0.8008281904610115,\n \"calorie_conversion_factor\" : {\n \"carbohydrate_value\" : 6.84685269835264,\n \"protein_value\" : 1.0246457001441578,\n \"fat_value\" : 1.4894159098541704\n },\n \"components\" : [ {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n }, {\n \"data_points\" : 3,\n \"pct_weight\" : 9.018348186070783,\n \"gram_weight\" : 6.438423552598547,\n \"name\" : \"name\",\n \"is_refuse\" : true\n } ],\n \"diet_labels\" : {\n \"vegetarian\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 9,\n \"name\" : \"name\",\n \"compatibility_level\" : 5,\n \"is_compatible\" : true\n },\n \"vegan\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 4,\n \"name\" : \"name\",\n \"compatibility_level\" : 1,\n \"is_compatible\" : true\n },\n \"gluten_free\" : {\n \"confidence_description\" : \"confidence_description\",\n \"confidence\" : 6,\n \"name\" : \"name\",\n \"compatibility_level\" : 9,\n \"is_compatible\" : true\n }\n },\n \"name\" : \"name\",\n \"description\" : \"description\",\n \"categories\" : [ \"categories\", \"categories\" ],\n \"footnote\" : \"footnote\",\n \"common_name\" : \"common_name\",\n \"nutrients\" : {\n \"usda\" : [ {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n }, {\n \"data_points\" : 1,\n \"min\" : 2.027123023002322,\n \"median\" : 7.386281948385884,\n \"max\" : 4.145608029883936,\n \"name\" : \"name\",\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"id\" : 9,\n \"per_100g\" : 3.616076749251911,\n \"footnote\" : \"footnote\",\n \"source\" : \"source\"\n } ]\n },\n \"portions\" : [ {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n }, {\n \"data_points\" : 1,\n \"modifier\" : \"modifier\",\n \"gram_weight\" : 6.965117697638846,\n \"measurement_unit\" : \"measurement_unit\",\n \"description\" : \"description\",\n \"footnote\" : \"footnote\"\n } ]\n } ]\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject(exampleJson) + : default(IngredientObject); //TODO: Change the data returned + return new ObjectResult(example); + } + } +} diff --git a/src/IO.Swagger/Dockerfile b/src/IO.Swagger/Dockerfile new file mode 100644 index 0000000..967c819 --- /dev/null +++ b/src/IO.Swagger/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env +WORKDIR /app + +ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 + +# copy csproj and restore as distinct layers +COPY *.csproj ./ +RUN dotnet restore + +# copy everything else and build +COPY . ./ +RUN dotnet publish -c Release -o out + +# build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 +WORKDIR /app +COPY --from=build-env /app/out . +ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/src/IO.Swagger/Filters/BasePathFilter.cs b/src/IO.Swagger/Filters/BasePathFilter.cs new file mode 100644 index 0000000..f3c528e --- /dev/null +++ b/src/IO.Swagger/Filters/BasePathFilter.cs @@ -0,0 +1,50 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of Swagger and removes it from the individual URL paths + /// + public class BasePathFilter : IDocumentFilter + { + /// + /// Constructor + /// + /// BasePath to remove from Operations + public BasePathFilter(string basePath) + { + BasePath = basePath; + } + + /// + /// Gets the BasePath of the Swagger Doc + /// + /// The BasePath of the Swagger Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// SwaggerDocument + /// FilterContext + public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context) + { + swaggerDoc.BasePath = this.BasePath; + + var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); + + foreach (var path in pathsToModify) + { + if (path.Key.StartsWith(this.BasePath)) + { + string newKey = Regex.Replace(path.Key, $"^{this.BasePath}", string.Empty); + swaggerDoc.Paths.Remove(path.Key); + swaggerDoc.Paths.Add(newKey, path.Value); + } + } + } + } +} diff --git a/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 0000000..8681586 --- /dev/null +++ b/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,100 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(Operation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + if (par.ParameterDescriptor != null && par.ParameterDescriptor is ControllerParameterDescriptor && ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo != null) + { + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes; + + if (attributes != null && attributes.Count() > 0 && swaggerParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + swaggerParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + string regex = (string)regexAttr.ConstructorArguments[0].Value; + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).Pattern = regex; + } + } + + // String Length [StringLength] + int? minLenght = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLenght = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; + } + maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; + } + + var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); + if (minLengthAttr != null) + { + minLenght = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).MinLength = minLenght; + ((NonBodyParameter)swaggerParam).MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).Minimum = rangeMin; + ((NonBodyParameter)swaggerParam).Maximum = rangeMax; + } + } + } + } + } + } + } +} + diff --git a/src/IO.Swagger/IO.Swagger.csproj b/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 0000000..616076b --- /dev/null +++ b/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,19 @@ + + + IO.Swagger + IO.Swagger + netcoreapp2.2 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + diff --git a/src/IO.Swagger/Models/BrandedFoodObject.cs b/src/IO.Swagger/Models/BrandedFoodObject.cs new file mode 100644 index 0000000..d24a475 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObject.cs @@ -0,0 +1,120 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Please read the description of each field in this API response object example. By default, the value of each field is __null__. This indicates an unknown state or that no data exists. + /// + [DataContract] + public partial class BrandedFoodObject : IEquatable + { + /// + /// An array containing an object for each individual item returned by your API call. + /// + /// An array containing an object for each individual item returned by your API call. + [DataMember(Name="items")] + public List Items { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObject {\n"); + sb.Append(" Items: ").Append(Items).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObject)obj); + } + + /// + /// Returns true if BrandedFoodObject instances are equal + /// + /// Instance of BrandedFoodObject to be compared + /// Boolean + public bool Equals(BrandedFoodObject other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Items == other.Items || + Items != null && + Items.SequenceEqual(other.Items) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Items != null) + hashCode = hashCode * 59 + Items.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObject left, BrandedFoodObject right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObject left, BrandedFoodObject right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectCalorieConversionFactor.cs b/src/IO.Swagger/Models/BrandedFoodObjectCalorieConversionFactor.cs new file mode 100644 index 0000000..bc860d4 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectCalorieConversionFactor.cs @@ -0,0 +1,150 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing the multiplication factors to be used when calculating energy from macronutrients for a specific food. + /// + [DataContract] + public partial class BrandedFoodObjectCalorieConversionFactor : IEquatable + { + /// + /// The multiplication factor for protein + /// + /// The multiplication factor for protein + [DataMember(Name="protein_value")] + public decimal? ProteinValue { get; set; } + + /// + /// The multiplication factor for fat + /// + /// The multiplication factor for fat + [DataMember(Name="fat_value")] + public decimal? FatValue { get; set; } + + /// + /// The multiplication factor for carbohydrates + /// + /// The multiplication factor for carbohydrates + [DataMember(Name="carbohydrate_value")] + public decimal? CarbohydrateValue { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectCalorieConversionFactor {\n"); + sb.Append(" ProteinValue: ").Append(ProteinValue).Append("\n"); + sb.Append(" FatValue: ").Append(FatValue).Append("\n"); + sb.Append(" CarbohydrateValue: ").Append(CarbohydrateValue).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectCalorieConversionFactor)obj); + } + + /// + /// Returns true if BrandedFoodObjectCalorieConversionFactor instances are equal + /// + /// Instance of BrandedFoodObjectCalorieConversionFactor to be compared + /// Boolean + public bool Equals(BrandedFoodObjectCalorieConversionFactor other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + ProteinValue == other.ProteinValue || + ProteinValue != null && + ProteinValue.Equals(other.ProteinValue) + ) && + ( + FatValue == other.FatValue || + FatValue != null && + FatValue.Equals(other.FatValue) + ) && + ( + CarbohydrateValue == other.CarbohydrateValue || + CarbohydrateValue != null && + CarbohydrateValue.Equals(other.CarbohydrateValue) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (ProteinValue != null) + hashCode = hashCode * 59 + ProteinValue.GetHashCode(); + if (FatValue != null) + hashCode = hashCode * 59 + FatValue.GetHashCode(); + if (CarbohydrateValue != null) + hashCode = hashCode * 59 + CarbohydrateValue.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectCalorieConversionFactor left, BrandedFoodObjectCalorieConversionFactor right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectCalorieConversionFactor left, BrandedFoodObjectCalorieConversionFactor right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectComponents.cs b/src/IO.Swagger/Models/BrandedFoodObjectComponents.cs new file mode 100644 index 0000000..20d4df3 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectComponents.cs @@ -0,0 +1,180 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing information on a specific component of this food item + /// + [DataContract] + public partial class BrandedFoodObjectComponents : IEquatable + { + /// + /// The kind of component, e.g. bone + /// + /// The kind of component, e.g. bone + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// The weight of the component as a percentage of the total weight of the food + /// + /// The weight of the component as a percentage of the total weight of the food + [DataMember(Name="pct_weight")] + public decimal? PctWeight { get; set; } + + /// + /// The weight of the component in grams + /// + /// The weight of the component in grams + [DataMember(Name="gram_weight")] + public decimal? GramWeight { get; set; } + + /// + /// Whether the component is refuse, i.e. not edible + /// + /// Whether the component is refuse, i.e. not edible + [DataMember(Name="is_refuse")] + public bool? IsRefuse { get; set; } + + /// + /// The number of obersvations on which the measure is based + /// + /// The number of obersvations on which the measure is based + [DataMember(Name="data_points")] + public int? DataPoints { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectComponents {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" PctWeight: ").Append(PctWeight).Append("\n"); + sb.Append(" GramWeight: ").Append(GramWeight).Append("\n"); + sb.Append(" IsRefuse: ").Append(IsRefuse).Append("\n"); + sb.Append(" DataPoints: ").Append(DataPoints).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectComponents)obj); + } + + /// + /// Returns true if BrandedFoodObjectComponents instances are equal + /// + /// Instance of BrandedFoodObjectComponents to be compared + /// Boolean + public bool Equals(BrandedFoodObjectComponents other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + PctWeight == other.PctWeight || + PctWeight != null && + PctWeight.Equals(other.PctWeight) + ) && + ( + GramWeight == other.GramWeight || + GramWeight != null && + GramWeight.Equals(other.GramWeight) + ) && + ( + IsRefuse == other.IsRefuse || + IsRefuse != null && + IsRefuse.Equals(other.IsRefuse) + ) && + ( + DataPoints == other.DataPoints || + DataPoints != null && + DataPoints.Equals(other.DataPoints) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (PctWeight != null) + hashCode = hashCode * 59 + PctWeight.GetHashCode(); + if (GramWeight != null) + hashCode = hashCode * 59 + GramWeight.GetHashCode(); + if (IsRefuse != null) + hashCode = hashCode * 59 + IsRefuse.GetHashCode(); + if (DataPoints != null) + hashCode = hashCode * 59 + DataPoints.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectComponents left, BrandedFoodObjectComponents right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectComponents left, BrandedFoodObjectComponents right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectCountryDetails.cs b/src/IO.Swagger/Models/BrandedFoodObjectCountryDetails.cs new file mode 100644 index 0000000..37efb73 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectCountryDetails.cs @@ -0,0 +1,135 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing additional information on the countries where this item is found + /// + [DataContract] + public partial class BrandedFoodObjectCountryDetails : IEquatable + { + /// + /// The number of countries where English is the country's primary language + /// + /// The number of countries where English is the country's primary language + [DataMember(Name="english_speaking")] + public int? EnglishSpeaking { get; set; } + + /// + /// The number of countries where English is not the country's primary language + /// + /// The number of countries where English is not the country's primary language + [DataMember(Name="non_english_speaking")] + public int? NonEnglishSpeaking { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectCountryDetails {\n"); + sb.Append(" EnglishSpeaking: ").Append(EnglishSpeaking).Append("\n"); + sb.Append(" NonEnglishSpeaking: ").Append(NonEnglishSpeaking).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectCountryDetails)obj); + } + + /// + /// Returns true if BrandedFoodObjectCountryDetails instances are equal + /// + /// Instance of BrandedFoodObjectCountryDetails to be compared + /// Boolean + public bool Equals(BrandedFoodObjectCountryDetails other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + EnglishSpeaking == other.EnglishSpeaking || + EnglishSpeaking != null && + EnglishSpeaking.Equals(other.EnglishSpeaking) + ) && + ( + NonEnglishSpeaking == other.NonEnglishSpeaking || + NonEnglishSpeaking != null && + NonEnglishSpeaking.Equals(other.NonEnglishSpeaking) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (EnglishSpeaking != null) + hashCode = hashCode * 59 + EnglishSpeaking.GetHashCode(); + if (NonEnglishSpeaking != null) + hashCode = hashCode * 59 + NonEnglishSpeaking.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectCountryDetails left, BrandedFoodObjectCountryDetails right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectCountryDetails left, BrandedFoodObjectCountryDetails right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectDietFlags.cs b/src/IO.Swagger/Models/BrandedFoodObjectDietFlags.cs new file mode 100644 index 0000000..8a8ea2b --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectDietFlags.cs @@ -0,0 +1,210 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing information on an individual ingredient that was flagged as potentially not being compatible with a certain diet + /// + [DataContract] + public partial class BrandedFoodObjectDietFlags : IEquatable + { + /// + /// Ingredient name + /// + /// Ingredient name + [DataMember(Name="ingredient")] + public string Ingredient { get; set; } + + /// + /// Description of the ingredient + /// + /// Description of the ingredient + [DataMember(Name="ingredient_description")] + public string IngredientDescription { get; set; } + + /// + /// Name of the diet with which this ingredient may not be compatible + /// + /// Name of the diet with which this ingredient may not be compatible + [DataMember(Name="diet_label")] + public string DietLabel { get; set; } + + /// + /// A description of if we believe this ingredient is compatible with the diet + /// + /// A description of if we believe this ingredient is compatible with the diet + [DataMember(Name="is_compatible")] + public string IsCompatible { get; set; } + + /// + /// A numeric representation of if we believe this ingredient is compatible with the diet. Higher values indicate more compatibility + /// + /// A numeric representation of if we believe this ingredient is compatible with the diet. Higher values indicate more compatibility + [DataMember(Name="compatibility_level")] + public int? CompatibilityLevel { get; set; } + + /// + /// A description of how we graded this ingredient for compatibility with the diet + /// + /// A description of how we graded this ingredient for compatibility with the diet + [DataMember(Name="compatibility_description")] + public string CompatibilityDescription { get; set; } + + /// + /// Boolean representing if the ingredient is a known allergen + /// + /// Boolean representing if the ingredient is a known allergen + [DataMember(Name="is_allergen")] + public bool? IsAllergen { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectDietFlags {\n"); + sb.Append(" Ingredient: ").Append(Ingredient).Append("\n"); + sb.Append(" IngredientDescription: ").Append(IngredientDescription).Append("\n"); + sb.Append(" DietLabel: ").Append(DietLabel).Append("\n"); + sb.Append(" IsCompatible: ").Append(IsCompatible).Append("\n"); + sb.Append(" CompatibilityLevel: ").Append(CompatibilityLevel).Append("\n"); + sb.Append(" CompatibilityDescription: ").Append(CompatibilityDescription).Append("\n"); + sb.Append(" IsAllergen: ").Append(IsAllergen).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectDietFlags)obj); + } + + /// + /// Returns true if BrandedFoodObjectDietFlags instances are equal + /// + /// Instance of BrandedFoodObjectDietFlags to be compared + /// Boolean + public bool Equals(BrandedFoodObjectDietFlags other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Ingredient == other.Ingredient || + Ingredient != null && + Ingredient.Equals(other.Ingredient) + ) && + ( + IngredientDescription == other.IngredientDescription || + IngredientDescription != null && + IngredientDescription.Equals(other.IngredientDescription) + ) && + ( + DietLabel == other.DietLabel || + DietLabel != null && + DietLabel.Equals(other.DietLabel) + ) && + ( + IsCompatible == other.IsCompatible || + IsCompatible != null && + IsCompatible.Equals(other.IsCompatible) + ) && + ( + CompatibilityLevel == other.CompatibilityLevel || + CompatibilityLevel != null && + CompatibilityLevel.Equals(other.CompatibilityLevel) + ) && + ( + CompatibilityDescription == other.CompatibilityDescription || + CompatibilityDescription != null && + CompatibilityDescription.Equals(other.CompatibilityDescription) + ) && + ( + IsAllergen == other.IsAllergen || + IsAllergen != null && + IsAllergen.Equals(other.IsAllergen) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Ingredient != null) + hashCode = hashCode * 59 + Ingredient.GetHashCode(); + if (IngredientDescription != null) + hashCode = hashCode * 59 + IngredientDescription.GetHashCode(); + if (DietLabel != null) + hashCode = hashCode * 59 + DietLabel.GetHashCode(); + if (IsCompatible != null) + hashCode = hashCode * 59 + IsCompatible.GetHashCode(); + if (CompatibilityLevel != null) + hashCode = hashCode * 59 + CompatibilityLevel.GetHashCode(); + if (CompatibilityDescription != null) + hashCode = hashCode * 59 + CompatibilityDescription.GetHashCode(); + if (IsAllergen != null) + hashCode = hashCode * 59 + IsAllergen.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectDietFlags left, BrandedFoodObjectDietFlags right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectDietFlags left, BrandedFoodObjectDietFlags right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectDietLabels.cs b/src/IO.Swagger/Models/BrandedFoodObjectDietLabels.cs new file mode 100644 index 0000000..ffdf874 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectDietLabels.cs @@ -0,0 +1,147 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing this item's compatibility grades for each supported diet + /// + [DataContract] + public partial class BrandedFoodObjectDietLabels : IEquatable + { + /// + /// Gets or Sets Vegan + /// + [DataMember(Name="vegan")] + public BrandedFoodObjectDietLabelsVegan Vegan { get; set; } + + /// + /// Gets or Sets Vegetarian + /// + [DataMember(Name="vegetarian")] + public BrandedFoodObjectDietLabelsVegetarian Vegetarian { get; set; } + + /// + /// Gets or Sets GlutenFree + /// + [DataMember(Name="gluten_free")] + public BrandedFoodObjectDietLabelsGlutenFree GlutenFree { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectDietLabels {\n"); + sb.Append(" Vegan: ").Append(Vegan).Append("\n"); + sb.Append(" Vegetarian: ").Append(Vegetarian).Append("\n"); + sb.Append(" GlutenFree: ").Append(GlutenFree).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectDietLabels)obj); + } + + /// + /// Returns true if BrandedFoodObjectDietLabels instances are equal + /// + /// Instance of BrandedFoodObjectDietLabels to be compared + /// Boolean + public bool Equals(BrandedFoodObjectDietLabels other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Vegan == other.Vegan || + Vegan != null && + Vegan.Equals(other.Vegan) + ) && + ( + Vegetarian == other.Vegetarian || + Vegetarian != null && + Vegetarian.Equals(other.Vegetarian) + ) && + ( + GlutenFree == other.GlutenFree || + GlutenFree != null && + GlutenFree.Equals(other.GlutenFree) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Vegan != null) + hashCode = hashCode * 59 + Vegan.GetHashCode(); + if (Vegetarian != null) + hashCode = hashCode * 59 + Vegetarian.GetHashCode(); + if (GlutenFree != null) + hashCode = hashCode * 59 + GlutenFree.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectDietLabels left, BrandedFoodObjectDietLabels right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectDietLabels left, BrandedFoodObjectDietLabels right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsGlutenFree.cs b/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsGlutenFree.cs new file mode 100644 index 0000000..ef27e22 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsGlutenFree.cs @@ -0,0 +1,180 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing information on this item's compatibility with Gluten Free diets + /// + [DataContract] + public partial class BrandedFoodObjectDietLabelsGlutenFree : IEquatable + { + /// + /// Diet name + /// + /// Diet name + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Boolean describing if this item is compatible with this diet + /// + /// Boolean describing if this item is compatible with this diet + [DataMember(Name="is_compatible")] + public bool? IsCompatible { get; set; } + + /// + /// Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility + /// + /// Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility + [DataMember(Name="compatibility_level")] + public int? CompatibilityLevel { get; set; } + + /// + /// Boolean that indicates if we are confident in how this item is graded for this diet + /// + /// Boolean that indicates if we are confident in how this item is graded for this diet + [DataMember(Name="confidence")] + public int? Confidence { get; set; } + + /// + /// Description of our confidence that this item was graded correctly + /// + /// Description of our confidence that this item was graded correctly + [DataMember(Name="confidence_description")] + public string ConfidenceDescription { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectDietLabelsGlutenFree {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" IsCompatible: ").Append(IsCompatible).Append("\n"); + sb.Append(" CompatibilityLevel: ").Append(CompatibilityLevel).Append("\n"); + sb.Append(" Confidence: ").Append(Confidence).Append("\n"); + sb.Append(" ConfidenceDescription: ").Append(ConfidenceDescription).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectDietLabelsGlutenFree)obj); + } + + /// + /// Returns true if BrandedFoodObjectDietLabelsGlutenFree instances are equal + /// + /// Instance of BrandedFoodObjectDietLabelsGlutenFree to be compared + /// Boolean + public bool Equals(BrandedFoodObjectDietLabelsGlutenFree other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + IsCompatible == other.IsCompatible || + IsCompatible != null && + IsCompatible.Equals(other.IsCompatible) + ) && + ( + CompatibilityLevel == other.CompatibilityLevel || + CompatibilityLevel != null && + CompatibilityLevel.Equals(other.CompatibilityLevel) + ) && + ( + Confidence == other.Confidence || + Confidence != null && + Confidence.Equals(other.Confidence) + ) && + ( + ConfidenceDescription == other.ConfidenceDescription || + ConfidenceDescription != null && + ConfidenceDescription.Equals(other.ConfidenceDescription) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (IsCompatible != null) + hashCode = hashCode * 59 + IsCompatible.GetHashCode(); + if (CompatibilityLevel != null) + hashCode = hashCode * 59 + CompatibilityLevel.GetHashCode(); + if (Confidence != null) + hashCode = hashCode * 59 + Confidence.GetHashCode(); + if (ConfidenceDescription != null) + hashCode = hashCode * 59 + ConfidenceDescription.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectDietLabelsGlutenFree left, BrandedFoodObjectDietLabelsGlutenFree right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectDietLabelsGlutenFree left, BrandedFoodObjectDietLabelsGlutenFree right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsVegan.cs b/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsVegan.cs new file mode 100644 index 0000000..d36f016 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsVegan.cs @@ -0,0 +1,180 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing information on this item's compatibility with the Vegan diets + /// + [DataContract] + public partial class BrandedFoodObjectDietLabelsVegan : IEquatable + { + /// + /// Diet name + /// + /// Diet name + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Boolean describing if this item is compatible with this diet + /// + /// Boolean describing if this item is compatible with this diet + [DataMember(Name="is_compatible")] + public bool? IsCompatible { get; set; } + + /// + /// Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility + /// + /// Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility + [DataMember(Name="compatibility_level")] + public int? CompatibilityLevel { get; set; } + + /// + /// Boolean that indicates if we are confident in how this item is graded for this diet + /// + /// Boolean that indicates if we are confident in how this item is graded for this diet + [DataMember(Name="confidence")] + public int? Confidence { get; set; } + + /// + /// Description of our confidence that this item was graded correctly + /// + /// Description of our confidence that this item was graded correctly + [DataMember(Name="confidence_description")] + public string ConfidenceDescription { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectDietLabelsVegan {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" IsCompatible: ").Append(IsCompatible).Append("\n"); + sb.Append(" CompatibilityLevel: ").Append(CompatibilityLevel).Append("\n"); + sb.Append(" Confidence: ").Append(Confidence).Append("\n"); + sb.Append(" ConfidenceDescription: ").Append(ConfidenceDescription).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectDietLabelsVegan)obj); + } + + /// + /// Returns true if BrandedFoodObjectDietLabelsVegan instances are equal + /// + /// Instance of BrandedFoodObjectDietLabelsVegan to be compared + /// Boolean + public bool Equals(BrandedFoodObjectDietLabelsVegan other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + IsCompatible == other.IsCompatible || + IsCompatible != null && + IsCompatible.Equals(other.IsCompatible) + ) && + ( + CompatibilityLevel == other.CompatibilityLevel || + CompatibilityLevel != null && + CompatibilityLevel.Equals(other.CompatibilityLevel) + ) && + ( + Confidence == other.Confidence || + Confidence != null && + Confidence.Equals(other.Confidence) + ) && + ( + ConfidenceDescription == other.ConfidenceDescription || + ConfidenceDescription != null && + ConfidenceDescription.Equals(other.ConfidenceDescription) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (IsCompatible != null) + hashCode = hashCode * 59 + IsCompatible.GetHashCode(); + if (CompatibilityLevel != null) + hashCode = hashCode * 59 + CompatibilityLevel.GetHashCode(); + if (Confidence != null) + hashCode = hashCode * 59 + Confidence.GetHashCode(); + if (ConfidenceDescription != null) + hashCode = hashCode * 59 + ConfidenceDescription.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectDietLabelsVegan left, BrandedFoodObjectDietLabelsVegan right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectDietLabelsVegan left, BrandedFoodObjectDietLabelsVegan right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsVegetarian.cs b/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsVegetarian.cs new file mode 100644 index 0000000..bcdb647 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectDietLabelsVegetarian.cs @@ -0,0 +1,180 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing information on this item's compatibility with Vegetarian diets + /// + [DataContract] + public partial class BrandedFoodObjectDietLabelsVegetarian : IEquatable + { + /// + /// Diet name + /// + /// Diet name + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Boolean describing if this item is compatible with this diet + /// + /// Boolean describing if this item is compatible with this diet + [DataMember(Name="is_compatible")] + public bool? IsCompatible { get; set; } + + /// + /// Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility + /// + /// Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility + [DataMember(Name="compatibility_level")] + public int? CompatibilityLevel { get; set; } + + /// + /// Boolean that indicates if we are confident in how this item is graded for this diet + /// + /// Boolean that indicates if we are confident in how this item is graded for this diet + [DataMember(Name="confidence")] + public int? Confidence { get; set; } + + /// + /// Description of our confidence that this item was graded correctly + /// + /// Description of our confidence that this item was graded correctly + [DataMember(Name="confidence_description")] + public string ConfidenceDescription { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectDietLabelsVegetarian {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" IsCompatible: ").Append(IsCompatible).Append("\n"); + sb.Append(" CompatibilityLevel: ").Append(CompatibilityLevel).Append("\n"); + sb.Append(" Confidence: ").Append(Confidence).Append("\n"); + sb.Append(" ConfidenceDescription: ").Append(ConfidenceDescription).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectDietLabelsVegetarian)obj); + } + + /// + /// Returns true if BrandedFoodObjectDietLabelsVegetarian instances are equal + /// + /// Instance of BrandedFoodObjectDietLabelsVegetarian to be compared + /// Boolean + public bool Equals(BrandedFoodObjectDietLabelsVegetarian other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + IsCompatible == other.IsCompatible || + IsCompatible != null && + IsCompatible.Equals(other.IsCompatible) + ) && + ( + CompatibilityLevel == other.CompatibilityLevel || + CompatibilityLevel != null && + CompatibilityLevel.Equals(other.CompatibilityLevel) + ) && + ( + Confidence == other.Confidence || + Confidence != null && + Confidence.Equals(other.Confidence) + ) && + ( + ConfidenceDescription == other.ConfidenceDescription || + ConfidenceDescription != null && + ConfidenceDescription.Equals(other.ConfidenceDescription) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (IsCompatible != null) + hashCode = hashCode * 59 + IsCompatible.GetHashCode(); + if (CompatibilityLevel != null) + hashCode = hashCode * 59 + CompatibilityLevel.GetHashCode(); + if (Confidence != null) + hashCode = hashCode * 59 + Confidence.GetHashCode(); + if (ConfidenceDescription != null) + hashCode = hashCode * 59 + ConfidenceDescription.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectDietLabelsVegetarian left, BrandedFoodObjectDietLabelsVegetarian right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectDietLabelsVegetarian left, BrandedFoodObjectDietLabelsVegetarian right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectItems.cs b/src/IO.Swagger/Models/BrandedFoodObjectItems.cs new file mode 100644 index 0000000..ad4992e --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectItems.cs @@ -0,0 +1,517 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing information for this specific item. + /// + [DataContract] + public partial class BrandedFoodObjectItems : IEquatable + { + /// + /// EAN/UPC barcode + /// + /// EAN/UPC barcode + [DataMember(Name="barcode")] + public string Barcode { get; set; } + + /// + /// Item name as provided by brand owner or as shown on packaging + /// + /// Item name as provided by brand owner or as shown on packaging + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// The brand name that owns this item + /// + /// The brand name that owns this item + [DataMember(Name="brand")] + public string Brand { get; set; } + + /// + /// Ingredients in order of highest value to least + /// + /// Ingredients in order of highest value to least + [DataMember(Name="ingredients")] + public string Ingredients { get; set; } + + /// + /// Gets or Sets Package + /// + [DataMember(Name="package")] + public BrandedFoodObjectPackage Package { get; set; } + + /// + /// Gets or Sets Serving + /// + [DataMember(Name="serving")] + public BrandedFoodObjectServing Serving { get; set; } + + /// + /// Gets or Sets Categories + /// + [DataMember(Name="categories")] + public List Categories { get; set; } + + /// + /// Gets or Sets Nutrients + /// + [DataMember(Name="nutrients")] + public BrandedFoodObjectNutrients Nutrients { get; set; } + + /// + /// Gets or Sets CalorieConversionFactor + /// + [DataMember(Name="calorie_conversion_factor")] + public BrandedFoodObjectCalorieConversionFactor CalorieConversionFactor { get; set; } + + /// + /// The multiplication factor used to calculate protein from nitrogen + /// + /// The multiplication factor used to calculate protein from nitrogen + [DataMember(Name="protein_conversion_factor")] + public decimal? ProteinConversionFactor { get; set; } + + /// + /// Gets or Sets DietLabels + /// + [DataMember(Name="diet_labels")] + public BrandedFoodObjectDietLabels DietLabels { get; set; } + + /// + /// An array of ingredient objects that were flagged while grading this item for compatibility with each diet + /// + /// An array of ingredient objects that were flagged while grading this item for compatibility with each diet + [DataMember(Name="diet_flags")] + public List DietFlags { get; set; } + + /// + /// Gets or Sets PackagingPhotos + /// + [DataMember(Name="packaging_photos")] + public BrandedFoodObjectPackagingPhotos PackagingPhotos { get; set; } + + /// + /// An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) + /// + /// An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) + [DataMember(Name="components")] + public List Components { get; set; } + + /// + /// An array of objects containing information on discrete amounts of a food found in this item + /// + /// An array of objects containing information on discrete amounts of a food found in this item + [DataMember(Name="portions")] + public List Portions { get; set; } + + /// + /// An array of ingredients in this item that may cause allergic reactions in people + /// + /// An array of ingredients in this item that may cause allergic reactions in people + [DataMember(Name="allergens")] + public List Allergens { get; set; } + + /// + /// An array of brands we have associated with this item. Some items are sold by more than 1 brand. + /// + /// An array of brands we have associated with this item. Some items are sold by more than 1 brand. + [DataMember(Name="brand_list")] + public List BrandList { get; set; } + + /// + /// An array of countries where this item is sold + /// + /// An array of countries where this item is sold + [DataMember(Name="countries")] + public List Countries { get; set; } + + /// + /// Gets or Sets CountryDetails + /// + [DataMember(Name="country_details")] + public BrandedFoodObjectCountryDetails CountryDetails { get; set; } + + /// + /// An array of ingredients made from palm oil + /// + /// An array of ingredients made from palm oil + [DataMember(Name="palm_oil_ingredients")] + public List PalmOilIngredients { get; set; } + + /// + /// An array of this item's ingredients + /// + /// An array of this item's ingredients + [DataMember(Name="ingredient_list")] + public List IngredientList { get; set; } + + /// + /// A boolean indicating if we have English ingredients for this item + /// + /// A boolean indicating if we have English ingredients for this item + [DataMember(Name="has_english_ingredients")] + public bool? HasEnglishIngredients { get; set; } + + /// + /// An array of minerals that this item contains + /// + /// An array of minerals that this item contains + [DataMember(Name="minerals")] + public List Minerals { get; set; } + + /// + /// An array of trace ingredients that may be found in this item + /// + /// An array of trace ingredients that may be found in this item + [DataMember(Name="traces")] + public List Traces { get; set; } + + /// + /// 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\") + /// + /// 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\") + [DataMember(Name="common_name")] + public string CommonName { get; set; } + + /// + /// A description of this item + /// + /// A description of this item + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// An array of keywords that can be used to describe this item + /// + /// An array of keywords that can be used to describe this item + [DataMember(Name="keywords")] + public List Keywords { get; set; } + + /// + /// Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. + /// + /// Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. + [DataMember(Name="footnote")] + public string Footnote { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectItems {\n"); + sb.Append(" Barcode: ").Append(Barcode).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Brand: ").Append(Brand).Append("\n"); + sb.Append(" Ingredients: ").Append(Ingredients).Append("\n"); + sb.Append(" Package: ").Append(Package).Append("\n"); + sb.Append(" Serving: ").Append(Serving).Append("\n"); + sb.Append(" Categories: ").Append(Categories).Append("\n"); + sb.Append(" Nutrients: ").Append(Nutrients).Append("\n"); + sb.Append(" CalorieConversionFactor: ").Append(CalorieConversionFactor).Append("\n"); + sb.Append(" ProteinConversionFactor: ").Append(ProteinConversionFactor).Append("\n"); + sb.Append(" DietLabels: ").Append(DietLabels).Append("\n"); + sb.Append(" DietFlags: ").Append(DietFlags).Append("\n"); + sb.Append(" PackagingPhotos: ").Append(PackagingPhotos).Append("\n"); + sb.Append(" Components: ").Append(Components).Append("\n"); + sb.Append(" Portions: ").Append(Portions).Append("\n"); + sb.Append(" Allergens: ").Append(Allergens).Append("\n"); + sb.Append(" BrandList: ").Append(BrandList).Append("\n"); + sb.Append(" Countries: ").Append(Countries).Append("\n"); + sb.Append(" CountryDetails: ").Append(CountryDetails).Append("\n"); + sb.Append(" PalmOilIngredients: ").Append(PalmOilIngredients).Append("\n"); + sb.Append(" IngredientList: ").Append(IngredientList).Append("\n"); + sb.Append(" HasEnglishIngredients: ").Append(HasEnglishIngredients).Append("\n"); + sb.Append(" Minerals: ").Append(Minerals).Append("\n"); + sb.Append(" Traces: ").Append(Traces).Append("\n"); + sb.Append(" CommonName: ").Append(CommonName).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Keywords: ").Append(Keywords).Append("\n"); + sb.Append(" Footnote: ").Append(Footnote).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectItems)obj); + } + + /// + /// Returns true if BrandedFoodObjectItems instances are equal + /// + /// Instance of BrandedFoodObjectItems to be compared + /// Boolean + public bool Equals(BrandedFoodObjectItems other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Barcode == other.Barcode || + Barcode != null && + Barcode.Equals(other.Barcode) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + Brand == other.Brand || + Brand != null && + Brand.Equals(other.Brand) + ) && + ( + Ingredients == other.Ingredients || + Ingredients != null && + Ingredients.Equals(other.Ingredients) + ) && + ( + Package == other.Package || + Package != null && + Package.Equals(other.Package) + ) && + ( + Serving == other.Serving || + Serving != null && + Serving.Equals(other.Serving) + ) && + ( + Categories == other.Categories || + Categories != null && + Categories.SequenceEqual(other.Categories) + ) && + ( + Nutrients == other.Nutrients || + Nutrients != null && + Nutrients.Equals(other.Nutrients) + ) && + ( + CalorieConversionFactor == other.CalorieConversionFactor || + CalorieConversionFactor != null && + CalorieConversionFactor.Equals(other.CalorieConversionFactor) + ) && + ( + ProteinConversionFactor == other.ProteinConversionFactor || + ProteinConversionFactor != null && + ProteinConversionFactor.Equals(other.ProteinConversionFactor) + ) && + ( + DietLabels == other.DietLabels || + DietLabels != null && + DietLabels.Equals(other.DietLabels) + ) && + ( + DietFlags == other.DietFlags || + DietFlags != null && + DietFlags.SequenceEqual(other.DietFlags) + ) && + ( + PackagingPhotos == other.PackagingPhotos || + PackagingPhotos != null && + PackagingPhotos.Equals(other.PackagingPhotos) + ) && + ( + Components == other.Components || + Components != null && + Components.SequenceEqual(other.Components) + ) && + ( + Portions == other.Portions || + Portions != null && + Portions.SequenceEqual(other.Portions) + ) && + ( + Allergens == other.Allergens || + Allergens != null && + Allergens.SequenceEqual(other.Allergens) + ) && + ( + BrandList == other.BrandList || + BrandList != null && + BrandList.SequenceEqual(other.BrandList) + ) && + ( + Countries == other.Countries || + Countries != null && + Countries.SequenceEqual(other.Countries) + ) && + ( + CountryDetails == other.CountryDetails || + CountryDetails != null && + CountryDetails.Equals(other.CountryDetails) + ) && + ( + PalmOilIngredients == other.PalmOilIngredients || + PalmOilIngredients != null && + PalmOilIngredients.SequenceEqual(other.PalmOilIngredients) + ) && + ( + IngredientList == other.IngredientList || + IngredientList != null && + IngredientList.SequenceEqual(other.IngredientList) + ) && + ( + HasEnglishIngredients == other.HasEnglishIngredients || + HasEnglishIngredients != null && + HasEnglishIngredients.Equals(other.HasEnglishIngredients) + ) && + ( + Minerals == other.Minerals || + Minerals != null && + Minerals.SequenceEqual(other.Minerals) + ) && + ( + Traces == other.Traces || + Traces != null && + Traces.SequenceEqual(other.Traces) + ) && + ( + CommonName == other.CommonName || + CommonName != null && + CommonName.Equals(other.CommonName) + ) && + ( + Description == other.Description || + Description != null && + Description.Equals(other.Description) + ) && + ( + Keywords == other.Keywords || + Keywords != null && + Keywords.SequenceEqual(other.Keywords) + ) && + ( + Footnote == other.Footnote || + Footnote != null && + Footnote.Equals(other.Footnote) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Barcode != null) + hashCode = hashCode * 59 + Barcode.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (Brand != null) + hashCode = hashCode * 59 + Brand.GetHashCode(); + if (Ingredients != null) + hashCode = hashCode * 59 + Ingredients.GetHashCode(); + if (Package != null) + hashCode = hashCode * 59 + Package.GetHashCode(); + if (Serving != null) + hashCode = hashCode * 59 + Serving.GetHashCode(); + if (Categories != null) + hashCode = hashCode * 59 + Categories.GetHashCode(); + if (Nutrients != null) + hashCode = hashCode * 59 + Nutrients.GetHashCode(); + if (CalorieConversionFactor != null) + hashCode = hashCode * 59 + CalorieConversionFactor.GetHashCode(); + if (ProteinConversionFactor != null) + hashCode = hashCode * 59 + ProteinConversionFactor.GetHashCode(); + if (DietLabels != null) + hashCode = hashCode * 59 + DietLabels.GetHashCode(); + if (DietFlags != null) + hashCode = hashCode * 59 + DietFlags.GetHashCode(); + if (PackagingPhotos != null) + hashCode = hashCode * 59 + PackagingPhotos.GetHashCode(); + if (Components != null) + hashCode = hashCode * 59 + Components.GetHashCode(); + if (Portions != null) + hashCode = hashCode * 59 + Portions.GetHashCode(); + if (Allergens != null) + hashCode = hashCode * 59 + Allergens.GetHashCode(); + if (BrandList != null) + hashCode = hashCode * 59 + BrandList.GetHashCode(); + if (Countries != null) + hashCode = hashCode * 59 + Countries.GetHashCode(); + if (CountryDetails != null) + hashCode = hashCode * 59 + CountryDetails.GetHashCode(); + if (PalmOilIngredients != null) + hashCode = hashCode * 59 + PalmOilIngredients.GetHashCode(); + if (IngredientList != null) + hashCode = hashCode * 59 + IngredientList.GetHashCode(); + if (HasEnglishIngredients != null) + hashCode = hashCode * 59 + HasEnglishIngredients.GetHashCode(); + if (Minerals != null) + hashCode = hashCode * 59 + Minerals.GetHashCode(); + if (Traces != null) + hashCode = hashCode * 59 + Traces.GetHashCode(); + if (CommonName != null) + hashCode = hashCode * 59 + CommonName.GetHashCode(); + if (Description != null) + hashCode = hashCode * 59 + Description.GetHashCode(); + if (Keywords != null) + hashCode = hashCode * 59 + Keywords.GetHashCode(); + if (Footnote != null) + hashCode = hashCode * 59 + Footnote.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectItems left, BrandedFoodObjectItems right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectItems left, BrandedFoodObjectItems right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectNutrients.cs b/src/IO.Swagger/Models/BrandedFoodObjectNutrients.cs new file mode 100644 index 0000000..503abe0 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectNutrients.cs @@ -0,0 +1,135 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing nutrient information from multiple sources + /// + [DataContract] + public partial class BrandedFoodObjectNutrients : IEquatable + { + /// + /// An array containing an object for each nutrient data point + /// + /// An array containing an object for each nutrient data point + [DataMember(Name="chomp")] + public List Chomp { get; set; } + + /// + /// An array containing an object for each nutrient data point as found in the USDA database + /// + /// An array containing an object for each nutrient data point as found in the USDA database + [DataMember(Name="usda")] + public List Usda { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectNutrients {\n"); + sb.Append(" Chomp: ").Append(Chomp).Append("\n"); + sb.Append(" Usda: ").Append(Usda).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectNutrients)obj); + } + + /// + /// Returns true if BrandedFoodObjectNutrients instances are equal + /// + /// Instance of BrandedFoodObjectNutrients to be compared + /// Boolean + public bool Equals(BrandedFoodObjectNutrients other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Chomp == other.Chomp || + Chomp != null && + Chomp.SequenceEqual(other.Chomp) + ) && + ( + Usda == other.Usda || + Usda != null && + Usda.SequenceEqual(other.Usda) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Chomp != null) + hashCode = hashCode * 59 + Chomp.GetHashCode(); + if (Usda != null) + hashCode = hashCode * 59 + Usda.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectNutrients left, BrandedFoodObjectNutrients right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectNutrients left, BrandedFoodObjectNutrients right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectNutrientsChomp.cs b/src/IO.Swagger/Models/BrandedFoodObjectNutrientsChomp.cs new file mode 100644 index 0000000..6f3c4cf --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectNutrientsChomp.cs @@ -0,0 +1,180 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class BrandedFoodObjectNutrientsChomp : IEquatable + { + /// + /// Nutrient name + /// + /// Nutrient name + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) + /// + /// The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) + [DataMember(Name="measurement_unit")] + public string MeasurementUnit { get; set; } + + /// + /// Amount of the nutrient per 100g of food + /// + /// Amount of the nutrient per 100g of food + [DataMember(Name="per_100g")] + public decimal? Per100g { get; set; } + + /// + /// Nutrient value per serving + /// + /// Nutrient value per serving + [DataMember(Name="per_serving")] + public decimal? PerServing { get; set; } + + /// + /// Total nutrient value + /// + /// Total nutrient value + [DataMember(Name="total")] + public decimal? Total { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectNutrientsChomp {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" MeasurementUnit: ").Append(MeasurementUnit).Append("\n"); + sb.Append(" Per100g: ").Append(Per100g).Append("\n"); + sb.Append(" PerServing: ").Append(PerServing).Append("\n"); + sb.Append(" Total: ").Append(Total).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectNutrientsChomp)obj); + } + + /// + /// Returns true if BrandedFoodObjectNutrientsChomp instances are equal + /// + /// Instance of BrandedFoodObjectNutrientsChomp to be compared + /// Boolean + public bool Equals(BrandedFoodObjectNutrientsChomp other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + MeasurementUnit == other.MeasurementUnit || + MeasurementUnit != null && + MeasurementUnit.Equals(other.MeasurementUnit) + ) && + ( + Per100g == other.Per100g || + Per100g != null && + Per100g.Equals(other.Per100g) + ) && + ( + PerServing == other.PerServing || + PerServing != null && + PerServing.Equals(other.PerServing) + ) && + ( + Total == other.Total || + Total != null && + Total.Equals(other.Total) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (MeasurementUnit != null) + hashCode = hashCode * 59 + MeasurementUnit.GetHashCode(); + if (Per100g != null) + hashCode = hashCode * 59 + Per100g.GetHashCode(); + if (PerServing != null) + hashCode = hashCode * 59 + PerServing.GetHashCode(); + if (Total != null) + hashCode = hashCode * 59 + Total.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectNutrientsChomp left, BrandedFoodObjectNutrientsChomp right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectNutrientsChomp left, BrandedFoodObjectNutrientsChomp right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectNutrientsUsda.cs b/src/IO.Swagger/Models/BrandedFoodObjectNutrientsUsda.cs new file mode 100644 index 0000000..82cd916 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectNutrientsUsda.cs @@ -0,0 +1,270 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// + /// + [DataContract] + public partial class BrandedFoodObjectNutrientsUsda : IEquatable + { + /// + /// Nutrient ID + /// + /// Nutrient ID + [DataMember(Name="id")] + public int? Id { get; set; } + + /// + /// Nutrient name + /// + /// Nutrient name + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Amount of the nutrient per 100g of food + /// + /// Amount of the nutrient per 100g of food + [DataMember(Name="per_100g")] + public decimal? Per100g { get; set; } + + /// + /// The unit used for the measure of this nutrient + /// + /// The unit used for the measure of this nutrient + [DataMember(Name="measurement_unit")] + public string MeasurementUnit { get; set; } + + /// + /// Minimum nutrient value + /// + /// Minimum nutrient value + [DataMember(Name="min")] + public decimal? Min { get; set; } + + /// + /// Maximum nutrient value + /// + /// Maximum nutrient value + [DataMember(Name="max")] + public decimal? Max { get; set; } + + /// + /// Median nutrient value + /// + /// Median nutrient value + [DataMember(Name="median")] + public decimal? Median { get; set; } + + /// + /// Number of observations on which the value is based + /// + /// Number of observations on which the value is based + [DataMember(Name="data_points")] + public int? DataPoints { get; set; } + + /// + /// Comments on any unusual aspect of the food nutrient. Examples might include why a nutrient value is different than typically expected. + /// + /// Comments on any unusual aspect of the food nutrient. Examples might include why a nutrient value is different than typically expected. + [DataMember(Name="footnote")] + public string Footnote { get; set; } + + /// + /// Description of the nutrient source + /// + /// Description of the nutrient source + [DataMember(Name="source")] + public string Source { get; set; } + + /// + /// Description of how the food nutrient value was obtained + /// + /// Description of how the food nutrient value was obtained + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectNutrientsUsda {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Per100g: ").Append(Per100g).Append("\n"); + sb.Append(" MeasurementUnit: ").Append(MeasurementUnit).Append("\n"); + sb.Append(" Min: ").Append(Min).Append("\n"); + sb.Append(" Max: ").Append(Max).Append("\n"); + sb.Append(" Median: ").Append(Median).Append("\n"); + sb.Append(" DataPoints: ").Append(DataPoints).Append("\n"); + sb.Append(" Footnote: ").Append(Footnote).Append("\n"); + sb.Append(" Source: ").Append(Source).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectNutrientsUsda)obj); + } + + /// + /// Returns true if BrandedFoodObjectNutrientsUsda instances are equal + /// + /// Instance of BrandedFoodObjectNutrientsUsda to be compared + /// Boolean + public bool Equals(BrandedFoodObjectNutrientsUsda other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + Id.Equals(other.Id) + ) && + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + Per100g == other.Per100g || + Per100g != null && + Per100g.Equals(other.Per100g) + ) && + ( + MeasurementUnit == other.MeasurementUnit || + MeasurementUnit != null && + MeasurementUnit.Equals(other.MeasurementUnit) + ) && + ( + Min == other.Min || + Min != null && + Min.Equals(other.Min) + ) && + ( + Max == other.Max || + Max != null && + Max.Equals(other.Max) + ) && + ( + Median == other.Median || + Median != null && + Median.Equals(other.Median) + ) && + ( + DataPoints == other.DataPoints || + DataPoints != null && + DataPoints.Equals(other.DataPoints) + ) && + ( + Footnote == other.Footnote || + Footnote != null && + Footnote.Equals(other.Footnote) + ) && + ( + Source == other.Source || + Source != null && + Source.Equals(other.Source) + ) && + ( + Description == other.Description || + Description != null && + Description.Equals(other.Description) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (Per100g != null) + hashCode = hashCode * 59 + Per100g.GetHashCode(); + if (MeasurementUnit != null) + hashCode = hashCode * 59 + MeasurementUnit.GetHashCode(); + if (Min != null) + hashCode = hashCode * 59 + Min.GetHashCode(); + if (Max != null) + hashCode = hashCode * 59 + Max.GetHashCode(); + if (Median != null) + hashCode = hashCode * 59 + Median.GetHashCode(); + if (DataPoints != null) + hashCode = hashCode * 59 + DataPoints.GetHashCode(); + if (Footnote != null) + hashCode = hashCode * 59 + Footnote.GetHashCode(); + if (Source != null) + hashCode = hashCode * 59 + Source.GetHashCode(); + if (Description != null) + hashCode = hashCode * 59 + Description.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectNutrientsUsda left, BrandedFoodObjectNutrientsUsda right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectNutrientsUsda left, BrandedFoodObjectNutrientsUsda right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectPackage.cs b/src/IO.Swagger/Models/BrandedFoodObjectPackage.cs new file mode 100644 index 0000000..493e400 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectPackage.cs @@ -0,0 +1,135 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing basic packaging information about this item + /// + [DataContract] + public partial class BrandedFoodObjectPackage : IEquatable + { + /// + /// Package quantity + /// + /// Package quantity + [DataMember(Name="quantity")] + public int? Quantity { get; set; } + + /// + /// Package size + /// + /// Package size + [DataMember(Name="size")] + public int? Size { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectPackage {\n"); + sb.Append(" Quantity: ").Append(Quantity).Append("\n"); + sb.Append(" Size: ").Append(Size).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectPackage)obj); + } + + /// + /// Returns true if BrandedFoodObjectPackage instances are equal + /// + /// Instance of BrandedFoodObjectPackage to be compared + /// Boolean + public bool Equals(BrandedFoodObjectPackage other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Quantity == other.Quantity || + Quantity != null && + Quantity.Equals(other.Quantity) + ) && + ( + Size == other.Size || + Size != null && + Size.Equals(other.Size) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Quantity != null) + hashCode = hashCode * 59 + Quantity.GetHashCode(); + if (Size != null) + hashCode = hashCode * 59 + Size.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectPackage left, BrandedFoodObjectPackage right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectPackage left, BrandedFoodObjectPackage right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotos.cs b/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotos.cs new file mode 100644 index 0000000..faeaf63 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotos.cs @@ -0,0 +1,147 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A object containing a collection of photos of this item's packaging + /// + [DataContract] + public partial class BrandedFoodObjectPackagingPhotos : IEquatable + { + /// + /// Gets or Sets Front + /// + [DataMember(Name="front")] + public BrandedFoodObjectPackagingPhotosFront Front { get; set; } + + /// + /// Gets or Sets Nutrition + /// + [DataMember(Name="nutrition")] + public BrandedFoodObjectPackagingPhotosNutrition Nutrition { get; set; } + + /// + /// Gets or Sets Ingredients + /// + [DataMember(Name="ingredients")] + public BrandedFoodObjectPackagingPhotosIngredients Ingredients { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectPackagingPhotos {\n"); + sb.Append(" Front: ").Append(Front).Append("\n"); + sb.Append(" Nutrition: ").Append(Nutrition).Append("\n"); + sb.Append(" Ingredients: ").Append(Ingredients).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectPackagingPhotos)obj); + } + + /// + /// Returns true if BrandedFoodObjectPackagingPhotos instances are equal + /// + /// Instance of BrandedFoodObjectPackagingPhotos to be compared + /// Boolean + public bool Equals(BrandedFoodObjectPackagingPhotos other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Front == other.Front || + Front != null && + Front.Equals(other.Front) + ) && + ( + Nutrition == other.Nutrition || + Nutrition != null && + Nutrition.Equals(other.Nutrition) + ) && + ( + Ingredients == other.Ingredients || + Ingredients != null && + Ingredients.Equals(other.Ingredients) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Front != null) + hashCode = hashCode * 59 + Front.GetHashCode(); + if (Nutrition != null) + hashCode = hashCode * 59 + Nutrition.GetHashCode(); + if (Ingredients != null) + hashCode = hashCode * 59 + Ingredients.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectPackagingPhotos left, BrandedFoodObjectPackagingPhotos right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectPackagingPhotos left, BrandedFoodObjectPackagingPhotos right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosFront.cs b/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosFront.cs new file mode 100644 index 0000000..afc8ded --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosFront.cs @@ -0,0 +1,150 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing photos of the front of this item's packaging + /// + [DataContract] + public partial class BrandedFoodObjectPackagingPhotosFront : IEquatable + { + /// + /// Small photo of the front of this item's packaging + /// + /// Small photo of the front of this item's packaging + [DataMember(Name="small")] + public string Small { get; set; } + + /// + /// Thumbnail photo of the front of this item's packaging + /// + /// Thumbnail photo of the front of this item's packaging + [DataMember(Name="thumb")] + public string Thumb { get; set; } + + /// + /// Full-sized photo of the front of this item's packaging + /// + /// Full-sized photo of the front of this item's packaging + [DataMember(Name="display")] + public string Display { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectPackagingPhotosFront {\n"); + sb.Append(" Small: ").Append(Small).Append("\n"); + sb.Append(" Thumb: ").Append(Thumb).Append("\n"); + sb.Append(" Display: ").Append(Display).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectPackagingPhotosFront)obj); + } + + /// + /// Returns true if BrandedFoodObjectPackagingPhotosFront instances are equal + /// + /// Instance of BrandedFoodObjectPackagingPhotosFront to be compared + /// Boolean + public bool Equals(BrandedFoodObjectPackagingPhotosFront other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Small == other.Small || + Small != null && + Small.Equals(other.Small) + ) && + ( + Thumb == other.Thumb || + Thumb != null && + Thumb.Equals(other.Thumb) + ) && + ( + Display == other.Display || + Display != null && + Display.Equals(other.Display) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Small != null) + hashCode = hashCode * 59 + Small.GetHashCode(); + if (Thumb != null) + hashCode = hashCode * 59 + Thumb.GetHashCode(); + if (Display != null) + hashCode = hashCode * 59 + Display.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectPackagingPhotosFront left, BrandedFoodObjectPackagingPhotosFront right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectPackagingPhotosFront left, BrandedFoodObjectPackagingPhotosFront right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosIngredients.cs b/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosIngredients.cs new file mode 100644 index 0000000..6ce9117 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosIngredients.cs @@ -0,0 +1,150 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing photos of the ingredients on this item's packaging + /// + [DataContract] + public partial class BrandedFoodObjectPackagingPhotosIngredients : IEquatable + { + /// + /// Small photo of the ingredients on this item's packaging + /// + /// Small photo of the ingredients on this item's packaging + [DataMember(Name="small")] + public string Small { get; set; } + + /// + /// Thumbnail photo of the ingredients on this item's packaging + /// + /// Thumbnail photo of the ingredients on this item's packaging + [DataMember(Name="thumb")] + public string Thumb { get; set; } + + /// + /// Full-sized photo of the ingredients on this item's packaging + /// + /// Full-sized photo of the ingredients on this item's packaging + [DataMember(Name="display")] + public string Display { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectPackagingPhotosIngredients {\n"); + sb.Append(" Small: ").Append(Small).Append("\n"); + sb.Append(" Thumb: ").Append(Thumb).Append("\n"); + sb.Append(" Display: ").Append(Display).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectPackagingPhotosIngredients)obj); + } + + /// + /// Returns true if BrandedFoodObjectPackagingPhotosIngredients instances are equal + /// + /// Instance of BrandedFoodObjectPackagingPhotosIngredients to be compared + /// Boolean + public bool Equals(BrandedFoodObjectPackagingPhotosIngredients other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Small == other.Small || + Small != null && + Small.Equals(other.Small) + ) && + ( + Thumb == other.Thumb || + Thumb != null && + Thumb.Equals(other.Thumb) + ) && + ( + Display == other.Display || + Display != null && + Display.Equals(other.Display) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Small != null) + hashCode = hashCode * 59 + Small.GetHashCode(); + if (Thumb != null) + hashCode = hashCode * 59 + Thumb.GetHashCode(); + if (Display != null) + hashCode = hashCode * 59 + Display.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectPackagingPhotosIngredients left, BrandedFoodObjectPackagingPhotosIngredients right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectPackagingPhotosIngredients left, BrandedFoodObjectPackagingPhotosIngredients right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosNutrition.cs b/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosNutrition.cs new file mode 100644 index 0000000..bcf3b4d --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectPackagingPhotosNutrition.cs @@ -0,0 +1,150 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing photos of this item's nutrition label + /// + [DataContract] + public partial class BrandedFoodObjectPackagingPhotosNutrition : IEquatable + { + /// + /// Small photo of this item's nutrition label + /// + /// Small photo of this item's nutrition label + [DataMember(Name="small")] + public string Small { get; set; } + + /// + /// Thumbnail photo of this item's nutrition label + /// + /// Thumbnail photo of this item's nutrition label + [DataMember(Name="thumb")] + public string Thumb { get; set; } + + /// + /// Full-sized photo of this item's nutrition label + /// + /// Full-sized photo of this item's nutrition label + [DataMember(Name="display")] + public string Display { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectPackagingPhotosNutrition {\n"); + sb.Append(" Small: ").Append(Small).Append("\n"); + sb.Append(" Thumb: ").Append(Thumb).Append("\n"); + sb.Append(" Display: ").Append(Display).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectPackagingPhotosNutrition)obj); + } + + /// + /// Returns true if BrandedFoodObjectPackagingPhotosNutrition instances are equal + /// + /// Instance of BrandedFoodObjectPackagingPhotosNutrition to be compared + /// Boolean + public bool Equals(BrandedFoodObjectPackagingPhotosNutrition other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Small == other.Small || + Small != null && + Small.Equals(other.Small) + ) && + ( + Thumb == other.Thumb || + Thumb != null && + Thumb.Equals(other.Thumb) + ) && + ( + Display == other.Display || + Display != null && + Display.Equals(other.Display) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Small != null) + hashCode = hashCode * 59 + Small.GetHashCode(); + if (Thumb != null) + hashCode = hashCode * 59 + Thumb.GetHashCode(); + if (Display != null) + hashCode = hashCode * 59 + Display.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectPackagingPhotosNutrition left, BrandedFoodObjectPackagingPhotosNutrition right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectPackagingPhotosNutrition left, BrandedFoodObjectPackagingPhotosNutrition right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectPortions.cs b/src/IO.Swagger/Models/BrandedFoodObjectPortions.cs new file mode 100644 index 0000000..d7c6da1 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectPortions.cs @@ -0,0 +1,195 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing information on a specific food portion found in this item + /// + [DataContract] + public partial class BrandedFoodObjectPortions : IEquatable + { + /// + /// The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) + /// + /// The unit used for measure (e.g. if mesure is 3 tsp, the unit is tsp) + [DataMember(Name="measurement_unit")] + public string MeasurementUnit { get; set; } + + /// + /// 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. + /// + /// 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. + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// Qualifier of the measure (e.g. related to food shape or form) (e.g. melted, crushed, diced) + /// + /// Qualifier of the measure (e.g. related to food shape or form) (e.g. melted, crushed, diced) + [DataMember(Name="modifier")] + public string Modifier { get; set; } + + /// + /// The weight of the measure in grams + /// + /// The weight of the measure in grams + [DataMember(Name="gram_weight")] + public decimal? GramWeight { get; set; } + + /// + /// The number of observations on which the measure is based + /// + /// The number of observations on which the measure is based + [DataMember(Name="data_points")] + public int? DataPoints { get; set; } + + /// + /// 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. + /// + /// 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. + [DataMember(Name="footnote")] + public string Footnote { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectPortions {\n"); + sb.Append(" MeasurementUnit: ").Append(MeasurementUnit).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Modifier: ").Append(Modifier).Append("\n"); + sb.Append(" GramWeight: ").Append(GramWeight).Append("\n"); + sb.Append(" DataPoints: ").Append(DataPoints).Append("\n"); + sb.Append(" Footnote: ").Append(Footnote).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectPortions)obj); + } + + /// + /// Returns true if BrandedFoodObjectPortions instances are equal + /// + /// Instance of BrandedFoodObjectPortions to be compared + /// Boolean + public bool Equals(BrandedFoodObjectPortions other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + MeasurementUnit == other.MeasurementUnit || + MeasurementUnit != null && + MeasurementUnit.Equals(other.MeasurementUnit) + ) && + ( + Description == other.Description || + Description != null && + Description.Equals(other.Description) + ) && + ( + Modifier == other.Modifier || + Modifier != null && + Modifier.Equals(other.Modifier) + ) && + ( + GramWeight == other.GramWeight || + GramWeight != null && + GramWeight.Equals(other.GramWeight) + ) && + ( + DataPoints == other.DataPoints || + DataPoints != null && + DataPoints.Equals(other.DataPoints) + ) && + ( + Footnote == other.Footnote || + Footnote != null && + Footnote.Equals(other.Footnote) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (MeasurementUnit != null) + hashCode = hashCode * 59 + MeasurementUnit.GetHashCode(); + if (Description != null) + hashCode = hashCode * 59 + Description.GetHashCode(); + if (Modifier != null) + hashCode = hashCode * 59 + Modifier.GetHashCode(); + if (GramWeight != null) + hashCode = hashCode * 59 + GramWeight.GetHashCode(); + if (DataPoints != null) + hashCode = hashCode * 59 + DataPoints.GetHashCode(); + if (Footnote != null) + hashCode = hashCode * 59 + Footnote.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectPortions left, BrandedFoodObjectPortions right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectPortions left, BrandedFoodObjectPortions right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/BrandedFoodObjectServing.cs b/src/IO.Swagger/Models/BrandedFoodObjectServing.cs new file mode 100644 index 0000000..e781a43 --- /dev/null +++ b/src/IO.Swagger/Models/BrandedFoodObjectServing.cs @@ -0,0 +1,165 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing serving information for this item + /// + [DataContract] + public partial class BrandedFoodObjectServing : IEquatable + { + /// + /// Serving size + /// + /// Serving size + [DataMember(Name="size")] + public int? Size { get; set; } + + /// + /// Serving measurement unit (e.g. if measure is 3 tsp, the unit is tsp) + /// + /// Serving measurement unit (e.g. if measure is 3 tsp, the unit is tsp) + [DataMember(Name="measurement_unit")] + public string MeasurementUnit { get; set; } + + /// + /// Serving size description + /// + /// Serving size description + [DataMember(Name="size_fulltext")] + public string SizeFulltext { get; set; } + + /// + /// Total servings + /// + /// Total servings + [DataMember(Name="total")] + public int? Total { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BrandedFoodObjectServing {\n"); + sb.Append(" Size: ").Append(Size).Append("\n"); + sb.Append(" MeasurementUnit: ").Append(MeasurementUnit).Append("\n"); + sb.Append(" SizeFulltext: ").Append(SizeFulltext).Append("\n"); + sb.Append(" Total: ").Append(Total).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((BrandedFoodObjectServing)obj); + } + + /// + /// Returns true if BrandedFoodObjectServing instances are equal + /// + /// Instance of BrandedFoodObjectServing to be compared + /// Boolean + public bool Equals(BrandedFoodObjectServing other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Size == other.Size || + Size != null && + Size.Equals(other.Size) + ) && + ( + MeasurementUnit == other.MeasurementUnit || + MeasurementUnit != null && + MeasurementUnit.Equals(other.MeasurementUnit) + ) && + ( + SizeFulltext == other.SizeFulltext || + SizeFulltext != null && + SizeFulltext.Equals(other.SizeFulltext) + ) && + ( + Total == other.Total || + Total != null && + Total.Equals(other.Total) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Size != null) + hashCode = hashCode * 59 + Size.GetHashCode(); + if (MeasurementUnit != null) + hashCode = hashCode * 59 + MeasurementUnit.GetHashCode(); + if (SizeFulltext != null) + hashCode = hashCode * 59 + SizeFulltext.GetHashCode(); + if (Total != null) + hashCode = hashCode * 59 + Total.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(BrandedFoodObjectServing left, BrandedFoodObjectServing right) + { + return Equals(left, right); + } + + public static bool operator !=(BrandedFoodObjectServing left, BrandedFoodObjectServing right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/IngredientObject.cs b/src/IO.Swagger/Models/IngredientObject.cs new file mode 100644 index 0000000..18a01d7 --- /dev/null +++ b/src/IO.Swagger/Models/IngredientObject.cs @@ -0,0 +1,120 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Please read the description of each field in this API response object example. By default, the value of each field is __null__. This indicates an unknown state or that no data exists. + /// + [DataContract] + public partial class IngredientObject : IEquatable + { + /// + /// An array containing an object for each individual item returned by your API call. + /// + /// An array containing an object for each individual item returned by your API call. + [DataMember(Name="items")] + public List Items { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IngredientObject {\n"); + sb.Append(" Items: ").Append(Items).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((IngredientObject)obj); + } + + /// + /// Returns true if IngredientObject instances are equal + /// + /// Instance of IngredientObject to be compared + /// Boolean + public bool Equals(IngredientObject other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Items == other.Items || + Items != null && + Items.SequenceEqual(other.Items) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Items != null) + hashCode = hashCode * 59 + Items.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(IngredientObject left, IngredientObject right) + { + return Equals(left, right); + } + + public static bool operator !=(IngredientObject left, IngredientObject right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/IngredientObjectItems.cs b/src/IO.Swagger/Models/IngredientObjectItems.cs new file mode 100644 index 0000000..e8be4cd --- /dev/null +++ b/src/IO.Swagger/Models/IngredientObjectItems.cs @@ -0,0 +1,266 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing information for this specific item. + /// + [DataContract] + public partial class IngredientObjectItems : IEquatable + { + /// + /// Item name as provided by brand owner or as shown on packaging + /// + /// Item name as provided by brand owner or as shown on packaging + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Gets or Sets Categories + /// + [DataMember(Name="categories")] + public List Categories { get; set; } + + /// + /// Gets or Sets Nutrients + /// + [DataMember(Name="nutrients")] + public IngredientObjectNutrients Nutrients { get; set; } + + /// + /// Gets or Sets CalorieConversionFactor + /// + [DataMember(Name="calorie_conversion_factor")] + public BrandedFoodObjectCalorieConversionFactor CalorieConversionFactor { get; set; } + + /// + /// The multiplication factor used to calculate protein from nitrogen + /// + /// The multiplication factor used to calculate protein from nitrogen + [DataMember(Name="protein_conversion_factor")] + public decimal? ProteinConversionFactor { get; set; } + + /// + /// Gets or Sets DietLabels + /// + [DataMember(Name="diet_labels")] + public BrandedFoodObjectDietLabels DietLabels { get; set; } + + /// + /// An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) + /// + /// An array of objects containing the constituent parts of a food (e.g. bone is a component of meat) + [DataMember(Name="components")] + public List Components { get; set; } + + /// + /// An array of objects containing information on discrete amounts of a food found in this item + /// + /// An array of objects containing information on discrete amounts of a food found in this item + [DataMember(Name="portions")] + public List Portions { get; set; } + + /// + /// 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\") + /// + /// 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\") + [DataMember(Name="common_name")] + public string CommonName { get; set; } + + /// + /// A description of this item + /// + /// A description of this item + [DataMember(Name="description")] + public string Description { get; set; } + + /// + /// Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. + /// + /// Comments on any unusual aspects of this item. Examples might include unusual aspects of the food overall. + [DataMember(Name="footnote")] + public string Footnote { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IngredientObjectItems {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Categories: ").Append(Categories).Append("\n"); + sb.Append(" Nutrients: ").Append(Nutrients).Append("\n"); + sb.Append(" CalorieConversionFactor: ").Append(CalorieConversionFactor).Append("\n"); + sb.Append(" ProteinConversionFactor: ").Append(ProteinConversionFactor).Append("\n"); + sb.Append(" DietLabels: ").Append(DietLabels).Append("\n"); + sb.Append(" Components: ").Append(Components).Append("\n"); + sb.Append(" Portions: ").Append(Portions).Append("\n"); + sb.Append(" CommonName: ").Append(CommonName).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Footnote: ").Append(Footnote).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((IngredientObjectItems)obj); + } + + /// + /// Returns true if IngredientObjectItems instances are equal + /// + /// Instance of IngredientObjectItems to be compared + /// Boolean + public bool Equals(IngredientObjectItems other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Name == other.Name || + Name != null && + Name.Equals(other.Name) + ) && + ( + Categories == other.Categories || + Categories != null && + Categories.SequenceEqual(other.Categories) + ) && + ( + Nutrients == other.Nutrients || + Nutrients != null && + Nutrients.Equals(other.Nutrients) + ) && + ( + CalorieConversionFactor == other.CalorieConversionFactor || + CalorieConversionFactor != null && + CalorieConversionFactor.Equals(other.CalorieConversionFactor) + ) && + ( + ProteinConversionFactor == other.ProteinConversionFactor || + ProteinConversionFactor != null && + ProteinConversionFactor.Equals(other.ProteinConversionFactor) + ) && + ( + DietLabels == other.DietLabels || + DietLabels != null && + DietLabels.Equals(other.DietLabels) + ) && + ( + Components == other.Components || + Components != null && + Components.SequenceEqual(other.Components) + ) && + ( + Portions == other.Portions || + Portions != null && + Portions.SequenceEqual(other.Portions) + ) && + ( + CommonName == other.CommonName || + CommonName != null && + CommonName.Equals(other.CommonName) + ) && + ( + Description == other.Description || + Description != null && + Description.Equals(other.Description) + ) && + ( + Footnote == other.Footnote || + Footnote != null && + Footnote.Equals(other.Footnote) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Name != null) + hashCode = hashCode * 59 + Name.GetHashCode(); + if (Categories != null) + hashCode = hashCode * 59 + Categories.GetHashCode(); + if (Nutrients != null) + hashCode = hashCode * 59 + Nutrients.GetHashCode(); + if (CalorieConversionFactor != null) + hashCode = hashCode * 59 + CalorieConversionFactor.GetHashCode(); + if (ProteinConversionFactor != null) + hashCode = hashCode * 59 + ProteinConversionFactor.GetHashCode(); + if (DietLabels != null) + hashCode = hashCode * 59 + DietLabels.GetHashCode(); + if (Components != null) + hashCode = hashCode * 59 + Components.GetHashCode(); + if (Portions != null) + hashCode = hashCode * 59 + Portions.GetHashCode(); + if (CommonName != null) + hashCode = hashCode * 59 + CommonName.GetHashCode(); + if (Description != null) + hashCode = hashCode * 59 + Description.GetHashCode(); + if (Footnote != null) + hashCode = hashCode * 59 + Footnote.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(IngredientObjectItems left, IngredientObjectItems right) + { + return Equals(left, right); + } + + public static bool operator !=(IngredientObjectItems left, IngredientObjectItems right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Models/IngredientObjectNutrients.cs b/src/IO.Swagger/Models/IngredientObjectNutrients.cs new file mode 100644 index 0000000..c694a3a --- /dev/null +++ b/src/IO.Swagger/Models/IngredientObjectNutrients.cs @@ -0,0 +1,120 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An object containing nutrient information from each source + /// + [DataContract] + public partial class IngredientObjectNutrients : IEquatable + { + /// + /// An array containing an object for each nutrient data point as found in the USDA database + /// + /// An array containing an object for each nutrient data point as found in the USDA database + [DataMember(Name="usda")] + public List Usda { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class IngredientObjectNutrients {\n"); + sb.Append(" Usda: ").Append(Usda).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((IngredientObjectNutrients)obj); + } + + /// + /// Returns true if IngredientObjectNutrients instances are equal + /// + /// Instance of IngredientObjectNutrients to be compared + /// Boolean + public bool Equals(IngredientObjectNutrients other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Usda == other.Usda || + Usda != null && + Usda.SequenceEqual(other.Usda) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + var hashCode = 41; + // Suitable nullity checks etc, of course :) + if (Usda != null) + hashCode = hashCode * 59 + Usda.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(IngredientObjectNutrients left, IngredientObjectNutrients right) + { + return Equals(left, right); + } + + public static bool operator !=(IngredientObjectNutrients left, IngredientObjectNutrients right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/src/IO.Swagger/Program.cs b/src/IO.Swagger/Program.cs new file mode 100644 index 0000000..bc35c2e --- /dev/null +++ b/src/IO.Swagger/Program.cs @@ -0,0 +1,30 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore; + +namespace IO.Swagger +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + /// + /// Create the web host builder. + /// + /// + /// IWebHostBuilder + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup() + .UseUrls("http://localhost:8080"); + } +} diff --git a/src/IO.Swagger/Properties/launchSettings.json b/src/IO.Swagger/Properties/launchSettings.json new file mode 100644 index 0000000..21acfed --- /dev/null +++ b/src/IO.Swagger/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50352/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "web": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000/swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs b/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs new file mode 100644 index 0000000..57b5fd5 --- /dev/null +++ b/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs @@ -0,0 +1,50 @@ +using System; +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text; +using System.Text.Encodings.Web; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace IO.Swagger.Security +{ + /// + /// class to handle api_key security. + /// + public class ApiKeyAuthenticationHandler : AuthenticationHandler + { + /// + /// scheme name for authentication handler. + /// + public const string SchemeName = "ApiKey"; + + public ApiKeyAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) + { + } + + /// + /// verify that require api key header exist and handle authorization. + /// + protected override async Task HandleAuthenticateAsync() + { + if (!Request.Headers.ContainsKey("api_key")) + { + return AuthenticateResult.Fail("Missing Authorization Header"); + } + + // do magic here! + + var claims = new[] { + new Claim(ClaimTypes.NameIdentifier, "changeme"), + new Claim(ClaimTypes.Name, "changeme"), + }; + var identity = new ClaimsIdentity(claims, Scheme.Name); + var principal = new ClaimsPrincipal(identity); + var ticket = new AuthenticationTicket(principal, Scheme.Name); + + return AuthenticateResult.Success(ticket); + } + } +} diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs new file mode 100644 index 0000000..31f34f8 --- /dev/null +++ b/src/IO.Swagger/Startup.cs @@ -0,0 +1,131 @@ +/* + * Chomp Food Database API Documentation + * + * __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) | | + * + * OpenAPI spec version: 1.0.0-oas3 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ +using System; +using System.IO; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using IO.Swagger.Filters; +using IO.Swagger.Security; + +using Microsoft.AspNetCore.Authentication; + +namespace IO.Swagger +{ + /// + /// Startup + /// + public class Startup + { + private readonly IHostingEnvironment _hostingEnv; + + private IConfiguration Configuration { get; } + + /// + /// Constructor + /// + /// + /// + public Startup(IHostingEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services + .AddMvc() + .AddJsonOptions(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter { + CamelCaseText = true + }); + }) + .AddXmlSerializerFormatters(); + + services.AddAuthentication(ApiKeyAuthenticationHandler.SchemeName) + .AddScheme(ApiKeyAuthenticationHandler.SchemeName, null); + + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("1.0.0-oas3", new Info + { + Version = "1.0.0-oas3", + Title = "Chomp Food Database API Documentation", + Description = "Chomp Food Database API Documentation (ASP.NET Core 2.0)", + Contact = new Contact() + { + Name = "Swagger Codegen Contributors", + Url = "https://github.com/swagger-api/swagger-codegen", + Email = "" + }, + TermsOfService = "" + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.DescribeAllEnumsAsStrings(); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + // Sets the basePath property in the Swagger document generated + c.DocumentFilter("/api/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) + // Use [ValidateModelState] on Actions to actually validate it in C# as well! + c.OperationFilter(); + }); + } + + /// + /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// + /// + /// + /// + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + app + .UseMvc() + .UseDefaultFiles() + .UseStaticFiles() + .UseSwagger() + .UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/1.0.0-oas3/swagger.json", "Chomp Food Database API Documentation"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "Chomp Food Database API Documentation Original"); + }); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) + // app.UseExceptionHandler("/Home/Error"); + } + } + } +} diff --git a/src/IO.Swagger/appsettings.json b/src/IO.Swagger/appsettings.json new file mode 100644 index 0000000..c6af7d9 --- /dev/null +++ b/src/IO.Swagger/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Information", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/IO.Swagger/web.config b/src/IO.Swagger/web.config new file mode 100644 index 0000000..a3b9f6a --- /dev/null +++ b/src/IO.Swagger/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/src/IO.Swagger/wwwroot/README.md b/src/IO.Swagger/wwwroot/README.md new file mode 100644 index 0000000..6a0b784 --- /dev/null +++ b/src/IO.Swagger/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/src/IO.Swagger/wwwroot/index.html b/src/IO.Swagger/wwwroot/index.html new file mode 100644 index 0000000..cde1f2f --- /dev/null +++ b/src/IO.Swagger/wwwroot/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/IO.Swagger/wwwroot/swagger-original.json b/src/IO.Swagger/wwwroot/swagger-original.json new file mode 100644 index 0000000..de68193 --- /dev/null +++ b/src/IO.Swagger/wwwroot/swagger-original.json @@ -0,0 +1,2109 @@ +{ + "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\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 - __[View example](https://raw.githubusercontent.com/chompfoods/examples/master/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) | [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", + "version" : "1.0.0-oas3" + }, + "servers" : [ { + "url" : "https://chompthis.com/api/v2", + "description" : "Production server (uses live data)" + } ], + "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.\n\n__Example:__ ```https://chompthis.com/api/v2/food/branded/barcode.php?api_key=API_KEY&code=CODE```\n", + "parameters" : [ { + "name" : "code", + "in" : "query", + "description" : "UPC/EAN barcode\n\n__Example:__ 0842234000988\n\n__Resources:__ [Database search](https://chompthis.com/api/lookup.php)\n\n_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._\n", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "__Valid__ - Will return an object containing any matching foods.", + "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. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._" + } + }, + "security" : [ { + "ApiKeyAuth" : [ ] + } ] + } + }, + "/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.\n\n_Alternatively, set the \"source\" parameter to \"USDA\" and use the food's FDC ID._\n\n__Example:__ ```https://chompthis.com/api/v2/food/branded/id.php?api_key=API_KEY&id=ID```\n", + "parameters" : [ { + "name" : "id", + "in" : "query", + "description" : "Chomp branded food ID.\n\n_Set \"source=USDA\" if you wish to pass in the food's FoodData Central ID (fdc_id)._\n\n__Example #1:__ 15\n\n__Resources:__ [Find branded food\nIDs](https://chompthis.com/api/lookup.php)\n", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer" + } + }, { + "name" : "source", + "in" : "query", + "description" : "Specify the data source (optional).\n\nYou must pass in \"USDA\" if you want to look up a food item using a USDA FDC ID.\n\n__Example:__ USDA _(defaults to \"Chomp\")_\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "__Valid__ - Will return an object containing any matching foods.", + "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. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._" + } + }, + "security" : [ { + "ApiKeyAuth" : [ ] + } ] + } + }, + "/food/branded/name.php" : { + "get" : { + "summary" : "Get a branded food item by name", + "description" : "# Search for branded food items by name.\n\n__Example:__ ```https://chompthis.com/api/v2/food/branded/name.php?api_key=API_KEY&name=NAME```\n", + "parameters" : [ { + "name" : "name", + "in" : "query", + "description" : "Branded food name\n\n__Example:__ Starburst\n\n__Resources:__ [Find branded food\nnames](https://chompthis.com/api/lookup.php)\n", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "description" : "Set maximum number of records you want the API to return.\n\n___Note:__ The maximum value is 10._\n\n__Example:__ 3 _(defaults to 10)_\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "enum" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] + } + } ], + "responses" : { + "200" : { + "description" : "__Valid__ - Will return an object containing any matching foods.", + "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. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._" + } + }, + "security" : [ { + "ApiKeyAuth" : [ ] + } ] + } + }, + "/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.\n\n__Example:__ ```https://chompthis.com/api/v2/food/branded/search.php?api_key=API_KEY&brand=BRAND&country=COUNTRY&page=1```\n\n___Tip:__ Get started by using the [Query Builder](https://chompthis.com/api/build.php)._\n", + "parameters" : [ { + "name" : "allergen", + "in" : "query", + "description" : "Specify a required allergen ingredient (optional)\n\n__Example__: Peanuts\n\n__Resources__: [List of\nallergens](https://chompthis.com/api/data/allergen.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "brand", + "in" : "query", + "description" : "Specify a required brand (optional)\n\n__Example__: Starbucks\n\n__Resources__: [List of\nbrands](https://chompthis.com/api/data/brand.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "category", + "in" : "query", + "description" : "Specify a required category (optional)\n\n__Example__: Pasta Dishes\n\n__Resources__: [List of\ncategories](https://chompthis.com/api/data/category.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "country", + "in" : "query", + "description" : "Specify a required country (optional)\n\n__Example__: United States\n\n__Resources__: [List of\ncountries](https://chompthis.com/api/data/country.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "diet", + "in" : "query", + "description" : "Specify a required diet (optional)\n\n_Filters the search to only include food items that are considered compatible with the following diets: Vegan, Vegetarian, Gluten Free_\n\n__Example__: Gluten Free\n\n__Resources__: [List of\ndiets](https://chompthis.com/api/data/lifestyle.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "ingredient", + "in" : "query", + "description" : "Specify a required ingredient (optional)\n\n__Example__: Salt\n\n__Resources__: [List of\ningredients](https://chompthis.com/api/data/ingredient.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "keyword", + "in" : "query", + "description" : "Specify a required keyword (optional)\n\n__Example__: Starbucks\n\n__Resources__: [List of\nbrands](https://chompthis.com/api/data/brand.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "mineral", + "in" : "query", + "description" : "Specify a required mineral (optional)\n\n__Example__: Potassium\n\n__Resources__: [List of\nminerals](https://chompthis.com/api/data/mineral.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "nutrient", + "in" : "query", + "description" : "Specify a required nutrition label item (optional)\n\n__Example__: Caffeine\n\n__Resources__: [List of nutrition label\nitems](https://chompthis.com/api/data/nutrition.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "palm_oil", + "in" : "query", + "description" : "Specify a required palm oil ingredient (optional)\n\n__Example__: E160a Beta Carotene\n\n__Resources__: [List of palm oil\ningredients](https://chompthis.com/api/data/palm-oil.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "trace", + "in" : "query", + "description" : "Specify a required trace ingredient (optional)\n\n__Example__: Tree Nuts\n\n__Resources__: [List of trace\ningredients](https://chompthis.com/api/data/trace.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "vitamin", + "in" : "query", + "description" : "Specify a required vitamin (optional)\n\n__Example__: Biotin\n\n__Resources__: [List of\nvitamins](https://chompthis.com/api/data/vitamin.php)\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "description" : "Set maximum number of records you want the API to return.\n\n___Note:__ The maximum value is 10._\n\n__Example:__ 3 _(defaults to 10)_\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "enum" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] + } + }, { + "name" : "page", + "in" : "query", + "description" : "Specify the search response page number.\n\n_Each page will contain up to 10 items._\n\n__Example__: 1 _(default)_\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "description" : "__Valid__ - Will return an object containing any matching foods.", + "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. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._" + } + }, + "security" : [ { + "ApiKeyAuth" : [ ] + } ] + } + }, + "/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.\n\n__Example:__ ```https://chompthis.com/api/v2/ingredient/search.php?api_key=API_KEY&find=STRING/LIST&list=BOOLEAN&raw=BOOLEAN```\n", + "parameters" : [ { + "name" : "find", + "in" : "query", + "description" : "Specify the ingredient name(s).\n\n__Example #1:__ broccoli\n\n__Example #2:__ broccoli,cauliflower,spinach\n\n___Important Note:__ Set the \"is_list\" parameter to true before passing in a comma-separated list of ingredients._\n", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer" + } + }, { + "name" : "list", + "in" : "query", + "description" : "Specify if you are searching for multiple ingredients.\n\n_Setting this to true will configure this endpoint so that it accepts a comma-separated list of ingredients._\n\n_By default, this endpoint expects a single ingredient._\n\n__Example:__ true _(defaults to false)_\n", + "required" : true, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "raw", + "in" : "query", + "description" : "Specify if you only want data for raw ingredients.\n\n__Example:__ true _(defaults to true)_\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean" + } + }, { + "name" : "limit", + "in" : "query", + "description" : "Set maximum number of records you want the API to return.\n\n___Important Note:__ Setting this to \"1\" will return 1 record per search term._\n\n__Example:__ 1 _(defaults to 1, max is 3)_\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "enum" : [ 1, 2, 3 ] + } + } ], + "responses" : { + "200" : { + "description" : "__Valid__ - Will return an object containing any matching ingredient foods.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/IngredientObject" + } + } + } + }, + "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. _[Contact us](https://chompthis.com/api/ticket-new.php) if you see this._" + } + }, + "security" : [ { + "ApiKeyAuth" : [ ] + } ] + } + } + }, + "components" : { + "schemas" : { + "BrandedFoodObject" : { + "type" : "object", + "properties" : { + "items" : { + "type" : "array", + "description" : "An array containing an object for each individual item returned by your API call.", + "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 an unknown state or that no data exists.", + "example" : { + "items" : [ { + "minerals" : [ "minerals", "minerals" ], + "components" : [ { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + }, { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + } ], + "keywords" : [ "keywords", "keywords" ], + "country_details" : { + "english_speaking" : 2, + "non_english_speaking" : 6 + }, + "description" : "description", + "has_english_ingredients" : true, + "palm_oil_ingredients" : [ "palm_oil_ingredients", "palm_oil_ingredients" ], + "serving" : { + "total" : 5, + "size_fulltext" : "size_fulltext", + "size" : 1, + "measurement_unit" : "measurement_unit" + }, + "nutrients" : { + "chomp" : [ { + "total" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + }, { + "total" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + } ], + "usda" : [ { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + }, { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } ] + }, + "protein_conversion_factor" : 7.457744773683766, + "packaging_photos" : { + "nutrition" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + }, + "ingredients" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + }, + "front" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + } + }, + "diet_labels" : { + "vegetarian" : { + "confidence_description" : "confidence_description", + "confidence" : 9, + "name" : "name", + "compatibility_level" : 5, + "is_compatible" : true + }, + "vegan" : { + "confidence_description" : "confidence_description", + "confidence" : 4, + "name" : "name", + "compatibility_level" : 1, + "is_compatible" : true + }, + "gluten_free" : { + "confidence_description" : "confidence_description", + "confidence" : 6, + "name" : "name", + "compatibility_level" : 9, + "is_compatible" : true + } + }, + "ingredients" : "ingredients", + "categories" : [ "categories", "categories" ], + "common_name" : "common_name", + "barcode" : "barcode", + "brand" : "brand", + "portions" : [ { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + }, { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + } ], + "package" : { + "quantity" : 0, + "size" : 6 + }, + "traces" : [ "traces", "traces" ], + "diet_flags" : [ { + "ingredient" : "ingredient", + "is_allergen" : true, + "ingredient_description" : "ingredient_description", + "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" : 8, + "is_compatible" : "is_compatible", + "diet_label" : "diet_label", + "compatibility_description" : "compatibility_description" + } ], + "countries" : [ "countries", "countries" ], + "footnote" : "footnote", + "allergens" : [ "allergens", "allergens" ], + "calorie_conversion_factor" : { + "carbohydrate_value" : 6.84685269835264, + "protein_value" : 1.0246457001441578, + "fat_value" : 1.4894159098541704 + }, + "ingredient_list" : [ "ingredient_list", "ingredient_list" ], + "name" : "name", + "brand_list" : [ "brand_list", "brand_list" ] + }, { + "minerals" : [ "minerals", "minerals" ], + "components" : [ { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + }, { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + } ], + "keywords" : [ "keywords", "keywords" ], + "country_details" : { + "english_speaking" : 2, + "non_english_speaking" : 6 + }, + "description" : "description", + "has_english_ingredients" : true, + "palm_oil_ingredients" : [ "palm_oil_ingredients", "palm_oil_ingredients" ], + "serving" : { + "total" : 5, + "size_fulltext" : "size_fulltext", + "size" : 1, + "measurement_unit" : "measurement_unit" + }, + "nutrients" : { + "chomp" : [ { + "total" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + }, { + "total" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + } ], + "usda" : [ { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + }, { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } ] + }, + "protein_conversion_factor" : 7.457744773683766, + "packaging_photos" : { + "nutrition" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + }, + "ingredients" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + }, + "front" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + } + }, + "diet_labels" : { + "vegetarian" : { + "confidence_description" : "confidence_description", + "confidence" : 9, + "name" : "name", + "compatibility_level" : 5, + "is_compatible" : true + }, + "vegan" : { + "confidence_description" : "confidence_description", + "confidence" : 4, + "name" : "name", + "compatibility_level" : 1, + "is_compatible" : true + }, + "gluten_free" : { + "confidence_description" : "confidence_description", + "confidence" : 6, + "name" : "name", + "compatibility_level" : 9, + "is_compatible" : true + } + }, + "ingredients" : "ingredients", + "categories" : [ "categories", "categories" ], + "common_name" : "common_name", + "barcode" : "barcode", + "brand" : "brand", + "portions" : [ { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + }, { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + } ], + "package" : { + "quantity" : 0, + "size" : 6 + }, + "traces" : [ "traces", "traces" ], + "diet_flags" : [ { + "ingredient" : "ingredient", + "is_allergen" : true, + "ingredient_description" : "ingredient_description", + "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" : 8, + "is_compatible" : "is_compatible", + "diet_label" : "diet_label", + "compatibility_description" : "compatibility_description" + } ], + "countries" : [ "countries", "countries" ], + "footnote" : "footnote", + "allergens" : [ "allergens", "allergens" ], + "calorie_conversion_factor" : { + "carbohydrate_value" : 6.84685269835264, + "protein_value" : 1.0246457001441578, + "fat_value" : 1.4894159098541704 + }, + "ingredient_list" : [ "ingredient_list", "ingredient_list" ], + "name" : "name", + "brand_list" : [ "brand_list", "brand_list" ] + } ] + } + }, + "IngredientObject" : { + "type" : "object", + "properties" : { + "items" : { + "type" : "array", + "description" : "An array containing an object for each individual item returned by your API call.", + "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 an unknown state or that no data exists.", + "example" : { + "items" : [ { + "protein_conversion_factor" : 0.8008281904610115, + "calorie_conversion_factor" : { + "carbohydrate_value" : 6.84685269835264, + "protein_value" : 1.0246457001441578, + "fat_value" : 1.4894159098541704 + }, + "components" : [ { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + }, { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + } ], + "diet_labels" : { + "vegetarian" : { + "confidence_description" : "confidence_description", + "confidence" : 9, + "name" : "name", + "compatibility_level" : 5, + "is_compatible" : true + }, + "vegan" : { + "confidence_description" : "confidence_description", + "confidence" : 4, + "name" : "name", + "compatibility_level" : 1, + "is_compatible" : true + }, + "gluten_free" : { + "confidence_description" : "confidence_description", + "confidence" : 6, + "name" : "name", + "compatibility_level" : 9, + "is_compatible" : true + } + }, + "name" : "name", + "description" : "description", + "categories" : [ "categories", "categories" ], + "footnote" : "footnote", + "common_name" : "common_name", + "nutrients" : { + "usda" : [ { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + }, { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } ] + }, + "portions" : [ { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + }, { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + } ] + }, { + "protein_conversion_factor" : 0.8008281904610115, + "calorie_conversion_factor" : { + "carbohydrate_value" : 6.84685269835264, + "protein_value" : 1.0246457001441578, + "fat_value" : 1.4894159098541704 + }, + "components" : [ { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + }, { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + } ], + "diet_labels" : { + "vegetarian" : { + "confidence_description" : "confidence_description", + "confidence" : 9, + "name" : "name", + "compatibility_level" : 5, + "is_compatible" : true + }, + "vegan" : { + "confidence_description" : "confidence_description", + "confidence" : 4, + "name" : "name", + "compatibility_level" : 1, + "is_compatible" : true + }, + "gluten_free" : { + "confidence_description" : "confidence_description", + "confidence" : 6, + "name" : "name", + "compatibility_level" : 9, + "is_compatible" : true + } + }, + "name" : "name", + "description" : "description", + "categories" : [ "categories", "categories" ], + "footnote" : "footnote", + "common_name" : "common_name", + "nutrients" : { + "usda" : [ { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + }, { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } ] + }, + "portions" : [ { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + }, { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + } ] + } ] + } + }, + "BrandedFoodObject_package" : { + "type" : "object", + "properties" : { + "quantity" : { + "type" : "integer", + "description" : "Package quantity" + }, + "size" : { + "type" : "integer", + "description" : "Package size" + } + }, + "description" : "An object containing basic packaging information about this item", + "example" : { + "quantity" : 0, + "size" : 6 + } + }, + "BrandedFoodObject_serving" : { + "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)" + }, + "size_fulltext" : { + "type" : "string", + "description" : "Serving size description" + }, + "total" : { + "type" : "integer", + "description" : "Total servings" + } + }, + "description" : "An object containing serving information for this item", + "example" : { + "total" : 5, + "size_fulltext" : "size_fulltext", + "size" : 1, + "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" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + } + }, + "BrandedFoodObject_nutrients_usda" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "description" : "Nutrient ID" + }, + "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" + }, + "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." + }, + "source" : { + "type" : "string", + "description" : "Description of the nutrient source" + }, + "description" : { + "type" : "string", + "description" : "Description of how the food nutrient value was obtained" + } + }, + "example" : { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } + }, + "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" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + }, { + "total" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + } ], + "usda" : [ { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + }, { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } ] + } + }, + "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" : 6.84685269835264, + "protein_value" : 1.0246457001441578, + "fat_value" : 1.4894159098541704 + } + }, + "BrandedFoodObject_diet_labels_vegan" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string", + "description" : "Diet name" + }, + "is_compatible" : { + "type" : "boolean", + "description" : "Boolean describing if this item is compatible with this diet" + }, + "compatibility_level" : { + "type" : "integer", + "description" : "Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility" + }, + "confidence" : { + "type" : "integer", + "description" : "Boolean that indicates if we are confident in how this item is graded for this diet" + }, + "confidence_description" : { + "type" : "string", + "description" : "Description of our confidence that this item was graded correctly" + } + }, + "description" : "An object containing information on this item's compatibility with the Vegan diets", + "example" : { + "confidence_description" : "confidence_description", + "confidence" : 4, + "name" : "name", + "compatibility_level" : 1, + "is_compatible" : true + } + }, + "BrandedFoodObject_diet_labels_vegetarian" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string", + "description" : "Diet name" + }, + "is_compatible" : { + "type" : "boolean", + "description" : "Boolean describing if this item is compatible with this diet" + }, + "compatibility_level" : { + "type" : "integer", + "description" : "Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility" + }, + "confidence" : { + "type" : "integer", + "description" : "Boolean that indicates if we are confident in how this item is graded for this diet" + }, + "confidence_description" : { + "type" : "string", + "description" : "Description of our confidence that this item was graded correctly" + } + }, + "description" : "An object containing information on this item's compatibility with Vegetarian diets", + "example" : { + "confidence_description" : "confidence_description", + "confidence" : 9, + "name" : "name", + "compatibility_level" : 5, + "is_compatible" : true + } + }, + "BrandedFoodObject_diet_labels_gluten_free" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string", + "description" : "Diet name" + }, + "is_compatible" : { + "type" : "boolean", + "description" : "Boolean describing if this item is compatible with this diet" + }, + "compatibility_level" : { + "type" : "integer", + "description" : "Numeric representation of how compatible this item is with this diet. Higher values indicate more compatibility" + }, + "confidence" : { + "type" : "integer", + "description" : "Boolean that indicates if we are confident in how this item is graded for this diet" + }, + "confidence_description" : { + "type" : "string", + "description" : "Description of our confidence that this item was graded correctly" + } + }, + "description" : "An object containing information on this item's compatibility with Gluten Free diets", + "example" : { + "confidence_description" : "confidence_description", + "confidence" : 6, + "name" : "name", + "compatibility_level" : 9, + "is_compatible" : true + } + }, + "BrandedFoodObject_diet_labels" : { + "type" : "object", + "properties" : { + "vegan" : { + "$ref" : "#/components/schemas/BrandedFoodObject_diet_labels_vegan" + }, + "vegetarian" : { + "$ref" : "#/components/schemas/BrandedFoodObject_diet_labels_vegetarian" + }, + "gluten_free" : { + "$ref" : "#/components/schemas/BrandedFoodObject_diet_labels_gluten_free" + } + }, + "description" : "An object containing this item's compatibility grades for each supported diet", + "example" : { + "vegetarian" : { + "confidence_description" : "confidence_description", + "confidence" : 9, + "name" : "name", + "compatibility_level" : 5, + "is_compatible" : true + }, + "vegan" : { + "confidence_description" : "confidence_description", + "confidence" : 4, + "name" : "name", + "compatibility_level" : 1, + "is_compatible" : true + }, + "gluten_free" : { + "confidence_description" : "confidence_description", + "confidence" : 6, + "name" : "name", + "compatibility_level" : 9, + "is_compatible" : true + } + } + }, + "BrandedFoodObject_diet_flags" : { + "type" : "object", + "properties" : { + "ingredient" : { + "type" : "string", + "description" : "Ingredient name" + }, + "ingredient_description" : { + "type" : "string", + "description" : "Description of the ingredient" + }, + "diet_label" : { + "type" : "string", + "description" : "Name of the diet with which this ingredient may not be compatible" + }, + "is_compatible" : { + "type" : "string", + "description" : "A description of if we believe this ingredient is compatible with the diet" + }, + "compatibility_level" : { + "type" : "integer", + "description" : "A numeric representation of if we believe this ingredient is compatible with the diet. Higher values indicate more compatibility" + }, + "compatibility_description" : { + "type" : "string", + "description" : "A description of how we graded this ingredient for compatibility with the diet" + }, + "is_allergen" : { + "type" : "boolean", + "description" : "Boolean representing if the ingredient is a known allergen" + } + }, + "description" : "An object containing information on an individual ingredient that was flagged as potentially not being compatible with a certain diet", + "example" : { + "ingredient" : "ingredient", + "is_allergen" : true, + "ingredient_description" : "ingredient_description", + "compatibility_level" : 8, + "is_compatible" : "is_compatible", + "diet_label" : "diet_label", + "compatibility_description" : "compatibility_description" + } + }, + "BrandedFoodObject_packaging_photos_front" : { + "type" : "object", + "properties" : { + "small" : { + "type" : "string", + "description" : "Small photo of the front of this item's packaging" + }, + "thumb" : { + "type" : "string", + "description" : "Thumbnail photo of the front of this item's packaging" + }, + "display" : { + "type" : "string", + "description" : "Full-sized photo of the front of this item's packaging" + } + }, + "description" : "An object containing photos of the front of this item's packaging", + "example" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + } + }, + "BrandedFoodObject_packaging_photos_nutrition" : { + "type" : "object", + "properties" : { + "small" : { + "type" : "string", + "description" : "Small photo of this item's nutrition label" + }, + "thumb" : { + "type" : "string", + "description" : "Thumbnail photo of this item's nutrition label" + }, + "display" : { + "type" : "string", + "description" : "Full-sized photo of this item's nutrition label" + } + }, + "description" : "An object containing photos of this item's nutrition label", + "example" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + } + }, + "BrandedFoodObject_packaging_photos_ingredients" : { + "type" : "object", + "properties" : { + "small" : { + "type" : "string", + "description" : "Small photo of the ingredients on this item's packaging" + }, + "thumb" : { + "type" : "string", + "description" : "Thumbnail photo of the ingredients on this item's packaging" + }, + "display" : { + "type" : "string", + "description" : "Full-sized photo of the ingredients on this item's packaging" + } + }, + "description" : "An object containing photos of the ingredients on this item's packaging", + "example" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + } + }, + "BrandedFoodObject_packaging_photos" : { + "type" : "object", + "properties" : { + "front" : { + "$ref" : "#/components/schemas/BrandedFoodObject_packaging_photos_front" + }, + "nutrition" : { + "$ref" : "#/components/schemas/BrandedFoodObject_packaging_photos_nutrition" + }, + "ingredients" : { + "$ref" : "#/components/schemas/BrandedFoodObject_packaging_photos_ingredients" + } + }, + "description" : "A object containing a collection of photos of this item's packaging", + "example" : { + "nutrition" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + }, + "ingredients" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + }, + "front" : { + "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" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "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" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + } + }, + "BrandedFoodObject_country_details" : { + "type" : "object", + "properties" : { + "english_speaking" : { + "type" : "integer", + "description" : "The number of countries where English is the country's primary language" + }, + "non_english_speaking" : { + "type" : "integer", + "description" : "The number of countries where English is not the country's primary language" + } + }, + "description" : "An object containing additional information on the countries where this item is found", + "example" : { + "english_speaking" : 2, + "non_english_speaking" : 6 + } + }, + "BrandedFoodObject_items" : { + "type" : "object", + "properties" : { + "barcode" : { + "type" : "string", + "description" : "EAN/UPC barcode" + }, + "name" : { + "type" : "string", + "description" : "Item name as provided by brand owner or as shown on packaging" + }, + "brand" : { + "type" : "string", + "description" : "The brand name that owns this item" + }, + "ingredients" : { + "type" : "string", + "description" : "Ingredients in order of highest value to least" + }, + "package" : { + "$ref" : "#/components/schemas/BrandedFoodObject_package" + }, + "serving" : { + "$ref" : "#/components/schemas/BrandedFoodObject_serving" + }, + "categories" : { + "type" : "array", + "items" : { + "type" : "string", + "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" : { + "type" : "array", + "description" : "An array of ingredient objects that were flagged while grading this item for compatibility with each diet", + "items" : { + "$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 reactions in people", + "items" : { + "type" : "string" + } + }, + "brand_list" : { + "type" : "array", + "description" : "An array of brands we have associated with this item. Some items are sold by more than 1 brand.", + "items" : { + "type" : "string" + } + }, + "countries" : { + "type" : "array", + "description" : "An array of countries where this item is sold", + "items" : { + "type" : "string" + } + }, + "country_details" : { + "$ref" : "#/components/schemas/BrandedFoodObject_country_details" + }, + "palm_oil_ingredients" : { + "type" : "array", + "description" : "An array of ingredients made from palm oil", + "items" : { + "type" : "string" + } + }, + "ingredient_list" : { + "type" : "array", + "description" : "An array of this item's ingredients", + "items" : { + "type" : "string" + } + }, + "has_english_ingredients" : { + "type" : "boolean", + "description" : "A boolean indicating if we have English ingredients for this item" + }, + "minerals" : { + "type" : "array", + "description" : "An array of minerals that this item contains", + "items" : { + "type" : "string" + } + }, + "traces" : { + "type" : "array", + "description" : "An array of trace ingredients that may be found in this item", + "items" : { + "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\" the common name may be \"Chicken enchilada\")" + }, + "description" : { + "type" : "string", + "description" : "A description of this item" + }, + "keywords" : { + "type" : "array", + "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" : [ "minerals", "minerals" ], + "components" : [ { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + }, { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + } ], + "keywords" : [ "keywords", "keywords" ], + "country_details" : { + "english_speaking" : 2, + "non_english_speaking" : 6 + }, + "description" : "description", + "has_english_ingredients" : true, + "palm_oil_ingredients" : [ "palm_oil_ingredients", "palm_oil_ingredients" ], + "serving" : { + "total" : 5, + "size_fulltext" : "size_fulltext", + "size" : 1, + "measurement_unit" : "measurement_unit" + }, + "nutrients" : { + "chomp" : [ { + "total" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + }, { + "total" : 7.061401241503109, + "name" : "name", + "measurement_unit" : "measurement_unit", + "per_100g" : 5.637376656633329, + "per_serving" : 2.3021358869347655 + } ], + "usda" : [ { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + }, { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } ] + }, + "protein_conversion_factor" : 7.457744773683766, + "packaging_photos" : { + "nutrition" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + }, + "ingredients" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + }, + "front" : { + "small" : "small", + "thumb" : "thumb", + "display" : "display" + } + }, + "diet_labels" : { + "vegetarian" : { + "confidence_description" : "confidence_description", + "confidence" : 9, + "name" : "name", + "compatibility_level" : 5, + "is_compatible" : true + }, + "vegan" : { + "confidence_description" : "confidence_description", + "confidence" : 4, + "name" : "name", + "compatibility_level" : 1, + "is_compatible" : true + }, + "gluten_free" : { + "confidence_description" : "confidence_description", + "confidence" : 6, + "name" : "name", + "compatibility_level" : 9, + "is_compatible" : true + } + }, + "ingredients" : "ingredients", + "categories" : [ "categories", "categories" ], + "common_name" : "common_name", + "barcode" : "barcode", + "brand" : "brand", + "portions" : [ { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + }, { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + } ], + "package" : { + "quantity" : 0, + "size" : 6 + }, + "traces" : [ "traces", "traces" ], + "diet_flags" : [ { + "ingredient" : "ingredient", + "is_allergen" : true, + "ingredient_description" : "ingredient_description", + "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" : 8, + "is_compatible" : "is_compatible", + "diet_label" : "diet_label", + "compatibility_description" : "compatibility_description" + } ], + "countries" : [ "countries", "countries" ], + "footnote" : "footnote", + "allergens" : [ "allergens", "allergens" ], + "calorie_conversion_factor" : { + "carbohydrate_value" : 6.84685269835264, + "protein_value" : 1.0246457001441578, + "fat_value" : 1.4894159098541704 + }, + "ingredient_list" : [ "ingredient_list", "ingredient_list" ], + "name" : "name", + "brand_list" : [ "brand_list", "brand_list" ] + } + }, + "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", + "example" : { + "usda" : [ { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + }, { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } ] + } + }, + "IngredientObject_items" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string", + "description" : "Item name as provided by brand owner or as shown on packaging" + }, + "categories" : { + "type" : "array", + "items" : { + "type" : "string", + "description" : "An array of categories for this item" + } + }, + "nutrients" : { + "$ref" : "#/components/schemas/IngredientObject_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" + }, + "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" + } + }, + "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\" 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 include unusual aspects of the food overall." + } + }, + "description" : "An object containing information for this specific item.", + "example" : { + "protein_conversion_factor" : 0.8008281904610115, + "calorie_conversion_factor" : { + "carbohydrate_value" : 6.84685269835264, + "protein_value" : 1.0246457001441578, + "fat_value" : 1.4894159098541704 + }, + "components" : [ { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + }, { + "data_points" : 3, + "pct_weight" : 9.018348186070783, + "gram_weight" : 6.438423552598547, + "name" : "name", + "is_refuse" : true + } ], + "diet_labels" : { + "vegetarian" : { + "confidence_description" : "confidence_description", + "confidence" : 9, + "name" : "name", + "compatibility_level" : 5, + "is_compatible" : true + }, + "vegan" : { + "confidence_description" : "confidence_description", + "confidence" : 4, + "name" : "name", + "compatibility_level" : 1, + "is_compatible" : true + }, + "gluten_free" : { + "confidence_description" : "confidence_description", + "confidence" : 6, + "name" : "name", + "compatibility_level" : 9, + "is_compatible" : true + } + }, + "name" : "name", + "description" : "description", + "categories" : [ "categories", "categories" ], + "footnote" : "footnote", + "common_name" : "common_name", + "nutrients" : { + "usda" : [ { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + }, { + "data_points" : 1, + "min" : 2.027123023002322, + "median" : 7.386281948385884, + "max" : 4.145608029883936, + "name" : "name", + "measurement_unit" : "measurement_unit", + "description" : "description", + "id" : 9, + "per_100g" : 3.616076749251911, + "footnote" : "footnote", + "source" : "source" + } ] + }, + "portions" : [ { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + }, { + "data_points" : 1, + "modifier" : "modifier", + "gram_weight" : 6.965117697638846, + "measurement_unit" : "measurement_unit", + "description" : "description", + "footnote" : "footnote" + } ] + } + } + }, + "responses" : { + "200BrandedResponse" : { + "description" : "__Valid__ - Will return an object containing any matching foods.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BrandedFoodObject" + } + } + } + }, + "200IngredientResponse" : { + "description" : "__Valid__ - Will return an object containing any matching ingredient foods.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/IngredientObject" + } + } + } + }, + "400Error" : { + "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)_" + }, + "403Error" : { + "description" : "__Forbidden__ - Disallowed entity." + }, + "404Error" : { + "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._" + } + }, + "securitySchemes" : { + "ApiKeyAuth" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "query" + } + } + } +} diff --git a/src/IO.Swagger/wwwroot/web.config b/src/IO.Swagger/wwwroot/web.config new file mode 100644 index 0000000..e70a777 --- /dev/null +++ b/src/IO.Swagger/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + +