# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class CountryResponse(UniversalBaseModel):
    """
    Response schema for country data.
    """

    id: str = pydantic.Field()
    """
    Country ID with country_ prefix
    """

    code: str = pydantic.Field()
    """
    ISO 3166-1 alpha-2 code (e.g., US, CH)
    """

    code_alpha3: str = pydantic.Field()
    """
    ISO 3166-1 alpha-3 code (e.g., USA, CHE)
    """

    name: str = pydantic.Field()
    """
    Official country name
    """

    native_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Country name in native language
    """

    phone_code: typing.Optional[str] = pydantic.Field(default=None)
    """
    International dialing code (e.g., +1, +41)
    """

    currency_code: typing.Optional[str] = pydantic.Field(default=None)
    """
    ISO 4217 currency code (e.g., USD, CHF)
    """

    currency_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Currency name
    """

    currency_symbol: typing.Optional[str] = pydantic.Field(default=None)
    """
    Currency symbol (e.g., $, CHF)
    """

    flag_emoji: typing.Optional[str] = pydantic.Field(default=None)
    """
    Flag emoji (e.g., 🇺🇸, 🇨🇭)
    """

    region: typing.Optional[str] = pydantic.Field(default=None)
    """
    Geographic region (e.g., Americas, Europe)
    """

    subregion: typing.Optional[str] = pydantic.Field(default=None)
    """
    Geographic subregion
    """

    latitude: typing.Optional[float] = pydantic.Field(default=None)
    """
    Country center latitude
    """

    longitude: typing.Optional[float] = pydantic.Field(default=None)
    """
    Country center longitude
    """

    is_active: bool = pydantic.Field()
    """
    Whether country is active
    """

    order: int = pydantic.Field()
    """
    Display order
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Creation timestamp
    """

    updated_at: dt.datetime = pydantic.Field()
    """
    Last update timestamp
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
