ExIbge.Locality.UrbanAgglomeration (ex_ibge v0.4.0)

Copy Markdown View Source

Module for handling Urban Agglomeration (Aglomeração Urbana) queries from IBGE.

This module provides functions to fetch Urban Agglomerations.

Summary

Functions

Get all urban agglomerations.

Same as all/1, but raises an error on failure.

Get urban agglomeration(s) by identifier(s).

Same as find/2, but raises an error on failure.

Functions

all(query \\ [])

@spec all(Keyword.t()) ::
  {:ok, [ExIbge.Geography.UrbanAgglomeration.t()]} | {:error, any()}

Get all urban agglomerations.

Parameters

  • query - Optional parameters supported by the API (e.g., order_by: :name, municipality: 2611101).

Examples

iex> ExIbge.Locality.UrbanAgglomeration.all()
{:ok, [%ExIbge.Geography.UrbanAgglomeration{id: "00301", name: "Aglomeração Urbana de Franca", ...}, ...]}

See Also

IBGE API: Aglomerações Urbanas

all!(query \\ [])

Same as all/1, but raises an error on failure.

Examples

iex> ExIbge.Locality.UrbanAgglomeration.all!()
[%ExIbge.Geography.UrbanAgglomeration{id: "00301", name: "Aglomeração Urbana de Franca", ...}, ...]

find(ids, query \\ [])

@spec find(integer() | String.t() | [integer() | String.t()], Keyword.t()) ::
  {:ok, [ExIbge.Geography.UrbanAgglomeration.t()]} | {:error, any()}

Get urban agglomeration(s) by identifier(s).

Parameters

  • ids - A single integer ID or a list of integer IDs.
  • query - Optional parameters supported by the API.

Examples

iex> ExIbge.Locality.UrbanAgglomeration.find("00301")
{:ok, [%ExIbge.Geography.UrbanAgglomeration{id: "00301", name: "Aglomeração Urbana de Franca", ...}]}

See Also

IBGE API: Aglomeração Urbana por ID

find!(ids, query \\ [])

Same as find/2, but raises an error on failure.

Examples

iex> ExIbge.Locality.UrbanAgglomeration.find!("00301")
[%ExIbge.Geography.UrbanAgglomeration{id: "00301", name: "Aglomeração Urbana de Franca", ...}]