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

from . import tesser_pb2 as tesser__pb2

GRPC_GENERATED_VERSION = '1.76.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in tesser_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class StrategyServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.Initialize = channel.unary_unary(
                '/tesser.rpc.v1.StrategyService/Initialize',
                request_serializer=tesser__pb2.InitRequest.SerializeToString,
                response_deserializer=tesser__pb2.InitResponse.FromString,
                _registered_method=True)
        self.Heartbeat = channel.unary_unary(
                '/tesser.rpc.v1.StrategyService/Heartbeat',
                request_serializer=tesser__pb2.HeartbeatRequest.SerializeToString,
                response_deserializer=tesser__pb2.HeartbeatResponse.FromString,
                _registered_method=True)
        self.OnTick = channel.unary_unary(
                '/tesser.rpc.v1.StrategyService/OnTick',
                request_serializer=tesser__pb2.TickRequest.SerializeToString,
                response_deserializer=tesser__pb2.SignalList.FromString,
                _registered_method=True)
        self.OnCandle = channel.unary_unary(
                '/tesser.rpc.v1.StrategyService/OnCandle',
                request_serializer=tesser__pb2.CandleRequest.SerializeToString,
                response_deserializer=tesser__pb2.SignalList.FromString,
                _registered_method=True)
        self.OnOrderBook = channel.unary_unary(
                '/tesser.rpc.v1.StrategyService/OnOrderBook',
                request_serializer=tesser__pb2.OrderBookRequest.SerializeToString,
                response_deserializer=tesser__pb2.SignalList.FromString,
                _registered_method=True)
        self.OnFill = channel.unary_unary(
                '/tesser.rpc.v1.StrategyService/OnFill',
                request_serializer=tesser__pb2.FillRequest.SerializeToString,
                response_deserializer=tesser__pb2.SignalList.FromString,
                _registered_method=True)


class StrategyServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def Initialize(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Heartbeat(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OnTick(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OnCandle(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OnOrderBook(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def OnFill(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_StrategyServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Initialize': grpc.unary_unary_rpc_method_handler(
                    servicer.Initialize,
                    request_deserializer=tesser__pb2.InitRequest.FromString,
                    response_serializer=tesser__pb2.InitResponse.SerializeToString,
            ),
            'Heartbeat': grpc.unary_unary_rpc_method_handler(
                    servicer.Heartbeat,
                    request_deserializer=tesser__pb2.HeartbeatRequest.FromString,
                    response_serializer=tesser__pb2.HeartbeatResponse.SerializeToString,
            ),
            'OnTick': grpc.unary_unary_rpc_method_handler(
                    servicer.OnTick,
                    request_deserializer=tesser__pb2.TickRequest.FromString,
                    response_serializer=tesser__pb2.SignalList.SerializeToString,
            ),
            'OnCandle': grpc.unary_unary_rpc_method_handler(
                    servicer.OnCandle,
                    request_deserializer=tesser__pb2.CandleRequest.FromString,
                    response_serializer=tesser__pb2.SignalList.SerializeToString,
            ),
            'OnOrderBook': grpc.unary_unary_rpc_method_handler(
                    servicer.OnOrderBook,
                    request_deserializer=tesser__pb2.OrderBookRequest.FromString,
                    response_serializer=tesser__pb2.SignalList.SerializeToString,
            ),
            'OnFill': grpc.unary_unary_rpc_method_handler(
                    servicer.OnFill,
                    request_deserializer=tesser__pb2.FillRequest.FromString,
                    response_serializer=tesser__pb2.SignalList.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'tesser.rpc.v1.StrategyService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('tesser.rpc.v1.StrategyService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class StrategyService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def Initialize(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,
            '/tesser.rpc.v1.StrategyService/Initialize',
            tesser__pb2.InitRequest.SerializeToString,
            tesser__pb2.InitResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Heartbeat(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,
            '/tesser.rpc.v1.StrategyService/Heartbeat',
            tesser__pb2.HeartbeatRequest.SerializeToString,
            tesser__pb2.HeartbeatResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def OnTick(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,
            '/tesser.rpc.v1.StrategyService/OnTick',
            tesser__pb2.TickRequest.SerializeToString,
            tesser__pb2.SignalList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def OnCandle(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,
            '/tesser.rpc.v1.StrategyService/OnCandle',
            tesser__pb2.CandleRequest.SerializeToString,
            tesser__pb2.SignalList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def OnOrderBook(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,
            '/tesser.rpc.v1.StrategyService/OnOrderBook',
            tesser__pb2.OrderBookRequest.SerializeToString,
            tesser__pb2.SignalList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def OnFill(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,
            '/tesser.rpc.v1.StrategyService/OnFill',
            tesser__pb2.FillRequest.SerializeToString,
            tesser__pb2.SignalList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)


class ControlServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetPortfolio = channel.unary_unary(
                '/tesser.rpc.v1.ControlService/GetPortfolio',
                request_serializer=tesser__pb2.GetPortfolioRequest.SerializeToString,
                response_deserializer=tesser__pb2.GetPortfolioResponse.FromString,
                _registered_method=True)
        self.GetOpenOrders = channel.unary_unary(
                '/tesser.rpc.v1.ControlService/GetOpenOrders',
                request_serializer=tesser__pb2.GetOpenOrdersRequest.SerializeToString,
                response_deserializer=tesser__pb2.GetOpenOrdersResponse.FromString,
                _registered_method=True)
        self.GetStatus = channel.unary_unary(
                '/tesser.rpc.v1.ControlService/GetStatus',
                request_serializer=tesser__pb2.GetStatusRequest.SerializeToString,
                response_deserializer=tesser__pb2.GetStatusResponse.FromString,
                _registered_method=True)
        self.CancelAll = channel.unary_unary(
                '/tesser.rpc.v1.ControlService/CancelAll',
                request_serializer=tesser__pb2.CancelAllRequest.SerializeToString,
                response_deserializer=tesser__pb2.CancelAllResponse.FromString,
                _registered_method=True)
        self.ListManagedTrades = channel.unary_unary(
                '/tesser.rpc.v1.ControlService/ListManagedTrades',
                request_serializer=tesser__pb2.ListManagedTradesRequest.SerializeToString,
                response_deserializer=tesser__pb2.ListManagedTradesResponse.FromString,
                _registered_method=True)
        self.UpdateTradeExitStrategy = channel.unary_unary(
                '/tesser.rpc.v1.ControlService/UpdateTradeExitStrategy',
                request_serializer=tesser__pb2.UpdateTradeExitStrategyRequest.SerializeToString,
                response_deserializer=tesser__pb2.UpdateTradeExitStrategyResponse.FromString,
                _registered_method=True)
        self.Monitor = channel.unary_stream(
                '/tesser.rpc.v1.ControlService/Monitor',
                request_serializer=tesser__pb2.MonitorRequest.SerializeToString,
                response_deserializer=tesser__pb2.Event.FromString,
                _registered_method=True)


class ControlServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def GetPortfolio(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetOpenOrders(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetStatus(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CancelAll(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListManagedTrades(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateTradeExitStrategy(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Monitor(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ControlServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetPortfolio': grpc.unary_unary_rpc_method_handler(
                    servicer.GetPortfolio,
                    request_deserializer=tesser__pb2.GetPortfolioRequest.FromString,
                    response_serializer=tesser__pb2.GetPortfolioResponse.SerializeToString,
            ),
            'GetOpenOrders': grpc.unary_unary_rpc_method_handler(
                    servicer.GetOpenOrders,
                    request_deserializer=tesser__pb2.GetOpenOrdersRequest.FromString,
                    response_serializer=tesser__pb2.GetOpenOrdersResponse.SerializeToString,
            ),
            'GetStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStatus,
                    request_deserializer=tesser__pb2.GetStatusRequest.FromString,
                    response_serializer=tesser__pb2.GetStatusResponse.SerializeToString,
            ),
            'CancelAll': grpc.unary_unary_rpc_method_handler(
                    servicer.CancelAll,
                    request_deserializer=tesser__pb2.CancelAllRequest.FromString,
                    response_serializer=tesser__pb2.CancelAllResponse.SerializeToString,
            ),
            'ListManagedTrades': grpc.unary_unary_rpc_method_handler(
                    servicer.ListManagedTrades,
                    request_deserializer=tesser__pb2.ListManagedTradesRequest.FromString,
                    response_serializer=tesser__pb2.ListManagedTradesResponse.SerializeToString,
            ),
            'UpdateTradeExitStrategy': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateTradeExitStrategy,
                    request_deserializer=tesser__pb2.UpdateTradeExitStrategyRequest.FromString,
                    response_serializer=tesser__pb2.UpdateTradeExitStrategyResponse.SerializeToString,
            ),
            'Monitor': grpc.unary_stream_rpc_method_handler(
                    servicer.Monitor,
                    request_deserializer=tesser__pb2.MonitorRequest.FromString,
                    response_serializer=tesser__pb2.Event.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'tesser.rpc.v1.ControlService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('tesser.rpc.v1.ControlService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ControlService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def GetPortfolio(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,
            '/tesser.rpc.v1.ControlService/GetPortfolio',
            tesser__pb2.GetPortfolioRequest.SerializeToString,
            tesser__pb2.GetPortfolioResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetOpenOrders(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,
            '/tesser.rpc.v1.ControlService/GetOpenOrders',
            tesser__pb2.GetOpenOrdersRequest.SerializeToString,
            tesser__pb2.GetOpenOrdersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetStatus(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,
            '/tesser.rpc.v1.ControlService/GetStatus',
            tesser__pb2.GetStatusRequest.SerializeToString,
            tesser__pb2.GetStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CancelAll(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,
            '/tesser.rpc.v1.ControlService/CancelAll',
            tesser__pb2.CancelAllRequest.SerializeToString,
            tesser__pb2.CancelAllResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListManagedTrades(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,
            '/tesser.rpc.v1.ControlService/ListManagedTrades',
            tesser__pb2.ListManagedTradesRequest.SerializeToString,
            tesser__pb2.ListManagedTradesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateTradeExitStrategy(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,
            '/tesser.rpc.v1.ControlService/UpdateTradeExitStrategy',
            tesser__pb2.UpdateTradeExitStrategyRequest.SerializeToString,
            tesser__pb2.UpdateTradeExitStrategyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Monitor(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,
            '/tesser.rpc.v1.ControlService/Monitor',
            tesser__pb2.MonitorRequest.SerializeToString,
            tesser__pb2.Event.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
