# `ExIbge.Locality.Country`
[🔗](https://github.com/pedrohfonseca81/ex_ibge/blob/main/lib/ex_ibge/locality/country.ex#L1)

Module for handling Country (País) queries from IBGE.

This module provides functions to fetch Countries.

# `all`

```elixir
@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

[IBGE API: Países](https://servicodados.ibge.gov.br/api/docs/localidades#api-Paises-paisesGet)

# `all!`

```elixir
@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", ...}, ...]

# `find`

```elixir
@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

[IBGE API: País por ID](https://servicodados.ibge.gov.br/api/docs/localidades#api-Paises-paisesPaisesGet)

# `find!`

```elixir
@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", ...}]

---

*Consult [api-reference.md](api-reference.md) for complete listing*
