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

from __future__ import annotations
from architect_py.grpc.models.Marketdata.TickersResponse import TickersResponse

from typing import Annotated, List, Optional

from msgspec import Meta, Struct

from .. import definitions


class TickersRequest(Struct, omit_defaults=True):
    i: Optional[Annotated[Optional[int], Meta(title="offset")]] = None
    include_options: Optional[bool] = None
    k: Optional[
        Annotated[Optional[definitions.SortTickersBy], Meta(title="sort_by")]
    ] = None
    n: Optional[Annotated[Optional[int], Meta(title="limit")]] = None
    symbols: Optional[List[str]] = None
    venue: Optional[str] = None

    # Constructor that takes all field titles as arguments for convenience
    @classmethod
    def new(
        cls,
        offset: Optional[int] = None,
        include_options: Optional[bool] = None,
        sort_by: Optional[definitions.SortTickersBy] = None,
        limit: Optional[int] = None,
        symbols: Optional[List[str]] = None,
        venue: Optional[str] = None,
    ):
        return cls(
            offset,
            include_options,
            sort_by,
            limit,
            symbols,
            venue,
        )

    def __str__(self) -> str:
        return f"TickersRequest(offset={self.i},include_options={self.include_options},sort_by={self.k},limit={self.n},symbols={self.symbols},venue={self.venue})"

    @property
    def offset(self) -> Optional[int]:
        return self.i

    @offset.setter
    def offset(self, value: Optional[int]) -> None:
        self.i = value

    @property
    def sort_by(self) -> Optional[definitions.SortTickersBy]:
        return self.k

    @sort_by.setter
    def sort_by(self, value: Optional[definitions.SortTickersBy]) -> None:
        self.k = value

    @property
    def limit(self) -> Optional[int]:
        return self.n

    @limit.setter
    def limit(self, value: Optional[int]) -> None:
        self.n = value

    @staticmethod
    def get_response_type():
        return TickersResponse

    @staticmethod
    def get_unannotated_response_type():
        return TickersResponse

    @staticmethod
    def get_route() -> str:
        return "/json.architect.Marketdata/Tickers"

    @staticmethod
    def get_rpc_method():
        return "unary"
