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

import typing

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


class CryptoExchangeItem(UniversalBaseModel):
    """
    A cryptocurrency exchange
    """

    id: str = pydantic.Field()
    """
    Exchange identifier (e.g. binance, coinbase-pro).
    """

    name: str = pydantic.Field()
    """
    Exchange name (e.g. Binance, Coinbase Pro).
    """

    year_established: typing.Optional[int] = pydantic.Field(default=None)
    """
    The year the exchange was established
    """

    country: typing.Optional[str] = pydantic.Field(default=None)
    """
    The country where the exchange is based.
    """

    website: str = pydantic.Field()
    """
    The exchange's official website URL.
    """

    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
