# 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 v4_proto.dydxprotocol.accountplus import tx_pb2 as dydxprotocol_dot_accountplus_dot_tx__pb2

GRPC_GENERATED_VERSION = '1.75.1'
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},'
        + f' but the generated code in dydxprotocol/accountplus/tx_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 MsgStub(object):
    """Msg defines the Msg service.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.AddAuthenticator = channel.unary_unary(
                '/dydxprotocol.accountplus.Msg/AddAuthenticator',
                request_serializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgAddAuthenticator.SerializeToString,
                response_deserializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgAddAuthenticatorResponse.FromString,
                _registered_method=True)
        self.RemoveAuthenticator = channel.unary_unary(
                '/dydxprotocol.accountplus.Msg/RemoveAuthenticator',
                request_serializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgRemoveAuthenticator.SerializeToString,
                response_deserializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgRemoveAuthenticatorResponse.FromString,
                _registered_method=True)
        self.SetActiveState = channel.unary_unary(
                '/dydxprotocol.accountplus.Msg/SetActiveState',
                request_serializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgSetActiveState.SerializeToString,
                response_deserializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgSetActiveStateResponse.FromString,
                _registered_method=True)


class MsgServicer(object):
    """Msg defines the Msg service.
    """

    def AddAuthenticator(self, request, context):
        """AddAuthenticator adds an authenticator to an account.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RemoveAuthenticator(self, request, context):
        """RemoveAuthenticator removes an authenticator from an account.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetActiveState(self, request, context):
        """SetActiveState sets the active state of the authenticator.
        Primarily used for circuit breaking.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MsgServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'AddAuthenticator': grpc.unary_unary_rpc_method_handler(
                    servicer.AddAuthenticator,
                    request_deserializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgAddAuthenticator.FromString,
                    response_serializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgAddAuthenticatorResponse.SerializeToString,
            ),
            'RemoveAuthenticator': grpc.unary_unary_rpc_method_handler(
                    servicer.RemoveAuthenticator,
                    request_deserializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgRemoveAuthenticator.FromString,
                    response_serializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgRemoveAuthenticatorResponse.SerializeToString,
            ),
            'SetActiveState': grpc.unary_unary_rpc_method_handler(
                    servicer.SetActiveState,
                    request_deserializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgSetActiveState.FromString,
                    response_serializer=dydxprotocol_dot_accountplus_dot_tx__pb2.MsgSetActiveStateResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'dydxprotocol.accountplus.Msg', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('dydxprotocol.accountplus.Msg', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Msg(object):
    """Msg defines the Msg service.
    """

    @staticmethod
    def AddAuthenticator(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,
            '/dydxprotocol.accountplus.Msg/AddAuthenticator',
            dydxprotocol_dot_accountplus_dot_tx__pb2.MsgAddAuthenticator.SerializeToString,
            dydxprotocol_dot_accountplus_dot_tx__pb2.MsgAddAuthenticatorResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RemoveAuthenticator(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,
            '/dydxprotocol.accountplus.Msg/RemoveAuthenticator',
            dydxprotocol_dot_accountplus_dot_tx__pb2.MsgRemoveAuthenticator.SerializeToString,
            dydxprotocol_dot_accountplus_dot_tx__pb2.MsgRemoveAuthenticatorResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetActiveState(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,
            '/dydxprotocol.accountplus.Msg/SetActiveState',
            dydxprotocol_dot_accountplus_dot_tx__pb2.MsgSetActiveState.SerializeToString,
            dydxprotocol_dot_accountplus_dot_tx__pb2.MsgSetActiveStateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
