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

from deepomatic.rpc.buffers.protobuf.workflows import WorkflowExecution_pb2 as buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2


class WorkflowExecutorStub(object):
    """To generate gRPC server and client in deepomatic-workflows
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ExecuteWorkflow = channel.unary_unary(
                '/buffers.protobuf.workflows.WorkflowExecutor/ExecuteWorkflow',
                request_serializer=buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowRequest.SerializeToString,
                response_deserializer=buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowResponse.FromString,
                )
        self.ExecuteWorkflowStream = channel.stream_stream(
                '/buffers.protobuf.workflows.WorkflowExecutor/ExecuteWorkflowStream',
                request_serializer=buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowRequest.SerializeToString,
                response_deserializer=buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowResponse.FromString,
                )


class WorkflowExecutorServicer(object):
    """To generate gRPC server and client in deepomatic-workflows
    """

    def ExecuteWorkflow(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 ExecuteWorkflowStream(self, request_iterator, 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_WorkflowExecutorServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ExecuteWorkflow': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecuteWorkflow,
                    request_deserializer=buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowRequest.FromString,
                    response_serializer=buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowResponse.SerializeToString,
            ),
            'ExecuteWorkflowStream': grpc.stream_stream_rpc_method_handler(
                    servicer.ExecuteWorkflowStream,
                    request_deserializer=buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowRequest.FromString,
                    response_serializer=buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'buffers.protobuf.workflows.WorkflowExecutor', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class WorkflowExecutor(object):
    """To generate gRPC server and client in deepomatic-workflows
    """

    @staticmethod
    def ExecuteWorkflow(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, '/buffers.protobuf.workflows.WorkflowExecutor/ExecuteWorkflow',
            buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowRequest.SerializeToString,
            buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ExecuteWorkflowStream(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/buffers.protobuf.workflows.WorkflowExecutor/ExecuteWorkflowStream',
            buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowRequest.SerializeToString,
            buffers_dot_protobuf_dot_workflows_dot_WorkflowExecution__pb2.WorkflowResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
