# 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
from .weekday import Weekday


class MarketResponse(UniversalBaseModel):
    mic: str = pydantic.Field()
    """
    Market Identifier Code (ISO 10383)
    """

    exchange: str = pydantic.Field()
    """
    Full name of the exchange
    """

    acronym: typing.Optional[str] = pydantic.Field(default=None)
    """
    Exchange acronym
    """

    lei: str = pydantic.Field()
    """
    Legal Entity Identifier
    """

    url: str = pydantic.Field()
    """
    Exchange website URL
    """

    city: str = pydantic.Field()
    """
    City where the exchange is located
    """

    country: str = pydantic.Field()
    """
    Country where the exchange is located
    """

    country_code: str = pydantic.Field()
    """
    ISO 3166-1 alpha-2 country code
    """

    flag: str = pydantic.Field()
    """
    Country flag emoji
    """

    currency_name: str = pydantic.Field()
    """
    Name of the primary currency used
    """

    currency_code: str = pydantic.Field()
    """
    ISO 4217 currency code
    """

    currency_symbol: str = pydantic.Field()
    """
    Symbol of the currency
    """

    region: str = pydantic.Field()
    """
    Geographical region
    """

    timezone: str = pydantic.Field()
    """
    Timezone identifier (IANA database)
    """

    timezone_abbr: str = pydantic.Field()
    """
    Timezone abbreviation
    """

    utc_offset: str = pydantic.Field()
    """
    UTC offset in hours
    """

    dst: bool = pydantic.Field()
    """
    Whether Daylight Saving Time is currently observed
    """

    previous_dst_transition: typing.Optional[dt.date] = pydantic.Field(default=None)
    """
    Date of the previous DST transition
    """

    next_dst_transition: typing.Optional[dt.date] = pydantic.Field(default=None)
    """
    Date of the next DST transition
    """

    working_days: typing.List[Weekday] = pydantic.Field()
    """
    List of working days
    """

    open_time: str = pydantic.Field()
    """
    Regular trading session opening time
    """

    close_time: str = pydantic.Field()
    """
    Regular trading session closing time
    """

    early_close_time: typing.Optional[str] = pydantic.Field(default=None)
    """
    Trading session closing time on early close days
    """

    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
