from google.protobuf import empty_pb2 as _empty_pb2
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union

DESCRIPTOR: _descriptor.FileDescriptor
INVALID: StatusCode
NOT_FOUND: StatusCode
OK: StatusCode
UNAUTHORIZED: StatusCode
UNKNOWN: StatusCode

class AllocNewWorkerReq(_message.Message):
    __slots__ = ["workspace_id"]
    WORKSPACE_ID_FIELD_NUMBER: _ClassVar[int]
    workspace_id: str
    def __init__(self, workspace_id: _Optional[str] = ...) -> None: ...

class Delta(_message.Message):
    __slots__ = ["add_dir", "add_path", "remove_path"]
    ADD_DIR_FIELD_NUMBER: _ClassVar[int]
    ADD_PATH_FIELD_NUMBER: _ClassVar[int]
    REMOVE_PATH_FIELD_NUMBER: _ClassVar[int]
    add_dir: _containers.RepeatedScalarFieldContainer[str]
    add_path: _containers.RepeatedScalarFieldContainer[str]
    remove_path: _containers.RepeatedScalarFieldContainer[str]
    def __init__(self, add_path: _Optional[_Iterable[str]] = ..., add_dir: _Optional[_Iterable[str]] = ..., remove_path: _Optional[_Iterable[str]] = ...) -> None: ...

class Environment(_message.Message):
    __slots__ = ["alloc", "python"]
    ALLOC_FIELD_NUMBER: _ClassVar[int]
    PYTHON_FIELD_NUMBER: _ClassVar[int]
    alloc: Remote
    python: Python
    def __init__(self, alloc: _Optional[_Union[Remote, _Mapping]] = ..., python: _Optional[_Union[Python, _Mapping]] = ...) -> None: ...

class ExecRequest(_message.Message):
    __slots__ = ["argv", "rsync_source", "workspace_id"]
    ARGV_FIELD_NUMBER: _ClassVar[int]
    RSYNC_SOURCE_FIELD_NUMBER: _ClassVar[int]
    WORKSPACE_ID_FIELD_NUMBER: _ClassVar[int]
    argv: _containers.RepeatedScalarFieldContainer[str]
    rsync_source: RsyncSource
    workspace_id: str
    def __init__(self, workspace_id: _Optional[str] = ..., argv: _Optional[_Iterable[str]] = ..., rsync_source: _Optional[_Union[RsyncSource, _Mapping]] = ...) -> None: ...

class ExecResponse(_message.Message):
    __slots__ = ["execution_id", "output_files", "result", "stderr", "stdout"]
    EXECUTION_ID_FIELD_NUMBER: _ClassVar[int]
    OUTPUT_FILES_FIELD_NUMBER: _ClassVar[int]
    RESULT_FIELD_NUMBER: _ClassVar[int]
    STDERR_FIELD_NUMBER: _ClassVar[int]
    STDOUT_FIELD_NUMBER: _ClassVar[int]
    execution_id: str
    output_files: _containers.RepeatedScalarFieldContainer[str]
    result: Result
    stderr: bytes
    stdout: bytes
    def __init__(self, result: _Optional[_Union[Result, _Mapping]] = ..., execution_id: _Optional[str] = ..., stdout: _Optional[bytes] = ..., stderr: _Optional[bytes] = ..., output_files: _Optional[_Iterable[str]] = ...) -> None: ...

class GetUserResponse(_message.Message):
    __slots__ = ["result", "username"]
    RESULT_FIELD_NUMBER: _ClassVar[int]
    USERNAME_FIELD_NUMBER: _ClassVar[int]
    result: Result
    username: str
    def __init__(self, result: _Optional[_Union[Result, _Mapping]] = ..., username: _Optional[str] = ...) -> None: ...

class InitRequest(_message.Message):
    __slots__ = ["project_name", "rsync_source", "target_env"]
    PROJECT_NAME_FIELD_NUMBER: _ClassVar[int]
    RSYNC_SOURCE_FIELD_NUMBER: _ClassVar[int]
    TARGET_ENV_FIELD_NUMBER: _ClassVar[int]
    project_name: str
    rsync_source: RsyncSource
    target_env: Environment
    def __init__(self, project_name: _Optional[str] = ..., rsync_source: _Optional[_Union[RsyncSource, _Mapping]] = ..., target_env: _Optional[_Union[Environment, _Mapping]] = ...) -> None: ...

class InitResponse(_message.Message):
    __slots__ = ["result", "rsync_dest", "worker_addr", "workspace_id"]
    RESULT_FIELD_NUMBER: _ClassVar[int]
    RSYNC_DEST_FIELD_NUMBER: _ClassVar[int]
    WORKER_ADDR_FIELD_NUMBER: _ClassVar[int]
    WORKSPACE_ID_FIELD_NUMBER: _ClassVar[int]
    result: Result
    rsync_dest: RsyncDestination
    worker_addr: str
    workspace_id: str
    def __init__(self, result: _Optional[_Union[Result, _Mapping]] = ..., rsync_dest: _Optional[_Union[RsyncDestination, _Mapping]] = ..., worker_addr: _Optional[str] = ..., workspace_id: _Optional[str] = ...) -> None: ...

class InstallDepsRequest(_message.Message):
    __slots__ = ["workspace_id"]
    WORKSPACE_ID_FIELD_NUMBER: _ClassVar[int]
    workspace_id: str
    def __init__(self, workspace_id: _Optional[str] = ...) -> None: ...

class InstallDepsResponse(_message.Message):
    __slots__ = ["result", "stdout"]
    RESULT_FIELD_NUMBER: _ClassVar[int]
    STDOUT_FIELD_NUMBER: _ClassVar[int]
    result: Result
    stdout: bytes
    def __init__(self, result: _Optional[_Union[Result, _Mapping]] = ..., stdout: _Optional[bytes] = ...) -> None: ...

class KillRequest(_message.Message):
    __slots__ = ["execution_id", "workspace_id"]
    EXECUTION_ID_FIELD_NUMBER: _ClassVar[int]
    WORKSPACE_ID_FIELD_NUMBER: _ClassVar[int]
    execution_id: str
    workspace_id: str
    def __init__(self, workspace_id: _Optional[str] = ..., execution_id: _Optional[str] = ...) -> None: ...

class Python(_message.Message):
    __slots__ = []
    def __init__(self) -> None: ...

class Remote(_message.Message):
    __slots__ = ["hardware", "image"]
    class Hardware(_message.Message):
        __slots__ = ["processor"]
        PROCESSOR_FIELD_NUMBER: _ClassVar[int]
        processor: str
        def __init__(self, processor: _Optional[str] = ...) -> None: ...
    class Image(_message.Message):
        __slots__ = ["docker", "tag"]
        DOCKER_FIELD_NUMBER: _ClassVar[int]
        TAG_FIELD_NUMBER: _ClassVar[int]
        docker: str
        tag: str
        def __init__(self, docker: _Optional[str] = ..., tag: _Optional[str] = ...) -> None: ...
    HARDWARE_FIELD_NUMBER: _ClassVar[int]
    IMAGE_FIELD_NUMBER: _ClassVar[int]
    hardware: Remote.Hardware
    image: Remote.Image
    def __init__(self, image: _Optional[_Union[Remote.Image, _Mapping]] = ..., hardware: _Optional[_Union[Remote.Hardware, _Mapping]] = ...) -> None: ...

class Result(_message.Message):
    __slots__ = ["code", "message"]
    CODE_FIELD_NUMBER: _ClassVar[int]
    MESSAGE_FIELD_NUMBER: _ClassVar[int]
    code: StatusCode
    message: str
    def __init__(self, code: _Optional[_Union[StatusCode, str]] = ..., message: _Optional[str] = ...) -> None: ...

class RsyncDestination(_message.Message):
    __slots__ = ["daemon_module"]
    DAEMON_MODULE_FIELD_NUMBER: _ClassVar[int]
    daemon_module: str
    def __init__(self, daemon_module: _Optional[str] = ...) -> None: ...

class RsyncSource(_message.Message):
    __slots__ = ["directory", "machine_id", "public_key"]
    DIRECTORY_FIELD_NUMBER: _ClassVar[int]
    MACHINE_ID_FIELD_NUMBER: _ClassVar[int]
    PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int]
    directory: str
    machine_id: int
    public_key: bytes
    def __init__(self, machine_id: _Optional[int] = ..., directory: _Optional[str] = ..., public_key: _Optional[bytes] = ...) -> None: ...

class SetUsernameRequest(_message.Message):
    __slots__ = ["username"]
    USERNAME_FIELD_NUMBER: _ClassVar[int]
    username: str
    def __init__(self, username: _Optional[str] = ...) -> None: ...

class SetUsernameResponse(_message.Message):
    __slots__ = ["result"]
    RESULT_FIELD_NUMBER: _ClassVar[int]
    result: Result
    def __init__(self, result: _Optional[_Union[Result, _Mapping]] = ...) -> None: ...

class StatusCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
    __slots__ = []
