# generated by datamodel-codegen:
#   filename:  Marketdata/MarketStatus.json

from __future__ import annotations

from typing import Annotated, Optional

from msgspec import Meta, Struct


class MarketStatus(Struct, omit_defaults=True):
    s: Annotated[str, Meta(title="symbol")]
    is_quoting: Optional[bool] = None
    is_trading: Optional[bool] = None

    # Constructor that takes all field titles as arguments for convenience
    @classmethod
    def new(
        cls,
        symbol: str,
        is_quoting: Optional[bool] = None,
        is_trading: Optional[bool] = None,
    ):
        return cls(
            symbol,
            is_quoting,
            is_trading,
        )

    def __str__(self) -> str:
        return f"MarketStatus(symbol={self.s},is_quoting={self.is_quoting},is_trading={self.is_trading})"

    @property
    def symbol(self) -> str:
        return self.s

    @symbol.setter
    def symbol(self, value: str) -> None:
        self.s = value
