api

package
v0.0.0-...-a602de9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 50 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func Coalesce

func Coalesce[T string | int | float32 | float64](i ...T) T

Coalesce returns the first non-zero provided

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func GetTraceID

func GetTraceID(ctx context.Context) string

func JSONBytesFromFile

func JSONBytesFromFile(ctx context.Context, inputPath string) ([][]byte, error)

func NewAssociateFoodWithIngredientRequest

func NewAssociateFoodWithIngredientRequest(server string, ingredientId string, params *AssociateFoodWithIngredientParams) (*http.Request, error)

NewAssociateFoodWithIngredientRequest generates requests for AssociateFoodWithIngredient

func NewAuthLoginRequest

func NewAuthLoginRequest(server string, params *AuthLoginParams) (*http.Request, error)

NewAuthLoginRequest generates requests for AuthLogin

func NewConvertIngredientToRecipeRequest

func NewConvertIngredientToRecipeRequest(server string, ingredientId string) (*http.Request, error)

NewConvertIngredientToRecipeRequest generates requests for ConvertIngredientToRecipe

func NewCreateIngredientsRequest

func NewCreateIngredientsRequest(server string, body CreateIngredientsJSONRequestBody) (*http.Request, error)

NewCreateIngredientsRequest calls the generic CreateIngredients builder with application/json body

func NewCreateIngredientsRequestWithBody

func NewCreateIngredientsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateIngredientsRequestWithBody generates requests for CreateIngredients with any type of body

func NewCreateRecipesRequest

func NewCreateRecipesRequest(server string, body CreateRecipesJSONRequestBody) (*http.Request, error)

NewCreateRecipesRequest calls the generic CreateRecipes builder with application/json body

func NewCreateRecipesRequestWithBody

func NewCreateRecipesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateRecipesRequestWithBody generates requests for CreateRecipes with any type of body

func NewDoSyncRequest

func NewDoSyncRequest(server string, params *DoSyncParams) (*http.Request, error)

NewDoSyncRequest generates requests for DoSync

func NewGetConfigRequest

func NewGetConfigRequest(server string) (*http.Request, error)

NewGetConfigRequest generates requests for GetConfig

func NewGetFoodByIdRequest

func NewGetFoodByIdRequest(server string, fdcId int) (*http.Request, error)

NewGetFoodByIdRequest generates requests for GetFoodById

func NewGetFoodsByIdsRequest

func NewGetFoodsByIdsRequest(server string, params *GetFoodsByIdsParams) (*http.Request, error)

NewGetFoodsByIdsRequest generates requests for GetFoodsByIds

func NewGetIngredientByIdRequest

func NewGetIngredientByIdRequest(server string, ingredientId string) (*http.Request, error)

NewGetIngredientByIdRequest generates requests for GetIngredientById

func NewGetLatexByRecipeIdRequest

func NewGetLatexByRecipeIdRequest(server string, recipeId string) (*http.Request, error)

NewGetLatexByRecipeIdRequest generates requests for GetLatexByRecipeId

func NewGetMealByIdRequest

func NewGetMealByIdRequest(server string, mealId string) (*http.Request, error)

NewGetMealByIdRequest generates requests for GetMealById

func NewGetRecipeByIdRequest

func NewGetRecipeByIdRequest(server string, recipeId string) (*http.Request, error)

NewGetRecipeByIdRequest generates requests for GetRecipeById

func NewGetRecipesByIdsRequest

func NewGetRecipesByIdsRequest(server string, params *GetRecipesByIdsParams) (*http.Request, error)

NewGetRecipesByIdsRequest generates requests for GetRecipesByIds

func NewListAllAlbumsRequest

func NewListAllAlbumsRequest(server string) (*http.Request, error)

NewListAllAlbumsRequest generates requests for ListAllAlbums

func NewListIngredientsRequest

func NewListIngredientsRequest(server string, params *ListIngredientsParams) (*http.Request, error)

NewListIngredientsRequest generates requests for ListIngredients

func NewListMealsRequest

func NewListMealsRequest(server string, params *ListMealsParams) (*http.Request, error)

NewListMealsRequest generates requests for ListMeals

func NewListPhotosRequest

func NewListPhotosRequest(server string, params *ListPhotosParams) (*http.Request, error)

NewListPhotosRequest generates requests for ListPhotos

func NewListRecipesRequest

func NewListRecipesRequest(server string, params *ListRecipesParams) (*http.Request, error)

NewListRecipesRequest generates requests for ListRecipes

func NewLoadIngredientMappingsRequest

func NewLoadIngredientMappingsRequest(server string, body LoadIngredientMappingsJSONRequestBody) (*http.Request, error)

NewLoadIngredientMappingsRequest calls the generic LoadIngredientMappings builder with application/json body

func NewLoadIngredientMappingsRequestWithBody

func NewLoadIngredientMappingsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewLoadIngredientMappingsRequestWithBody generates requests for LoadIngredientMappings with any type of body

func NewMergeIngredientsRequest

func NewMergeIngredientsRequest(server string, ingredientId string, body MergeIngredientsJSONRequestBody) (*http.Request, error)

NewMergeIngredientsRequest calls the generic MergeIngredients builder with application/json body

func NewMergeIngredientsRequestWithBody

func NewMergeIngredientsRequestWithBody(server string, ingredientId string, contentType string, body io.Reader) (*http.Request, error)

NewMergeIngredientsRequestWithBody generates requests for MergeIngredients with any type of body

func NewRecipeDependenciesRequest

func NewRecipeDependenciesRequest(server string) (*http.Request, error)

NewRecipeDependenciesRequest generates requests for RecipeDependencies

func NewScrapeRecipeRequest

func NewScrapeRecipeRequest(server string, body ScrapeRecipeJSONRequestBody) (*http.Request, error)

NewScrapeRecipeRequest calls the generic ScrapeRecipe builder with application/json body

func NewScrapeRecipeRequestWithBody

func NewScrapeRecipeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewScrapeRecipeRequestWithBody generates requests for ScrapeRecipe with any type of body

func NewSearchFoodsRequest

func NewSearchFoodsRequest(server string, params *SearchFoodsParams) (*http.Request, error)

NewSearchFoodsRequest generates requests for SearchFoods

func NewSearchRequest

func NewSearchRequest(server string, params *SearchParams) (*http.Request, error)

NewSearchRequest generates requests for Search

func NewSumRecipesRequest

func NewSumRecipesRequest(server string, body SumRecipesJSONRequestBody) (*http.Request, error)

NewSumRecipesRequest calls the generic SumRecipes builder with application/json body

func NewSumRecipesRequestWithBody

func NewSumRecipesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewSumRecipesRequestWithBody generates requests for SumRecipes with any type of body

func NewUpdateRecipesForMealRequest

func NewUpdateRecipesForMealRequest(server string, mealId string, body UpdateRecipesForMealJSONRequestBody) (*http.Request, error)

NewUpdateRecipesForMealRequest calls the generic UpdateRecipesForMeal builder with application/json body

func NewUpdateRecipesForMealRequestWithBody

func NewUpdateRecipesForMealRequestWithBody(server string, mealId string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateRecipesForMealRequestWithBody generates requests for UpdateRecipesForMeal with any type of body

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

func Test

func Test()

Types

type API

type API struct {
	Google     *google.Client
	GPhotos    *gphotos.Photos
	Auth       *auth.Auth
	R          *rs_client.Client
	Notion     notion.Client
	ImageStore image.Store
	// contains filtered or unexported fields
}

func New

func New(db *db.Client,
	r *rs_client.Client,
	imageStore image.Store,
	opts ...ServerOption) *API

func (*API) AssociateFoodWithIngredient

func (a *API) AssociateFoodWithIngredient(c echo.Context, ingredientId string, params AssociateFoodWithIngredientParams) error

func (*API) AuthLogin

func (a *API) AuthLogin(c echo.Context, params AuthLoginParams) error

func (*API) CalTest

func (a *API) CalTest(c echo.Context) error

func (*API) ConvertIngredientToRecipe

func (a *API) ConvertIngredientToRecipe(c echo.Context, ingredientId string) error

func (*API) CreateIngredients

func (a *API) CreateIngredients(c echo.Context) error

func (*API) CreateRecipe

func (a *API) CreateRecipe(ctx context.Context, r *RecipeWrapperInput) (*RecipeWrapper, error)

func (*API) CreateRecipes

func (a *API) CreateRecipes(c echo.Context) error

Create a recipe (POST /recipes)

func (*API) DB

func (a *API) DB() *db.Client

func (*API) DoSync

func (a *API) DoSync(c echo.Context, params DoSyncParams) error

func (*API) FetchAndTransform

func (a *API) FetchAndTransform(ctx context.Context, addr string, ingredientToId func(ctx context.Context, name string) (string, error)) (*RecipeWrapperInput, error)

FetchAndTransform returns a recipe.

func (*API) GetConfig

func (a *API) GetConfig(c echo.Context) error

func (*API) GetFoodById

func (a *API) GetFoodById(c echo.Context, fdcId int) error

func (*API) GetFoodsByIds

func (a *API) GetFoodsByIds(c echo.Context, params GetFoodsByIdsParams) error

func (*API) GetIngredientById

func (a *API) GetIngredientById(c echo.Context, ingredientId string) error

func (*API) GetLatexByRecipeId

func (a *API) GetLatexByRecipeId(c echo.Context, recipeId string) error

func (*API) GetMealById

func (a *API) GetMealById(c echo.Context, mealId string) error

func (*API) GetMealInfo

func (a *API) GetMealInfo(ctx context.Context, meals db.Meals) ([]Meal, error)

func (*API) GetRecipeById

func (a *API) GetRecipeById(c echo.Context, recipeId string) error

Info for a specific recipe (GET /recipes/{recipeId})

func (*API) GetRecipesByIds

func (a *API) GetRecipesByIds(c echo.Context, params GetRecipesByIdsParams) error

func (*API) IngredientIdByName

func (a *API) IngredientIdByName(ctx context.Context, name string) (string, error)

func (*API) IngredientListV2

func (a *API) IngredientListV2(ctx context.Context, pagination Items, mods ...QueryMod) ([]IngredientWrapper, int64, error)

func (*API) Latex

func (a *API) Latex(ctx context.Context, id string) ([]byte, error)

func (*API) ListAllAlbums

func (a *API) ListAllAlbums(c echo.Context) error

func (*API) ListIngredients

func (a *API) ListIngredients(c echo.Context, params ListIngredientsParams) error

func (*API) ListMeals

func (a *API) ListMeals(c echo.Context, _ ListMealsParams) error

func (*API) ListPhotos

func (a *API) ListPhotos(c echo.Context, params ListPhotosParams) error

func (*API) ListRecipes

func (a *API) ListRecipes(c echo.Context, params ListRecipesParams) error

Items all recipes (GET /recipes)

func (*API) LoadIngredientMappings

func (a *API) LoadIngredientMappings(c echo.Context) error

func (*API) MergeIngredients

func (a *API) MergeIngredients(c echo.Context, ingredientId string) error

func (*API) Misc

func (a *API) Misc(c echo.Context) error

func (*API) NormalizeAmount

func (a *API) NormalizeAmount(ctx context.Context, amt Amount) (*Amount, error)

func (*API) NotionTest

func (a *API) NotionTest(c echo.Context) error

func (*API) ProcessGoogleAuth

func (a *API) ProcessGoogleAuth(ctx context.Context, code string) (jwt string, rawUser map[string]interface{}, err error)

func (*API) RecipeDependencies

func (a *API) RecipeDependencies(c echo.Context) error

func (*API) RecipeFromCompact

func (a *API) RecipeFromCompact(ctx context.Context, cr CompactRecipe) (*RecipeWrapperInput, error)

func (*API) RecipeFromFile

func (a *API) RecipeFromFile(ctx context.Context, inputPath string) (output []RecipeDetailInput, error error)

RecipeFromFile reads a recipe from json or yaml file

func (*API) RecipeFromText

func (a *API) RecipeFromText(ctx context.Context, text string) (*RecipeDetailInput, error)

func (*API) RecipeListV2

func (a *API) RecipeListV2(ctx context.Context, pagination Items, mods ...QueryMod) ([]RecipeWrapper, int64, error)

func (*API) Scrape

func (a *API) Scrape(ctx context.Context, url string) (*RecipeWrapper, error)

func (*API) ScrapeRecipe

func (a *API) ScrapeRecipe(c echo.Context) error

func (*API) Search

func (a *API) Search(c echo.Context, params SearchParams) error

func (*API) SearchFoods

func (a *API) SearchFoods(c echo.Context, params SearchFoodsParams) error

func (*API) SumRecipes

func (a *API) SumRecipes(c echo.Context) error

SumRecipes sums the amounts of ingredients in the recipes

func (*API) Sync

func (a *API) Sync(ctx context.Context, lookbackDays int) error

func (*API) UpdateRecipesForMeal

func (a *API) UpdateRecipesForMeal(c echo.Context, mealId string) error

type Amount

type Amount struct {
	// Source if it was explicit, inferred, etc
	Source *string `json:"source,omitempty"`

	// Unit unit
	Unit string `json:"unit"`

	// UpperValue value
	UpperValue *float64 `json:"upper_value,omitempty"`

	// Value value
	Value float64 `json:"value"`
}

Amount amount and unit

func (Amount) IsGram

func (a Amount) IsGram() bool

IsGram checks if the unit is gram

func (Amount) IsMoneyKCal

func (a Amount) IsMoneyKCal() bool

IsMoneyKCal checks if the unit is money or kcalories

type AssociateFoodWithIngredientParams

type AssociateFoodWithIngredientParams struct {
	// FdcId The FDC id of the food to link to the ingredient
	FdcId int `form:"fdc_id" json:"fdc_id"`
}

AssociateFoodWithIngredientParams defines parameters for AssociateFoodWithIngredient.

type AssociateFoodWithIngredientResponse

type AssociateFoodWithIngredientResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *RecipeDetail
	JSONDefault  *Error
}

func ParseAssociateFoodWithIngredientResponse

func ParseAssociateFoodWithIngredientResponse(rsp *http.Response) (*AssociateFoodWithIngredientResponse, error)

ParseAssociateFoodWithIngredientResponse parses an HTTP response from a AssociateFoodWithIngredientWithResponse call

func (AssociateFoodWithIngredientResponse) Status

Status returns HTTPResponse.Status

func (AssociateFoodWithIngredientResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type AuthLoginParams

type AuthLoginParams struct {
	// Code Google code
	Code string `form:"code" json:"code"`
}

AuthLoginParams defines parameters for AuthLogin.

type AuthLoginResponse

type AuthLoginResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *AuthResp
	JSONDefault  *Error
}

func ParseAuthLoginResponse

func ParseAuthLoginResponse(rsp *http.Response) (*AuthLoginResponse, error)

ParseAuthLoginResponse parses an HTTP response from a AuthLoginWithResponse call

func (AuthLoginResponse) Status

func (r AuthLoginResponse) Status() string

Status returns HTTPResponse.Status

func (AuthLoginResponse) StatusCode

func (r AuthLoginResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AuthResp

type AuthResp struct {
	Jwt  string                 `json:"jwt"`
	User map[string]interface{} `json:"user"`
}

AuthResp todo

type BrandedFoodItem

type BrandedFoodItem struct {
	AvailableDate            *string          `json:"availableDate,omitempty"`
	BrandOwner               *string          `json:"brandOwner,omitempty"`
	BrandedFoodCategory      *string          `json:"brandedFoodCategory,omitempty"`
	DataSource               *string          `json:"dataSource,omitempty"`
	DataType                 string           `json:"dataType"`
	Description              string           `json:"description"`
	FdcId                    int              `json:"fdcId"`
	FoodClass                *string          `json:"foodClass,omitempty"`
	FoodNutrients            *[]FoodNutrient  `json:"foodNutrients,omitempty"`
	FoodUpdateLog            *[]FoodUpdateLog `json:"foodUpdateLog,omitempty"`
	GpcClassCode             *int             `json:"gpcClassCode,omitempty"`
	GtinUpc                  *string          `json:"gtinUpc,omitempty"`
	HouseholdServingFullText *string          `json:"householdServingFullText,omitempty"`
	Ingredients              *string          `json:"ingredients,omitempty"`
	LabelNutrients           *struct {
		Calcium *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"calcium,omitempty"`
		Calories *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"calories,omitempty"`
		Carbohydrates *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"carbohydrates,omitempty"`
		Cholesterol *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"cholesterol,omitempty"`
		Fat *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"fat,omitempty"`
		Fiber *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"fiber,omitempty"`
		Iron *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"iron,omitempty"`
		Potassium *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"potassium,omitempty"`
		Protein *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"protein,omitempty"`
		SaturatedFat *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"saturatedFat,omitempty"`
		Sodium *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"sodium,omitempty"`
		Sugars *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"sugars,omitempty"`
		TransFat *struct {
			Value *float64 `json:"value,omitempty"`
		} `json:"transFat,omitempty"`
	} `json:"labelNutrients,omitempty"`
	ModifiedDate         *string   `json:"modifiedDate,omitempty"`
	PreparationStateCode *string   `json:"preparationStateCode,omitempty"`
	PublicationDate      *string   `json:"publicationDate,omitempty"`
	ServingSize          *float64  `json:"servingSize,omitempty"`
	ServingSizeUnit      *string   `json:"servingSizeUnit,omitempty"`
	TradeChannel         *[]string `json:"tradeChannel,omitempty"`
}

BrandedFoodItem defines model for BrandedFoodItem.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) AssociateFoodWithIngredient

func (c *Client) AssociateFoodWithIngredient(ctx context.Context, ingredientId string, params *AssociateFoodWithIngredientParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AuthLogin

func (c *Client) AuthLogin(ctx context.Context, params *AuthLoginParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ConvertIngredientToRecipe

func (c *Client) ConvertIngredientToRecipe(ctx context.Context, ingredientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateIngredients

func (c *Client) CreateIngredients(ctx context.Context, body CreateIngredientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateIngredientsWithBody

func (c *Client) CreateIngredientsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateRecipes

func (c *Client) CreateRecipes(ctx context.Context, body CreateRecipesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateRecipesWithBody

func (c *Client) CreateRecipesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DoSync

func (c *Client) DoSync(ctx context.Context, params *DoSyncParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetConfig

func (c *Client) GetConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetFoodById

func (c *Client) GetFoodById(ctx context.Context, fdcId int, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetFoodsByIds

func (c *Client) GetFoodsByIds(ctx context.Context, params *GetFoodsByIdsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetIngredientById

func (c *Client) GetIngredientById(ctx context.Context, ingredientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetLatexByRecipeId

func (c *Client) GetLatexByRecipeId(ctx context.Context, recipeId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetMealById

func (c *Client) GetMealById(ctx context.Context, mealId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetRecipeById

func (c *Client) GetRecipeById(ctx context.Context, recipeId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetRecipesByIds

func (c *Client) GetRecipesByIds(ctx context.Context, params *GetRecipesByIdsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListAllAlbums

func (c *Client) ListAllAlbums(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListIngredients

func (c *Client) ListIngredients(ctx context.Context, params *ListIngredientsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListMeals

func (c *Client) ListMeals(ctx context.Context, params *ListMealsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListPhotos

func (c *Client) ListPhotos(ctx context.Context, params *ListPhotosParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListRecipes

func (c *Client) ListRecipes(ctx context.Context, params *ListRecipesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) LoadIngredientMappings

func (c *Client) LoadIngredientMappings(ctx context.Context, body LoadIngredientMappingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) LoadIngredientMappingsWithBody

func (c *Client) LoadIngredientMappingsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) MergeIngredients

func (c *Client) MergeIngredients(ctx context.Context, ingredientId string, body MergeIngredientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) MergeIngredientsWithBody

func (c *Client) MergeIngredientsWithBody(ctx context.Context, ingredientId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RecipeDependencies

func (c *Client) RecipeDependencies(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ScrapeRecipe

func (c *Client) ScrapeRecipe(ctx context.Context, body ScrapeRecipeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ScrapeRecipeWithBody

func (c *Client) ScrapeRecipeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Search

func (c *Client) Search(ctx context.Context, params *SearchParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SearchFoods

func (c *Client) SearchFoods(ctx context.Context, params *SearchFoodsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SumRecipes

func (c *Client) SumRecipes(ctx context.Context, body SumRecipesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) SumRecipesWithBody

func (c *Client) SumRecipesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateRecipesForMeal

func (c *Client) UpdateRecipesForMeal(ctx context.Context, mealId string, body UpdateRecipesForMealJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateRecipesForMealWithBody

func (c *Client) UpdateRecipesForMealWithBody(ctx context.Context, mealId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// ListAllAlbums request
	ListAllAlbums(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AuthLogin request
	AuthLogin(ctx context.Context, params *AuthLoginParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetConfig request
	GetConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RecipeDependencies request
	RecipeDependencies(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFoodsByIds request
	GetFoodsByIds(ctx context.Context, params *GetFoodsByIdsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SearchFoods request
	SearchFoods(ctx context.Context, params *SearchFoodsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFoodById request
	GetFoodById(ctx context.Context, fdcId int, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListIngredients request
	ListIngredients(ctx context.Context, params *ListIngredientsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateIngredientsWithBody request with any body
	CreateIngredientsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateIngredients(ctx context.Context, body CreateIngredientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetIngredientById request
	GetIngredientById(ctx context.Context, ingredientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AssociateFoodWithIngredient request
	AssociateFoodWithIngredient(ctx context.Context, ingredientId string, params *AssociateFoodWithIngredientParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ConvertIngredientToRecipe request
	ConvertIngredientToRecipe(ctx context.Context, ingredientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// MergeIngredientsWithBody request with any body
	MergeIngredientsWithBody(ctx context.Context, ingredientId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	MergeIngredients(ctx context.Context, ingredientId string, body MergeIngredientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListMeals request
	ListMeals(ctx context.Context, params *ListMealsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetMealById request
	GetMealById(ctx context.Context, mealId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateRecipesForMealWithBody request with any body
	UpdateRecipesForMealWithBody(ctx context.Context, mealId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateRecipesForMeal(ctx context.Context, mealId string, body UpdateRecipesForMealJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// LoadIngredientMappingsWithBody request with any body
	LoadIngredientMappingsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	LoadIngredientMappings(ctx context.Context, body LoadIngredientMappingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListPhotos request
	ListPhotos(ctx context.Context, params *ListPhotosParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListRecipes request
	ListRecipes(ctx context.Context, params *ListRecipesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateRecipesWithBody request with any body
	CreateRecipesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateRecipes(ctx context.Context, body CreateRecipesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetRecipesByIds request
	GetRecipesByIds(ctx context.Context, params *GetRecipesByIdsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ScrapeRecipeWithBody request with any body
	ScrapeRecipeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	ScrapeRecipe(ctx context.Context, body ScrapeRecipeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SumRecipesWithBody request with any body
	SumRecipesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SumRecipes(ctx context.Context, body SumRecipesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetRecipeById request
	GetRecipeById(ctx context.Context, recipeId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLatexByRecipeId request
	GetLatexByRecipeId(ctx context.Context, recipeId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Search request
	Search(ctx context.Context, params *SearchParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DoSync request
	DoSync(ctx context.Context, params *DoSyncParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) AssociateFoodWithIngredientWithResponse

func (c *ClientWithResponses) AssociateFoodWithIngredientWithResponse(ctx context.Context, ingredientId string, params *AssociateFoodWithIngredientParams, reqEditors ...RequestEditorFn) (*AssociateFoodWithIngredientResponse, error)

AssociateFoodWithIngredientWithResponse request returning *AssociateFoodWithIngredientResponse

func (*ClientWithResponses) AuthLoginWithResponse

func (c *ClientWithResponses) AuthLoginWithResponse(ctx context.Context, params *AuthLoginParams, reqEditors ...RequestEditorFn) (*AuthLoginResponse, error)

AuthLoginWithResponse request returning *AuthLoginResponse

func (*ClientWithResponses) ConvertIngredientToRecipeWithResponse

func (c *ClientWithResponses) ConvertIngredientToRecipeWithResponse(ctx context.Context, ingredientId string, reqEditors ...RequestEditorFn) (*ConvertIngredientToRecipeResponse, error)

ConvertIngredientToRecipeWithResponse request returning *ConvertIngredientToRecipeResponse

func (*ClientWithResponses) CreateIngredientsWithBodyWithResponse

func (c *ClientWithResponses) CreateIngredientsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateIngredientsResponse, error)

CreateIngredientsWithBodyWithResponse request with arbitrary body returning *CreateIngredientsResponse

func (*ClientWithResponses) CreateIngredientsWithResponse

func (c *ClientWithResponses) CreateIngredientsWithResponse(ctx context.Context, body CreateIngredientsJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateIngredientsResponse, error)

func (*ClientWithResponses) CreateRecipesWithBodyWithResponse

func (c *ClientWithResponses) CreateRecipesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRecipesResponse, error)

CreateRecipesWithBodyWithResponse request with arbitrary body returning *CreateRecipesResponse

func (*ClientWithResponses) CreateRecipesWithResponse

func (c *ClientWithResponses) CreateRecipesWithResponse(ctx context.Context, body CreateRecipesJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRecipesResponse, error)

func (*ClientWithResponses) DoSyncWithResponse

func (c *ClientWithResponses) DoSyncWithResponse(ctx context.Context, params *DoSyncParams, reqEditors ...RequestEditorFn) (*DoSyncResponse, error)

DoSyncWithResponse request returning *DoSyncResponse

func (*ClientWithResponses) GetConfigWithResponse

func (c *ClientWithResponses) GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error)

GetConfigWithResponse request returning *GetConfigResponse

func (*ClientWithResponses) GetFoodByIdWithResponse

func (c *ClientWithResponses) GetFoodByIdWithResponse(ctx context.Context, fdcId int, reqEditors ...RequestEditorFn) (*GetFoodByIdResponse, error)

GetFoodByIdWithResponse request returning *GetFoodByIdResponse

func (*ClientWithResponses) GetFoodsByIdsWithResponse

func (c *ClientWithResponses) GetFoodsByIdsWithResponse(ctx context.Context, params *GetFoodsByIdsParams, reqEditors ...RequestEditorFn) (*GetFoodsByIdsResponse, error)

GetFoodsByIdsWithResponse request returning *GetFoodsByIdsResponse

func (*ClientWithResponses) GetIngredientByIdWithResponse

func (c *ClientWithResponses) GetIngredientByIdWithResponse(ctx context.Context, ingredientId string, reqEditors ...RequestEditorFn) (*GetIngredientByIdResponse, error)

GetIngredientByIdWithResponse request returning *GetIngredientByIdResponse

func (*ClientWithResponses) GetLatexByRecipeIdWithResponse

func (c *ClientWithResponses) GetLatexByRecipeIdWithResponse(ctx context.Context, recipeId string, reqEditors ...RequestEditorFn) (*GetLatexByRecipeIdResponse, error)

GetLatexByRecipeIdWithResponse request returning *GetLatexByRecipeIdResponse

func (*ClientWithResponses) GetMealByIdWithResponse

func (c *ClientWithResponses) GetMealByIdWithResponse(ctx context.Context, mealId string, reqEditors ...RequestEditorFn) (*GetMealByIdResponse, error)

GetMealByIdWithResponse request returning *GetMealByIdResponse

func (*ClientWithResponses) GetRecipeByIdWithResponse

func (c *ClientWithResponses) GetRecipeByIdWithResponse(ctx context.Context, recipeId string, reqEditors ...RequestEditorFn) (*GetRecipeByIdResponse, error)

GetRecipeByIdWithResponse request returning *GetRecipeByIdResponse

func (*ClientWithResponses) GetRecipesByIdsWithResponse

func (c *ClientWithResponses) GetRecipesByIdsWithResponse(ctx context.Context, params *GetRecipesByIdsParams, reqEditors ...RequestEditorFn) (*GetRecipesByIdsResponse, error)

GetRecipesByIdsWithResponse request returning *GetRecipesByIdsResponse

func (*ClientWithResponses) ListAllAlbumsWithResponse

func (c *ClientWithResponses) ListAllAlbumsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAllAlbumsResponse, error)

ListAllAlbumsWithResponse request returning *ListAllAlbumsResponse

func (*ClientWithResponses) ListIngredientsWithResponse

func (c *ClientWithResponses) ListIngredientsWithResponse(ctx context.Context, params *ListIngredientsParams, reqEditors ...RequestEditorFn) (*ListIngredientsResponse, error)

ListIngredientsWithResponse request returning *ListIngredientsResponse

func (*ClientWithResponses) ListMealsWithResponse

func (c *ClientWithResponses) ListMealsWithResponse(ctx context.Context, params *ListMealsParams, reqEditors ...RequestEditorFn) (*ListMealsResponse, error)

ListMealsWithResponse request returning *ListMealsResponse

func (*ClientWithResponses) ListPhotosWithResponse

func (c *ClientWithResponses) ListPhotosWithResponse(ctx context.Context, params *ListPhotosParams, reqEditors ...RequestEditorFn) (*ListPhotosResponse, error)

ListPhotosWithResponse request returning *ListPhotosResponse

func (*ClientWithResponses) ListRecipesWithResponse

func (c *ClientWithResponses) ListRecipesWithResponse(ctx context.Context, params *ListRecipesParams, reqEditors ...RequestEditorFn) (*ListRecipesResponse, error)

ListRecipesWithResponse request returning *ListRecipesResponse

func (*ClientWithResponses) LoadIngredientMappingsWithBodyWithResponse

func (c *ClientWithResponses) LoadIngredientMappingsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoadIngredientMappingsResponse, error)

LoadIngredientMappingsWithBodyWithResponse request with arbitrary body returning *LoadIngredientMappingsResponse

func (*ClientWithResponses) LoadIngredientMappingsWithResponse

func (c *ClientWithResponses) LoadIngredientMappingsWithResponse(ctx context.Context, body LoadIngredientMappingsJSONRequestBody, reqEditors ...RequestEditorFn) (*LoadIngredientMappingsResponse, error)

func (*ClientWithResponses) MergeIngredientsWithBodyWithResponse

func (c *ClientWithResponses) MergeIngredientsWithBodyWithResponse(ctx context.Context, ingredientId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MergeIngredientsResponse, error)

MergeIngredientsWithBodyWithResponse request with arbitrary body returning *MergeIngredientsResponse

func (*ClientWithResponses) MergeIngredientsWithResponse

func (c *ClientWithResponses) MergeIngredientsWithResponse(ctx context.Context, ingredientId string, body MergeIngredientsJSONRequestBody, reqEditors ...RequestEditorFn) (*MergeIngredientsResponse, error)

func (*ClientWithResponses) RecipeDependenciesWithResponse

func (c *ClientWithResponses) RecipeDependenciesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RecipeDependenciesResponse, error)

RecipeDependenciesWithResponse request returning *RecipeDependenciesResponse

func (*ClientWithResponses) ScrapeRecipeWithBodyWithResponse

func (c *ClientWithResponses) ScrapeRecipeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ScrapeRecipeResponse, error)

ScrapeRecipeWithBodyWithResponse request with arbitrary body returning *ScrapeRecipeResponse

func (*ClientWithResponses) ScrapeRecipeWithResponse

func (c *ClientWithResponses) ScrapeRecipeWithResponse(ctx context.Context, body ScrapeRecipeJSONRequestBody, reqEditors ...RequestEditorFn) (*ScrapeRecipeResponse, error)

func (*ClientWithResponses) SearchFoodsWithResponse

func (c *ClientWithResponses) SearchFoodsWithResponse(ctx context.Context, params *SearchFoodsParams, reqEditors ...RequestEditorFn) (*SearchFoodsResponse, error)

SearchFoodsWithResponse request returning *SearchFoodsResponse

func (*ClientWithResponses) SearchWithResponse

func (c *ClientWithResponses) SearchWithResponse(ctx context.Context, params *SearchParams, reqEditors ...RequestEditorFn) (*SearchResponse, error)

SearchWithResponse request returning *SearchResponse

func (*ClientWithResponses) SumRecipesWithBodyWithResponse

func (c *ClientWithResponses) SumRecipesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SumRecipesResponse, error)

SumRecipesWithBodyWithResponse request with arbitrary body returning *SumRecipesResponse

func (*ClientWithResponses) SumRecipesWithResponse

func (c *ClientWithResponses) SumRecipesWithResponse(ctx context.Context, body SumRecipesJSONRequestBody, reqEditors ...RequestEditorFn) (*SumRecipesResponse, error)

func (*ClientWithResponses) UpdateRecipesForMealWithBodyWithResponse

func (c *ClientWithResponses) UpdateRecipesForMealWithBodyWithResponse(ctx context.Context, mealId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateRecipesForMealResponse, error)

UpdateRecipesForMealWithBodyWithResponse request with arbitrary body returning *UpdateRecipesForMealResponse

func (*ClientWithResponses) UpdateRecipesForMealWithResponse

func (c *ClientWithResponses) UpdateRecipesForMealWithResponse(ctx context.Context, mealId string, body UpdateRecipesForMealJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateRecipesForMealResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ListAllAlbumsWithResponse request
	ListAllAlbumsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAllAlbumsResponse, error)

	// AuthLoginWithResponse request
	AuthLoginWithResponse(ctx context.Context, params *AuthLoginParams, reqEditors ...RequestEditorFn) (*AuthLoginResponse, error)

	// GetConfigWithResponse request
	GetConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetConfigResponse, error)

	// RecipeDependenciesWithResponse request
	RecipeDependenciesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RecipeDependenciesResponse, error)

	// GetFoodsByIdsWithResponse request
	GetFoodsByIdsWithResponse(ctx context.Context, params *GetFoodsByIdsParams, reqEditors ...RequestEditorFn) (*GetFoodsByIdsResponse, error)

	// SearchFoodsWithResponse request
	SearchFoodsWithResponse(ctx context.Context, params *SearchFoodsParams, reqEditors ...RequestEditorFn) (*SearchFoodsResponse, error)

	// GetFoodByIdWithResponse request
	GetFoodByIdWithResponse(ctx context.Context, fdcId int, reqEditors ...RequestEditorFn) (*GetFoodByIdResponse, error)

	// ListIngredientsWithResponse request
	ListIngredientsWithResponse(ctx context.Context, params *ListIngredientsParams, reqEditors ...RequestEditorFn) (*ListIngredientsResponse, error)

	// CreateIngredientsWithBodyWithResponse request with any body
	CreateIngredientsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateIngredientsResponse, error)

	CreateIngredientsWithResponse(ctx context.Context, body CreateIngredientsJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateIngredientsResponse, error)

	// GetIngredientByIdWithResponse request
	GetIngredientByIdWithResponse(ctx context.Context, ingredientId string, reqEditors ...RequestEditorFn) (*GetIngredientByIdResponse, error)

	// AssociateFoodWithIngredientWithResponse request
	AssociateFoodWithIngredientWithResponse(ctx context.Context, ingredientId string, params *AssociateFoodWithIngredientParams, reqEditors ...RequestEditorFn) (*AssociateFoodWithIngredientResponse, error)

	// ConvertIngredientToRecipeWithResponse request
	ConvertIngredientToRecipeWithResponse(ctx context.Context, ingredientId string, reqEditors ...RequestEditorFn) (*ConvertIngredientToRecipeResponse, error)

	// MergeIngredientsWithBodyWithResponse request with any body
	MergeIngredientsWithBodyWithResponse(ctx context.Context, ingredientId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MergeIngredientsResponse, error)

	MergeIngredientsWithResponse(ctx context.Context, ingredientId string, body MergeIngredientsJSONRequestBody, reqEditors ...RequestEditorFn) (*MergeIngredientsResponse, error)

	// ListMealsWithResponse request
	ListMealsWithResponse(ctx context.Context, params *ListMealsParams, reqEditors ...RequestEditorFn) (*ListMealsResponse, error)

	// GetMealByIdWithResponse request
	GetMealByIdWithResponse(ctx context.Context, mealId string, reqEditors ...RequestEditorFn) (*GetMealByIdResponse, error)

	// UpdateRecipesForMealWithBodyWithResponse request with any body
	UpdateRecipesForMealWithBodyWithResponse(ctx context.Context, mealId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateRecipesForMealResponse, error)

	UpdateRecipesForMealWithResponse(ctx context.Context, mealId string, body UpdateRecipesForMealJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateRecipesForMealResponse, error)

	// LoadIngredientMappingsWithBodyWithResponse request with any body
	LoadIngredientMappingsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LoadIngredientMappingsResponse, error)

	LoadIngredientMappingsWithResponse(ctx context.Context, body LoadIngredientMappingsJSONRequestBody, reqEditors ...RequestEditorFn) (*LoadIngredientMappingsResponse, error)

	// ListPhotosWithResponse request
	ListPhotosWithResponse(ctx context.Context, params *ListPhotosParams, reqEditors ...RequestEditorFn) (*ListPhotosResponse, error)

	// ListRecipesWithResponse request
	ListRecipesWithResponse(ctx context.Context, params *ListRecipesParams, reqEditors ...RequestEditorFn) (*ListRecipesResponse, error)

	// CreateRecipesWithBodyWithResponse request with any body
	CreateRecipesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRecipesResponse, error)

	CreateRecipesWithResponse(ctx context.Context, body CreateRecipesJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRecipesResponse, error)

	// GetRecipesByIdsWithResponse request
	GetRecipesByIdsWithResponse(ctx context.Context, params *GetRecipesByIdsParams, reqEditors ...RequestEditorFn) (*GetRecipesByIdsResponse, error)

	// ScrapeRecipeWithBodyWithResponse request with any body
	ScrapeRecipeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ScrapeRecipeResponse, error)

	ScrapeRecipeWithResponse(ctx context.Context, body ScrapeRecipeJSONRequestBody, reqEditors ...RequestEditorFn) (*ScrapeRecipeResponse, error)

	// SumRecipesWithBodyWithResponse request with any body
	SumRecipesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SumRecipesResponse, error)

	SumRecipesWithResponse(ctx context.Context, body SumRecipesJSONRequestBody, reqEditors ...RequestEditorFn) (*SumRecipesResponse, error)

	// GetRecipeByIdWithResponse request
	GetRecipeByIdWithResponse(ctx context.Context, recipeId string, reqEditors ...RequestEditorFn) (*GetRecipeByIdResponse, error)

	// GetLatexByRecipeIdWithResponse request
	GetLatexByRecipeIdWithResponse(ctx context.Context, recipeId string, reqEditors ...RequestEditorFn) (*GetLatexByRecipeIdResponse, error)

	// SearchWithResponse request
	SearchWithResponse(ctx context.Context, params *SearchParams, reqEditors ...RequestEditorFn) (*SearchResponse, error)

	// DoSyncWithResponse request
	DoSyncWithResponse(ctx context.Context, params *DoSyncParams, reqEditors ...RequestEditorFn) (*DoSyncResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CompactRecipe

type CompactRecipe struct {
	Id       string                 `json:"id"`
	Image    *string                `json:"image,omitempty"`
	Name     string                 `json:"name"`
	Sections []CompactRecipeSection `json:"sections"`
	Url      *string                `json:"url,omitempty"`
}

CompactRecipe defines model for CompactRecipe.

type CompactRecipeSection

type CompactRecipeSection struct {
	Ingredients  []string `json:"ingredients"`
	Instructions []string `json:"instructions"`
}

CompactRecipeSection defines model for CompactRecipeSection.

type ConfigData

type ConfigData struct {
	GoogleClientId string `json:"google_client_id"`
	GoogleScopes   string `json:"google_scopes"`
}

ConfigData config data

type ConvertIngredientToRecipeResponse

type ConvertIngredientToRecipeResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *RecipeDetail
	JSONDefault  *Error
}

func ParseConvertIngredientToRecipeResponse

func ParseConvertIngredientToRecipeResponse(rsp *http.Response) (*ConvertIngredientToRecipeResponse, error)

ParseConvertIngredientToRecipeResponse parses an HTTP response from a ConvertIngredientToRecipeWithResponse call

func (ConvertIngredientToRecipeResponse) Status

Status returns HTTPResponse.Status

func (ConvertIngredientToRecipeResponse) StatusCode

func (r ConvertIngredientToRecipeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateIngredientsJSONRequestBody

type CreateIngredientsJSONRequestBody = Ingredient

CreateIngredientsJSONRequestBody defines body for CreateIngredients for application/json ContentType.

type CreateIngredientsResponse

type CreateIngredientsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *Ingredient
	JSONDefault  *Error
}

func ParseCreateIngredientsResponse

func ParseCreateIngredientsResponse(rsp *http.Response) (*CreateIngredientsResponse, error)

ParseCreateIngredientsResponse parses an HTTP response from a CreateIngredientsWithResponse call

func (CreateIngredientsResponse) Status

func (r CreateIngredientsResponse) Status() string

Status returns HTTPResponse.Status

func (CreateIngredientsResponse) StatusCode

func (r CreateIngredientsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateRecipesJSONRequestBody

type CreateRecipesJSONRequestBody = RecipeWrapperInput

CreateRecipesJSONRequestBody defines body for CreateRecipes for application/json ContentType.

type CreateRecipesResponse

type CreateRecipesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *RecipeWrapper
	JSONDefault  *Error
}

func ParseCreateRecipesResponse

func ParseCreateRecipesResponse(rsp *http.Response) (*CreateRecipesResponse, error)

ParseCreateRecipesResponse parses an HTTP response from a CreateRecipesWithResponse call

func (CreateRecipesResponse) Status

func (r CreateRecipesResponse) Status() string

Status returns HTTPResponse.Status

func (CreateRecipesResponse) StatusCode

func (r CreateRecipesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DoSyncParams

type DoSyncParams struct {
	// LookbackDays how many days to lookback
	LookbackDays int `form:"lookback_days" json:"lookback_days"`
}

DoSyncParams defines parameters for DoSync.

type DoSyncResponse

type DoSyncResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
	JSONDefault  *Error
}

func ParseDoSyncResponse

func ParseDoSyncResponse(rsp *http.Response) (*DoSyncResponse, error)

ParseDoSyncResponse parses an HTTP response from a DoSyncWithResponse call

func (DoSyncResponse) Status

func (r DoSyncResponse) Status() string

Status returns HTTPResponse.Status

func (DoSyncResponse) StatusCode

func (r DoSyncResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type EntitySummary

type EntitySummary struct {
	// Id recipe_detail or ingredient id
	Id   string         `json:"id"`
	Kind IngredientKind `json:"kind"`

	// Multiplier multiplier
	Multiplier float64 `json:"multiplier"`

	// Name recipe or ingredient name
	Name string `json:"name"`
}

EntitySummary holds name/id and multiplier for a Kind of entity

type Error

type Error struct {
	Message string  `json:"message"`
	TraceId *string `json:"trace_id,omitempty"`
}

Error A generic error message

type Foo

type Foo[T any] interface {
	All(ctx context.Context, exec boil.ContextExecutor) (T, error)
	Count(ctx context.Context, exec boil.ContextExecutor) (int64, error)
}

type FoodAttribute

type FoodAttribute struct {
	FoodAttributeType *struct {
		Description *string `json:"description,omitempty"`
		Id          *int    `json:"id,omitempty"`
		Name        *string `json:"name,omitempty"`
	} `json:"FoodAttributeType,omitempty"`
	Id             *int    `json:"id,omitempty"`
	SequenceNumber *int    `json:"sequenceNumber,omitempty"`
	Value          *string `json:"value,omitempty"`
}

FoodAttribute defines model for FoodAttribute.

type FoodCategory

type FoodCategory struct {
	Code        *string `json:"code,omitempty"`
	Description *string `json:"description,omitempty"`
	Id          *int32  `json:"id,omitempty"`
}

FoodCategory defines model for FoodCategory.

type FoodComponent

type FoodComponent struct {
	DataPoints      *int     `json:"dataPoints,omitempty"`
	GramWeight      *float32 `json:"gramWeight,omitempty"`
	Id              *int32   `json:"id,omitempty"`
	IsRefuse        *bool    `json:"isRefuse,omitempty"`
	MinYearAcquired *int     `json:"minYearAcquired,omitempty"`
	Name            *string  `json:"name,omitempty"`
	PercentWeight   *float32 `json:"percentWeight,omitempty"`
}

FoodComponent defines model for FoodComponent.

type FoodNutrient

type FoodNutrient struct {
	Amount                 *float64                `json:"amount,omitempty"`
	DataPoints             *int64                  `json:"dataPoints,omitempty"`
	FoodNutrientDerivation *FoodNutrientDerivation `json:"foodNutrientDerivation,omitempty"`
	Id                     int                     `json:"id"`
	Max                    *float64                `json:"max,omitempty"`
	Median                 *float64                `json:"median,omitempty"`
	Min                    *float64                `json:"min,omitempty"`

	// Nutrient a food nutrient
	Nutrient                *Nutrient                `json:"nutrient,omitempty"`
	NutrientAnalysisDetails *NutrientAnalysisDetails `json:"nutrientAnalysisDetails,omitempty"`
	Type                    *string                  `json:"type,omitempty"`
}

FoodNutrient defines model for FoodNutrient.

type FoodNutrientDerivation

type FoodNutrientDerivation struct {
	Code               *string             `json:"code,omitempty"`
	Description        *string             `json:"description,omitempty"`
	FoodNutrientSource *FoodNutrientSource `json:"foodNutrientSource,omitempty"`
	Id                 *int32              `json:"id,omitempty"`
}

FoodNutrientDerivation defines model for FoodNutrientDerivation.

type FoodNutrientSource

type FoodNutrientSource struct {
	Code        *string `json:"code,omitempty"`
	Description *string `json:"description,omitempty"`
	Id          *int32  `json:"id,omitempty"`
}

FoodNutrientSource defines model for FoodNutrientSource.

type FoodPortion

type FoodPortion struct {
	Amount             *float64     `json:"amount,omitempty"`
	DataPoints         *int32       `json:"dataPoints,omitempty"`
	GramWeight         *float64     `json:"gramWeight,omitempty"`
	Id                 *int32       `json:"id,omitempty"`
	MeasureUnit        *MeasureUnit `json:"measureUnit,omitempty"`
	MinYearAcquired    *int         `json:"minYearAcquired,omitempty"`
	Modifier           *string      `json:"modifier,omitempty"`
	PortionDescription *string      `json:"portionDescription,omitempty"`
	SequenceNumber     *int         `json:"sequenceNumber,omitempty"`
}

FoodPortion defines model for FoodPortion.

type FoodSearchResult

type FoodSearchResult struct {
	Foods []TempFood `json:"foods"`
}

FoodSearchResult A meal, which bridges recipes to photos

type FoodUpdateLog

type FoodUpdateLog struct {
	AvailableDate            *string          `json:"availableDate,omitempty"`
	BrandOwner               *string          `json:"brandOwner,omitempty"`
	BrandedFoodCategory      *string          `json:"brandedFoodCategory,omitempty"`
	Changes                  *string          `json:"changes,omitempty"`
	DataSource               *string          `json:"dataSource,omitempty"`
	DataType                 *string          `json:"dataType,omitempty"`
	Description              *string          `json:"description,omitempty"`
	FdcId                    *int             `json:"fdcId,omitempty"`
	FoodAttributes           *[]FoodAttribute `json:"foodAttributes,omitempty"`
	FoodClass                *string          `json:"foodClass,omitempty"`
	GtinUpc                  *string          `json:"gtinUpc,omitempty"`
	HouseholdServingFullText *string          `json:"householdServingFullText,omitempty"`
	Ingredients              *string          `json:"ingredients,omitempty"`
	ModifiedDate             *string          `json:"modifiedDate,omitempty"`
	PublicationDate          *string          `json:"publicationDate,omitempty"`
	ServingSize              *float64         `json:"servingSize,omitempty"`
	ServingSizeUnit          *string          `json:"servingSizeUnit,omitempty"`
}

FoodUpdateLog defines model for FoodUpdateLog.

type FoundationFoodItem

type FoundationFoodItem struct {
	DataType                  string                       `json:"dataType"`
	Description               string                       `json:"description"`
	FdcId                     int                          `json:"fdcId"`
	FoodCategory              *FoodCategory                `json:"foodCategory,omitempty"`
	FoodClass                 *string                      `json:"foodClass,omitempty"`
	FoodComponents            *[]FoodComponent             `json:"foodComponents,omitempty"`
	FoodNutrients             *[]FoodNutrient              `json:"foodNutrients,omitempty"`
	FoodPortions              *[]FoodPortion               `json:"foodPortions,omitempty"`
	FootNote                  *string                      `json:"footNote,omitempty"`
	InputFoods                *[]InputFoodFoundation       `json:"inputFoods,omitempty"`
	IsHistoricalReference     *bool                        `json:"isHistoricalReference,omitempty"`
	NdbNumber                 *int                         `json:"ndbNumber,omitempty"`
	NutrientConversionFactors *[]NutrientConversionFactors `json:"nutrientConversionFactors,omitempty"`
	PublicationDate           *string                      `json:"publicationDate,omitempty"`
	ScientificName            *string                      `json:"scientificName,omitempty"`
}

FoundationFoodItem defines model for FoundationFoodItem.

type GetConfigResponse

type GetConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ConfigData
	JSONDefault  *Error
}

func ParseGetConfigResponse

func ParseGetConfigResponse(rsp *http.Response) (*GetConfigResponse, error)

ParseGetConfigResponse parses an HTTP response from a GetConfigWithResponse call

func (GetConfigResponse) Status

func (r GetConfigResponse) Status() string

Status returns HTTPResponse.Status

func (GetConfigResponse) StatusCode

func (r GetConfigResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFoodByIdResponse

type GetFoodByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TempFood
	JSONDefault  *Error
}

func ParseGetFoodByIdResponse

func ParseGetFoodByIdResponse(rsp *http.Response) (*GetFoodByIdResponse, error)

ParseGetFoodByIdResponse parses an HTTP response from a GetFoodByIdWithResponse call

func (GetFoodByIdResponse) Status

func (r GetFoodByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetFoodByIdResponse) StatusCode

func (r GetFoodByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFoodsByIdsParams

type GetFoodsByIdsParams struct {
	// FdcId ids
	FdcId []int `form:"fdc_id" json:"fdc_id"`
}

GetFoodsByIdsParams defines parameters for GetFoodsByIds.

type GetFoodsByIdsResponse

type GetFoodsByIdsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PaginatedFoods
}

func ParseGetFoodsByIdsResponse

func ParseGetFoodsByIdsResponse(rsp *http.Response) (*GetFoodsByIdsResponse, error)

ParseGetFoodsByIdsResponse parses an HTTP response from a GetFoodsByIdsWithResponse call

func (GetFoodsByIdsResponse) Status

func (r GetFoodsByIdsResponse) Status() string

Status returns HTTPResponse.Status

func (GetFoodsByIdsResponse) StatusCode

func (r GetFoodsByIdsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetIngredientByIdResponse

type GetIngredientByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *IngredientWrapper
	JSONDefault  *Error
}

func ParseGetIngredientByIdResponse

func ParseGetIngredientByIdResponse(rsp *http.Response) (*GetIngredientByIdResponse, error)

ParseGetIngredientByIdResponse parses an HTTP response from a GetIngredientByIdWithResponse call

func (GetIngredientByIdResponse) Status

func (r GetIngredientByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetIngredientByIdResponse) StatusCode

func (r GetIngredientByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLatexByRecipeIdResponse

type GetLatexByRecipeIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseGetLatexByRecipeIdResponse

func ParseGetLatexByRecipeIdResponse(rsp *http.Response) (*GetLatexByRecipeIdResponse, error)

ParseGetLatexByRecipeIdResponse parses an HTTP response from a GetLatexByRecipeIdWithResponse call

func (GetLatexByRecipeIdResponse) Status

Status returns HTTPResponse.Status

func (GetLatexByRecipeIdResponse) StatusCode

func (r GetLatexByRecipeIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetMealByIdResponse

type GetMealByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Meal
	JSONDefault  *Error
}

func ParseGetMealByIdResponse

func ParseGetMealByIdResponse(rsp *http.Response) (*GetMealByIdResponse, error)

ParseGetMealByIdResponse parses an HTTP response from a GetMealByIdWithResponse call

func (GetMealByIdResponse) Status

func (r GetMealByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetMealByIdResponse) StatusCode

func (r GetMealByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetRecipeByIdResponse

type GetRecipeByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *RecipeWrapper
	JSONDefault  *Error
}

func ParseGetRecipeByIdResponse

func ParseGetRecipeByIdResponse(rsp *http.Response) (*GetRecipeByIdResponse, error)

ParseGetRecipeByIdResponse parses an HTTP response from a GetRecipeByIdWithResponse call

func (GetRecipeByIdResponse) Status

func (r GetRecipeByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetRecipeByIdResponse) StatusCode

func (r GetRecipeByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetRecipesByIdsParams

type GetRecipesByIdsParams struct {
	// RecipeId detail ids
	RecipeId []string `form:"recipe_id" json:"recipe_id"`
}

GetRecipesByIdsParams defines parameters for GetRecipesByIds.

type GetRecipesByIdsResponse

type GetRecipesByIdsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PaginatedRecipeWrappers
}

func ParseGetRecipesByIdsResponse

func ParseGetRecipesByIdsResponse(rsp *http.Response) (*GetRecipesByIdsResponse, error)

ParseGetRecipesByIdsResponse parses an HTTP response from a GetRecipesByIdsWithResponse call

func (GetRecipesByIdsResponse) Status

func (r GetRecipesByIdsResponse) Status() string

Status returns HTTPResponse.Status

func (GetRecipesByIdsResponse) StatusCode

func (r GetRecipesByIdsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GooglePhotosAlbum

type GooglePhotosAlbum struct {
	// Id id
	Id string `json:"id"`

	// ProductUrl product_url
	ProductUrl string `json:"product_url"`

	// Title title
	Title string `json:"title"`

	// Usecase usecase
	Usecase string `json:"usecase"`
}

GooglePhotosAlbum an album containing `Photo`

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Ingredient

type Ingredient struct {
	// FdcId FDC id equivalent to this ingredient
	FdcId *int `json:"fdc_id,omitempty"`

	// Id id
	Id string `json:"id"`

	// Name Ingredient name
	Name string `json:"name"`

	// Parent ingredient ID for a similar (likely a different spelling)
	Parent *string `json:"parent,omitempty"`
}

Ingredient An Ingredient

type IngredientID

type IngredientID string

IngredientID is an alias

type IngredientKind

type IngredientKind string

IngredientKind defines model for IngredientKind.

const (
	IngredientKindIngredient IngredientKind = "ingredient"
	IngredientKindRecipe     IngredientKind = "recipe"
)

Defines values for IngredientKind.

type IngredientMapping

type IngredientMapping struct {
	Aliases []string `json:"aliases"`
	FdcId   *int     `json:"fdc_id,omitempty"`
	Name    string   `json:"name"`

	// UnitMappings mappings of equivalent units
	UnitMappings []UnitMapping `json:"unit_mappings"`
}

IngredientMapping details about ingredients

func IngredientMappingFromFile

func IngredientMappingFromFile(ctx context.Context, inputPath string) ([]IngredientMapping, error)

IngredientMappingFromFile is todo

type IngredientMappings

type IngredientMappings []IngredientMapping

func (IngredientMappings) Valdiate

func (m IngredientMappings) Valdiate() error

type IngredientMappingsPayload

type IngredientMappingsPayload struct {
	// IngredientMappings mappings of equivalent units
	IngredientMappings []IngredientMapping `json:"ingredient_mappings"`
}

IngredientMappingsPayload list of IngredientMapping

type IngredientUsage

type IngredientUsage struct {
	// Amounts multiple amounts to try
	Amounts []Amount `json:"amounts"`

	// Multiplier multiplier
	Multiplier float64 `json:"multiplier"`

	// RequiredBy mappings of equivalent units
	RequiredBy []EntitySummary `json:"required_by"`
}

IngredientUsage todo

type IngredientWrapper

type IngredientWrapper struct {
	// Children Ingredients that are equivalent
	Children *[]IngredientWrapper `json:"children,omitempty"`
	Food     *TempFood            `json:"food,omitempty"`

	// Ingredient An Ingredient
	Ingredient Ingredient `json:"ingredient"`

	// Recipes Recipes referencing this ingredient
	Recipes []RecipeDetail `json:"recipes"`

	// UnitMappings mappings of equivalent units
	UnitMappings []UnitMapping `json:"unit_mappings"`
}

IngredientWrapper An Ingredient

type InputFoodFoundation

type InputFoodFoundation struct {
	FoodDescription *string         `json:"foodDescription,omitempty"`
	Id              *int            `json:"id,omitempty"`
	InputFood       *SampleFoodItem `json:"inputFood,omitempty"`
}

InputFoodFoundation applies to Foundation foods. Not all inputFoods will have all fields.

type InputFoodSurvey

type InputFoodSurvey struct {
	Amount                *float64         `json:"amount,omitempty"`
	FoodDescription       *string          `json:"foodDescription,omitempty"`
	Id                    *int             `json:"id,omitempty"`
	IngredientCode        *int             `json:"ingredientCode,omitempty"`
	IngredientDescription *string          `json:"ingredientDescription,omitempty"`
	IngredientWeight      *float64         `json:"ingredientWeight,omitempty"`
	InputFood             *SurveyFoodItem  `json:"inputFood,omitempty"`
	PortionCode           *string          `json:"portionCode,omitempty"`
	PortionDescription    *string          `json:"portionDescription,omitempty"`
	RetentionFactor       *RetentionFactor `json:"retentionFactor,omitempty"`
	SequenceNumber        *int             `json:"sequenceNumber,omitempty"`
	SurveyFlag            *int             `json:"surveyFlag,omitempty"`
	Unit                  *string          `json:"unit,omitempty"`
}

InputFoodSurvey applies to Survey (FNDDS). Not all inputFoods will have all fields.

type Items

type Items struct {
	// Limit How many items were requested for this page
	Limit int `json:"limit"`

	// Offset todo
	Offset int `json:"offset"`

	// PageCount Total number of pages available
	PageCount int `json:"page_count"`

	// PageNumber What number page this is
	PageNumber int `json:"page_number"`

	// TotalCount Total number of items across all pages
	TotalCount int `json:"total_count"`
}

Items A generic list (for pagination use)

type LimitParam

type LimitParam = int

LimitParam defines model for limitParam.

type ListAllAlbumsResponse

type ListAllAlbumsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Albums The list of albums
		Albums *[]GooglePhotosAlbum `json:"albums,omitempty"`
	}
	JSONDefault *Error
}

func ParseListAllAlbumsResponse

func ParseListAllAlbumsResponse(rsp *http.Response) (*ListAllAlbumsResponse, error)

ParseListAllAlbumsResponse parses an HTTP response from a ListAllAlbumsWithResponse call

func (ListAllAlbumsResponse) Status

func (r ListAllAlbumsResponse) Status() string

Status returns HTTPResponse.Status

func (ListAllAlbumsResponse) StatusCode

func (r ListAllAlbumsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListIngredientsParams

type ListIngredientsParams struct {
	// Offset The number of items to skip before starting to collect the result set.
	Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit The numbers of items to return.
	Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// IngredientId ids
	IngredientId *[]string `form:"ingredient_id,omitempty" json:"ingredient_id,omitempty"`
}

ListIngredientsParams defines parameters for ListIngredients.

type ListIngredientsResponse

type ListIngredientsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PaginatedIngredients
	JSONDefault  *Error
}

func ParseListIngredientsResponse

func ParseListIngredientsResponse(rsp *http.Response) (*ListIngredientsResponse, error)

ParseListIngredientsResponse parses an HTTP response from a ListIngredientsWithResponse call

func (ListIngredientsResponse) Status

func (r ListIngredientsResponse) Status() string

Status returns HTTPResponse.Status

func (ListIngredientsResponse) StatusCode

func (r ListIngredientsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListMealsParams

type ListMealsParams struct {
	// Offset The number of items to skip before starting to collect the result set.
	Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit The numbers of items to return.
	Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}

ListMealsParams defines parameters for ListMeals.

type ListMealsResponse

type ListMealsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PaginatedMeals
	JSONDefault  *Error
}

func ParseListMealsResponse

func ParseListMealsResponse(rsp *http.Response) (*ListMealsResponse, error)

ParseListMealsResponse parses an HTTP response from a ListMealsWithResponse call

func (ListMealsResponse) Status

func (r ListMealsResponse) Status() string

Status returns HTTPResponse.Status

func (ListMealsResponse) StatusCode

func (r ListMealsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListPhotosParams

type ListPhotosParams struct {
	// Offset The number of items to skip before starting to collect the result set.
	Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit The numbers of items to return.
	Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}

ListPhotosParams defines parameters for ListPhotos.

type ListPhotosResponse

type ListPhotosResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PaginatedPhotos
	JSONDefault  *Error
}

func ParseListPhotosResponse

func ParseListPhotosResponse(rsp *http.Response) (*ListPhotosResponse, error)

ParseListPhotosResponse parses an HTTP response from a ListPhotosWithResponse call

func (ListPhotosResponse) Status

func (r ListPhotosResponse) Status() string

Status returns HTTPResponse.Status

func (ListPhotosResponse) StatusCode

func (r ListPhotosResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListRecipesParams

type ListRecipesParams struct {
	// Offset The number of items to skip before starting to collect the result set.
	Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit The numbers of items to return.
	Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}

ListRecipesParams defines parameters for ListRecipes.

type ListRecipesResponse

type ListRecipesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PaginatedRecipeWrappers
	JSONDefault  *Error
}

func ParseListRecipesResponse

func ParseListRecipesResponse(rsp *http.Response) (*ListRecipesResponse, error)

ParseListRecipesResponse parses an HTTP response from a ListRecipesWithResponse call

func (ListRecipesResponse) Status

func (r ListRecipesResponse) Status() string

Status returns HTTPResponse.Status

func (ListRecipesResponse) StatusCode

func (r ListRecipesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type LoadIngredientMappingsJSONRequestBody

type LoadIngredientMappingsJSONRequestBody = IngredientMappingsPayload

LoadIngredientMappingsJSONRequestBody defines body for LoadIngredientMappings for application/json ContentType.

type LoadIngredientMappingsResponse

type LoadIngredientMappingsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseLoadIngredientMappingsResponse

func ParseLoadIngredientMappingsResponse(rsp *http.Response) (*LoadIngredientMappingsResponse, error)

ParseLoadIngredientMappingsResponse parses an HTTP response from a LoadIngredientMappingsWithResponse call

func (LoadIngredientMappingsResponse) Status

Status returns HTTPResponse.Status

func (LoadIngredientMappingsResponse) StatusCode

func (r LoadIngredientMappingsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Meal

type Meal struct {
	// AteAt when it was taken
	AteAt time.Time `json:"ate_at"`

	// Id id
	Id string `json:"id"`

	// Name public image
	Name    string        `json:"name"`
	Photos  []Photo       `json:"photos"`
	Recipes *[]MealRecipe `json:"recipes,omitempty"`
}

Meal A meal, which bridges recipes to photos

type MealRecipe

type MealRecipe struct {
	// Multiplier when it was taken
	Multiplier float64 `json:"multiplier"`

	// Recipe A revision of a recipe. does not include any "generated" fields. everything directly from db
	Recipe RecipeDetail `json:"recipe"`
}

MealRecipe A recipe that's part of a meal (a recipe at a specific amount)

type MealRecipeUpdate

type MealRecipeUpdate struct {
	// Action todo
	Action MealRecipeUpdateAction `json:"action"`

	// Multiplier multiplier
	Multiplier float64 `json:"multiplier"`

	// RecipeId Recipe Id
	RecipeId string `json:"recipe_id"`
}

MealRecipeUpdate an update to the recipes on a mea

type MealRecipeUpdateAction

type MealRecipeUpdateAction string

MealRecipeUpdateAction todo

const (
	Add    MealRecipeUpdateAction = "add"
	Remove MealRecipeUpdateAction = "remove"
)

Defines values for MealRecipeUpdateAction.

type MeasureUnit

type MeasureUnit struct {
	Abbreviation *string `json:"abbreviation,omitempty"`
	Id           *int32  `json:"id,omitempty"`
	Name         *string `json:"name,omitempty"`
}

MeasureUnit defines model for MeasureUnit.

type MergeIngredientsJSONBody

type MergeIngredientsJSONBody struct {
	IngredientIds []string `json:"ingredient_ids"`
}

MergeIngredientsJSONBody defines parameters for MergeIngredients.

type MergeIngredientsJSONRequestBody

type MergeIngredientsJSONRequestBody MergeIngredientsJSONBody

MergeIngredientsJSONRequestBody defines body for MergeIngredients for application/json ContentType.

type MergeIngredientsResponse

type MergeIngredientsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *Ingredient
	JSONDefault  *Error
}

func ParseMergeIngredientsResponse

func ParseMergeIngredientsResponse(rsp *http.Response) (*MergeIngredientsResponse, error)

ParseMergeIngredientsResponse parses an HTTP response from a MergeIngredientsWithResponse call

func (MergeIngredientsResponse) Status

func (r MergeIngredientsResponse) Status() string

Status returns HTTPResponse.Status

func (MergeIngredientsResponse) StatusCode

func (r MergeIngredientsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type NameParam

type NameParam = string

NameParam defines model for nameParam.

type Nutrient

type Nutrient struct {
	Id       *int    `json:"id,omitempty"`
	Name     *string `json:"name,omitempty"`
	Number   *string `json:"number,omitempty"`
	Rank     *int    `json:"rank,omitempty"`
	UnitName *string `json:"unitName,omitempty"`
}

Nutrient a food nutrient

type NutrientAcquisitionDetails

type NutrientAcquisitionDetails struct {
	PurchaseDate *string `json:"purchaseDate,omitempty"`
	SampleUnitId *int    `json:"sampleUnitId,omitempty"`
	StoreCity    *string `json:"storeCity,omitempty"`
	StoreState   *string `json:"storeState,omitempty"`
}

NutrientAcquisitionDetails defines model for NutrientAcquisitionDetails.

type NutrientAnalysisDetails

type NutrientAnalysisDetails struct {
	Amount                       *float64                      `json:"amount,omitempty"`
	LabMethodDescription         *string                       `json:"labMethodDescription,omitempty"`
	LabMethodLink                *string                       `json:"labMethodLink,omitempty"`
	LabMethodOriginalDescription *string                       `json:"labMethodOriginalDescription,omitempty"`
	LabMethodTechnique           *string                       `json:"labMethodTechnique,omitempty"`
	NutrientAcquisitionDetails   *[]NutrientAcquisitionDetails `json:"nutrientAcquisitionDetails,omitempty"`
	NutrientId                   *int                          `json:"nutrientId,omitempty"`
	SubSampleId                  *int                          `json:"subSampleId,omitempty"`
}

NutrientAnalysisDetails defines model for NutrientAnalysisDetails.

type NutrientConversionFactors

type NutrientConversionFactors struct {
	Type  *string  `json:"type,omitempty"`
	Value *float64 `json:"value,omitempty"`
}

NutrientConversionFactors defines model for NutrientConversionFactors.

type OffsetParam

type OffsetParam = int

OffsetParam defines model for offsetParam.

type PaginatedFoods

type PaginatedFoods struct {
	Foods *[]TempFood `json:"foods,omitempty"`

	// Meta A generic list (for pagination use)
	Meta Items `json:"meta"`
}

PaginatedFoods pages of Food

type PaginatedIngredients

type PaginatedIngredients struct {
	Ingredients *[]IngredientWrapper `json:"ingredients,omitempty"`

	// Meta A generic list (for pagination use)
	Meta Items `json:"meta"`
}

PaginatedIngredients pages of IngredientWrapper

type PaginatedMeals

type PaginatedMeals struct {
	Meals *[]Meal `json:"meals,omitempty"`

	// Meta A generic list (for pagination use)
	Meta Items `json:"meta"`
}

PaginatedMeals pages of Meal

type PaginatedPhotos

type PaginatedPhotos struct {
	// Meta A generic list (for pagination use)
	Meta   Items    `json:"meta"`
	Photos *[]Photo `json:"photos,omitempty"`
}

PaginatedPhotos pages of Photos

type PaginatedRecipeWrappers

type PaginatedRecipeWrappers struct {
	// Meta A generic list (for pagination use)
	Meta    Items            `json:"meta"`
	Recipes *[]RecipeWrapper `json:"recipes,omitempty"`
}

PaginatedRecipeWrappers pages of Recipe

type Photo

type Photo struct {
	// BaseUrl public image
	BaseUrl string `json:"base_url"`

	// BlurHash blur hash
	BlurHash *string `json:"blur_hash,omitempty"`

	// Height height px
	Height int64 `json:"height"`

	// Id id
	Id string `json:"id"`

	// Source where the photo came from
	Source PhotoSource `json:"source"`

	// TakenAt when it was taken
	TakenAt *time.Time `json:"taken_at,omitempty"`

	// Width width px
	Width int64 `json:"width"`
}

Photo A photo

type PhotoSource

type PhotoSource string

PhotoSource where the photo came from

const (
	Google PhotoSource = "google"
	Notion PhotoSource = "notion"
)

Defines values for PhotoSource.

type RecipeDependenciesResponse

type RecipeDependenciesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		// Items all
		Items *[]RecipeDependency `json:"items,omitempty"`
	}
}

func ParseRecipeDependenciesResponse

func ParseRecipeDependenciesResponse(rsp *http.Response) (*RecipeDependenciesResponse, error)

ParseRecipeDependenciesResponse parses an HTTP response from a RecipeDependenciesWithResponse call

func (RecipeDependenciesResponse) Status

Status returns HTTPResponse.Status

func (RecipeDependenciesResponse) StatusCode

func (r RecipeDependenciesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RecipeDependency

type RecipeDependency struct {
	// IngredientId id
	IngredientId   string         `json:"ingredient_id"`
	IngredientKind IngredientKind `json:"ingredient_kind"`

	// IngredientName id
	IngredientName string `json:"ingredient_name"`

	// RecipeId recipe_id
	RecipeId string `json:"recipe_id"`

	// RecipeName id
	RecipeName string `json:"recipe_name"`
}

RecipeDependency represents a relationship between recipe and ingredient, the latter of which can also be a recipe.

type RecipeDetail

type RecipeDetail struct {
	// CreatedAt when the version was created
	CreatedAt time.Time `json:"created_at"`

	// Id id
	Id string `json:"id"`

	// Meta metadata about recipe detail
	Meta RecipeDetailMeta `json:"meta"`

	// Name recipe name
	Name string `json:"name"`

	// Sections sections of the recipe
	Sections []RecipeSection `json:"sections"`

	// ServingInfo recipe servings info
	ServingInfo RecipeServingInfo `json:"serving_info"`

	// Sources book or websites
	Sources []RecipeSource `json:"sources"`

	// Tags tags
	Tags []string `json:"tags"`
}

RecipeDetail A revision of a recipe. does not include any "generated" fields. everything directly from db

type RecipeDetailInput

type RecipeDetailInput struct {
	// Date when it created / updated
	Date *time.Time `json:"date,omitempty"`

	// Name recipe name
	Name string `json:"name"`

	// Sections sections of the recipe
	Sections []RecipeSectionInput `json:"sections"`

	// ServingInfo recipe servings info
	ServingInfo RecipeServingInfo `json:"serving_info"`

	// Sources book or websites
	Sources *[]RecipeSource `json:"sources,omitempty"`

	// Tags tags
	Tags []string `json:"tags"`
}

RecipeDetailInput A revision of a recipe

type RecipeDetailMeta

type RecipeDetailMeta struct {
	// IsLatestVersion whether or not it is the most recent version
	IsLatestVersion bool `json:"is_latest_version"`

	// Version version of the recipe
	Version int `json:"version"`
}

RecipeDetailMeta metadata about recipe detail

type RecipeSection

type RecipeSection struct {
	// Duration amount and unit
	Duration *Amount `json:"duration,omitempty"`

	// Id id
	Id string `json:"id"`

	// Ingredients x
	Ingredients []SectionIngredient `json:"ingredients"`

	// Instructions x
	Instructions []SectionInstruction `json:"instructions"`
}

RecipeSection A step in the recipe

type RecipeSectionInput

type RecipeSectionInput struct {
	// Duration amount and unit
	Duration *Amount `json:"duration,omitempty"`

	// Ingredients x
	Ingredients []SectionIngredientInput `json:"ingredients"`

	// Instructions x
	Instructions []SectionInstructionInput `json:"instructions"`
}

RecipeSectionInput A step in the recipe

type RecipeServingInfo

type RecipeServingInfo struct {
	// Quantity serving quantity
	Quantity int `json:"quantity"`

	// Servings num servings
	Servings *int `json:"servings,omitempty"`

	// Unit serving unit
	Unit string `json:"unit"`
}

RecipeServingInfo recipe servings info

type RecipeSource

type RecipeSource struct {
	// ImageUrl image url
	ImageUrl *string `json:"image_url,omitempty"`

	// Page page number/section (if book)
	Page *string `json:"page,omitempty"`

	// Title title (if book)
	Title *string `json:"title,omitempty"`

	// Url url
	Url *string `json:"url,omitempty"`
}

RecipeSource where the recipe came from (i.e. book/website)

type RecipeWrapper

type RecipeWrapper struct {
	// Detail A revision of a recipe. does not include any "generated" fields. everything directly from db
	Detail RecipeDetail `json:"detail"`

	// Id id
	Id           string   `json:"id"`
	LinkedMeals  *[]Meal  `json:"linked_meals,omitempty"`
	LinkedPhotos *[]Photo `json:"linked_photos,omitempty"`

	// OtherVersions Other versions
	OtherVersions *[]RecipeDetail `json:"other_versions,omitempty"`
}

RecipeWrapper A recipe with subcomponents, including some "generated" fields to enhance data

type RecipeWrapperInput

type RecipeWrapperInput struct {
	// Detail A revision of a recipe
	Detail RecipeDetailInput `json:"detail"`

	// Id id
	Id *string `json:"id,omitempty"`
}

RecipeWrapperInput A recipe with subcomponents

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Res

type Res struct {
	Notion  notion.Recipe
	Details *RecipeDetailInput
}

type RetentionFactor

type RetentionFactor struct {
	Code        *int    `json:"code,omitempty"`
	Description *string `json:"description,omitempty"`
	Id          *int    `json:"id,omitempty"`
}

RetentionFactor defines model for RetentionFactor.

type SRLegacyFoodItem

type SRLegacyFoodItem struct {
	DataType                  string                       `json:"dataType"`
	Description               string                       `json:"description"`
	FdcId                     int                          `json:"fdcId"`
	FoodCategory              *FoodCategory                `json:"foodCategory,omitempty"`
	FoodClass                 *string                      `json:"foodClass,omitempty"`
	FoodNutrients             *[]FoodNutrient              `json:"foodNutrients,omitempty"`
	IsHistoricalReference     *bool                        `json:"isHistoricalReference,omitempty"`
	NdbNumber                 *int                         `json:"ndbNumber,omitempty"`
	NutrientConversionFactors *[]NutrientConversionFactors `json:"nutrientConversionFactors,omitempty"`
	PublicationDate           *string                      `json:"publicationDate,omitempty"`
	ScientificName            *string                      `json:"scientificName,omitempty"`
}

SRLegacyFoodItem defines model for SRLegacyFoodItem.

type SampleFoodItem

type SampleFoodItem struct {
	Datatype        *string         `json:"datatype,omitempty"`
	Description     string          `json:"description"`
	FdcId           int             `json:"fdcId"`
	FoodAttributes  *[]FoodCategory `json:"foodAttributes,omitempty"`
	FoodClass       *string         `json:"foodClass,omitempty"`
	PublicationDate *string         `json:"publicationDate,omitempty"`
}

SampleFoodItem defines model for SampleFoodItem.

type ScrapeRecipeJSONBody

type ScrapeRecipeJSONBody struct {
	Url string `json:"url"`
}

ScrapeRecipeJSONBody defines parameters for ScrapeRecipe.

type ScrapeRecipeJSONRequestBody

type ScrapeRecipeJSONRequestBody ScrapeRecipeJSONBody

ScrapeRecipeJSONRequestBody defines body for ScrapeRecipe for application/json ContentType.

type ScrapeRecipeResponse

type ScrapeRecipeResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *RecipeWrapper
	JSONDefault  *Error
}

func ParseScrapeRecipeResponse

func ParseScrapeRecipeResponse(rsp *http.Response) (*ScrapeRecipeResponse, error)

ParseScrapeRecipeResponse parses an HTTP response from a ScrapeRecipeWithResponse call

func (ScrapeRecipeResponse) Status

func (r ScrapeRecipeResponse) Status() string

Status returns HTTPResponse.Status

func (ScrapeRecipeResponse) StatusCode

func (r ScrapeRecipeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SearchFoodsParams

type SearchFoodsParams struct {
	// Offset The number of items to skip before starting to collect the result set.
	Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit The numbers of items to return.
	Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// Name The search query (name).
	Name NameParam `form:"name" json:"name"`
}

SearchFoodsParams defines parameters for SearchFoods.

type SearchFoodsResponse

type SearchFoodsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *FoodSearchResult
	JSONDefault  *Error
}

func ParseSearchFoodsResponse

func ParseSearchFoodsResponse(rsp *http.Response) (*SearchFoodsResponse, error)

ParseSearchFoodsResponse parses an HTTP response from a SearchFoodsWithResponse call

func (SearchFoodsResponse) Status

func (r SearchFoodsResponse) Status() string

Status returns HTTPResponse.Status

func (SearchFoodsResponse) StatusCode

func (r SearchFoodsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SearchParams

type SearchParams struct {
	// Offset The number of items to skip before starting to collect the result set.
	Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit The numbers of items to return.
	Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`

	// Name The search query (name).
	Name NameParam `form:"name" json:"name"`
}

SearchParams defines parameters for Search.

type SearchResponse

type SearchResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SearchResult
	JSONDefault  *Error
}

func ParseSearchResponse

func ParseSearchResponse(rsp *http.Response) (*SearchResponse, error)

ParseSearchResponse parses an HTTP response from a SearchWithResponse call

func (SearchResponse) Status

func (r SearchResponse) Status() string

Status returns HTTPResponse.Status

func (SearchResponse) StatusCode

func (r SearchResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SearchResult

type SearchResult struct {
	// Ingredients The ingredients
	Ingredients *[]IngredientWrapper `json:"ingredients,omitempty"`

	// Meta A generic list (for pagination use)
	Meta *Items `json:"meta,omitempty"`

	// Recipes The recipes
	Recipes *[]RecipeWrapper `json:"recipes,omitempty"`
}

SearchResult A search result wrapper, which contains ingredients and recipes

type SectionIngredient

type SectionIngredient struct {
	// Adjective adjective
	Adjective *string `json:"adjective,omitempty"`

	// Amounts the various measures
	Amounts []Amount `json:"amounts"`

	// Id id
	Id string `json:"id"`

	// Ingredient An Ingredient
	Ingredient *IngredientWrapper `json:"ingredient,omitempty"`
	Kind       IngredientKind     `json:"kind"`

	// Optional optional
	Optional *bool `json:"optional,omitempty"`

	// Original raw line item (pre-import/scrape)
	Original *string `json:"original,omitempty"`

	// Recipe A revision of a recipe. does not include any "generated" fields. everything directly from db
	Recipe *RecipeDetail `json:"recipe,omitempty"`

	// Substitutes x
	Substitutes *[]SectionIngredient `json:"substitutes,omitempty"`
}

SectionIngredient Ingredients in a single section

type SectionIngredientInput

type SectionIngredientInput struct {
	// Adjective adjective
	Adjective *string `json:"adjective,omitempty"`

	// Amounts the various measures
	Amounts []Amount       `json:"amounts"`
	Kind    IngredientKind `json:"kind"`

	// Name recipe/ingredient name
	Name *string `json:"name,omitempty"`

	// Optional optional
	Optional *bool `json:"optional,omitempty"`

	// Original raw line item (pre-import/scrape)
	Original *string `json:"original,omitempty"`

	// Substitutes x
	Substitutes *[]SectionIngredientInput `json:"substitutes,omitempty"`

	// TargetId recipe/ingredient id
	TargetId *string `json:"target_id,omitempty"`
}

SectionIngredientInput Ingredients in a single section

type SectionInstruction

type SectionInstruction struct {
	// Id id
	Id string `json:"id"`

	// Instruction instruction
	Instruction string `json:"instruction"`
}

SectionInstruction Instructions in a single section

type SectionInstructionInput

type SectionInstructionInput struct {
	// Instruction instruction
	Instruction string `json:"instruction"`
}

SectionInstructionInput Instructions in a single section

type ServerInterface

type ServerInterface interface {
	// List all albums
	// (GET /albums)
	ListAllAlbums(ctx echo.Context) error
	// Google Login callback
	// (POST /auth)
	AuthLogin(ctx echo.Context, params AuthLoginParams) error
	// Get app config
	// (GET /config)
	GetConfig(ctx echo.Context) error
	// Get foods
	// (GET /data/recipe_dependencies)
	RecipeDependencies(ctx echo.Context) error
	// Get foods
	// (GET /foods/bulk)
	GetFoodsByIds(ctx echo.Context, params GetFoodsByIdsParams) error
	// Search foods
	// (GET /foods/search)
	SearchFoods(ctx echo.Context, params SearchFoodsParams) error
	// get a FDC entry by id
	// (GET /foods/{fdc_id})
	GetFoodById(ctx echo.Context, fdcId int) error
	// List all ingredients
	// (GET /ingredients)
	ListIngredients(ctx echo.Context, params ListIngredientsParams) error
	// Create a ingredient
	// (POST /ingredients)
	CreateIngredients(ctx echo.Context) error
	// Get a specific ingredient
	// (GET /ingredients/{ingredient_id})
	GetIngredientById(ctx echo.Context, ingredientId string) error
	// Assosiates a food with a given ingredient
	// (POST /ingredients/{ingredient_id}/associate_food)
	AssociateFoodWithIngredient(ctx echo.Context, ingredientId string, params AssociateFoodWithIngredientParams) error
	// Converts an ingredient to a recipe, updating all recipes depending on it
	// (POST /ingredients/{ingredient_id}/convert_to_recipe)
	ConvertIngredientToRecipe(ctx echo.Context, ingredientId string) error
	// Merges the provide ingredients in the body into the param
	// (POST /ingredients/{ingredient_id}/merge)
	MergeIngredients(ctx echo.Context, ingredientId string) error
	// List all meals
	// (GET /meals)
	ListMeals(ctx echo.Context, params ListMealsParams) error
	// Info for a specific meal
	// (GET /meals/{meal_id})
	GetMealById(ctx echo.Context, mealId string) error
	// Update the recipes associated with a given meal
	// (PATCH /meals/{meal_id}/recipes)
	UpdateRecipesForMeal(ctx echo.Context, mealId string) error
	// load mappings
	// (POST /meta/load_ingredient_mappings)
	LoadIngredientMappings(ctx echo.Context) error
	// List all photos
	// (GET /photos)
	ListPhotos(ctx echo.Context, params ListPhotosParams) error
	// List all recipes
	// (GET /recipes)
	ListRecipes(ctx echo.Context, params ListRecipesParams) error
	// Create a recipe
	// (POST /recipes)
	CreateRecipes(ctx echo.Context) error
	// Get recipes
	// (GET /recipes/bulk)
	GetRecipesByIds(ctx echo.Context, params GetRecipesByIdsParams) error
	// scrape a recipe by URL
	// (POST /recipes/scrape)
	ScrapeRecipe(ctx echo.Context) error
	// sum up recipes
	// (POST /recipes/sum)
	SumRecipes(ctx echo.Context) error
	// Info for a specific recipe
	// (GET /recipes/{recipe_id})
	GetRecipeById(ctx echo.Context, recipeId string) error
	// recipe as latex
	// (GET /recipes/{recipe_id}/latex)
	GetLatexByRecipeId(ctx echo.Context, recipeId string) error
	// Search recipes and ingredients
	// (GET /search)
	Search(ctx echo.Context, params SearchParams) error
	// perform sync
	// (GET /sync)
	DoSync(ctx echo.Context, params DoSyncParams) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) AssociateFoodWithIngredient

func (w *ServerInterfaceWrapper) AssociateFoodWithIngredient(ctx echo.Context) error

AssociateFoodWithIngredient converts echo context to params.

func (*ServerInterfaceWrapper) AuthLogin

func (w *ServerInterfaceWrapper) AuthLogin(ctx echo.Context) error

AuthLogin converts echo context to params.

func (*ServerInterfaceWrapper) ConvertIngredientToRecipe

func (w *ServerInterfaceWrapper) ConvertIngredientToRecipe(ctx echo.Context) error

ConvertIngredientToRecipe converts echo context to params.

func (*ServerInterfaceWrapper) CreateIngredients

func (w *ServerInterfaceWrapper) CreateIngredients(ctx echo.Context) error

CreateIngredients converts echo context to params.

func (*ServerInterfaceWrapper) CreateRecipes

func (w *ServerInterfaceWrapper) CreateRecipes(ctx echo.Context) error

CreateRecipes converts echo context to params.

func (*ServerInterfaceWrapper) DoSync

func (w *ServerInterfaceWrapper) DoSync(ctx echo.Context) error

DoSync converts echo context to params.

func (*ServerInterfaceWrapper) GetConfig

func (w *ServerInterfaceWrapper) GetConfig(ctx echo.Context) error

GetConfig converts echo context to params.

func (*ServerInterfaceWrapper) GetFoodById

func (w *ServerInterfaceWrapper) GetFoodById(ctx echo.Context) error

GetFoodById converts echo context to params.

func (*ServerInterfaceWrapper) GetFoodsByIds

func (w *ServerInterfaceWrapper) GetFoodsByIds(ctx echo.Context) error

GetFoodsByIds converts echo context to params.

func (*ServerInterfaceWrapper) GetIngredientById

func (w *ServerInterfaceWrapper) GetIngredientById(ctx echo.Context) error

GetIngredientById converts echo context to params.

func (*ServerInterfaceWrapper) GetLatexByRecipeId

func (w *ServerInterfaceWrapper) GetLatexByRecipeId(ctx echo.Context) error

GetLatexByRecipeId converts echo context to params.

func (*ServerInterfaceWrapper) GetMealById

func (w *ServerInterfaceWrapper) GetMealById(ctx echo.Context) error

GetMealById converts echo context to params.

func (*ServerInterfaceWrapper) GetRecipeById

func (w *ServerInterfaceWrapper) GetRecipeById(ctx echo.Context) error

GetRecipeById converts echo context to params.

func (*ServerInterfaceWrapper) GetRecipesByIds

func (w *ServerInterfaceWrapper) GetRecipesByIds(ctx echo.Context) error

GetRecipesByIds converts echo context to params.

func (*ServerInterfaceWrapper) ListAllAlbums

func (w *ServerInterfaceWrapper) ListAllAlbums(ctx echo.Context) error

ListAllAlbums converts echo context to params.

func (*ServerInterfaceWrapper) ListIngredients

func (w *ServerInterfaceWrapper) ListIngredients(ctx echo.Context) error

ListIngredients converts echo context to params.

func (*ServerInterfaceWrapper) ListMeals

func (w *ServerInterfaceWrapper) ListMeals(ctx echo.Context) error

ListMeals converts echo context to params.

func (*ServerInterfaceWrapper) ListPhotos

func (w *ServerInterfaceWrapper) ListPhotos(ctx echo.Context) error

ListPhotos converts echo context to params.

func (*ServerInterfaceWrapper) ListRecipes

func (w *ServerInterfaceWrapper) ListRecipes(ctx echo.Context) error

ListRecipes converts echo context to params.

func (*ServerInterfaceWrapper) LoadIngredientMappings

func (w *ServerInterfaceWrapper) LoadIngredientMappings(ctx echo.Context) error

LoadIngredientMappings converts echo context to params.

func (*ServerInterfaceWrapper) MergeIngredients

func (w *ServerInterfaceWrapper) MergeIngredients(ctx echo.Context) error

MergeIngredients converts echo context to params.

func (*ServerInterfaceWrapper) RecipeDependencies

func (w *ServerInterfaceWrapper) RecipeDependencies(ctx echo.Context) error

RecipeDependencies converts echo context to params.

func (*ServerInterfaceWrapper) ScrapeRecipe

func (w *ServerInterfaceWrapper) ScrapeRecipe(ctx echo.Context) error

ScrapeRecipe converts echo context to params.

func (*ServerInterfaceWrapper) Search

func (w *ServerInterfaceWrapper) Search(ctx echo.Context) error

Search converts echo context to params.

func (*ServerInterfaceWrapper) SearchFoods

func (w *ServerInterfaceWrapper) SearchFoods(ctx echo.Context) error

SearchFoods converts echo context to params.

func (*ServerInterfaceWrapper) SumRecipes

func (w *ServerInterfaceWrapper) SumRecipes(ctx echo.Context) error

SumRecipes converts echo context to params.

func (*ServerInterfaceWrapper) UpdateRecipesForMeal

func (w *ServerInterfaceWrapper) UpdateRecipesForMeal(ctx echo.Context) error

UpdateRecipesForMeal converts echo context to params.

type ServerOption

type ServerOption func(*API)

func WithAuthClient

func WithAuthClient(a *auth.Auth) ServerOption

func WithGoogleClient

func WithGoogleClient(g *google.Client) ServerOption

func WithNotionClient

func WithNotionClient(n notion.Client) ServerOption

type SumRecipesJSONBody

type SumRecipesJSONBody struct {
	Inputs []EntitySummary `json:"inputs"`
}

SumRecipesJSONBody defines parameters for SumRecipes.

type SumRecipesJSONRequestBody

type SumRecipesJSONRequestBody SumRecipesJSONBody

SumRecipesJSONRequestBody defines body for SumRecipes for application/json ContentType.

type SumRecipesResponse

type SumRecipesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SumsResponse
	JSONDefault  *Error
}

func ParseSumRecipesResponse

func ParseSumRecipesResponse(rsp *http.Response) (*SumRecipesResponse, error)

ParseSumRecipesResponse parses an HTTP response from a SumRecipesWithResponse call

func (SumRecipesResponse) Status

func (r SumRecipesResponse) Status() string

Status returns HTTPResponse.Status

func (SumRecipesResponse) StatusCode

func (r SumRecipesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SumsResponse

type SumsResponse struct {
	ByRecipe map[string][]UsageValue `json:"by_recipe"`

	// Sums mappings of equivalent units
	Sums []UsageValue `json:"sums"`
}

SumsResponse defines model for SumsResponse.

type SurveyFoodItem

type SurveyFoodItem struct {
	DataType          string             `json:"dataType"`
	Description       string             `json:"description"`
	EndDate           *string            `json:"endDate,omitempty"`
	FdcId             int                `json:"fdcId"`
	FoodAttributes    *[]FoodAttribute   `json:"foodAttributes,omitempty"`
	FoodClass         *string            `json:"foodClass,omitempty"`
	FoodCode          *string            `json:"foodCode,omitempty"`
	FoodPortions      *[]FoodPortion     `json:"foodPortions,omitempty"`
	InputFoods        *[]InputFoodSurvey `json:"inputFoods,omitempty"`
	PublicationDate   *string            `json:"publicationDate,omitempty"`
	StartDate         *string            `json:"startDate,omitempty"`
	WweiaFoodCategory *WweiaFoodCategory `json:"wweiaFoodCategory,omitempty"`
}

SurveyFoodItem defines model for SurveyFoodItem.

type TempFood

type TempFood struct {
	BrandedFood    *BrandedFoodItem    `json:"branded_food,omitempty"`
	FoodNutrients  *[]FoodNutrient     `json:"foodNutrients,omitempty"`
	FoundationFood *FoundationFoodItem `json:"foundation_food,omitempty"`
	LegacyFood     *SRLegacyFoodItem   `json:"legacy_food,omitempty"`
	SurveyFood     *SurveyFoodItem     `json:"survey_food,omitempty"`

	// UnitMappings mappings of equivalent units
	UnitMappings []UnitMapping    `json:"unit_mappings"`
	Wrapper      TempFood_Wrapper `json:"wrapper"`
}

TempFood defines model for TempFood.

type TempFood_Wrapper

type TempFood_Wrapper struct {
	// contains filtered or unexported fields
}

TempFood_Wrapper defines model for TempFood.Wrapper.

func (TempFood_Wrapper) AsBrandedFoodItem

func (t TempFood_Wrapper) AsBrandedFoodItem() (BrandedFoodItem, error)

AsBrandedFoodItem returns the union data inside the TempFood_Wrapper as a BrandedFoodItem

func (TempFood_Wrapper) AsFoundationFoodItem

func (t TempFood_Wrapper) AsFoundationFoodItem() (FoundationFoodItem, error)

AsFoundationFoodItem returns the union data inside the TempFood_Wrapper as a FoundationFoodItem

func (TempFood_Wrapper) AsSRLegacyFoodItem

func (t TempFood_Wrapper) AsSRLegacyFoodItem() (SRLegacyFoodItem, error)

AsSRLegacyFoodItem returns the union data inside the TempFood_Wrapper as a SRLegacyFoodItem

func (TempFood_Wrapper) AsSurveyFoodItem

func (t TempFood_Wrapper) AsSurveyFoodItem() (SurveyFoodItem, error)

AsSurveyFoodItem returns the union data inside the TempFood_Wrapper as a SurveyFoodItem

func (*TempFood_Wrapper) FromBrandedFoodItem

func (t *TempFood_Wrapper) FromBrandedFoodItem(v BrandedFoodItem) error

FromBrandedFoodItem overwrites any union data inside the TempFood_Wrapper as the provided BrandedFoodItem

func (*TempFood_Wrapper) FromFoundationFoodItem

func (t *TempFood_Wrapper) FromFoundationFoodItem(v FoundationFoodItem) error

FromFoundationFoodItem overwrites any union data inside the TempFood_Wrapper as the provided FoundationFoodItem

func (*TempFood_Wrapper) FromSRLegacyFoodItem

func (t *TempFood_Wrapper) FromSRLegacyFoodItem(v SRLegacyFoodItem) error

FromSRLegacyFoodItem overwrites any union data inside the TempFood_Wrapper as the provided SRLegacyFoodItem

func (*TempFood_Wrapper) FromSurveyFoodItem

func (t *TempFood_Wrapper) FromSurveyFoodItem(v SurveyFoodItem) error

FromSurveyFoodItem overwrites any union data inside the TempFood_Wrapper as the provided SurveyFoodItem

func (TempFood_Wrapper) MarshalJSON

func (t TempFood_Wrapper) MarshalJSON() ([]byte, error)

func (*TempFood_Wrapper) MergeBrandedFoodItem

func (t *TempFood_Wrapper) MergeBrandedFoodItem(v BrandedFoodItem) error

MergeBrandedFoodItem performs a merge with any union data inside the TempFood_Wrapper, using the provided BrandedFoodItem

func (*TempFood_Wrapper) MergeFoundationFoodItem

func (t *TempFood_Wrapper) MergeFoundationFoodItem(v FoundationFoodItem) error

MergeFoundationFoodItem performs a merge with any union data inside the TempFood_Wrapper, using the provided FoundationFoodItem

func (*TempFood_Wrapper) MergeSRLegacyFoodItem

func (t *TempFood_Wrapper) MergeSRLegacyFoodItem(v SRLegacyFoodItem) error

MergeSRLegacyFoodItem performs a merge with any union data inside the TempFood_Wrapper, using the provided SRLegacyFoodItem

func (*TempFood_Wrapper) MergeSurveyFoodItem

func (t *TempFood_Wrapper) MergeSurveyFoodItem(v SurveyFoodItem) error

MergeSurveyFoodItem performs a merge with any union data inside the TempFood_Wrapper, using the provided SurveyFoodItem

func (*TempFood_Wrapper) UnmarshalJSON

func (t *TempFood_Wrapper) UnmarshalJSON(b []byte) error

type UnitConversionRequest

type UnitConversionRequest struct {
	// Input multiple amounts to try
	Input  []Amount                     `json:"input"`
	Target *UnitConversionRequestTarget `json:"target,omitempty"`

	// UnitMappings mappings of equivalent units
	UnitMappings []UnitMapping `json:"unit_mappings"`
}

UnitConversionRequest defines model for UnitConversionRequest.

type UnitConversionRequestTarget

type UnitConversionRequestTarget string

UnitConversionRequestTarget defines model for UnitConversionRequest.Target.

const (
	Calories UnitConversionRequestTarget = "calories"
	Money    UnitConversionRequestTarget = "money"
	Other    UnitConversionRequestTarget = "other"
	Volume   UnitConversionRequestTarget = "volume"
	Weight   UnitConversionRequestTarget = "weight"
)

Defines values for UnitConversionRequestTarget.

type UnitMapping

type UnitMapping struct {
	// A amount and unit
	A Amount `json:"a"`

	// B amount and unit
	B Amount `json:"b"`

	// Source source of the mapping
	Source *string `json:"source,omitempty"`
}

UnitMapping mappings

type Unused

type Unused struct {
	Compact *CompactRecipe         `json:"_compact,omitempty"`
	Convert *UnitConversionRequest `json:"_convert,omitempty"`
}

Unused defines model for _unused.

type UpdateRecipesForMealJSONRequestBody

type UpdateRecipesForMealJSONRequestBody = MealRecipeUpdate

UpdateRecipesForMealJSONRequestBody defines body for UpdateRecipesForMeal for application/json ContentType.

type UpdateRecipesForMealResponse

type UpdateRecipesForMealResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Meal
	JSONDefault  *Error
}

func ParseUpdateRecipesForMealResponse

func ParseUpdateRecipesForMealResponse(rsp *http.Response) (*UpdateRecipesForMealResponse, error)

ParseUpdateRecipesForMealResponse parses an HTTP response from a UpdateRecipesForMealWithResponse call

func (UpdateRecipesForMealResponse) Status

Status returns HTTPResponse.Status

func (UpdateRecipesForMealResponse) StatusCode

func (r UpdateRecipesForMealResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UsageSummary

type UsageSummary map[IngredientID]UsageValue

UsageSummary is a map of ingredient ids to their value

type UsageValue

type UsageValue struct {
	// Ings multiplier
	Ings []IngredientUsage `json:"ings"`

	// Meta holds name/id and multiplier for a Kind of entity
	Meta EntitySummary `json:"meta"`

	// Sum amounts
	Sum []Amount `json:"sum"`
}

UsageValue holds information

type WweiaFoodCategory

type WweiaFoodCategory struct {
	WweiaFoodCategoryCode        *int    `json:"wweiaFoodCategoryCode,omitempty"`
	WweiaFoodCategoryDescription *string `json:"wweiaFoodCategoryDescription,omitempty"`
}

WweiaFoodCategory defines model for WweiaFoodCategory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL