# generated by datamodel-codegen:
#   filename:  Orderflow/OrderflowRequest.json

from __future__ import annotations
from architect_py.grpc.models.Orderflow.Orderflow import (
    Orderflow,
    OrderPending,
    TaggedOrderAck,
    TaggedOrderReject,
    TaggedOrderOut,
    OrderReconciledOut,
    TaggedOrderStale,
    CancelPending,
    TaggedCancelReject,
    TaggedOrderCanceling,
    TaggedOrderCanceled,
    TaggedFill,
    TaggedAberrantFill,
)

from typing import Annotated, Union

from msgspec import Meta

from ..Oms.CancelAllOrdersRequest import CancelAllOrdersRequest
from ..Oms.CancelOrderRequest import CancelOrderRequest
from ..Oms.PlaceOrderRequest import PlaceOrderRequest


class PlaceOrder(PlaceOrderRequest, omit_defaults=True, tag_field="t", tag="p"):
    pass


class CancelOrder(CancelOrderRequest, omit_defaults=True, tag_field="t", tag="x"):
    pass


class CancelAllOrders(
    CancelAllOrdersRequest, omit_defaults=True, tag_field="t", tag="xo"
):
    pass


OrderflowRequest = Annotated[
    Union[PlaceOrder, CancelOrder, CancelAllOrders], Meta(title="OrderflowRequest")
]

OrderflowRequest_rpc_method = "duplex_stream"
UnannotatedOrderflowRequest = PlaceOrder | CancelOrder | CancelAllOrders
OrderflowRequestResponseType = Orderflow
OrderflowRequestUnannotatedResponseType = (
    OrderPending
    | TaggedOrderAck
    | TaggedOrderReject
    | TaggedOrderOut
    | OrderReconciledOut
    | TaggedOrderStale
    | CancelPending
    | TaggedCancelReject
    | TaggedOrderCanceling
    | TaggedOrderCanceled
    | TaggedFill
    | TaggedAberrantFill
)
OrderflowRequest_route = "/json.architect.Orderflow/Orderflow"
