# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from meshtrade.trading.limit_order.v1 import limit_order_pb2 as meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2
from meshtrade.trading.limit_order.v1 import service_pb2 as meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2


class LimitOrderServiceStub(object):
    """
    LimitOrderService manages limit orders for trading operations (BETA).

    This service provides comprehensive limit order management capabilities including
    order creation, cancellation, querying, and real-time monitoring. All operations
    are scoped to the authenticated group's hierarchy and require appropriate trading
    domain permissions.

    Note: This service is currently in BETA. Interface and functionality may change.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.CreateLimitOrder = channel.unary_unary(
                '/meshtrade.trading.limit_order.v1.LimitOrderService/CreateLimitOrder',
                request_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.CreateLimitOrderRequest.SerializeToString,
                response_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
                _registered_method=True)
        self.CancelLimitOrder = channel.unary_unary(
                '/meshtrade.trading.limit_order.v1.LimitOrderService/CancelLimitOrder',
                request_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.CancelLimitOrderRequest.SerializeToString,
                response_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
                _registered_method=True)
        self.GetLimitOrder = channel.unary_unary(
                '/meshtrade.trading.limit_order.v1.LimitOrderService/GetLimitOrder',
                request_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.GetLimitOrderRequest.SerializeToString,
                response_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
                _registered_method=True)
        self.GetLimitOrderByExternalReference = channel.unary_unary(
                '/meshtrade.trading.limit_order.v1.LimitOrderService/GetLimitOrderByExternalReference',
                request_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.GetLimitOrderByExternalReferenceRequest.SerializeToString,
                response_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
                _registered_method=True)
        self.ListLimitOrders = channel.unary_unary(
                '/meshtrade.trading.limit_order.v1.LimitOrderService/ListLimitOrders',
                request_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.ListLimitOrdersRequest.SerializeToString,
                response_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.ListLimitOrdersResponse.FromString,
                _registered_method=True)
        self.SearchLimitOrders = channel.unary_unary(
                '/meshtrade.trading.limit_order.v1.LimitOrderService/SearchLimitOrders',
                request_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.SearchLimitOrdersRequest.SerializeToString,
                response_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.SearchLimitOrdersResponse.FromString,
                _registered_method=True)
        self.MonitorLimitOrder = channel.unary_stream(
                '/meshtrade.trading.limit_order.v1.LimitOrderService/MonitorLimitOrder',
                request_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.MonitorLimitOrderRequest.SerializeToString,
                response_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
                _registered_method=True)


class LimitOrderServiceServicer(object):
    """
    LimitOrderService manages limit orders for trading operations (BETA).

    This service provides comprehensive limit order management capabilities including
    order creation, cancellation, querying, and real-time monitoring. All operations
    are scoped to the authenticated group's hierarchy and require appropriate trading
    domain permissions.

    Note: This service is currently in BETA. Interface and functionality may change.
    """

    def CreateLimitOrder(self, request, context):
        """
        Creates a new limit order.

        Submits a limit order to the trading system. The order is validated and
        submitted to the appropriate ledger for execution.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelLimitOrder(self, request, context):
        """
        Cancels an existing limit order.

        Initiates cancellation of a limit order on the ledger.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLimitOrder(self, request, context):
        """
        Retrieves a specific limit order by its resource name.

        Provides access to limit order metadata and optionally fetches live
        ledger data when populate_ledger_data is true.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLimitOrderByExternalReference(self, request, context):
        """
        Retrieves a limit order by its external reference.

        Convenient lookup using client-provided external reference identifier.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListLimitOrders(self, request, context):
        """
        Lists all limit orders within the authenticated group's scope.

        Returns the complete set of limit orders accessible to the executing context.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SearchLimitOrders(self, request, context):
        """
        Searches limit orders using flexible filtering criteria.

        Supports filtering by token, account, and populating live ledger data.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def MonitorLimitOrder(self, request, context):
        """
        Monitors a limit order for real-time updates.

        Supports lookup by either resource name or external reference using
        the identifier oneof field in the request. Returns a stream of limit
        order states as they change.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_LimitOrderServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateLimitOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateLimitOrder,
                    request_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.CreateLimitOrderRequest.FromString,
                    response_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.SerializeToString,
            ),
            'CancelLimitOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelLimitOrder,
                    request_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.CancelLimitOrderRequest.FromString,
                    response_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.SerializeToString,
            ),
            'GetLimitOrder': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLimitOrder,
                    request_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.GetLimitOrderRequest.FromString,
                    response_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.SerializeToString,
            ),
            'GetLimitOrderByExternalReference': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLimitOrderByExternalReference,
                    request_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.GetLimitOrderByExternalReferenceRequest.FromString,
                    response_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.SerializeToString,
            ),
            'ListLimitOrders': grpc.unary_unary_rpc_method_handler(
                    servicer.ListLimitOrders,
                    request_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.ListLimitOrdersRequest.FromString,
                    response_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.ListLimitOrdersResponse.SerializeToString,
            ),
            'SearchLimitOrders': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchLimitOrders,
                    request_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.SearchLimitOrdersRequest.FromString,
                    response_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.SearchLimitOrdersResponse.SerializeToString,
            ),
            'MonitorLimitOrder': grpc.unary_stream_rpc_method_handler(
                    servicer.MonitorLimitOrder,
                    request_deserializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.MonitorLimitOrderRequest.FromString,
                    response_serializer=meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'meshtrade.trading.limit_order.v1.LimitOrderService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('meshtrade.trading.limit_order.v1.LimitOrderService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class LimitOrderService(object):
    """
    LimitOrderService manages limit orders for trading operations (BETA).

    This service provides comprehensive limit order management capabilities including
    order creation, cancellation, querying, and real-time monitoring. All operations
    are scoped to the authenticated group's hierarchy and require appropriate trading
    domain permissions.

    Note: This service is currently in BETA. Interface and functionality may change.
    """

    @staticmethod
    def CreateLimitOrder(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.trading.limit_order.v1.LimitOrderService/CreateLimitOrder',
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.CreateLimitOrderRequest.SerializeToString,
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CancelLimitOrder(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.trading.limit_order.v1.LimitOrderService/CancelLimitOrder',
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.CancelLimitOrderRequest.SerializeToString,
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetLimitOrder(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.trading.limit_order.v1.LimitOrderService/GetLimitOrder',
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.GetLimitOrderRequest.SerializeToString,
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetLimitOrderByExternalReference(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.trading.limit_order.v1.LimitOrderService/GetLimitOrderByExternalReference',
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.GetLimitOrderByExternalReferenceRequest.SerializeToString,
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListLimitOrders(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.trading.limit_order.v1.LimitOrderService/ListLimitOrders',
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.ListLimitOrdersRequest.SerializeToString,
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.ListLimitOrdersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SearchLimitOrders(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/meshtrade.trading.limit_order.v1.LimitOrderService/SearchLimitOrders',
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.SearchLimitOrdersRequest.SerializeToString,
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.SearchLimitOrdersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def MonitorLimitOrder(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(
            request,
            target,
            '/meshtrade.trading.limit_order.v1.LimitOrderService/MonitorLimitOrder',
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_service__pb2.MonitorLimitOrderRequest.SerializeToString,
            meshtrade_dot_trading_dot_limit__order_dot_v1_dot_limit__order__pb2.LimitOrder.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
