Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions temporalio/api/enums/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from .query_pb2 import QueryRejectCondition, QueryResultType
from .reset_pb2 import ResetReapplyExcludeType, ResetReapplyType, ResetType
from .schedule_pb2 import ScheduleOverlapPolicy
from .stream_pb2 import StreamErrorReason, StreamIdConflictPolicy, StreamStatus
from .task_queue_pb2 import (
BuildIdTaskReachability,
DescribeTaskQueueMode,
Expand Down Expand Up @@ -120,6 +121,9 @@
"Severity",
"SignalExternalWorkflowExecutionFailedCause",
"StartChildWorkflowExecutionFailedCause",
"StreamErrorReason",
"StreamIdConflictPolicy",
"StreamStatus",
"SuggestContinueAsNewReason",
"TaskQueueKind",
"TaskQueueType",
Expand Down
31 changes: 31 additions & 0 deletions temporalio/api/enums/v1/stream_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

175 changes: 175 additions & 0 deletions temporalio/api/enums/v1/stream_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""

import builtins
import sys
import typing

import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper

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

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

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

class _StreamStatusEnumTypeWrapper(
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
_StreamStatus.ValueType
],
builtins.type,
):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
STREAM_STATUS_UNSPECIFIED: _StreamStatus.ValueType # 0
STREAM_STATUS_OPEN: _StreamStatus.ValueType # 1
STREAM_STATUS_CLOSED: _StreamStatus.ValueType # 2
STREAM_STATUS_EXPIRED: _StreamStatus.ValueType # 3

class StreamStatus(_StreamStatus, metaclass=_StreamStatusEnumTypeWrapper):
"""Experimental. Might change in the future.
The state of a Stream, as a describe gives it.
(-- api-linter: core::0216::synonyms=disabled
aip.dev/not-precedent: Named consistently with WorkflowExecutionStatus. --)
"""

STREAM_STATUS_UNSPECIFIED: StreamStatus.ValueType # 0
STREAM_STATUS_OPEN: StreamStatus.ValueType # 1
STREAM_STATUS_CLOSED: StreamStatus.ValueType # 2
STREAM_STATUS_EXPIRED: StreamStatus.ValueType # 3
global___StreamStatus = StreamStatus

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

class _StreamIdConflictPolicyEnumTypeWrapper(
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
_StreamIdConflictPolicy.ValueType
],
builtins.type,
):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
STREAM_ID_CONFLICT_POLICY_UNSPECIFIED: _StreamIdConflictPolicy.ValueType # 0
STREAM_ID_CONFLICT_POLICY_FAIL: _StreamIdConflictPolicy.ValueType # 1
"""The create fails with ALREADY_EXISTS."""
STREAM_ID_CONFLICT_POLICY_USE_EXISTING: _StreamIdConflictPolicy.ValueType # 2
"""The create gets the open Stream, which keeps its own Retention."""

class StreamIdConflictPolicy(
_StreamIdConflictPolicy, metaclass=_StreamIdConflictPolicyEnumTypeWrapper
):
"""Experimental. Might change in the future.
What a create does when its Stream exists. Unspecified is FAIL, as for a Workflow start.
"""

STREAM_ID_CONFLICT_POLICY_UNSPECIFIED: StreamIdConflictPolicy.ValueType # 0
STREAM_ID_CONFLICT_POLICY_FAIL: StreamIdConflictPolicy.ValueType # 1
"""The create fails with ALREADY_EXISTS."""
STREAM_ID_CONFLICT_POLICY_USE_EXISTING: StreamIdConflictPolicy.ValueType # 2
"""The create gets the open Stream, which keeps its own Retention."""
global___StreamIdConflictPolicy = StreamIdConflictPolicy

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

class _StreamErrorReasonEnumTypeWrapper(
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
_StreamErrorReason.ValueType
],
builtins.type,
):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
STREAM_ERROR_REASON_UNSPECIFIED: _StreamErrorReason.ValueType # 0
STREAM_ERROR_REASON_NOT_FOUND: _StreamErrorReason.ValueType # 1
"""Nobody created the Stream. NOT_FOUND."""
STREAM_ERROR_REASON_EXPIRED: _StreamErrorReason.ValueType # 2
"""The Stream's Retention or its last-write TTL passed. NOT_FOUND."""
STREAM_ERROR_REASON_CLOSED: _StreamErrorReason.ValueType # 3
"""The Stream is closed. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_FENCED: _StreamErrorReason.ValueType # 4
"""The Producer's epoch is lower than the newest one. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_SEQUENCE_TOO_LOW: _StreamErrorReason.ValueType # 5
"""The batch has a lower `sequence` than the last one of its epoch. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_SEQ_DIVERGENT: _StreamErrorReason.ValueType # 6
"""The batch has the `sequence` of the last one of its epoch, and other content.
FAILED_PRECONDITION.
"""
STREAM_ERROR_REASON_NOT_OWNER: _StreamErrorReason.ValueType # 7
"""The caller may not create or close this Stream. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_FORMAT_TOO_NEW: _StreamErrorReason.ValueType # 8
"""A newer format version wrote the Stream. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_OFFSET_TOO_HIGH: _StreamErrorReason.ValueType # 9
"""The offset is past the newest offset, for example after a failover lost the newest Records.
A read from it works again once the Stream has Records up to it. OUT_OF_RANGE.
"""
STREAM_ERROR_REASON_TOO_LARGE: _StreamErrorReason.ValueType # 10
"""A Record or a batch is over the Store's limit. INVALID_ARGUMENT."""
STREAM_ERROR_REASON_INVALID: _StreamErrorReason.ValueType # 11
"""The request is malformed. INVALID_ARGUMENT."""
STREAM_ERROR_REASON_STORAGE_UNAVAILABLE: _StreamErrorReason.ValueType # 12
"""The Store failed or did not answer. A retry can succeed. UNAVAILABLE."""
STREAM_ERROR_REASON_UNSUPPORTED: _StreamErrorReason.ValueType # 13
"""The Store lacks a capability that the call needs. UNIMPLEMENTED."""
STREAM_ERROR_REASON_ALREADY_EXISTS: _StreamErrorReason.ValueType # 14
"""A create with the FAIL conflict policy is for a Stream that exists. ALREADY_EXISTS."""
STREAM_ERROR_REASON_STORAGE_CORRUPT: _StreamErrorReason.ValueType # 15
"""The Store gave back data that isn't valid, such as a stored value with the wrong length. A
retry reads the same data. DATA_LOSS.
"""

class StreamErrorReason(
_StreamErrorReason, metaclass=_StreamErrorReasonEnumTypeWrapper
):
"""Experimental. Might change in the future.
Why a Stream call failed. Each reason has one gRPC status code, and several reasons share a
code. So code matches on the reason, and not on the status code. An SDK raises one error type
that carries the reason.
"""

STREAM_ERROR_REASON_UNSPECIFIED: StreamErrorReason.ValueType # 0
STREAM_ERROR_REASON_NOT_FOUND: StreamErrorReason.ValueType # 1
"""Nobody created the Stream. NOT_FOUND."""
STREAM_ERROR_REASON_EXPIRED: StreamErrorReason.ValueType # 2
"""The Stream's Retention or its last-write TTL passed. NOT_FOUND."""
STREAM_ERROR_REASON_CLOSED: StreamErrorReason.ValueType # 3
"""The Stream is closed. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_FENCED: StreamErrorReason.ValueType # 4
"""The Producer's epoch is lower than the newest one. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_SEQUENCE_TOO_LOW: StreamErrorReason.ValueType # 5
"""The batch has a lower `sequence` than the last one of its epoch. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_SEQ_DIVERGENT: StreamErrorReason.ValueType # 6
"""The batch has the `sequence` of the last one of its epoch, and other content.
FAILED_PRECONDITION.
"""
STREAM_ERROR_REASON_NOT_OWNER: StreamErrorReason.ValueType # 7
"""The caller may not create or close this Stream. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_FORMAT_TOO_NEW: StreamErrorReason.ValueType # 8
"""A newer format version wrote the Stream. FAILED_PRECONDITION."""
STREAM_ERROR_REASON_OFFSET_TOO_HIGH: StreamErrorReason.ValueType # 9
"""The offset is past the newest offset, for example after a failover lost the newest Records.
A read from it works again once the Stream has Records up to it. OUT_OF_RANGE.
"""
STREAM_ERROR_REASON_TOO_LARGE: StreamErrorReason.ValueType # 10
"""A Record or a batch is over the Store's limit. INVALID_ARGUMENT."""
STREAM_ERROR_REASON_INVALID: StreamErrorReason.ValueType # 11
"""The request is malformed. INVALID_ARGUMENT."""
STREAM_ERROR_REASON_STORAGE_UNAVAILABLE: StreamErrorReason.ValueType # 12
"""The Store failed or did not answer. A retry can succeed. UNAVAILABLE."""
STREAM_ERROR_REASON_UNSUPPORTED: StreamErrorReason.ValueType # 13
"""The Store lacks a capability that the call needs. UNIMPLEMENTED."""
STREAM_ERROR_REASON_ALREADY_EXISTS: StreamErrorReason.ValueType # 14
"""A create with the FAIL conflict policy is for a Stream that exists. ALREADY_EXISTS."""
STREAM_ERROR_REASON_STORAGE_CORRUPT: StreamErrorReason.ValueType # 15
"""The Store gave back data that isn't valid, such as a stored value with the wrong length. A
retry reads the same data. DATA_LOSS.
"""
global___StreamErrorReason = StreamErrorReason
Empty file.
29 changes: 29 additions & 0 deletions temporalio/api/stream/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from .message_pb2 import (
ActivityEpoch,
ActivityProducer,
AppendRecord,
ClientProducer,
LocalActivityEpoch,
LocalActivityProducer,
Producer,
StreamErrorDetails,
StreamRecord,
StreamRef,
WorkflowProducer,
WorkflowTaskEpoch,
)

__all__ = [
"ActivityEpoch",
"ActivityProducer",
"AppendRecord",
"ClientProducer",
"LocalActivityEpoch",
"LocalActivityProducer",
"Producer",
"StreamErrorDetails",
"StreamRecord",
"StreamRef",
"WorkflowProducer",
"WorkflowTaskEpoch",
]
58 changes: 58 additions & 0 deletions temporalio/api/stream/v1/message_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading