"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""
import builtins
import collections.abc
from isolate.connections.grpc.definitions import common_pb2
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
from isolate.server.definitions import server_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

@typing_extensions.final
class HostedRun(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    ENVIRONMENTS_FIELD_NUMBER: builtins.int
    MACHINE_REQUIREMENTS_FIELD_NUMBER: builtins.int
    FUNCTION_FIELD_NUMBER: builtins.int
    @property
    def environments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[server_pb2.EnvironmentDefinition]:
        """Environment definitions."""
    @property
    def machine_requirements(self) -> global___MachineRequirements:
        """Machine requirements"""
    @property
    def function(self) -> common_pb2.SerializedObject:
        """Function to run."""
    def __init__(
        self,
        *,
        environments: collections.abc.Iterable[server_pb2.EnvironmentDefinition] | None = ...,
        machine_requirements: global___MachineRequirements | None = ...,
        function: common_pb2.SerializedObject | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["_machine_requirements", b"_machine_requirements", "function", b"function", "machine_requirements", b"machine_requirements"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["_machine_requirements", b"_machine_requirements", "environments", b"environments", "function", b"function", "machine_requirements", b"machine_requirements"]) -> None: ...
    def WhichOneof(self, oneof_group: typing_extensions.Literal["_machine_requirements", b"_machine_requirements"]) -> typing_extensions.Literal["machine_requirements"] | None: ...

global___HostedRun = HostedRun

@typing_extensions.final
class HostedRunCron(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    ENVIRONMENTS_FIELD_NUMBER: builtins.int
    MACHINE_REQUIREMENTS_FIELD_NUMBER: builtins.int
    FUNCTION_FIELD_NUMBER: builtins.int
    CRON_FIELD_NUMBER: builtins.int
    @property
    def environments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[server_pb2.EnvironmentDefinition]:
        """Environment definitions."""
    @property
    def machine_requirements(self) -> global___MachineRequirements:
        """Machine requirements"""
    @property
    def function(self) -> common_pb2.SerializedObject:
        """Function to run."""
    cron: builtins.str
    """cron string to represent the run schedule"""
    def __init__(
        self,
        *,
        environments: collections.abc.Iterable[server_pb2.EnvironmentDefinition] | None = ...,
        machine_requirements: global___MachineRequirements | None = ...,
        function: common_pb2.SerializedObject | None = ...,
        cron: builtins.str = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["_machine_requirements", b"_machine_requirements", "function", b"function", "machine_requirements", b"machine_requirements"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["_machine_requirements", b"_machine_requirements", "cron", b"cron", "environments", b"environments", "function", b"function", "machine_requirements", b"machine_requirements"]) -> None: ...
    def WhichOneof(self, oneof_group: typing_extensions.Literal["_machine_requirements", b"_machine_requirements"]) -> typing_extensions.Literal["machine_requirements"] | None: ...

global___HostedRunCron = HostedRunCron

@typing_extensions.final
class HostedRunResult(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    RUN_ID_FIELD_NUMBER: builtins.int
    STATUS_FIELD_NUMBER: builtins.int
    LOGS_FIELD_NUMBER: builtins.int
    RETURN_VALUE_FIELD_NUMBER: builtins.int
    run_id: builtins.str
    """Unique run id / token."""
    @property
    def status(self) -> global___HostedRunStatus:
        """Optionally the status of the current run (in terms of
        fal cloud).
        """
    @property
    def logs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[common_pb2.Log]:
        """The most recent logs from the run."""
    @property
    def return_value(self) -> common_pb2.SerializedObject:
        """The result of the run, if it is complete (indicated by
        status.is_complete).
        """
    def __init__(
        self,
        *,
        run_id: builtins.str = ...,
        status: global___HostedRunStatus | None = ...,
        logs: collections.abc.Iterable[common_pb2.Log] | None = ...,
        return_value: common_pb2.SerializedObject | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["_return_value", b"_return_value", "_status", b"_status", "return_value", b"return_value", "status", b"status"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["_return_value", b"_return_value", "_status", b"_status", "logs", b"logs", "return_value", b"return_value", "run_id", b"run_id", "status", b"status"]) -> None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing_extensions.Literal["_return_value", b"_return_value"]) -> typing_extensions.Literal["return_value"] | None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing_extensions.Literal["_status", b"_status"]) -> typing_extensions.Literal["status"] | None: ...

global___HostedRunResult = HostedRunResult

@typing_extensions.final
class HostedRunStatus(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

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

    class _StateEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[HostedRunStatus._State.ValueType], builtins.type):  # noqa: F821
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        IN_PROGRESS: HostedRunStatus._State.ValueType  # 0
        """The run is in progress."""
        SUCCESS: HostedRunStatus._State.ValueType  # 1
        """The run has completed successfully."""
        INTERNAL_FAILURE: HostedRunStatus._State.ValueType  # 2
        """The run has failed because of isolate.
        TODO: probably QUEUED, etc.
        """

    class State(_State, metaclass=_StateEnumTypeWrapper): ...
    IN_PROGRESS: HostedRunStatus.State.ValueType  # 0
    """The run is in progress."""
    SUCCESS: HostedRunStatus.State.ValueType  # 1
    """The run has completed successfully."""
    INTERNAL_FAILURE: HostedRunStatus.State.ValueType  # 2
    """The run has failed because of isolate.
    TODO: probably QUEUED, etc.
    """

    STATE_FIELD_NUMBER: builtins.int
    state: global___HostedRunStatus.State.ValueType
    """The state of the run."""
    def __init__(
        self,
        *,
        state: global___HostedRunStatus.State.ValueType = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["state", b"state"]) -> None: ...

global___HostedRunStatus = HostedRunStatus

@typing_extensions.final
class MachineRequirements(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    MACHINE_TYPE_FIELD_NUMBER: builtins.int
    machine_type: builtins.str
    """Machine type. It is not an enum because we want to be able
    to dynamically add new machine types without regenerating
    both the client and the server. Validation is done at the
    server side.
    """
    def __init__(
        self,
        *,
        machine_type: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["machine_type", b"machine_type"]) -> None: ...

global___MachineRequirements = MachineRequirements
