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

from __future__ import annotations
from architect_py.grpc.models.Marketdata.TickerUpdate import (
    TickerUpdate,
    Snapshot,
    Diff,
)

from typing import Annotated, List, Optional

from msgspec import Meta, Struct


class SubscribeTickersRequest(Struct, omit_defaults=True):
    """
    Ticker updates are not strongly ordered because the data is considered more casual.  You may receive diffs or snapshots slightly out of order.
    """

    symbols: Optional[
        Annotated[
            List[str],
            Meta(description="If None, subscribe from all symbols on the feed"),
        ]
    ] = None
    """
    If None, subscribe from all symbols on the feed
    """

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

    def __str__(self) -> str:
        return f"SubscribeTickersRequest(symbols={self.symbols})"

    @staticmethod
    def get_response_type():
        return TickerUpdate

    @staticmethod
    def get_unannotated_response_type():
        return Snapshot | Diff

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

    @staticmethod
    def get_rpc_method():
        return "stream"
