# 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 ibc.core.client.v1 import tx_pb2 as ibc_dot_core_dot_client_dot_v1_dot_tx__pb2

GRPC_GENERATED_VERSION = '1.70.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},'
        + f' but the generated code in ibc/core/client/v1/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 ibc/client Msg service.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateClient = channel.unary_unary(
                '/ibc.core.client.v1.Msg/CreateClient',
                request_serializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgCreateClient.SerializeToString,
                response_deserializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgCreateClientResponse.FromString,
                _registered_method=True)
        self.UpdateClient = channel.unary_unary(
                '/ibc.core.client.v1.Msg/UpdateClient',
                request_serializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpdateClient.SerializeToString,
                response_deserializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpdateClientResponse.FromString,
                _registered_method=True)
        self.UpgradeClient = channel.unary_unary(
                '/ibc.core.client.v1.Msg/UpgradeClient',
                request_serializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpgradeClient.SerializeToString,
                response_deserializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpgradeClientResponse.FromString,
                _registered_method=True)
        self.SubmitMisbehaviour = channel.unary_unary(
                '/ibc.core.client.v1.Msg/SubmitMisbehaviour',
                request_serializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgSubmitMisbehaviour.SerializeToString,
                response_deserializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgSubmitMisbehaviourResponse.FromString,
                _registered_method=True)


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

    def CreateClient(self, request, context):
        """CreateClient defines a rpc handler method for MsgCreateClient.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateClient(self, request, context):
        """UpdateClient defines a rpc handler method for MsgUpdateClient.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpgradeClient(self, request, context):
        """UpgradeClient defines a rpc handler method for MsgUpgradeClient.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SubmitMisbehaviour(self, request, context):
        """SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour.
        """
        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 = {
            'CreateClient': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateClient,
                    request_deserializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgCreateClient.FromString,
                    response_serializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgCreateClientResponse.SerializeToString,
            ),
            'UpdateClient': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateClient,
                    request_deserializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpdateClient.FromString,
                    response_serializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpdateClientResponse.SerializeToString,
            ),
            'UpgradeClient': grpc.unary_unary_rpc_method_handler(
                    servicer.UpgradeClient,
                    request_deserializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpgradeClient.FromString,
                    response_serializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpgradeClientResponse.SerializeToString,
            ),
            'SubmitMisbehaviour': grpc.unary_unary_rpc_method_handler(
                    servicer.SubmitMisbehaviour,
                    request_deserializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgSubmitMisbehaviour.FromString,
                    response_serializer=ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgSubmitMisbehaviourResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ibc.core.client.v1.Msg', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('ibc.core.client.v1.Msg', rpc_method_handlers)


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

    @staticmethod
    def CreateClient(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,
            '/ibc.core.client.v1.Msg/CreateClient',
            ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgCreateClient.SerializeToString,
            ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgCreateClientResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateClient(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,
            '/ibc.core.client.v1.Msg/UpdateClient',
            ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpdateClient.SerializeToString,
            ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpdateClientResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpgradeClient(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,
            '/ibc.core.client.v1.Msg/UpgradeClient',
            ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpgradeClient.SerializeToString,
            ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgUpgradeClientResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SubmitMisbehaviour(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,
            '/ibc.core.client.v1.Msg/SubmitMisbehaviour',
            ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgSubmitMisbehaviour.SerializeToString,
            ibc_dot_core_dot_client_dot_v1_dot_tx__pb2.MsgSubmitMisbehaviourResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
