# 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 nexus.grpc.approvals import approvals_pb2 as nexus_dot_grpc_dot_approvals_dot_approvals__pb2

GRPC_GENERATED_VERSION = '1.78.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 nexus/grpc/approvals/approvals_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 ApprovalsV1Stub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListPending = channel.unary_unary(
                '/nexus.approvals.v1.ApprovalsV1/ListPending',
                request_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ListPendingRequest.SerializeToString,
                response_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ListPendingResponse.FromString,
                _registered_method=True)
        self.Get = channel.unary_unary(
                '/nexus.approvals.v1.ApprovalsV1/Get',
                request_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.GetRequest.SerializeToString,
                response_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalRequestProto.FromString,
                _registered_method=True)
        self.Decide = channel.unary_unary(
                '/nexus.approvals.v1.ApprovalsV1/Decide',
                request_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.DecideRequest.SerializeToString,
                response_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalRequestProto.FromString,
                _registered_method=True)
        self.Cancel = channel.unary_unary(
                '/nexus.approvals.v1.ApprovalsV1/Cancel',
                request_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.CancelRequest.SerializeToString,
                response_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.CancelResponse.FromString,
                _registered_method=True)
        self.Watch = channel.unary_stream(
                '/nexus.approvals.v1.ApprovalsV1/Watch',
                request_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.WatchRequest.SerializeToString,
                response_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalEvent.FromString,
                _registered_method=True)
        self.Submit = channel.unary_unary(
                '/nexus.approvals.v1.ApprovalsV1/Submit',
                request_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.SubmitRequest.SerializeToString,
                response_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.SubmitDecision.FromString,
                _registered_method=True)


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

    def ListPending(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 Get(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 Decide(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 Cancel(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 Watch(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 Submit(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_ApprovalsV1Servicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListPending': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPending,
                    request_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ListPendingRequest.FromString,
                    response_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ListPendingResponse.SerializeToString,
            ),
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.GetRequest.FromString,
                    response_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalRequestProto.SerializeToString,
            ),
            'Decide': grpc.unary_unary_rpc_method_handler(
                    servicer.Decide,
                    request_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.DecideRequest.FromString,
                    response_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalRequestProto.SerializeToString,
            ),
            'Cancel': grpc.unary_unary_rpc_method_handler(
                    servicer.Cancel,
                    request_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.CancelRequest.FromString,
                    response_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.CancelResponse.SerializeToString,
            ),
            'Watch': grpc.unary_stream_rpc_method_handler(
                    servicer.Watch,
                    request_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.WatchRequest.FromString,
                    response_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalEvent.SerializeToString,
            ),
            'Submit': grpc.unary_unary_rpc_method_handler(
                    servicer.Submit,
                    request_deserializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.SubmitRequest.FromString,
                    response_serializer=nexus_dot_grpc_dot_approvals_dot_approvals__pb2.SubmitDecision.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'nexus.approvals.v1.ApprovalsV1', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('nexus.approvals.v1.ApprovalsV1', rpc_method_handlers)


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

    @staticmethod
    def ListPending(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.approvals.v1.ApprovalsV1/ListPending',
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ListPendingRequest.SerializeToString,
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ListPendingResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Get(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.approvals.v1.ApprovalsV1/Get',
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.GetRequest.SerializeToString,
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalRequestProto.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Decide(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.approvals.v1.ApprovalsV1/Decide',
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.DecideRequest.SerializeToString,
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalRequestProto.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Cancel(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.approvals.v1.ApprovalsV1/Cancel',
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.CancelRequest.SerializeToString,
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.CancelResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Watch(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.approvals.v1.ApprovalsV1/Watch',
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.WatchRequest.SerializeToString,
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.ApprovalEvent.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Submit(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.approvals.v1.ApprovalsV1/Submit',
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.SubmitRequest.SerializeToString,
            nexus_dot_grpc_dot_approvals_dot_approvals__pb2.SubmitDecision.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
