ExIbge.Locality.IntegratedDevelopmentRegion (ex_ibge v0.4.0)

Copy Markdown View Source

Module for handling Integrated Development Region (Região Integrada de Desenvolvimento - RIDE) queries from IBGE.

This module provides functions to fetch Integrated Development Regions.

Summary

Functions

Get all integrated development regions.

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

Get integrated development region(s) by identifier(s).

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

Functions

all(query \\ [])

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

Get all integrated development regions.

Parameters

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

Examples

iex> ExIbge.Locality.IntegratedDevelopmentRegion.all()
{:ok, [%ExIbge.Geography.IntegratedDevelopmentRegion{id: "07801", name: "Região Integrada de Desenvolvimento do Distrito Federal e Entorno", ...}, ...]}

See Also

IBGE API: Regiões Integradas de Desenvolvimento

all!(query \\ [])

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

Examples

iex> ExIbge.Locality.IntegratedDevelopmentRegion.all!()
[%ExIbge.Geography.IntegratedDevelopmentRegion{id: "07801", ...}, ...]

find(ids, query \\ [])

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

Get integrated development region(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.IntegratedDevelopmentRegion.find("07801")
{:ok, [%ExIbge.Geography.IntegratedDevelopmentRegion{id: "07801", ...}]}

See Also

IBGE API: Região Integrada de Desenvolvimento por ID

find!(ids, query \\ [])

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

Examples

iex> ExIbge.Locality.IntegratedDevelopmentRegion.find!("07801")
[%ExIbge.Geography.IntegratedDevelopmentRegion{id: "07801", ...}]