"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""
import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import modal_proto.api_pb2
import sys
import typing

if sys.version_info >= (3, 10):
    import typing as typing_extensions
else:
    import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _TaskExecStderrConfig:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _TaskExecStderrConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStderrConfig.ValueType], builtins.type):  # noqa: F821
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    TASK_EXEC_STDERR_CONFIG_DEVNULL: _TaskExecStderrConfig.ValueType  # 0
    """The output will be discarded."""
    TASK_EXEC_STDERR_CONFIG_PIPE: _TaskExecStderrConfig.ValueType  # 1
    """The output will be streamed to the client."""
    TASK_EXEC_STDERR_CONFIG_STDOUT: _TaskExecStderrConfig.ValueType  # 2
    """A special value that can be used to indicate that the stderr stream should
    be merged with the stdout stream.
    """

class TaskExecStderrConfig(_TaskExecStderrConfig, metaclass=_TaskExecStderrConfigEnumTypeWrapper): ...

TASK_EXEC_STDERR_CONFIG_DEVNULL: TaskExecStderrConfig.ValueType  # 0
"""The output will be discarded."""
TASK_EXEC_STDERR_CONFIG_PIPE: TaskExecStderrConfig.ValueType  # 1
"""The output will be streamed to the client."""
TASK_EXEC_STDERR_CONFIG_STDOUT: TaskExecStderrConfig.ValueType  # 2
"""A special value that can be used to indicate that the stderr stream should
be merged with the stdout stream.
"""
global___TaskExecStderrConfig = TaskExecStderrConfig

class _TaskExecStdioFileDescriptor:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _TaskExecStdioFileDescriptorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStdioFileDescriptor.ValueType], builtins.type):  # noqa: F821
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: _TaskExecStdioFileDescriptor.ValueType  # 0
    """Read from stdout."""
    TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: _TaskExecStdioFileDescriptor.ValueType  # 1
    """Read from stderr."""

class TaskExecStdioFileDescriptor(_TaskExecStdioFileDescriptor, metaclass=_TaskExecStdioFileDescriptorEnumTypeWrapper): ...

TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: TaskExecStdioFileDescriptor.ValueType  # 0
"""Read from stdout."""
TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: TaskExecStdioFileDescriptor.ValueType  # 1
"""Read from stderr."""
global___TaskExecStdioFileDescriptor = TaskExecStdioFileDescriptor

class _TaskExecStdoutConfig:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _TaskExecStdoutConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStdoutConfig.ValueType], builtins.type):  # noqa: F821
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    TASK_EXEC_STDOUT_CONFIG_DEVNULL: _TaskExecStdoutConfig.ValueType  # 0
    """The output will be discarded."""
    TASK_EXEC_STDOUT_CONFIG_PIPE: _TaskExecStdoutConfig.ValueType  # 1
    """The output will be streamed to the client."""

class TaskExecStdoutConfig(_TaskExecStdoutConfig, metaclass=_TaskExecStdoutConfigEnumTypeWrapper): ...

TASK_EXEC_STDOUT_CONFIG_DEVNULL: TaskExecStdoutConfig.ValueType  # 0
"""The output will be discarded."""
TASK_EXEC_STDOUT_CONFIG_PIPE: TaskExecStdoutConfig.ValueType  # 1
"""The output will be streamed to the client."""
global___TaskExecStdoutConfig = TaskExecStdoutConfig

class TaskExecPollRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TASK_ID_FIELD_NUMBER: builtins.int
    EXEC_ID_FIELD_NUMBER: builtins.int
    task_id: builtins.str
    """The ID of the task running the exec'd command."""
    exec_id: builtins.str
    """The execution ID of the command to wait on."""
    def __init__(
        self,
        *,
        task_id: builtins.str = ...,
        exec_id: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "task_id", b"task_id"]) -> None: ...

global___TaskExecPollRequest = TaskExecPollRequest

class TaskExecPollResponse(google.protobuf.message.Message):
    """The response to a TaskExecPollRequest. If the exec'd command has not
    completed, exit_status will be unset.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    CODE_FIELD_NUMBER: builtins.int
    SIGNAL_FIELD_NUMBER: builtins.int
    code: builtins.int
    """The exit code of the command."""
    signal: builtins.int
    """The signal that terminated the command."""
    def __init__(
        self,
        *,
        code: builtins.int = ...,
        signal: builtins.int = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> None: ...
    def WhichOneof(self, oneof_group: typing_extensions.Literal["exit_status", b"exit_status"]) -> typing_extensions.Literal["code", "signal"] | None: ...

global___TaskExecPollResponse = TaskExecPollResponse

class TaskExecStartRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TASK_ID_FIELD_NUMBER: builtins.int
    EXEC_ID_FIELD_NUMBER: builtins.int
    COMMAND_ARGS_FIELD_NUMBER: builtins.int
    STDOUT_CONFIG_FIELD_NUMBER: builtins.int
    STDERR_CONFIG_FIELD_NUMBER: builtins.int
    TIMEOUT_SECS_FIELD_NUMBER: builtins.int
    WORKDIR_FIELD_NUMBER: builtins.int
    SECRET_IDS_FIELD_NUMBER: builtins.int
    PTY_INFO_FIELD_NUMBER: builtins.int
    RUNTIME_DEBUG_FIELD_NUMBER: builtins.int
    task_id: builtins.str
    """The ID of the task to execute the command in."""
    exec_id: builtins.str
    """Execution ID. This ID will be used to identify the execution for other
    requests and ensure exec commands are idempotent.
    """
    @property
    def command_args(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Command arguments to execute."""
    stdout_config: global___TaskExecStdoutConfig.ValueType
    """Configures how the stdout of the command will be handled."""
    stderr_config: global___TaskExecStderrConfig.ValueType
    """Configures how the stderr of the command will be handled."""
    timeout_secs: builtins.int
    """Timeout in seconds for the exec'd command to exit. If the command does not
    exit within this duration, the command will be killed. This is NOT the
    timeout for the ExecStartRequest RPC to complete.
    """
    workdir: builtins.str
    """Working directory for the command."""
    @property
    def secret_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Secret IDs to mount into the task."""
    @property
    def pty_info(self) -> modal_proto.api_pb2.PTYInfo:
        """PTY info for the command."""
    runtime_debug: builtins.bool
    """Enable debugging capabilities on the container runtime. Used only for
    internal debugging.
    """
    def __init__(
        self,
        *,
        task_id: builtins.str = ...,
        exec_id: builtins.str = ...,
        command_args: collections.abc.Iterable[builtins.str] | None = ...,
        stdout_config: global___TaskExecStdoutConfig.ValueType = ...,
        stderr_config: global___TaskExecStderrConfig.ValueType = ...,
        timeout_secs: builtins.int | None = ...,
        workdir: builtins.str | None = ...,
        secret_ids: collections.abc.Iterable[builtins.str] | None = ...,
        pty_info: modal_proto.api_pb2.PTYInfo | None = ...,
        runtime_debug: builtins.bool = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["_pty_info", b"_pty_info", "_timeout_secs", b"_timeout_secs", "_workdir", b"_workdir", "pty_info", b"pty_info", "timeout_secs", b"timeout_secs", "workdir", b"workdir"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["_pty_info", b"_pty_info", "_timeout_secs", b"_timeout_secs", "_workdir", b"_workdir", "command_args", b"command_args", "exec_id", b"exec_id", "pty_info", b"pty_info", "runtime_debug", b"runtime_debug", "secret_ids", b"secret_ids", "stderr_config", b"stderr_config", "stdout_config", b"stdout_config", "task_id", b"task_id", "timeout_secs", b"timeout_secs", "workdir", b"workdir"]) -> None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing_extensions.Literal["_pty_info", b"_pty_info"]) -> typing_extensions.Literal["pty_info"] | None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing_extensions.Literal["_timeout_secs", b"_timeout_secs"]) -> typing_extensions.Literal["timeout_secs"] | None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing_extensions.Literal["_workdir", b"_workdir"]) -> typing_extensions.Literal["workdir"] | None: ...

global___TaskExecStartRequest = TaskExecStartRequest

class TaskExecStartResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    def __init__(
        self,
    ) -> None: ...

global___TaskExecStartResponse = TaskExecStartResponse

class TaskExecStdinWriteRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TASK_ID_FIELD_NUMBER: builtins.int
    EXEC_ID_FIELD_NUMBER: builtins.int
    OFFSET_FIELD_NUMBER: builtins.int
    DATA_FIELD_NUMBER: builtins.int
    EOF_FIELD_NUMBER: builtins.int
    task_id: builtins.str
    """The ID of the task running the exec'd command."""
    exec_id: builtins.str
    """The execution ID of the command to write to."""
    offset: builtins.int
    """The offset to start writing to. This is used to resume writing from the
    last write position if the connection is closed and reopened.
    """
    data: builtins.bytes
    eof: builtins.bool
    """If true, close the stdin stream after writing any provided data.
    This signals EOF to the exec'd process.
    """
    def __init__(
        self,
        *,
        task_id: builtins.str = ...,
        exec_id: builtins.str = ...,
        offset: builtins.int = ...,
        data: builtins.bytes = ...,
        eof: builtins.bool = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "eof", b"eof", "exec_id", b"exec_id", "offset", b"offset", "task_id", b"task_id"]) -> None: ...

global___TaskExecStdinWriteRequest = TaskExecStdinWriteRequest

class TaskExecStdinWriteResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    def __init__(
        self,
    ) -> None: ...

global___TaskExecStdinWriteResponse = TaskExecStdinWriteResponse

class TaskExecStdioReadRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TASK_ID_FIELD_NUMBER: builtins.int
    EXEC_ID_FIELD_NUMBER: builtins.int
    OFFSET_FIELD_NUMBER: builtins.int
    FILE_DESCRIPTOR_FIELD_NUMBER: builtins.int
    task_id: builtins.str
    """The ID of the task running the exec'd command."""
    exec_id: builtins.str
    """The execution ID of the command to read from."""
    offset: builtins.int
    """The offset to start reading from. This is used to resume reading from the
    last read position if the connection is closed and reopened.
    """
    file_descriptor: global___TaskExecStdioFileDescriptor.ValueType
    """Which file descriptor to read from."""
    def __init__(
        self,
        *,
        task_id: builtins.str = ...,
        exec_id: builtins.str = ...,
        offset: builtins.int = ...,
        file_descriptor: global___TaskExecStdioFileDescriptor.ValueType = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "file_descriptor", b"file_descriptor", "offset", b"offset", "task_id", b"task_id"]) -> None: ...

global___TaskExecStdioReadRequest = TaskExecStdioReadRequest

class TaskExecStdioReadResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    DATA_FIELD_NUMBER: builtins.int
    data: builtins.bytes
    """The data read from the file descriptor."""
    def __init__(
        self,
        *,
        data: builtins.bytes = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["data", b"data"]) -> None: ...

global___TaskExecStdioReadResponse = TaskExecStdioReadResponse

class TaskExecWaitRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TASK_ID_FIELD_NUMBER: builtins.int
    EXEC_ID_FIELD_NUMBER: builtins.int
    task_id: builtins.str
    """The ID of the task running the exec'd command."""
    exec_id: builtins.str
    """The execution ID of the command to wait on."""
    def __init__(
        self,
        *,
        task_id: builtins.str = ...,
        exec_id: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "task_id", b"task_id"]) -> None: ...

global___TaskExecWaitRequest = TaskExecWaitRequest

class TaskExecWaitResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    CODE_FIELD_NUMBER: builtins.int
    SIGNAL_FIELD_NUMBER: builtins.int
    code: builtins.int
    """The exit code of the command."""
    signal: builtins.int
    """The signal that terminated the command."""
    def __init__(
        self,
        *,
        code: builtins.int = ...,
        signal: builtins.int = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> None: ...
    def WhichOneof(self, oneof_group: typing_extensions.Literal["exit_status", b"exit_status"]) -> typing_extensions.Literal["code", "signal"] | None: ...

global___TaskExecWaitResponse = TaskExecWaitResponse

class TaskMountDirectoryRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TASK_ID_FIELD_NUMBER: builtins.int
    PATH_FIELD_NUMBER: builtins.int
    IMAGE_ID_FIELD_NUMBER: builtins.int
    task_id: builtins.str
    path: builtins.bytes
    image_id: builtins.str
    def __init__(
        self,
        *,
        task_id: builtins.str = ...,
        path: builtins.bytes = ...,
        image_id: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["image_id", b"image_id", "path", b"path", "task_id", b"task_id"]) -> None: ...

global___TaskMountDirectoryRequest = TaskMountDirectoryRequest

class TaskSnapshotDirectoryRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TASK_ID_FIELD_NUMBER: builtins.int
    PATH_FIELD_NUMBER: builtins.int
    task_id: builtins.str
    path: builtins.bytes
    def __init__(
        self,
        *,
        task_id: builtins.str = ...,
        path: builtins.bytes = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["path", b"path", "task_id", b"task_id"]) -> None: ...

global___TaskSnapshotDirectoryRequest = TaskSnapshotDirectoryRequest

class TaskSnapshotDirectoryResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    IMAGE_ID_FIELD_NUMBER: builtins.int
    image_id: builtins.str
    def __init__(
        self,
        *,
        image_id: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["image_id", b"image_id"]) -> None: ...

global___TaskSnapshotDirectoryResponse = TaskSnapshotDirectoryResponse
