|
| 1 | +""" |
| 2 | +@generated by mypy-protobuf. Do not edit manually! |
| 3 | +isort:skip_file |
| 4 | +""" |
| 5 | + |
| 6 | +import builtins |
| 7 | +import sys |
| 8 | +import typing |
| 9 | + |
| 10 | +import google.protobuf.descriptor |
| 11 | +import google.protobuf.internal.enum_type_wrapper |
| 12 | + |
| 13 | +if sys.version_info >= (3, 10): |
| 14 | + import typing as typing_extensions |
| 15 | +else: |
| 16 | + import typing_extensions |
| 17 | + |
| 18 | +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor |
| 19 | + |
| 20 | +class _ActivityExecutionStatus: |
| 21 | + ValueType = typing.NewType("ValueType", builtins.int) |
| 22 | + V: typing_extensions.TypeAlias = ValueType |
| 23 | + |
| 24 | +class _ActivityExecutionStatusEnumTypeWrapper( |
| 25 | + google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ |
| 26 | + _ActivityExecutionStatus.ValueType |
| 27 | + ], |
| 28 | + builtins.type, |
| 29 | +): # noqa: F821 |
| 30 | + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor |
| 31 | + ACTIVITY_EXECUTION_STATUS_UNSPECIFIED: _ActivityExecutionStatus.ValueType # 0 |
| 32 | + ACTIVITY_EXECUTION_STATUS_RUNNING: _ActivityExecutionStatus.ValueType # 1 |
| 33 | + """The activity has not reached a terminal status. See PendingActivityState for the run state |
| 34 | + (SCHEDULED, STARTED, or CANCEL_REQUESTED). |
| 35 | + """ |
| 36 | + ACTIVITY_EXECUTION_STATUS_COMPLETED: _ActivityExecutionStatus.ValueType # 2 |
| 37 | + """The activity completed successfully. An activity can complete even after cancellation is |
| 38 | + requested if the worker calls RespondActivityTaskCompleted before acknowledging cancellation. |
| 39 | + """ |
| 40 | + ACTIVITY_EXECUTION_STATUS_FAILED: _ActivityExecutionStatus.ValueType # 3 |
| 41 | + """The activity failed. Causes: |
| 42 | + - Worker returned a non-retryable failure |
| 43 | + - RetryPolicy.maximum_attempts exhausted |
| 44 | + - Attempt failed after cancellation was requested (retries blocked) |
| 45 | + """ |
| 46 | + ACTIVITY_EXECUTION_STATUS_CANCELED: _ActivityExecutionStatus.ValueType # 4 |
| 47 | + """The activity was canceled. Reached when: |
| 48 | + - Cancellation requested while SCHEDULED (immediate), or |
| 49 | + - Cancellation requested while STARTED and worker called RespondActivityTaskCanceled. |
| 50 | +
|
| 51 | + Workers discover cancellation requests via heartbeat responses (cancel_requested=true). |
| 52 | + Activities that do not heartbeat will not learn of cancellation and may complete, fail, or |
| 53 | + time out normally. CANCELED requires explicit worker acknowledgment or immediate cancellation |
| 54 | + of a SCHEDULED activity. |
| 55 | + """ |
| 56 | + ACTIVITY_EXECUTION_STATUS_TERMINATED: _ActivityExecutionStatus.ValueType # 5 |
| 57 | + """The activity was terminated. Immediate; does not wait for worker acknowledgment.""" |
| 58 | + ACTIVITY_EXECUTION_STATUS_TIMED_OUT: _ActivityExecutionStatus.ValueType # 6 |
| 59 | + """The activity timed out. See TimeoutType for the specific timeout. |
| 60 | + - SCHEDULE_TO_START and SCHEDULE_TO_CLOSE timeouts always result in TIMED_OUT. |
| 61 | + - START_TO_CLOSE and HEARTBEAT may retry if RetryPolicy permits; TIMED_OUT is |
| 62 | + reached when retry is blocked (RetryPolicy.maximum_attempts exhausted, |
| 63 | + SCHEDULE_TO_CLOSE would be exceeded, or cancellation has been requested). |
| 64 | + """ |
| 65 | + |
| 66 | +class ActivityExecutionStatus( |
| 67 | + _ActivityExecutionStatus, metaclass=_ActivityExecutionStatusEnumTypeWrapper |
| 68 | +): |
| 69 | + """Status of a standalone activity. |
| 70 | + The status is updated once, when the activity is originally scheduled, and again when the activity reaches a terminal |
| 71 | + status. |
| 72 | + (-- api-linter: core::0216::synonyms=disabled |
| 73 | + aip.dev/not-precedent: Named consistently with WorkflowExecutionStatus. --) |
| 74 | + """ |
| 75 | + |
| 76 | +ACTIVITY_EXECUTION_STATUS_UNSPECIFIED: ActivityExecutionStatus.ValueType # 0 |
| 77 | +ACTIVITY_EXECUTION_STATUS_RUNNING: ActivityExecutionStatus.ValueType # 1 |
| 78 | +"""The activity has not reached a terminal status. See PendingActivityState for the run state |
| 79 | +(SCHEDULED, STARTED, or CANCEL_REQUESTED). |
| 80 | +""" |
| 81 | +ACTIVITY_EXECUTION_STATUS_COMPLETED: ActivityExecutionStatus.ValueType # 2 |
| 82 | +"""The activity completed successfully. An activity can complete even after cancellation is |
| 83 | +requested if the worker calls RespondActivityTaskCompleted before acknowledging cancellation. |
| 84 | +""" |
| 85 | +ACTIVITY_EXECUTION_STATUS_FAILED: ActivityExecutionStatus.ValueType # 3 |
| 86 | +"""The activity failed. Causes: |
| 87 | +- Worker returned a non-retryable failure |
| 88 | +- RetryPolicy.maximum_attempts exhausted |
| 89 | +- Attempt failed after cancellation was requested (retries blocked) |
| 90 | +""" |
| 91 | +ACTIVITY_EXECUTION_STATUS_CANCELED: ActivityExecutionStatus.ValueType # 4 |
| 92 | +"""The activity was canceled. Reached when: |
| 93 | +- Cancellation requested while SCHEDULED (immediate), or |
| 94 | +- Cancellation requested while STARTED and worker called RespondActivityTaskCanceled. |
| 95 | +
|
| 96 | +Workers discover cancellation requests via heartbeat responses (cancel_requested=true). |
| 97 | +Activities that do not heartbeat will not learn of cancellation and may complete, fail, or |
| 98 | +time out normally. CANCELED requires explicit worker acknowledgment or immediate cancellation |
| 99 | +of a SCHEDULED activity. |
| 100 | +""" |
| 101 | +ACTIVITY_EXECUTION_STATUS_TERMINATED: ActivityExecutionStatus.ValueType # 5 |
| 102 | +"""The activity was terminated. Immediate; does not wait for worker acknowledgment.""" |
| 103 | +ACTIVITY_EXECUTION_STATUS_TIMED_OUT: ActivityExecutionStatus.ValueType # 6 |
| 104 | +"""The activity timed out. See TimeoutType for the specific timeout. |
| 105 | +- SCHEDULE_TO_START and SCHEDULE_TO_CLOSE timeouts always result in TIMED_OUT. |
| 106 | +- START_TO_CLOSE and HEARTBEAT may retry if RetryPolicy permits; TIMED_OUT is |
| 107 | + reached when retry is blocked (RetryPolicy.maximum_attempts exhausted, |
| 108 | + SCHEDULE_TO_CLOSE would be exceeded, or cancellation has been requested). |
| 109 | +""" |
| 110 | +global___ActivityExecutionStatus = ActivityExecutionStatus |
| 111 | + |
| 112 | +class _ActivityIdReusePolicy: |
| 113 | + ValueType = typing.NewType("ValueType", builtins.int) |
| 114 | + V: typing_extensions.TypeAlias = ValueType |
| 115 | + |
| 116 | +class _ActivityIdReusePolicyEnumTypeWrapper( |
| 117 | + google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ |
| 118 | + _ActivityIdReusePolicy.ValueType |
| 119 | + ], |
| 120 | + builtins.type, |
| 121 | +): # noqa: F821 |
| 122 | + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor |
| 123 | + ACTIVITY_ID_REUSE_POLICY_UNSPECIFIED: _ActivityIdReusePolicy.ValueType # 0 |
| 124 | + ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE: _ActivityIdReusePolicy.ValueType # 1 |
| 125 | + """Always allow starting an activity using the same activity ID.""" |
| 126 | + ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: ( |
| 127 | + _ActivityIdReusePolicy.ValueType |
| 128 | + ) # 2 |
| 129 | + """Allow starting an activity using the same ID only when the last activity's final state is one |
| 130 | + of {failed, canceled, terminated, timed out}. |
| 131 | + """ |
| 132 | + ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE: _ActivityIdReusePolicy.ValueType # 3 |
| 133 | + """Do not permit re-use of the ID for this activity. Future start requests could potentially change the policy, |
| 134 | + allowing re-use of the ID. |
| 135 | + """ |
| 136 | + |
| 137 | +class ActivityIdReusePolicy( |
| 138 | + _ActivityIdReusePolicy, metaclass=_ActivityIdReusePolicyEnumTypeWrapper |
| 139 | +): |
| 140 | + """Defines whether to allow re-using an activity ID from a previously *closed* activity. |
| 141 | + If the request is denied, the server returns an `ActivityExecutionAlreadyStarted` error. |
| 142 | +
|
| 143 | + See `ActivityIdConflictPolicy` for handling ID duplication with a *running* activity. |
| 144 | + """ |
| 145 | + |
| 146 | +ACTIVITY_ID_REUSE_POLICY_UNSPECIFIED: ActivityIdReusePolicy.ValueType # 0 |
| 147 | +ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE: ActivityIdReusePolicy.ValueType # 1 |
| 148 | +"""Always allow starting an activity using the same activity ID.""" |
| 149 | +ACTIVITY_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: ( |
| 150 | + ActivityIdReusePolicy.ValueType |
| 151 | +) # 2 |
| 152 | +"""Allow starting an activity using the same ID only when the last activity's final state is one |
| 153 | +of {failed, canceled, terminated, timed out}. |
| 154 | +""" |
| 155 | +ACTIVITY_ID_REUSE_POLICY_REJECT_DUPLICATE: ActivityIdReusePolicy.ValueType # 3 |
| 156 | +"""Do not permit re-use of the ID for this activity. Future start requests could potentially change the policy, |
| 157 | +allowing re-use of the ID. |
| 158 | +""" |
| 159 | +global___ActivityIdReusePolicy = ActivityIdReusePolicy |
| 160 | + |
| 161 | +class _ActivityIdConflictPolicy: |
| 162 | + ValueType = typing.NewType("ValueType", builtins.int) |
| 163 | + V: typing_extensions.TypeAlias = ValueType |
| 164 | + |
| 165 | +class _ActivityIdConflictPolicyEnumTypeWrapper( |
| 166 | + google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ |
| 167 | + _ActivityIdConflictPolicy.ValueType |
| 168 | + ], |
| 169 | + builtins.type, |
| 170 | +): # noqa: F821 |
| 171 | + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor |
| 172 | + ACTIVITY_ID_CONFLICT_POLICY_UNSPECIFIED: _ActivityIdConflictPolicy.ValueType # 0 |
| 173 | + ACTIVITY_ID_CONFLICT_POLICY_FAIL: _ActivityIdConflictPolicy.ValueType # 1 |
| 174 | + """Don't start a new activity; instead return `ActivityExecutionAlreadyStarted` error.""" |
| 175 | + ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING: _ActivityIdConflictPolicy.ValueType # 2 |
| 176 | + """Don't start a new activity; instead return a handle for the running activity.""" |
| 177 | + |
| 178 | +class ActivityIdConflictPolicy( |
| 179 | + _ActivityIdConflictPolicy, metaclass=_ActivityIdConflictPolicyEnumTypeWrapper |
| 180 | +): |
| 181 | + """Defines what to do when trying to start an activity with the same ID as a *running* activity. |
| 182 | + Note that it is *never* valid to have two running instances of the same activity ID. |
| 183 | +
|
| 184 | + See `ActivityIdReusePolicy` for handling activity ID duplication with a *closed* activity. |
| 185 | + """ |
| 186 | + |
| 187 | +ACTIVITY_ID_CONFLICT_POLICY_UNSPECIFIED: ActivityIdConflictPolicy.ValueType # 0 |
| 188 | +ACTIVITY_ID_CONFLICT_POLICY_FAIL: ActivityIdConflictPolicy.ValueType # 1 |
| 189 | +"""Don't start a new activity; instead return `ActivityExecutionAlreadyStarted` error.""" |
| 190 | +ACTIVITY_ID_CONFLICT_POLICY_USE_EXISTING: ActivityIdConflictPolicy.ValueType # 2 |
| 191 | +"""Don't start a new activity; instead return a handle for the running activity.""" |
| 192 | +global___ActivityIdConflictPolicy = ActivityIdConflictPolicy |
0 commit comments