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

from pyinjective.proto.cometbft.services.version.v1 import version_pb2 as cometbft_dot_services_dot_version_dot_v1_dot_version__pb2


class VersionServiceStub(object):
    """VersionService simply provides version information about the node and the
    protocols it uses.

    The intention with this service is to offer a stable interface through which
    clients can access version information. This means that the version of the
    service should be kept stable at v1, with GetVersionResponse evolving only
    in non-breaking ways.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetVersion = channel.unary_unary(
                '/cometbft.services.version.v1.VersionService/GetVersion',
                request_serializer=cometbft_dot_services_dot_version_dot_v1_dot_version__pb2.GetVersionRequest.SerializeToString,
                response_deserializer=cometbft_dot_services_dot_version_dot_v1_dot_version__pb2.GetVersionResponse.FromString,
                _registered_method=True)


class VersionServiceServicer(object):
    """VersionService simply provides version information about the node and the
    protocols it uses.

    The intention with this service is to offer a stable interface through which
    clients can access version information. This means that the version of the
    service should be kept stable at v1, with GetVersionResponse evolving only
    in non-breaking ways.
    """

    def GetVersion(self, request, context):
        """GetVersion retrieves version information about the node and the protocols
        it implements.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_VersionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetVersion': grpc.unary_unary_rpc_method_handler(
                    servicer.GetVersion,
                    request_deserializer=cometbft_dot_services_dot_version_dot_v1_dot_version__pb2.GetVersionRequest.FromString,
                    response_serializer=cometbft_dot_services_dot_version_dot_v1_dot_version__pb2.GetVersionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cometbft.services.version.v1.VersionService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('cometbft.services.version.v1.VersionService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class VersionService(object):
    """VersionService simply provides version information about the node and the
    protocols it uses.

    The intention with this service is to offer a stable interface through which
    clients can access version information. This means that the version of the
    service should be kept stable at v1, with GetVersionResponse evolving only
    in non-breaking ways.
    """

    @staticmethod
    def GetVersion(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,
            '/cometbft.services.version.v1.VersionService/GetVersion',
            cometbft_dot_services_dot_version_dot_v1_dot_version__pb2.GetVersionRequest.SerializeToString,
            cometbft_dot_services_dot_version_dot_v1_dot_version__pb2.GetVersionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
