# Generated by ariadne-codegen
# Source: queries.gql

from datetime import time
from typing import Annotated, List, Optional

from pydantic import BeforeValidator, Field

from .base_model import BaseModel
from .time_scalar import value_parser


class Exchanges(BaseModel):
    exchanges: List[Optional["ExchangesExchanges"]]


class ExchangesExchanges(BaseModel):
    id: int
    name: str
    country: Optional["ExchangesExchangesCountry"]
    currency: Optional["ExchangesExchangesCurrency"]
    open_utc: Optional[Annotated[time, BeforeValidator(value_parser)]]
    close_utc: Optional[Annotated[time, BeforeValidator(value_parser)]]


class ExchangesExchangesCountry(BaseModel):
    alpha_3_code: str = Field(alias="alpha3_code")
    name: str


class ExchangesExchangesCurrency(BaseModel):
    name: str
    iso_code: str
