# 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 MarketHolidayResponse(UniversalBaseModel):
    exchange: str = pydantic.Field()
    """
    Full name of the exchange
    """

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

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

    date: str = pydantic.Field()
    """
    Date of the holiday (YYYY-MM-DD)
    """

    day_of_week: str = pydantic.Field()
    """
    Day of the week
    """

    is_weekend: bool = pydantic.Field()
    """
    Whether the holiday falls on a weekend
    """

    is_business_day: bool = pydantic.Field()
    """
    Whether the day is a business day
    """

    holiday_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of the holiday
    """

    is_early_close: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the market closes early on this day
    """

    open_time: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Opening time for the day
    """

    close_time: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Closing time for the day
    """

    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
