# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: temporal/api/taskqueue/v1/message.proto
# plugin: python-betterproto
from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import Optional

import betterproto

from temporal.api.enums import v1 as v1enums


@dataclass
class TaskQueue(betterproto.Message):
    name: str = betterproto.string_field(1)
    # Default: TASK_QUEUE_KIND_NORMAL.
    kind: v1enums.TaskQueueKind = betterproto.enum_field(2)


@dataclass
class TaskQueueMetadata(betterproto.Message):
    max_tasks_per_second: Optional[float] = betterproto.message_field(
        1, wraps=betterproto.TYPE_DOUBLE
    )


@dataclass
class TaskQueueStatus(betterproto.Message):
    backlog_count_hint: int = betterproto.int64_field(1)
    read_level: int = betterproto.int64_field(2)
    ack_level: int = betterproto.int64_field(3)
    rate_per_second: float = betterproto.double_field(4)
    task_id_block: "TaskIdBlock" = betterproto.message_field(5)


@dataclass
class TaskIdBlock(betterproto.Message):
    start_id: int = betterproto.int64_field(1)
    end_id: int = betterproto.int64_field(2)


@dataclass
class TaskQueuePartitionMetadata(betterproto.Message):
    key: str = betterproto.string_field(1)
    owner_host_name: str = betterproto.string_field(2)


@dataclass
class PollerInfo(betterproto.Message):
    # Unix Nano
    last_access_time: datetime = betterproto.message_field(1)
    identity: str = betterproto.string_field(2)
    rate_per_second: float = betterproto.double_field(3)


@dataclass
class StickyExecutionAttributes(betterproto.Message):
    worker_task_queue: "TaskQueue" = betterproto.message_field(1)
    # (-- api-linter: core::0140::prepositions=disabled     aip.dev/not-
    # precedent: "to" is used to indicate interval. --)
    schedule_to_start_timeout: timedelta = betterproto.message_field(2)
