"""
@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
import google.protobuf.timestamp_pb2

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

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

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

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

        def __init__(
            self,
        ) -> None: ...

    ACTIVITY_PAUSE_FIELD_NUMBER: builtins.int
    @property
    def activity_pause(self) -> global___WorkflowRuleAction.ActionActivityPause: ...
    def __init__(
        self,
        *,
        activity_pause: global___WorkflowRuleAction.ActionActivityPause | None = ...,
    ) -> None: ...
    def HasField(
        self,
        field_name: typing_extensions.Literal[
            "activity_pause", b"activity_pause", "variant", b"variant"
        ],
    ) -> builtins.bool: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal[
            "activity_pause", b"activity_pause", "variant", b"variant"
        ],
    ) -> None: ...
    def WhichOneof(
        self, oneof_group: typing_extensions.Literal["variant", b"variant"]
    ) -> typing_extensions.Literal["activity_pause"] | None: ...

global___WorkflowRuleAction = WorkflowRuleAction

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

    class ActivityStartingTrigger(google.protobuf.message.Message):
        """Activity trigger will be triggered when an activity is about to start."""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        PREDICATE_FIELD_NUMBER: builtins.int
        predicate: builtins.str
        """Activity predicate is a SQL-like string filter parameter.
        It is used to match against workflow data.
        The following activity attributes are supported as part of the predicate:
        - ActivityType: An Activity Type is the mapping of a name to an Activity Definition..
        - ActivityId: The ID of the activity.
        - ActivityAttempt: The number attempts of the activity.
        - BackoffInterval: The current amount of time between scheduled attempts of the activity.
        - ActivityStatus: The status of the activity. Can be one of "Scheduled", "Started", "Paused".
        - TaskQueue: The name of the task queue the workflow specified that the activity should run on.
        Activity predicate support the following operators:
         * =, !=, >, >=, <, <=
         * AND, OR, ()
         * BETWEEN ... AND
           STARTS_WITH
        """
        def __init__(
            self,
            *,
            predicate: builtins.str = ...,
        ) -> None: ...
        def ClearField(
            self, field_name: typing_extensions.Literal["predicate", b"predicate"]
        ) -> None: ...

    ID_FIELD_NUMBER: builtins.int
    ACTIVITY_START_FIELD_NUMBER: builtins.int
    VISIBILITY_QUERY_FIELD_NUMBER: builtins.int
    ACTIONS_FIELD_NUMBER: builtins.int
    EXPIRATION_TIME_FIELD_NUMBER: builtins.int
    id: builtins.str
    """The id of the new workflow rule. Must be unique within the namespace.
    Can be set by the user, and can have business meaning.
    """
    @property
    def activity_start(self) -> global___WorkflowRuleSpec.ActivityStartingTrigger: ...
    visibility_query: builtins.str
    """Restricted Visibility query.
    This query is used to filter workflows in this namespace to which this rule should apply.
    It is applied to any running workflow each time a triggering event occurs, before the trigger predicate is evaluated.
    The following workflow attributes are supported:
    - WorkflowType
    - WorkflowId
    - StartTime
    - ExecutionStatus
    """
    @property
    def actions(
        self,
    ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
        global___WorkflowRuleAction
    ]:
        """WorkflowRuleAction to be taken when the rule is triggered and predicate is matched."""
    @property
    def expiration_time(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """Expiration time of the rule. After this time, the rule will be deleted.
        Can be empty if the rule should never expire.
        """
    def __init__(
        self,
        *,
        id: builtins.str = ...,
        activity_start: global___WorkflowRuleSpec.ActivityStartingTrigger | None = ...,
        visibility_query: builtins.str = ...,
        actions: collections.abc.Iterable[global___WorkflowRuleAction] | None = ...,
        expiration_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
    ) -> None: ...
    def HasField(
        self,
        field_name: typing_extensions.Literal[
            "activity_start",
            b"activity_start",
            "expiration_time",
            b"expiration_time",
            "trigger",
            b"trigger",
        ],
    ) -> builtins.bool: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal[
            "actions",
            b"actions",
            "activity_start",
            b"activity_start",
            "expiration_time",
            b"expiration_time",
            "id",
            b"id",
            "trigger",
            b"trigger",
            "visibility_query",
            b"visibility_query",
        ],
    ) -> None: ...
    def WhichOneof(
        self, oneof_group: typing_extensions.Literal["trigger", b"trigger"]
    ) -> typing_extensions.Literal["activity_start"] | None: ...

global___WorkflowRuleSpec = WorkflowRuleSpec

class WorkflowRule(google.protobuf.message.Message):
    """WorkflowRule describes a rule that can be applied to any workflow in this namespace."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    CREATE_TIME_FIELD_NUMBER: builtins.int
    SPEC_FIELD_NUMBER: builtins.int
    CREATED_BY_IDENTITY_FIELD_NUMBER: builtins.int
    DESCRIPTION_FIELD_NUMBER: builtins.int
    @property
    def create_time(self) -> google.protobuf.timestamp_pb2.Timestamp:
        """Rule creation time."""
    @property
    def spec(self) -> global___WorkflowRuleSpec:
        """Rule specification"""
    created_by_identity: builtins.str
    """Identity of the actor that created the rule
    (-- api-linter: core::0140::prepositions=disabled
        aip.dev/not-precedent: It is better reflect the intent this way, we will also have updated_by. --)
    (-- api-linter: core::0142::time-field-names=disabled
        aip.dev/not-precedent: Same as above. All other options sounds clumsy --)
    """
    description: builtins.str
    """Rule description."""
    def __init__(
        self,
        *,
        create_time: google.protobuf.timestamp_pb2.Timestamp | None = ...,
        spec: global___WorkflowRuleSpec | None = ...,
        created_by_identity: builtins.str = ...,
        description: builtins.str = ...,
    ) -> None: ...
    def HasField(
        self,
        field_name: typing_extensions.Literal[
            "create_time", b"create_time", "spec", b"spec"
        ],
    ) -> builtins.bool: ...
    def ClearField(
        self,
        field_name: typing_extensions.Literal[
            "create_time",
            b"create_time",
            "created_by_identity",
            b"created_by_identity",
            "description",
            b"description",
            "spec",
            b"spec",
        ],
    ) -> None: ...

global___WorkflowRule = WorkflowRule
