// This file is @generated by prost-build.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WorkflowRuleAction {
    /// Supported actions.
    #[prost(oneof = "workflow_rule_action::Variant", tags = "1")]
    pub variant: ::core::option::Option<workflow_rule_action::Variant>,
}
/// Nested message and enum types in `WorkflowRuleAction`.
pub mod workflow_rule_action {
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct ActionActivityPause {}
    /// Supported actions.
    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Variant {
        #[prost(message, tag = "1")]
        ActivityPause(ActionActivityPause),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowRuleSpec {
    /// The id of the new workflow rule. Must be unique within the namespace.
    /// Can be set by the user, and can have business meaning.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// 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
    #[prost(string, tag = "3")]
    pub visibility_query: ::prost::alloc::string::String,
    /// WorkflowRuleAction to be taken when the rule is triggered and predicate is matched.
    #[prost(message, repeated, tag = "4")]
    pub actions: ::prost::alloc::vec::Vec<WorkflowRuleAction>,
    /// Expiration time of the rule. After this time, the rule will be deleted.
    /// Can be empty if the rule should never expire.
    #[prost(message, optional, tag = "5")]
    pub expiration_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Specifies how the rule should be triggered and evaluated.
    /// Currently, only "activity start" type is supported.
    #[prost(oneof = "workflow_rule_spec::Trigger", tags = "2")]
    pub trigger: ::core::option::Option<workflow_rule_spec::Trigger>,
}
/// Nested message and enum types in `WorkflowRuleSpec`.
pub mod workflow_rule_spec {
    /// Activity trigger will be triggered when an activity is about to start.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ActivityStartingTrigger {
        /// 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
        #[prost(string, tag = "1")]
        pub predicate: ::prost::alloc::string::String,
    }
    /// Specifies how the rule should be triggered and evaluated.
    /// Currently, only "activity start" type is supported.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Trigger {
        #[prost(message, tag = "2")]
        ActivityStart(ActivityStartingTrigger),
    }
}
/// WorkflowRule describes a rule that can be applied to any workflow in this namespace.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowRule {
    /// Rule creation time.
    #[prost(message, optional, tag = "1")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Rule specification
    #[prost(message, optional, tag = "2")]
    pub spec: ::core::option::Option<WorkflowRuleSpec>,
    /// 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 --)
    #[prost(string, tag = "3")]
    pub created_by_identity: ::prost::alloc::string::String,
    /// Rule description.
    #[prost(string, tag = "4")]
    pub description: ::prost::alloc::string::String,
}
