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

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

from typing import Optional

from msgspec import Struct

from .. import definitions


class CancelAllOrdersRequest(Struct, omit_defaults=True):
    id: str
    account: Optional[definitions.AccountIdOrName] = None
    execution_venue: Optional[str] = None
    trader: Optional[definitions.TraderIdOrEmail] = None

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

    def __str__(self) -> str:
        return f"CancelAllOrdersRequest(id={self.id},account={self.account},execution_venue={self.execution_venue},trader={self.trader})"

    @staticmethod
    def get_response_type():
        return CancelAllOrdersResponse

    @staticmethod
    def get_unannotated_response_type():
        return CancelAllOrdersResponse

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

    @staticmethod
    def get_rpc_method():
        return "unary"
