"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""

import builtins
import collections.abc
import sys

import google.protobuf.descriptor
import google.protobuf.duration_pb2
import google.protobuf.internal.containers
import google.protobuf.message
import google.protobuf.timestamp_pb2

import temporalio.api.deployment.v1.message_pb2
import temporalio.api.enums.v1.common_pb2

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

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

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

    CURRENT_POLLERS_FIELD_NUMBER: builtins.int
    LAST_SUCCESSFUL_POLL_TIME_FIELD_NUMBER: builtins.int
    IS_AUTOSCALING_FIELD_NUMBER: builtins.int
    current_pollers: builtins.int
    """Number of polling RPCs that are currently in flight."""
    @property
    def last_successful_poll_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ...
    is_autoscaling: builtins.bool
    """Set true if the number of concurrent pollers is auto-scaled"""
    def __init__(
        self,
        *,
        current_pollers: builtins.int = ...,
        last_successful_poll_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        is_autoscaling: builtins.bool = ...,
    ) -> None: ...
    def HasField(
        self,
        field_name: typing_extensions.Literal[
            "last_successful_poll_time", b"last_successful_poll_time"
        ],
    ) -> builtins.bool: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal[
            "current_pollers",
            b"current_pollers",
            "is_autoscaling",
            b"is_autoscaling",
            "last_successful_poll_time",
            b"last_successful_poll_time",
        ],
    ) -> None: ...

global___WorkerPollerInfo = WorkerPollerInfo

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

    CURRENT_AVAILABLE_SLOTS_FIELD_NUMBER: builtins.int
    CURRENT_USED_SLOTS_FIELD_NUMBER: builtins.int
    SLOT_SUPPLIER_KIND_FIELD_NUMBER: builtins.int
    TOTAL_PROCESSED_TASKS_FIELD_NUMBER: builtins.int
    TOTAL_FAILED_TASKS_FIELD_NUMBER: builtins.int
    LAST_INTERVAL_PROCESSED_TASKS_FIELD_NUMBER: builtins.int
    LAST_INTERVAL_FAILURE_TASKS_FIELD_NUMBER: builtins.int
    current_available_slots: builtins.int
    """Number of slots available for the worker to specific tasks.
    May be -1 if the upper bound is not known.
    """
    current_used_slots: builtins.int
    """Number of slots used by the worker for specific tasks."""
    slot_supplier_kind: builtins.str
    """Kind of the slot supplier, which is used to determine how the slots are allocated.
    Possible values: "Fixed | ResourceBased | Custom String"
    """
    total_processed_tasks: builtins.int
    """Total number of tasks processed (completed both successfully and unsuccesfully, or any other way)
    by the worker since the worker started. This is a cumulative counter.
    """
    total_failed_tasks: builtins.int
    """Total number of failed tasks processed by the worker so far."""
    last_interval_processed_tasks: builtins.int
    """Number of tasks processed in since the last heartbeat from the worker.
    This is a cumulative counter, and it is reset to 0 each time the worker sends a heartbeat.
    Contains both successful and failed tasks.
    """
    last_interval_failure_tasks: builtins.int
    """Number of failed tasks processed since the last heartbeat from the worker."""
    def __init__(
        self,
        *,
        current_available_slots: builtins.int = ...,
        current_used_slots: builtins.int = ...,
        slot_supplier_kind: builtins.str = ...,
        total_processed_tasks: builtins.int = ...,
        total_failed_tasks: builtins.int = ...,
        last_interval_processed_tasks: builtins.int = ...,
        last_interval_failure_tasks: builtins.int = ...,
    ) -> None: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal[
            "current_available_slots",
            b"current_available_slots",
            "current_used_slots",
            b"current_used_slots",
            "last_interval_failure_tasks",
            b"last_interval_failure_tasks",
            "last_interval_processed_tasks",
            b"last_interval_processed_tasks",
            "slot_supplier_kind",
            b"slot_supplier_kind",
            "total_failed_tasks",
            b"total_failed_tasks",
            "total_processed_tasks",
            b"total_processed_tasks",
        ],
    ) -> None: ...

global___WorkerSlotsInfo = WorkerSlotsInfo

class WorkerHostInfo(google.protobuf.message.Message):
    """Holds everything needed to identify the worker host/process context"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    HOST_NAME_FIELD_NUMBER: builtins.int
    PROCESS_KEY_FIELD_NUMBER: builtins.int
    PROCESS_ID_FIELD_NUMBER: builtins.int
    CURRENT_HOST_CPU_USAGE_FIELD_NUMBER: builtins.int
    CURRENT_HOST_MEM_USAGE_FIELD_NUMBER: builtins.int
    host_name: builtins.str
    """Worker host identifier."""
    process_key: builtins.str
    """Worker process identifier. This id should be unique for all _processes_
    running workers in the namespace, and should be shared by all workers
    in the same process.
    This will be used to build the worker command nexus task queue name:
    "temporal-sys/worker-commands/{process_key}"
    """
    process_id: builtins.str
    """Worker process identifier. Unlike process_key, this id only needs to be unique
    within one host (so using e.g. a unix pid would be appropriate).
    """
    current_host_cpu_usage: builtins.float
    """System used CPU as a float in the range [0.0, 1.0] where 1.0 is defined as all
    cores on the host pegged.
    """
    current_host_mem_usage: builtins.float
    """System used memory as a float in the range [0.0, 1.0] where 1.0 is defined as
    all available memory on the host is used.
    """
    def __init__(
        self,
        *,
        host_name: builtins.str = ...,
        process_key: builtins.str = ...,
        process_id: builtins.str = ...,
        current_host_cpu_usage: builtins.float = ...,
        current_host_mem_usage: builtins.float = ...,
    ) -> None: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal[
            "current_host_cpu_usage",
            b"current_host_cpu_usage",
            "current_host_mem_usage",
            b"current_host_mem_usage",
            "host_name",
            b"host_name",
            "process_id",
            b"process_id",
            "process_key",
            b"process_key",
        ],
    ) -> None: ...

global___WorkerHostInfo = WorkerHostInfo

class WorkerHeartbeat(google.protobuf.message.Message):
    """Worker info message, contains information about the worker and its current state.
    All information is provided by the worker itself.
    (-- api-linter: core::0140::prepositions=disabled
        aip.dev/not-precedent: Removing those words make names less clear. --)
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    WORKER_INSTANCE_KEY_FIELD_NUMBER: builtins.int
    WORKER_IDENTITY_FIELD_NUMBER: builtins.int
    HOST_INFO_FIELD_NUMBER: builtins.int
    TASK_QUEUE_FIELD_NUMBER: builtins.int
    DEPLOYMENT_VERSION_FIELD_NUMBER: builtins.int
    SDK_NAME_FIELD_NUMBER: builtins.int
    SDK_VERSION_FIELD_NUMBER: builtins.int
    STATUS_FIELD_NUMBER: builtins.int
    START_TIME_FIELD_NUMBER: builtins.int
    HEARTBEAT_TIME_FIELD_NUMBER: builtins.int
    ELAPSED_SINCE_LAST_HEARTBEAT_FIELD_NUMBER: builtins.int
    WORKFLOW_TASK_SLOTS_INFO_FIELD_NUMBER: builtins.int
    ACTIVITY_TASK_SLOTS_INFO_FIELD_NUMBER: builtins.int
    NEXUS_TASK_SLOTS_INFO_FIELD_NUMBER: builtins.int
    LOCAL_ACTIVITY_SLOTS_INFO_FIELD_NUMBER: builtins.int
    WORKFLOW_POLLER_INFO_FIELD_NUMBER: builtins.int
    WORKFLOW_STICKY_POLLER_INFO_FIELD_NUMBER: builtins.int
    ACTIVITY_POLLER_INFO_FIELD_NUMBER: builtins.int
    NEXUS_POLLER_INFO_FIELD_NUMBER: builtins.int
    TOTAL_STICKY_CACHE_HIT_FIELD_NUMBER: builtins.int
    TOTAL_STICKY_CACHE_MISS_FIELD_NUMBER: builtins.int
    CURRENT_STICKY_CACHE_SIZE_FIELD_NUMBER: builtins.int
    PLUGINS_FIELD_NUMBER: builtins.int
    worker_instance_key: builtins.str
    """Worker identifier, should be unique for the namespace.
    It is distinct from worker identity, which is not necessarily namespace-unique.
    """
    worker_identity: builtins.str
    """Worker identity, set by the client, may not be unique.
    Usually host_name+(user group name)+process_id, but can be overwritten by the user.
    """
    @property
    def host_info(self) -> global___WorkerHostInfo:
        """Worker host information."""
    task_queue: builtins.str
    """Task queue this worker is polling for tasks."""
    @property
    def deployment_version(
        self,
    ) -> temporalio.api.deployment.v1.message_pb2.WorkerDeploymentVersion: ...
    sdk_name: builtins.str
    sdk_version: builtins.str
    status: temporalio.api.enums.v1.common_pb2.WorkerStatus.ValueType
    """Worker status. Defined by SDK."""
    @property
    def start_time(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """Worker start time.
        It can be used to determine worker uptime. (current time - start time)
        """
    @property
    def heartbeat_time(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """Timestamp of this heartbeat, coming from the worker. Worker should set it to "now".
        Note that this timestamp comes directly from the worker and is subject to workers' clock skew.
        """
    @property
    def elapsed_since_last_heartbeat(self) -> google.protobuf.duration_pb2.Duration:
        """Elapsed time since the last heartbeat from the worker."""
    @property
    def workflow_task_slots_info(self) -> global___WorkerSlotsInfo: ...
    @property
    def activity_task_slots_info(self) -> global___WorkerSlotsInfo: ...
    @property
    def nexus_task_slots_info(self) -> global___WorkerSlotsInfo: ...
    @property
    def local_activity_slots_info(self) -> global___WorkerSlotsInfo: ...
    @property
    def workflow_poller_info(self) -> global___WorkerPollerInfo: ...
    @property
    def workflow_sticky_poller_info(self) -> global___WorkerPollerInfo: ...
    @property
    def activity_poller_info(self) -> global___WorkerPollerInfo: ...
    @property
    def nexus_poller_info(self) -> global___WorkerPollerInfo: ...
    total_sticky_cache_hit: builtins.int
    """A Workflow Task found a cached Workflow Execution to run against."""
    total_sticky_cache_miss: builtins.int
    """A Workflow Task did not find a cached Workflow execution to run against."""
    current_sticky_cache_size: builtins.int
    """Current cache size, expressed in number of Workflow Executions."""
    @property
    def plugins(
        self,
    ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
        global___PluginInfo
    ]:
        """Plugins currently in use by this SDK."""
    def __init__(
        self,
        *,
        worker_instance_key: builtins.str = ...,
        worker_identity: builtins.str = ...,
        host_info: global___WorkerHostInfo | None = ...,
        task_queue: builtins.str = ...,
        deployment_version: temporalio.api.deployment.v1.message_pb2.WorkerDeploymentVersion
        | None = ...,
        sdk_name: builtins.str = ...,
        sdk_version: builtins.str = ...,
        status: temporalio.api.enums.v1.common_pb2.WorkerStatus.ValueType = ...,
        start_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        heartbeat_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        elapsed_since_last_heartbeat: google.protobuf.duration_pb2.Duration
        | None = ...,
        workflow_task_slots_info: global___WorkerSlotsInfo | None = ...,
        activity_task_slots_info: global___WorkerSlotsInfo | None = ...,
        nexus_task_slots_info: global___WorkerSlotsInfo | None = ...,
        local_activity_slots_info: global___WorkerSlotsInfo | None = ...,
        workflow_poller_info: global___WorkerPollerInfo | None = ...,
        workflow_sticky_poller_info: global___WorkerPollerInfo | None = ...,
        activity_poller_info: global___WorkerPollerInfo | None = ...,
        nexus_poller_info: global___WorkerPollerInfo | None = ...,
        total_sticky_cache_hit: builtins.int = ...,
        total_sticky_cache_miss: builtins.int = ...,
        current_sticky_cache_size: builtins.int = ...,
        plugins: collections.abc.Iterable[global___PluginInfo] | None = ...,
    ) -> None: ...
    def HasField(
        self,
        field_name: typing_extensions.Literal[
            "activity_poller_info",
            b"activity_poller_info",
            "activity_task_slots_info",
            b"activity_task_slots_info",
            "deployment_version",
            b"deployment_version",
            "elapsed_since_last_heartbeat",
            b"elapsed_since_last_heartbeat",
            "heartbeat_time",
            b"heartbeat_time",
            "host_info",
            b"host_info",
            "local_activity_slots_info",
            b"local_activity_slots_info",
            "nexus_poller_info",
            b"nexus_poller_info",
            "nexus_task_slots_info",
            b"nexus_task_slots_info",
            "start_time",
            b"start_time",
            "workflow_poller_info",
            b"workflow_poller_info",
            "workflow_sticky_poller_info",
            b"workflow_sticky_poller_info",
            "workflow_task_slots_info",
            b"workflow_task_slots_info",
        ],
    ) -> builtins.bool: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal[
            "activity_poller_info",
            b"activity_poller_info",
            "activity_task_slots_info",
            b"activity_task_slots_info",
            "current_sticky_cache_size",
            b"current_sticky_cache_size",
            "deployment_version",
            b"deployment_version",
            "elapsed_since_last_heartbeat",
            b"elapsed_since_last_heartbeat",
            "heartbeat_time",
            b"heartbeat_time",
            "host_info",
            b"host_info",
            "local_activity_slots_info",
            b"local_activity_slots_info",
            "nexus_poller_info",
            b"nexus_poller_info",
            "nexus_task_slots_info",
            b"nexus_task_slots_info",
            "plugins",
            b"plugins",
            "sdk_name",
            b"sdk_name",
            "sdk_version",
            b"sdk_version",
            "start_time",
            b"start_time",
            "status",
            b"status",
            "task_queue",
            b"task_queue",
            "total_sticky_cache_hit",
            b"total_sticky_cache_hit",
            "total_sticky_cache_miss",
            b"total_sticky_cache_miss",
            "worker_identity",
            b"worker_identity",
            "worker_instance_key",
            b"worker_instance_key",
            "workflow_poller_info",
            b"workflow_poller_info",
            "workflow_sticky_poller_info",
            b"workflow_sticky_poller_info",
            "workflow_task_slots_info",
            b"workflow_task_slots_info",
        ],
    ) -> None: ...

global___WorkerHeartbeat = WorkerHeartbeat

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

    WORKER_HEARTBEAT_FIELD_NUMBER: builtins.int
    @property
    def worker_heartbeat(self) -> global___WorkerHeartbeat: ...
    def __init__(
        self,
        *,
        worker_heartbeat: global___WorkerHeartbeat | None = ...,
    ) -> None: ...
    def HasField(
        self,
        field_name: typing_extensions.Literal["worker_heartbeat", b"worker_heartbeat"],
    ) -> builtins.bool: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal["worker_heartbeat", b"worker_heartbeat"],
    ) -> None: ...

global___WorkerInfo = WorkerInfo

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

    NAME_FIELD_NUMBER: builtins.int
    VERSION_FIELD_NUMBER: builtins.int
    name: builtins.str
    """The name of the plugin, required."""
    version: builtins.str
    """The version of the plugin, may be empty."""
    def __init__(
        self,
        *,
        name: builtins.str = ...,
        version: builtins.str = ...,
    ) -> None: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal["name", b"name", "version", b"version"],
    ) -> None: ...

global___PluginInfo = PluginInfo
