Trifolium.Genus (Trifolium v1.0.0)

Module to be used to interact with Trefle Genus related endpoints.

Link to this section Summary

Functions

List every possible Genus. This endpoint IS paginated, using a optional keyword parameter. By default, the page 1 is returned.

Find a specific Genus according to its id or slug.

Lists all available Plants for a specific Genus according to its id or slug. You can paginate this endpoint, and also filter it, as explained on Trefle documentation. You can use a filter or a not_filter like so

Lists all available Species for a specific Genus according to its id or slug. You can paginate this endpoint, and also filter it, as explained on Trefle documentation. You can use a filter or a not_filter like so

Link to this section Functions

Link to this function

all(opts \\ [])

Specs

all(page: non_neg_integer(), filter: %{}, order: %{}) ::
  Trifolium.API.response()

List every possible Genus. This endpoint IS paginated, using a optional keyword parameter. By default, the page 1 is returned.

Specs

Find a specific Genus according to its id or slug.

Link to this function

plants(id, opts \\ [])

Specs

plants(non_neg_integer() | String.t(),
  filter: map(),
  filter_not: map(),
  order: map(),
  range: map(),
  page: non_neg_integer()
) :: Trifolium.API.response()

Lists all available Plants for a specific Genus according to its id or slug. You can paginate this endpoint, and also filter it, as explained on Trefle documentation. You can use a filter or a not_filter like so:

  iex()> Trifolium.Genus.plants(id, filter: %{year: year})

The same applies to the order and range parameters, where you just need to pass a map to it, that it will be correctly parsed to the query parameter.

Link to this function

species(id, opts \\ [])

Specs

species(non_neg_integer() | String.t(),
  filter: map(),
  filter_not: map(),
  order: map(),
  range: map(),
  page: non_neg_integer()
) :: Trifolium.API.response()

Lists all available Species for a specific Genus according to its id or slug. You can paginate this endpoint, and also filter it, as explained on Trefle documentation. You can use a filter or a not_filter like so:

  iex()> Trifolium.Genus.species(id, filter: %{year: year})

The same applies to the order and range parameters, where you just need to pass a map to it, that it will be correctly parsed to the query parameter.