Skip to content

Resource CountryResource

CrucifiedPain edited this page Jun 26, 2026 · 9 revisions

CountryResource (client.country)

Endpoints: • country.getCountryById • country.getAllCountries

.find_by_name()

Client-side helper: return the country matching name (case-insensitive).

Returns None if no country with that name exists.

Signature

await client.country.find_by_name(name: 'str') -> 'Country | None'

Parameters

Name Type Default
name str *Required*

.get()

Get a single country by ID.

Signature

await client.country.get(country_id: 'str') -> 'Country'

Parameters

Name Type Default
country_id str *Required*

.get_all()

Get all countries. Returns a dict keyed by country ID for O(1) lookups.

Signature

await client.country.get_all() -> 'dict[str, Country]'

.invalidate_cache()

Clear the SWR cache for all resources.

Signature

await client.country.invalidate_cache() -> 'None'

Clone this wiki locally