Module for handling Country (País) queries from IBGE.
This module provides functions to fetch Countries.
Summary
Functions
@spec all(Keyword.t()) :: {:ok, [ExIbge.Geography.Country.t()]} | {:error, any()}
Get all countries.
Parameters
query- Optional parameters supported by the API (e.g.,order_by: :name).
Examples
iex> ExIbge.Locality.Country.all()
{:ok, [%ExIbge.Geography.Country{id: 76, name: "Brasil", ...}, ...]}See Also
@spec all!(Keyword.t()) :: [ExIbge.Geography.Country.t()]
Same as all/1, but raises an error on failure.
Examples
iex> ExIbge.Locality.Country.all!()
[%ExIbge.Geography.Country{id: 76, name: "Brasil", ...}, ...]
@spec find(integer() | String.t() | [integer() | String.t()], Keyword.t()) :: {:ok, [ExIbge.Geography.Country.t()]} | {:error, any()}
Get country(ies) by identifier(s).
Parameters
ids- A single integer ID (M49) or a list of integer IDs.query- Optional parameters supported by the API.
Examples
iex> ExIbge.Locality.Country.find(76)
{:ok, [%ExIbge.Geography.Country{id: 76, name: "Brasil", ...}]}See Also
@spec find!(integer() | String.t() | [integer() | String.t()], Keyword.t()) :: [ ExIbge.Geography.Country.t() ]
Same as find/2, but raises an error on failure.
Examples
iex> ExIbge.Locality.Country.find!(76)
[%ExIbge.Geography.Country{id: 76, name: "Brasil", ...}]