# 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 google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from infradsl.proto import nexus_pb2 as infradsl_dot_proto_dot_nexus__pb2

GRPC_GENERATED_VERSION = '1.73.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 infradsl/proto/nexus_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 NexusServiceStub(object):
    """Service definition for Nexus gRPC API
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateResource = channel.unary_unary(
                '/nexus.NexusService/CreateResource',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.CreateResourceRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
                _registered_method=True)
        self.GetResource = channel.unary_unary(
                '/nexus.NexusService/GetResource',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.GetResourceRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.ResourceResponse.FromString,
                _registered_method=True)
        self.UpdateResource = channel.unary_unary(
                '/nexus.NexusService/UpdateResource',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.UpdateResourceRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
                _registered_method=True)
        self.DeleteResource = channel.unary_unary(
                '/nexus.NexusService/DeleteResource',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.DeleteResourceRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
                _registered_method=True)
        self.ListResources = channel.unary_unary(
                '/nexus.NexusService/ListResources',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.ListResourcesRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.ListResourcesResponse.FromString,
                _registered_method=True)
        self.GetOperation = channel.unary_unary(
                '/nexus.NexusService/GetOperation',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.GetOperationRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
                _registered_method=True)
        self.CheckDrift = channel.unary_unary(
                '/nexus.NexusService/CheckDrift',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.CheckDriftRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.CheckDriftResponse.FromString,
                _registered_method=True)
        self.HealDrift = channel.unary_unary(
                '/nexus.NexusService/HealDrift',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.HealDriftRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
                _registered_method=True)
        self.SyncState = channel.unary_unary(
                '/nexus.NexusService/SyncState',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.SyncStateRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
                _registered_method=True)
        self.ListProviders = channel.unary_unary(
                '/nexus.NexusService/ListProviders',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.ListProvidersResponse.FromString,
                _registered_method=True)
        self.GetProviderHealth = channel.unary_unary(
                '/nexus.NexusService/GetProviderHealth',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.GetProviderHealthRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.ProviderHealthResponse.FromString,
                _registered_method=True)
        self.StreamEvents = channel.unary_stream(
                '/nexus.NexusService/StreamEvents',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.StreamEventsRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.EventResponse.FromString,
                _registered_method=True)
        self.StreamOperationStatus = channel.unary_stream(
                '/nexus.NexusService/StreamOperationStatus',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.StreamOperationStatusRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
                _registered_method=True)
        self.StreamResourceUpdates = channel.unary_stream(
                '/nexus.NexusService/StreamResourceUpdates',
                request_serializer=infradsl_dot_proto_dot_nexus__pb2.StreamResourceUpdatesRequest.SerializeToString,
                response_deserializer=infradsl_dot_proto_dot_nexus__pb2.ResourceResponse.FromString,
                _registered_method=True)


class NexusServiceServicer(object):
    """Service definition for Nexus gRPC API
    """

    def CreateResource(self, request, context):
        """Resource operations
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetResource(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 UpdateResource(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 DeleteResource(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 ListResources(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 GetOperation(self, request, context):
        """Operation status
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CheckDrift(self, request, context):
        """State management
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def HealDrift(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 SyncState(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 ListProviders(self, request, context):
        """Provider management
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetProviderHealth(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 StreamEvents(self, request, context):
        """Streaming operations
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamOperationStatus(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 StreamResourceUpdates(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_NexusServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateResource': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateResource,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.CreateResourceRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.SerializeToString,
            ),
            'GetResource': grpc.unary_unary_rpc_method_handler(
                    servicer.GetResource,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.GetResourceRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.ResourceResponse.SerializeToString,
            ),
            'UpdateResource': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateResource,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.UpdateResourceRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.SerializeToString,
            ),
            'DeleteResource': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteResource,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.DeleteResourceRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.SerializeToString,
            ),
            'ListResources': grpc.unary_unary_rpc_method_handler(
                    servicer.ListResources,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.ListResourcesRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.ListResourcesResponse.SerializeToString,
            ),
            'GetOperation': grpc.unary_unary_rpc_method_handler(
                    servicer.GetOperation,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.GetOperationRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.SerializeToString,
            ),
            'CheckDrift': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckDrift,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.CheckDriftRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.CheckDriftResponse.SerializeToString,
            ),
            'HealDrift': grpc.unary_unary_rpc_method_handler(
                    servicer.HealDrift,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.HealDriftRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.SerializeToString,
            ),
            'SyncState': grpc.unary_unary_rpc_method_handler(
                    servicer.SyncState,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.SyncStateRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.SerializeToString,
            ),
            'ListProviders': grpc.unary_unary_rpc_method_handler(
                    servicer.ListProviders,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.ListProvidersResponse.SerializeToString,
            ),
            'GetProviderHealth': grpc.unary_unary_rpc_method_handler(
                    servicer.GetProviderHealth,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.GetProviderHealthRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.ProviderHealthResponse.SerializeToString,
            ),
            'StreamEvents': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamEvents,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.StreamEventsRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.EventResponse.SerializeToString,
            ),
            'StreamOperationStatus': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamOperationStatus,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.StreamOperationStatusRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.OperationResponse.SerializeToString,
            ),
            'StreamResourceUpdates': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamResourceUpdates,
                    request_deserializer=infradsl_dot_proto_dot_nexus__pb2.StreamResourceUpdatesRequest.FromString,
                    response_serializer=infradsl_dot_proto_dot_nexus__pb2.ResourceResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'nexus.NexusService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('nexus.NexusService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class NexusService(object):
    """Service definition for Nexus gRPC API
    """

    @staticmethod
    def CreateResource(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,
            '/nexus.NexusService/CreateResource',
            infradsl_dot_proto_dot_nexus__pb2.CreateResourceRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetResource(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,
            '/nexus.NexusService/GetResource',
            infradsl_dot_proto_dot_nexus__pb2.GetResourceRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.ResourceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateResource(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,
            '/nexus.NexusService/UpdateResource',
            infradsl_dot_proto_dot_nexus__pb2.UpdateResourceRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeleteResource(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,
            '/nexus.NexusService/DeleteResource',
            infradsl_dot_proto_dot_nexus__pb2.DeleteResourceRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListResources(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,
            '/nexus.NexusService/ListResources',
            infradsl_dot_proto_dot_nexus__pb2.ListResourcesRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.ListResourcesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetOperation(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,
            '/nexus.NexusService/GetOperation',
            infradsl_dot_proto_dot_nexus__pb2.GetOperationRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CheckDrift(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,
            '/nexus.NexusService/CheckDrift',
            infradsl_dot_proto_dot_nexus__pb2.CheckDriftRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.CheckDriftResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def HealDrift(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,
            '/nexus.NexusService/HealDrift',
            infradsl_dot_proto_dot_nexus__pb2.HealDriftRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SyncState(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,
            '/nexus.NexusService/SyncState',
            infradsl_dot_proto_dot_nexus__pb2.SyncStateRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListProviders(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,
            '/nexus.NexusService/ListProviders',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.ListProvidersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetProviderHealth(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,
            '/nexus.NexusService/GetProviderHealth',
            infradsl_dot_proto_dot_nexus__pb2.GetProviderHealthRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.ProviderHealthResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamEvents(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,
            '/nexus.NexusService/StreamEvents',
            infradsl_dot_proto_dot_nexus__pb2.StreamEventsRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.EventResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamOperationStatus(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,
            '/nexus.NexusService/StreamOperationStatus',
            infradsl_dot_proto_dot_nexus__pb2.StreamOperationStatusRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.OperationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamResourceUpdates(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,
            '/nexus.NexusService/StreamResourceUpdates',
            infradsl_dot_proto_dot_nexus__pb2.StreamResourceUpdatesRequest.SerializeToString,
            infradsl_dot_proto_dot_nexus__pb2.ResourceResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
