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

import grpc

from workflow.v2 import (
    execution_service_pb2 as workflow_dot_v2_dot_execution__service__pb2,
)


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.StartExecution = channel.unary_unary(
            "/workflow.v2.ExecutionService/StartExecution",
            request_serializer=workflow_dot_v2_dot_execution__service__pb2.StartExecutionRequest.SerializeToString,
            response_deserializer=workflow_dot_v2_dot_execution__service__pb2.StartExecutionResponse.FromString,
            _registered_method=True,
        )
        self.GetExecution = channel.unary_unary(
            "/workflow.v2.ExecutionService/GetExecution",
            request_serializer=workflow_dot_v2_dot_execution__service__pb2.GetExecutionRequest.SerializeToString,
            response_deserializer=workflow_dot_v2_dot_execution__service__pb2.GetExecutionResponse.FromString,
            _registered_method=True,
        )
        self.ListExecutions = channel.unary_unary(
            "/workflow.v2.ExecutionService/ListExecutions",
            request_serializer=workflow_dot_v2_dot_execution__service__pb2.ListExecutionsRequest.SerializeToString,
            response_deserializer=workflow_dot_v2_dot_execution__service__pb2.ListExecutionsResponse.FromString,
            _registered_method=True,
        )
        self.CancelExecution = channel.unary_unary(
            "/workflow.v2.ExecutionService/CancelExecution",
            request_serializer=workflow_dot_v2_dot_execution__service__pb2.CancelExecutionRequest.SerializeToString,
            response_deserializer=workflow_dot_v2_dot_execution__service__pb2.CancelExecutionResponse.FromString,
            _registered_method=True,
        )
        self.StreamExecution = channel.unary_stream(
            "/workflow.v2.ExecutionService/StreamExecution",
            request_serializer=workflow_dot_v2_dot_execution__service__pb2.StreamExecutionRequest.SerializeToString,
            response_deserializer=workflow_dot_v2_dot_execution__service__pb2.StreamExecutionResponse.FromString,
            _registered_method=True,
        )


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

    def StartExecution(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 GetExecution(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 ListExecutions(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 CancelExecution(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 StreamExecution(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_ExecutionServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "StartExecution": grpc.unary_unary_rpc_method_handler(
            servicer.StartExecution,
            request_deserializer=workflow_dot_v2_dot_execution__service__pb2.StartExecutionRequest.FromString,
            response_serializer=workflow_dot_v2_dot_execution__service__pb2.StartExecutionResponse.SerializeToString,
        ),
        "GetExecution": grpc.unary_unary_rpc_method_handler(
            servicer.GetExecution,
            request_deserializer=workflow_dot_v2_dot_execution__service__pb2.GetExecutionRequest.FromString,
            response_serializer=workflow_dot_v2_dot_execution__service__pb2.GetExecutionResponse.SerializeToString,
        ),
        "ListExecutions": grpc.unary_unary_rpc_method_handler(
            servicer.ListExecutions,
            request_deserializer=workflow_dot_v2_dot_execution__service__pb2.ListExecutionsRequest.FromString,
            response_serializer=workflow_dot_v2_dot_execution__service__pb2.ListExecutionsResponse.SerializeToString,
        ),
        "CancelExecution": grpc.unary_unary_rpc_method_handler(
            servicer.CancelExecution,
            request_deserializer=workflow_dot_v2_dot_execution__service__pb2.CancelExecutionRequest.FromString,
            response_serializer=workflow_dot_v2_dot_execution__service__pb2.CancelExecutionResponse.SerializeToString,
        ),
        "StreamExecution": grpc.unary_stream_rpc_method_handler(
            servicer.StreamExecution,
            request_deserializer=workflow_dot_v2_dot_execution__service__pb2.StreamExecutionRequest.FromString,
            response_serializer=workflow_dot_v2_dot_execution__service__pb2.StreamExecutionResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "workflow.v2.ExecutionService", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers(
        "workflow.v2.ExecutionService", rpc_method_handlers
    )


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

    @staticmethod
    def StartExecution(
        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,
            "/workflow.v2.ExecutionService/StartExecution",
            workflow_dot_v2_dot_execution__service__pb2.StartExecutionRequest.SerializeToString,
            workflow_dot_v2_dot_execution__service__pb2.StartExecutionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def GetExecution(
        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,
            "/workflow.v2.ExecutionService/GetExecution",
            workflow_dot_v2_dot_execution__service__pb2.GetExecutionRequest.SerializeToString,
            workflow_dot_v2_dot_execution__service__pb2.GetExecutionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def ListExecutions(
        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,
            "/workflow.v2.ExecutionService/ListExecutions",
            workflow_dot_v2_dot_execution__service__pb2.ListExecutionsRequest.SerializeToString,
            workflow_dot_v2_dot_execution__service__pb2.ListExecutionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def CancelExecution(
        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,
            "/workflow.v2.ExecutionService/CancelExecution",
            workflow_dot_v2_dot_execution__service__pb2.CancelExecutionRequest.SerializeToString,
            workflow_dot_v2_dot_execution__service__pb2.CancelExecutionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )

    @staticmethod
    def StreamExecution(
        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,
            "/workflow.v2.ExecutionService/StreamExecution",
            workflow_dot_v2_dot_execution__service__pb2.StreamExecutionRequest.SerializeToString,
            workflow_dot_v2_dot_execution__service__pb2.StreamExecutionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True,
        )
