"""
@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.internal.containers
import google.protobuf.message

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

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

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

    CORE_USED_FLAGS_FIELD_NUMBER: builtins.int
    LANG_USED_FLAGS_FIELD_NUMBER: builtins.int
    SDK_NAME_FIELD_NUMBER: builtins.int
    SDK_VERSION_FIELD_NUMBER: builtins.int
    @property
    def core_used_flags(
        self,
    ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
        """Internal flags used by the core SDK. SDKs using flags must comply with the following behavior:

        During replay:
        * If a flag is not recognized (value is too high or not defined), it must fail the workflow
          task.
        * If a flag is recognized, it is stored in a set of used flags for the run. Code checks for
          that flag during and after this WFT are allowed to assume that the flag is present.
        * If a code check for a flag does not find the flag in the set of used flags, it must take
          the branch corresponding to the absence of that flag.

        During non-replay execution of new WFTs:
        * The SDK is free to use all flags it knows about. It must record any newly-used (IE: not
          previously recorded) flags when completing the WFT.

        SDKs which are too old to even know about this field at all are considered to produce
        undefined behavior if they replay workflows which used this mechanism.

        (-- api-linter: core::0141::forbidden-types=disabled
            aip.dev/not-precedent: These really shouldn't have negative values. --)
        """
    @property
    def lang_used_flags(
        self,
    ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
        """Flags used by the SDK lang. No attempt is made to distinguish between different SDK languages
        here as processing a workflow with a different language than the one which authored it is
        already undefined behavior. See `core_used_patches` for more.

        (-- api-linter: core::0141::forbidden-types=disabled
            aip.dev/not-precedent: These really shouldn't have negative values. --)
        """
    sdk_name: builtins.str
    """Name of the SDK that processed the task. This is usually something like "temporal-go" and is
    usually the same as client-name gRPC header. This should only be set if its value changed
    since the last time recorded on the workflow (or be set on the first task).

    (-- api-linter: core::0122::name-suffix=disabled
        aip.dev/not-precedent: We're ok with a name suffix here. --)
    """
    sdk_version: builtins.str
    """Version of the SDK that processed the task. This is usually something like "1.20.0" and is
    usually the same as client-version gRPC header. This should only be set if its value changed
    since the last time recorded on the workflow (or be set on the first task).
    """
    def __init__(
        self,
        *,
        core_used_flags: collections.abc.Iterable[builtins.int] | None = ...,
        lang_used_flags: collections.abc.Iterable[builtins.int] | None = ...,
        sdk_name: builtins.str = ...,
        sdk_version: builtins.str = ...,
    ) -> None: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal[
            "core_used_flags",
            b"core_used_flags",
            "lang_used_flags",
            b"lang_used_flags",
            "sdk_name",
            b"sdk_name",
            "sdk_version",
            b"sdk_version",
        ],
    ) -> None: ...

global___WorkflowTaskCompletedMetadata = WorkflowTaskCompletedMetadata
