# 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 cvt_pb2 as cvt__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 cvt_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 ContractValidatorStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.RegisterSchema = channel.unary_unary(
                '/cvt.ContractValidator/RegisterSchema',
                request_serializer=cvt__pb2.RegisterSchemaRequest.SerializeToString,
                response_deserializer=cvt__pb2.RegisterSchemaResponse.FromString,
                _registered_method=True)
        self.ValidateInteraction = channel.unary_unary(
                '/cvt.ContractValidator/ValidateInteraction',
                request_serializer=cvt__pb2.InteractionRequest.SerializeToString,
                response_deserializer=cvt__pb2.ValidationResult.FromString,
                _registered_method=True)
        self.GetSchema = channel.unary_unary(
                '/cvt.ContractValidator/GetSchema',
                request_serializer=cvt__pb2.GetSchemaRequest.SerializeToString,
                response_deserializer=cvt__pb2.GetSchemaResponse.FromString,
                _registered_method=True)
        self.ListSchemas = channel.unary_unary(
                '/cvt.ContractValidator/ListSchemas',
                request_serializer=cvt__pb2.ListSchemasRequest.SerializeToString,
                response_deserializer=cvt__pb2.ListSchemasResponse.FromString,
                _registered_method=True)
        self.CompareSchemas = channel.unary_unary(
                '/cvt.ContractValidator/CompareSchemas',
                request_serializer=cvt__pb2.CompareSchemasRequest.SerializeToString,
                response_deserializer=cvt__pb2.CompareSchemasResponse.FromString,
                _registered_method=True)
        self.GenerateFixture = channel.unary_unary(
                '/cvt.ContractValidator/GenerateFixture',
                request_serializer=cvt__pb2.GenerateFixtureRequest.SerializeToString,
                response_deserializer=cvt__pb2.GenerateFixtureResponse.FromString,
                _registered_method=True)
        self.ListEndpoints = channel.unary_unary(
                '/cvt.ContractValidator/ListEndpoints',
                request_serializer=cvt__pb2.ListEndpointsRequest.SerializeToString,
                response_deserializer=cvt__pb2.ListEndpointsResponse.FromString,
                _registered_method=True)
        self.ValidateProducerResponse = channel.unary_unary(
                '/cvt.ContractValidator/ValidateProducerResponse',
                request_serializer=cvt__pb2.ValidateProducerRequest.SerializeToString,
                response_deserializer=cvt__pb2.ValidationResult.FromString,
                _registered_method=True)
        self.RegisterConsumer = channel.unary_unary(
                '/cvt.ContractValidator/RegisterConsumer',
                request_serializer=cvt__pb2.RegisterConsumerRequest.SerializeToString,
                response_deserializer=cvt__pb2.RegisterConsumerResponse.FromString,
                _registered_method=True)
        self.ListConsumers = channel.unary_unary(
                '/cvt.ContractValidator/ListConsumers',
                request_serializer=cvt__pb2.ListConsumersRequest.SerializeToString,
                response_deserializer=cvt__pb2.ListConsumersResponse.FromString,
                _registered_method=True)
        self.DeregisterConsumer = channel.unary_unary(
                '/cvt.ContractValidator/DeregisterConsumer',
                request_serializer=cvt__pb2.DeregisterConsumerRequest.SerializeToString,
                response_deserializer=cvt__pb2.DeregisterConsumerResponse.FromString,
                _registered_method=True)
        self.CanIDeploy = channel.unary_unary(
                '/cvt.ContractValidator/CanIDeploy',
                request_serializer=cvt__pb2.CanIDeployRequest.SerializeToString,
                response_deserializer=cvt__pb2.CanIDeployResponse.FromString,
                _registered_method=True)


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

    def RegisterSchema(self, request, context):
        """Registers an OpenAPI schema for future validation
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ValidateInteraction(self, request, context):
        """Validates a single request/response interaction against a registered schema
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetSchema(self, request, context):
        """Gets metadata for a registered schema
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListSchemas(self, request, context):
        """Lists all registered schemas
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CompareSchemas(self, request, context):
        """Compares two schema versions for breaking changes
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GenerateFixture(self, request, context):
        """Generates test fixtures from an OpenAPI schema
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListEndpoints(self, request, context):
        """Lists all endpoints available in a schema
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ValidateProducerResponse(self, request, context):
        """===== Phase 1: Producer Testing =====

        Validates a producer's response against its OpenAPI schema (for producer contract tests)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def RegisterConsumer(self, request, context):
        """===== Phase 2: Consumer Registry =====

        Registers a consumer's dependency on a schema
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListConsumers(self, request, context):
        """Lists all consumers that depend on a schema
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeregisterConsumer(self, request, context):
        """Removes a consumer registration
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CanIDeploy(self, request, context):
        """===== Phase 3: Deployment Safety =====

        Checks if a schema version can be safely deployed
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ContractValidatorServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'RegisterSchema': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterSchema,
                    request_deserializer=cvt__pb2.RegisterSchemaRequest.FromString,
                    response_serializer=cvt__pb2.RegisterSchemaResponse.SerializeToString,
            ),
            'ValidateInteraction': grpc.unary_unary_rpc_method_handler(
                    servicer.ValidateInteraction,
                    request_deserializer=cvt__pb2.InteractionRequest.FromString,
                    response_serializer=cvt__pb2.ValidationResult.SerializeToString,
            ),
            'GetSchema': grpc.unary_unary_rpc_method_handler(
                    servicer.GetSchema,
                    request_deserializer=cvt__pb2.GetSchemaRequest.FromString,
                    response_serializer=cvt__pb2.GetSchemaResponse.SerializeToString,
            ),
            'ListSchemas': grpc.unary_unary_rpc_method_handler(
                    servicer.ListSchemas,
                    request_deserializer=cvt__pb2.ListSchemasRequest.FromString,
                    response_serializer=cvt__pb2.ListSchemasResponse.SerializeToString,
            ),
            'CompareSchemas': grpc.unary_unary_rpc_method_handler(
                    servicer.CompareSchemas,
                    request_deserializer=cvt__pb2.CompareSchemasRequest.FromString,
                    response_serializer=cvt__pb2.CompareSchemasResponse.SerializeToString,
            ),
            'GenerateFixture': grpc.unary_unary_rpc_method_handler(
                    servicer.GenerateFixture,
                    request_deserializer=cvt__pb2.GenerateFixtureRequest.FromString,
                    response_serializer=cvt__pb2.GenerateFixtureResponse.SerializeToString,
            ),
            'ListEndpoints': grpc.unary_unary_rpc_method_handler(
                    servicer.ListEndpoints,
                    request_deserializer=cvt__pb2.ListEndpointsRequest.FromString,
                    response_serializer=cvt__pb2.ListEndpointsResponse.SerializeToString,
            ),
            'ValidateProducerResponse': grpc.unary_unary_rpc_method_handler(
                    servicer.ValidateProducerResponse,
                    request_deserializer=cvt__pb2.ValidateProducerRequest.FromString,
                    response_serializer=cvt__pb2.ValidationResult.SerializeToString,
            ),
            'RegisterConsumer': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterConsumer,
                    request_deserializer=cvt__pb2.RegisterConsumerRequest.FromString,
                    response_serializer=cvt__pb2.RegisterConsumerResponse.SerializeToString,
            ),
            'ListConsumers': grpc.unary_unary_rpc_method_handler(
                    servicer.ListConsumers,
                    request_deserializer=cvt__pb2.ListConsumersRequest.FromString,
                    response_serializer=cvt__pb2.ListConsumersResponse.SerializeToString,
            ),
            'DeregisterConsumer': grpc.unary_unary_rpc_method_handler(
                    servicer.DeregisterConsumer,
                    request_deserializer=cvt__pb2.DeregisterConsumerRequest.FromString,
                    response_serializer=cvt__pb2.DeregisterConsumerResponse.SerializeToString,
            ),
            'CanIDeploy': grpc.unary_unary_rpc_method_handler(
                    servicer.CanIDeploy,
                    request_deserializer=cvt__pb2.CanIDeployRequest.FromString,
                    response_serializer=cvt__pb2.CanIDeployResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cvt.ContractValidator', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('cvt.ContractValidator', rpc_method_handlers)


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

    @staticmethod
    def RegisterSchema(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,
            '/cvt.ContractValidator/RegisterSchema',
            cvt__pb2.RegisterSchemaRequest.SerializeToString,
            cvt__pb2.RegisterSchemaResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ValidateInteraction(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,
            '/cvt.ContractValidator/ValidateInteraction',
            cvt__pb2.InteractionRequest.SerializeToString,
            cvt__pb2.ValidationResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetSchema(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,
            '/cvt.ContractValidator/GetSchema',
            cvt__pb2.GetSchemaRequest.SerializeToString,
            cvt__pb2.GetSchemaResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListSchemas(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,
            '/cvt.ContractValidator/ListSchemas',
            cvt__pb2.ListSchemasRequest.SerializeToString,
            cvt__pb2.ListSchemasResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CompareSchemas(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,
            '/cvt.ContractValidator/CompareSchemas',
            cvt__pb2.CompareSchemasRequest.SerializeToString,
            cvt__pb2.CompareSchemasResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GenerateFixture(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,
            '/cvt.ContractValidator/GenerateFixture',
            cvt__pb2.GenerateFixtureRequest.SerializeToString,
            cvt__pb2.GenerateFixtureResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListEndpoints(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,
            '/cvt.ContractValidator/ListEndpoints',
            cvt__pb2.ListEndpointsRequest.SerializeToString,
            cvt__pb2.ListEndpointsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ValidateProducerResponse(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,
            '/cvt.ContractValidator/ValidateProducerResponse',
            cvt__pb2.ValidateProducerRequest.SerializeToString,
            cvt__pb2.ValidationResult.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def RegisterConsumer(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,
            '/cvt.ContractValidator/RegisterConsumer',
            cvt__pb2.RegisterConsumerRequest.SerializeToString,
            cvt__pb2.RegisterConsumerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListConsumers(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,
            '/cvt.ContractValidator/ListConsumers',
            cvt__pb2.ListConsumersRequest.SerializeToString,
            cvt__pb2.ListConsumersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeregisterConsumer(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,
            '/cvt.ContractValidator/DeregisterConsumer',
            cvt__pb2.DeregisterConsumerRequest.SerializeToString,
            cvt__pb2.DeregisterConsumerResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CanIDeploy(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,
            '/cvt.ContractValidator/CanIDeploy',
            cvt__pb2.CanIDeployRequest.SerializeToString,
            cvt__pb2.CanIDeployResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
