Trifolium.Species (Trifolium v1.0.0)

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

Link to this section Summary

Functions

List every possible Species. This endpoint IS paginated, using a optional keyword parameter. By default, the page 1 is returned. You can use a filter or a not_filter like so

Find a specific Specie according to its id or slug.

Report a problem with a specific Specie. The second parameter is optional, as per Trefle docs, but be aware that it doesn't make much sense to report a problem without informing it. The notes parameter is a String.t() explaining the problem.

Similar to Trifolium.Species.all, but you can pass an additional query parameter which will full-text search for it in the available fields. More information can be found on Trefle documentation. This endpoint IS paginated, using a optional keyword parameter. By default, the page 1 is returned. You can use a filter or a not_filter like so

Link to this section Functions

Link to this function

all(opts \\ [])

Specs

all(
  filter: map(),
  filter_not: map(),
  order: map(),
  page: non_neg_integer(),
  range: map()
) :: Trifolium.API.response()

List every possible Species. This endpoint IS paginated, using a optional keyword parameter. By default, the page 1 is returned. You can use a filter or a not_filter like so:

  iex()> Trifolium.Species.all(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.

Specs

Find a specific Specie according to its id or slug.

Link to this function

report(id, notes \\ "")

Specs

Report a problem with a specific Specie. The second parameter is optional, as per Trefle docs, but be aware that it doesn't make much sense to report a problem without informing it. The notes parameter is a String.t() explaining the problem.

  iex()> Trifolium.Species.report(id, "Should have synonim Trifolium")

If you want to test this endpoint, without bothering Trefle community, you can use the special notes parameter "TEST":

  iex()> Trifolium.Species.report(id, "TEST")
Link to this function

search(query, opts \\ [])

Specs

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

Similar to Trifolium.Species.all, but you can pass an additional query parameter which will full-text search for it in the available fields. More information can be found on Trefle documentation. This endpoint IS paginated, using a optional keyword parameter. By default, the page 1 is returned. You can use a filter or a not_filter like so:

  iex()> Trifolium.Species.search(query, 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.