# generated by datamodel-codegen:
#   filename:  Oms/PendingCancelsRequest.json

from __future__ import annotations
from architect_py.grpc.models.Oms.PendingCancelsResponse import PendingCancelsResponse

from typing import List, Optional

from msgspec import Struct

from .. import definitions


class PendingCancelsRequest(Struct, omit_defaults=True):
    account: Optional[definitions.AccountIdOrName] = None
    cancel_ids: Optional[List[str]] = None
    symbol: Optional[str] = None
    trader: Optional[definitions.TraderIdOrEmail] = None
    venue: Optional[str] = None

    # Constructor that takes all field titles as arguments for convenience
    @classmethod
    def new(
        cls,
        account: Optional[definitions.AccountIdOrName] = None,
        cancel_ids: Optional[List[str]] = None,
        symbol: Optional[str] = None,
        trader: Optional[definitions.TraderIdOrEmail] = None,
        venue: Optional[str] = None,
    ):
        return cls(
            account,
            cancel_ids,
            symbol,
            trader,
            venue,
        )

    def __str__(self) -> str:
        return f"PendingCancelsRequest(account={self.account},cancel_ids={self.cancel_ids},symbol={self.symbol},trader={self.trader},venue={self.venue})"

    @staticmethod
    def get_response_type():
        return PendingCancelsResponse

    @staticmethod
    def get_unannotated_response_type():
        return PendingCancelsResponse

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

    @staticmethod
    def get_rpc_method():
        return "unary"
