StrawHat.Map v1.2.0 StrawHat.Map.Countries View Source
Defines functionality for countries management.
Link to this section Summary
Functions
Creates a country
Destroys a country
Gets a country by id
Gets the list of countries
Gets list of countries
Gets a country by id
Gets list of states
Updates a country
Link to this section Functions
Link to this function
create_country(country_attrs)
View Source
create_country(StrawHat.Map.Country.country_attrs()) :: {:ok, StrawHat.Map.Country.t()} | {:error, Ecto.Changeset.t()}
Creates a country.
Link to this function
destroy_country(country)
View Source
destroy_country(StrawHat.Map.Country.t()) :: {:ok, StrawHat.Map.Country.t()} | {:error, Ecto.Changeset.t()}
Destroys a country.
Link to this function
find_country(country_id)
View Source
find_country(String.t()) :: {:ok, StrawHat.Map.Country.t()} | {:error, StrawHat.Error.t()}
Gets a country by id
.
Link to this function
get_countries(pagination \\ [])
View Source
get_countries(Scrivener.Config.t()) :: Scrivener.Page.t()
Gets the list of countries.
Link to this function
get_countries_by_ids(country_ids)
View Source
get_countries_by_ids([integer()]) :: [StrawHat.Map.Country.t()] | no_return()
Gets list of countries.
Link to this function
get_country(country_id)
View Source
get_country(String.t()) :: StrawHat.Map.Country.t() | nil | no_return()
Gets a country by id
.
Link to this function
get_states(country_ids)
View Source
get_states([integer()]) :: [StrawHat.Map.State.t()] | no_return()
Gets list of states.
Link to this function
update_country(country, country_attrs)
View Source
update_country(StrawHat.Map.Country.t(), StrawHat.Map.Country.country_attrs()) :: {:ok, StrawHat.Map.Country.t()} | {:error, Ecto.Changeset.t()}
Updates a country.