Picnic.Resources.Recipes (Picnic v0.1.0)

Copy Markdown View Source

Meal recipes and their ingredient lists.

{:ok, recipes} = Picnic.recipes(client)
{:ok, recipe} = Picnic.recipe(client, id)

list/2 returns whatever Picnic is currently promoting rather than a stable catalogue, and this area of the API changes shape more often than the others — reach for Picnic.request/4 and :raw sooner here than elsewhere.

Summary

Functions

Fetches one recipe by id. Pass as: :struct to decode into a Picnic.Schema.Recipe.

Lists recipes. Pass as: :struct to decode into Picnic.Schema.Recipe structs.

Types

result()

@type result() :: {:ok, term()} | {:error, Picnic.Error.t()}

Functions

get(client, recipe_id, opts \\ [])

@spec get(Picnic.Client.t(), String.t(), keyword()) :: result()

Fetches one recipe by id. Pass as: :struct to decode into a Picnic.Schema.Recipe.

list(client, opts \\ [])

@spec list(
  Picnic.Client.t(),
  keyword()
) :: result()

Lists recipes. Pass as: :struct to decode into Picnic.Schema.Recipe structs.