# 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 workflows_pb2 as workflows__pb2

GRPC_GENERATED_VERSION = '1.64.1'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_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:
    warnings.warn(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in workflows_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}.'
        + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
        + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
        RuntimeWarning
    )


class WorkflowServiceStub(object):
    """WorkflowService represents a set of RPCs for managing workflows.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.PutWorkflow = channel.unary_unary(
                '/WorkflowService/PutWorkflow',
                request_serializer=workflows__pb2.PutWorkflowRequest.SerializeToString,
                response_deserializer=workflows__pb2.WorkflowVersion.FromString,
                _registered_method=True)
        self.ScheduleWorkflow = channel.unary_unary(
                '/WorkflowService/ScheduleWorkflow',
                request_serializer=workflows__pb2.ScheduleWorkflowRequest.SerializeToString,
                response_deserializer=workflows__pb2.WorkflowVersion.FromString,
                _registered_method=True)
        self.TriggerWorkflow = channel.unary_unary(
                '/WorkflowService/TriggerWorkflow',
                request_serializer=workflows__pb2.TriggerWorkflowRequest.SerializeToString,
                response_deserializer=workflows__pb2.TriggerWorkflowResponse.FromString,
                _registered_method=True)
        self.BulkTriggerWorkflow = channel.unary_unary(
                '/WorkflowService/BulkTriggerWorkflow',
                request_serializer=workflows__pb2.BulkTriggerWorkflowRequest.SerializeToString,
                response_deserializer=workflows__pb2.BulkTriggerWorkflowResponse.FromString,
                _registered_method=True)
        self.PutRateLimit = channel.unary_unary(
                '/WorkflowService/PutRateLimit',
                request_serializer=workflows__pb2.PutRateLimitRequest.SerializeToString,
                response_deserializer=workflows__pb2.PutRateLimitResponse.FromString,
                _registered_method=True)


class WorkflowServiceServicer(object):
    """WorkflowService represents a set of RPCs for managing workflows.
    """

    def PutWorkflow(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 ScheduleWorkflow(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 TriggerWorkflow(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 BulkTriggerWorkflow(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 PutRateLimit(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_WorkflowServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'PutWorkflow': grpc.unary_unary_rpc_method_handler(
                    servicer.PutWorkflow,
                    request_deserializer=workflows__pb2.PutWorkflowRequest.FromString,
                    response_serializer=workflows__pb2.WorkflowVersion.SerializeToString,
            ),
            'ScheduleWorkflow': grpc.unary_unary_rpc_method_handler(
                    servicer.ScheduleWorkflow,
                    request_deserializer=workflows__pb2.ScheduleWorkflowRequest.FromString,
                    response_serializer=workflows__pb2.WorkflowVersion.SerializeToString,
            ),
            'TriggerWorkflow': grpc.unary_unary_rpc_method_handler(
                    servicer.TriggerWorkflow,
                    request_deserializer=workflows__pb2.TriggerWorkflowRequest.FromString,
                    response_serializer=workflows__pb2.TriggerWorkflowResponse.SerializeToString,
            ),
            'BulkTriggerWorkflow': grpc.unary_unary_rpc_method_handler(
                    servicer.BulkTriggerWorkflow,
                    request_deserializer=workflows__pb2.BulkTriggerWorkflowRequest.FromString,
                    response_serializer=workflows__pb2.BulkTriggerWorkflowResponse.SerializeToString,
            ),
            'PutRateLimit': grpc.unary_unary_rpc_method_handler(
                    servicer.PutRateLimit,
                    request_deserializer=workflows__pb2.PutRateLimitRequest.FromString,
                    response_serializer=workflows__pb2.PutRateLimitResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'WorkflowService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('WorkflowService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class WorkflowService(object):
    """WorkflowService represents a set of RPCs for managing workflows.
    """

    @staticmethod
    def PutWorkflow(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,
            '/WorkflowService/PutWorkflow',
            workflows__pb2.PutWorkflowRequest.SerializeToString,
            workflows__pb2.WorkflowVersion.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ScheduleWorkflow(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,
            '/WorkflowService/ScheduleWorkflow',
            workflows__pb2.ScheduleWorkflowRequest.SerializeToString,
            workflows__pb2.WorkflowVersion.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def TriggerWorkflow(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,
            '/WorkflowService/TriggerWorkflow',
            workflows__pb2.TriggerWorkflowRequest.SerializeToString,
            workflows__pb2.TriggerWorkflowResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BulkTriggerWorkflow(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,
            '/WorkflowService/BulkTriggerWorkflow',
            workflows__pb2.BulkTriggerWorkflowRequest.SerializeToString,
            workflows__pb2.BulkTriggerWorkflowResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PutRateLimit(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,
            '/WorkflowService/PutRateLimit',
            workflows__pb2.PutRateLimitRequest.SerializeToString,
            workflows__pb2.PutRateLimitResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
