"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""
import abc
import collections.abc
import google.protobuf.empty_pb2
import grpc
import modal_proto.task_command_router_pb2

class TaskCommandRouterStub:
    def __init__(self, channel: grpc.Channel) -> None: ...
    TaskContainerCreate: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskContainerCreateRequest,
        modal_proto.task_command_router_pb2.TaskContainerCreateResponse,
    ]
    """Create an additional container for a task."""
    TaskContainerGet: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskContainerGetRequest,
        modal_proto.task_command_router_pb2.TaskContainerGetResponse,
    ]
    """Get the latest container associated with a logical name."""
    TaskContainerList: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskContainerListRequest,
        modal_proto.task_command_router_pb2.TaskContainerListResponse,
    ]
    """List containers associated with the task."""
    TaskContainerTerminate: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskContainerTerminateRequest,
        modal_proto.task_command_router_pb2.TaskContainerTerminateResponse,
    ]
    """Terminate or release a tracked container."""
    TaskContainerWait: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskContainerWaitRequest,
        modal_proto.task_command_router_pb2.TaskContainerWaitResponse,
    ]
    """Wait for a tracked container to reach a terminal result."""
    TaskExecPoll: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskExecPollRequest,
        modal_proto.task_command_router_pb2.TaskExecPollResponse,
    ]
    """Poll for the exit status of an exec'd command."""
    TaskExecStart: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskExecStartRequest,
        modal_proto.task_command_router_pb2.TaskExecStartResponse,
    ]
    """Execute a command in the task."""
    TaskExecStdinWrite: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskExecStdinWriteRequest,
        modal_proto.task_command_router_pb2.TaskExecStdinWriteResponse,
    ]
    """Write to the stdin stream of an exec'd command."""
    TaskExecStdioRead: grpc.UnaryStreamMultiCallable[
        modal_proto.task_command_router_pb2.TaskExecStdioReadRequest,
        modal_proto.task_command_router_pb2.TaskExecStdioReadResponse,
    ]
    """Get a stream of output from the stdout or stderr stream of an exec'd command."""
    TaskExecWait: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskExecWaitRequest,
        modal_proto.task_command_router_pb2.TaskExecWaitResponse,
    ]
    """Wait for an exec'd command to exit and return the exit code."""
    TaskMountDirectory: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskMountDirectoryRequest,
        google.protobuf.empty_pb2.Empty,
    ]
    """Mount an image at a directory in the container."""
    TaskSnapshotDirectory: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskSnapshotDirectoryRequest,
        modal_proto.task_command_router_pb2.TaskSnapshotDirectoryResponse,
    ]
    """Snapshot a directory with a mounted image, including any local changes, into a new image."""
    TaskUnmountDirectory: grpc.UnaryUnaryMultiCallable[
        modal_proto.task_command_router_pb2.TaskUnmountDirectoryRequest,
        google.protobuf.empty_pb2.Empty,
    ]
    """Unmount an image previously mounted at a directory in the container."""

class TaskCommandRouterServicer(metaclass=abc.ABCMeta):
    @abc.abstractmethod
    def TaskContainerCreate(
        self,
        request: modal_proto.task_command_router_pb2.TaskContainerCreateRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskContainerCreateResponse:
        """Create an additional container for a task."""
    @abc.abstractmethod
    def TaskContainerGet(
        self,
        request: modal_proto.task_command_router_pb2.TaskContainerGetRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskContainerGetResponse:
        """Get the latest container associated with a logical name."""
    @abc.abstractmethod
    def TaskContainerList(
        self,
        request: modal_proto.task_command_router_pb2.TaskContainerListRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskContainerListResponse:
        """List containers associated with the task."""
    @abc.abstractmethod
    def TaskContainerTerminate(
        self,
        request: modal_proto.task_command_router_pb2.TaskContainerTerminateRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskContainerTerminateResponse:
        """Terminate or release a tracked container."""
    @abc.abstractmethod
    def TaskContainerWait(
        self,
        request: modal_proto.task_command_router_pb2.TaskContainerWaitRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskContainerWaitResponse:
        """Wait for a tracked container to reach a terminal result."""
    @abc.abstractmethod
    def TaskExecPoll(
        self,
        request: modal_proto.task_command_router_pb2.TaskExecPollRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskExecPollResponse:
        """Poll for the exit status of an exec'd command."""
    @abc.abstractmethod
    def TaskExecStart(
        self,
        request: modal_proto.task_command_router_pb2.TaskExecStartRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskExecStartResponse:
        """Execute a command in the task."""
    @abc.abstractmethod
    def TaskExecStdinWrite(
        self,
        request: modal_proto.task_command_router_pb2.TaskExecStdinWriteRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskExecStdinWriteResponse:
        """Write to the stdin stream of an exec'd command."""
    @abc.abstractmethod
    def TaskExecStdioRead(
        self,
        request: modal_proto.task_command_router_pb2.TaskExecStdioReadRequest,
        context: grpc.ServicerContext,
    ) -> collections.abc.Iterator[modal_proto.task_command_router_pb2.TaskExecStdioReadResponse]:
        """Get a stream of output from the stdout or stderr stream of an exec'd command."""
    @abc.abstractmethod
    def TaskExecWait(
        self,
        request: modal_proto.task_command_router_pb2.TaskExecWaitRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskExecWaitResponse:
        """Wait for an exec'd command to exit and return the exit code."""
    @abc.abstractmethod
    def TaskMountDirectory(
        self,
        request: modal_proto.task_command_router_pb2.TaskMountDirectoryRequest,
        context: grpc.ServicerContext,
    ) -> google.protobuf.empty_pb2.Empty:
        """Mount an image at a directory in the container."""
    @abc.abstractmethod
    def TaskSnapshotDirectory(
        self,
        request: modal_proto.task_command_router_pb2.TaskSnapshotDirectoryRequest,
        context: grpc.ServicerContext,
    ) -> modal_proto.task_command_router_pb2.TaskSnapshotDirectoryResponse:
        """Snapshot a directory with a mounted image, including any local changes, into a new image."""
    @abc.abstractmethod
    def TaskUnmountDirectory(
        self,
        request: modal_proto.task_command_router_pb2.TaskUnmountDirectoryRequest,
        context: grpc.ServicerContext,
    ) -> google.protobuf.empty_pb2.Empty:
        """Unmount an image previously mounted at a directory in the container."""

def add_TaskCommandRouterServicer_to_server(servicer: TaskCommandRouterServicer, server: grpc.Server) -> None: ...
