// This file is @generated by prost-build.
/// Hold basic information about a workflow execution.
/// This structure is a part of visibility, and thus contain a limited subset of information.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowExecutionInfo {
    #[prost(message, optional, tag = "1")]
    pub execution: ::core::option::Option<super::super::common::v1::WorkflowExecution>,
    #[prost(message, optional, tag = "2")]
    pub r#type: ::core::option::Option<super::super::common::v1::WorkflowType>,
    #[prost(message, optional, tag = "3")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "4")]
    pub close_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(enumeration = "super::super::enums::v1::WorkflowExecutionStatus", tag = "5")]
    pub status: i32,
    #[prost(int64, tag = "6")]
    pub history_length: i64,
    #[prost(string, tag = "7")]
    pub parent_namespace_id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "8")]
    pub parent_execution: ::core::option::Option<
        super::super::common::v1::WorkflowExecution,
    >,
    #[prost(message, optional, tag = "9")]
    pub execution_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "10")]
    pub memo: ::core::option::Option<super::super::common::v1::Memo>,
    #[prost(message, optional, tag = "11")]
    pub search_attributes: ::core::option::Option<
        super::super::common::v1::SearchAttributes,
    >,
    #[prost(message, optional, tag = "12")]
    pub auto_reset_points: ::core::option::Option<ResetPoints>,
    #[prost(string, tag = "13")]
    pub task_queue: ::prost::alloc::string::String,
    #[prost(int64, tag = "14")]
    pub state_transition_count: i64,
    #[prost(int64, tag = "15")]
    pub history_size_bytes: i64,
    /// If set, the most recent worker version stamp that appeared in a workflow task completion
    /// Deprecated. This field should be cleaned up when versioning-2 API is removed. \[cleanup-experimental-wv\]
    #[deprecated]
    #[prost(message, optional, tag = "16")]
    pub most_recent_worker_version_stamp: ::core::option::Option<
        super::super::common::v1::WorkerVersionStamp,
    >,
    /// Workflow execution duration is defined as difference between close time and execution time.
    /// This field is only populated if the workflow is closed.
    #[prost(message, optional, tag = "17")]
    pub execution_duration: ::core::option::Option<::prost_types::Duration>,
    /// Contains information about the root workflow execution.
    /// The root workflow execution is defined as follows:
    /// 1. A workflow without parent workflow is its own root workflow.
    /// 2. A workflow that has a parent workflow has the same root workflow as its parent workflow.
    /// Note: workflows continued as new or reseted may or may not have parents, check examples below.
    ///
    /// Examples:
    ///    Scenario 1: Workflow W1 starts child workflow W2, and W2 starts child workflow W3.
    ///      - The root workflow of all three workflows is W1.
    ///    Scenario 2: Workflow W1 starts child workflow W2, and W2 continued as new W3.
    ///      - The root workflow of all three workflows is W1.
    ///    Scenario 3: Workflow W1 continued as new W2.
    ///      - The root workflow of W1 is W1 and the root workflow of W2 is W2.
    ///    Scenario 4: Workflow W1 starts child workflow W2, and W2 is reseted, creating W3
    ///      - The root workflow of all three workflows is W1.
    ///    Scenario 5: Workflow W1 is reseted, creating W2.
    ///      - The root workflow of W1 is W1 and the root workflow of W2 is W2.
    #[prost(message, optional, tag = "18")]
    pub root_execution: ::core::option::Option<
        super::super::common::v1::WorkflowExecution,
    >,
    /// The currently assigned build ID for this execution. Presence of this value means worker versioning is used
    /// for this execution. Assigned build ID is selected based on Worker Versioning Assignment Rules
    /// when the first workflow task of the execution is scheduled. If the first workflow task fails and is scheduled
    /// again, the assigned build ID may change according to the latest versioning rules.
    /// Assigned build ID can also change in the middle of a execution if Compatible Redirect Rules are applied to
    /// this execution.
    /// Deprecated. This field should be cleaned up when versioning-2 API is removed. \[cleanup-experimental-wv\]
    #[deprecated]
    #[prost(string, tag = "19")]
    pub assigned_build_id: ::prost::alloc::string::String,
    /// Build ID inherited from a previous/parent execution. If present, assigned_build_id will be set to this, instead
    /// of using the assignment rules.
    /// Deprecated. This field should be cleaned up when versioning-2 API is removed. \[cleanup-experimental-wv\]
    #[deprecated]
    #[prost(string, tag = "20")]
    pub inherited_build_id: ::prost::alloc::string::String,
    /// The first run ID in the execution chain.
    /// Executions created via the following operations are considered to be in the same chain
    /// - ContinueAsNew
    /// - Workflow Retry
    /// - Workflow Reset
    /// - Cron Schedule
    #[prost(string, tag = "21")]
    pub first_run_id: ::prost::alloc::string::String,
    /// Absent value means the workflow execution is not versioned. When present, the execution might
    /// be versioned or unversioned, depending on `versioning_info.behavior` and `versioning_info.versioning_override`.
    /// Experimental. Versioning info is experimental and might change in the future.
    #[prost(message, optional, tag = "22")]
    pub versioning_info: ::core::option::Option<WorkflowExecutionVersioningInfo>,
    /// The name of Worker Deployment that completed the most recent workflow task.
    /// Experimental. Worker Deployments are experimental and might change in the future.
    #[prost(string, tag = "23")]
    pub worker_deployment_name: ::prost::alloc::string::String,
    /// Priority metadata
    #[prost(message, optional, tag = "24")]
    pub priority: ::core::option::Option<super::super::common::v1::Priority>,
    /// Total size in bytes of all external payloads referenced in workflow history.
    #[prost(int64, tag = "25")]
    pub external_payload_size_bytes: i64,
    /// Count of external payloads referenced in workflow history.
    #[prost(int64, tag = "26")]
    pub external_payload_count: i64,
}
/// Holds all the extra information about workflow execution that is not part of Visibility.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowExecutionExtendedInfo {
    /// Workflow execution expiration time is defined as workflow start time plus expiration timeout.
    /// Workflow start time may change after workflow reset.
    #[prost(message, optional, tag = "1")]
    pub execution_expiration_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Workflow run expiration time is defined as current workflow run start time plus workflow run timeout.
    #[prost(message, optional, tag = "2")]
    pub run_expiration_time: ::core::option::Option<::prost_types::Timestamp>,
    /// indicates if the workflow received a cancel request
    #[prost(bool, tag = "3")]
    pub cancel_requested: bool,
    /// Last workflow reset time. Nil if the workflow was never reset.
    #[prost(message, optional, tag = "4")]
    pub last_reset_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Original workflow start time.
    #[prost(message, optional, tag = "5")]
    pub original_start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Reset Run ID points to the new run when this execution is reset. If the execution is reset multiple times, it points to the latest run.
    #[prost(string, tag = "6")]
    pub reset_run_id: ::prost::alloc::string::String,
    /// Request ID information (eg: history event information associated with the request ID).
    /// Note: It only contains request IDs from StartWorkflowExecution requests, including indirect
    /// calls (eg: if SignalWithStartWorkflowExecution starts a new workflow, then the request ID is
    /// used in the StartWorkflowExecution request).
    #[prost(map = "string, message", tag = "7")]
    pub request_id_infos: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        RequestIdInfo,
    >,
    /// Information about the workflow execution pause operation.
    #[prost(message, optional, tag = "8")]
    pub pause_info: ::core::option::Option<WorkflowExecutionPauseInfo>,
}
/// Holds all the information about worker versioning for a particular workflow execution.
/// Experimental. Versioning info is experimental and might change in the future.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowExecutionVersioningInfo {
    /// Versioning behavior determines how the server should treat this execution when workers are
    /// upgraded. When present it means this workflow execution is versioned; UNSPECIFIED means
    /// unversioned. See the comments in `VersioningBehavior` enum for more info about different
    /// behaviors.
    ///
    /// Child workflows or CaN executions **inherit** their parent/previous run's effective Versioning
    /// Behavior and Version (except when the new execution runs on a task queue not belonging to the
    /// same deployment version as the parent/previous run's task queue). The first workflow task will
    /// be dispatched according to the inherited behavior (or to the current version of the task-queue's
    /// deployment in the case of AutoUpgrade.) After completion of their first workflow task the
    /// Deployment Version and Behavior of the execution will update according to configuration on the worker.
    ///
    /// Note that `behavior` is overridden by `versioning_override` if the latter is present.
    #[prost(enumeration = "super::super::enums::v1::VersioningBehavior", tag = "1")]
    pub behavior: i32,
    /// The worker deployment that completed the last workflow task of this workflow execution. Must
    /// be present if `behavior` is set. Absent value means no workflow task is completed, or the
    /// last workflow task was completed by an unversioned worker. Unversioned workers may still send
    /// a deployment value which will be stored here, so the right way to check if an execution is
    /// versioned if an execution is versioned or not is via the `behavior` field.
    /// Note that `deployment` is overridden by `versioning_override` if the latter is present.
    /// Deprecated. Use `deployment_version`.
    #[deprecated]
    #[prost(message, optional, tag = "2")]
    pub deployment: ::core::option::Option<super::super::deployment::v1::Deployment>,
    /// Deprecated. Use `deployment_version`.
    #[deprecated]
    #[prost(string, tag = "5")]
    pub version: ::prost::alloc::string::String,
    /// The Worker Deployment Version that completed the last workflow task of this workflow execution.
    /// An absent value means no workflow task is completed, or the workflow is unversioned.
    /// If present, and `behavior` is UNSPECIFIED, the last task of this workflow execution was completed
    /// by a worker that is not using versioning but _is_ passing Deployment Name and Build ID.
    ///
    /// Child workflows or CaN executions **inherit** their parent/previous run's effective Versioning
    /// Behavior and Version (except when the new execution runs on a task queue not belonging to the
    /// same deployment version as the parent/previous run's task queue). The first workflow task will
    /// be dispatched according to the inherited behavior (or to the current version of the task-queue's
    /// deployment in the case of AutoUpgrade.) After completion of their first workflow task the
    /// Deployment Version and Behavior of the execution will update according to configuration on the worker.
    ///
    /// Note that if `versioning_override.behavior` is PINNED then `versioning_override.pinned_version`
    /// will override this value.
    #[prost(message, optional, tag = "7")]
    pub deployment_version: ::core::option::Option<
        super::super::deployment::v1::WorkerDeploymentVersion,
    >,
    /// Present if user has set an execution-specific versioning override. This override takes
    /// precedence over SDK-sent `behavior` (and `version` when override is PINNED). An
    /// override can be set when starting a new execution, as well as afterwards by calling the
    /// `UpdateWorkflowExecutionOptions` API.
    /// Pinned overrides are automatically inherited by child workflows, continue-as-new workflows,
    /// workflow retries, and cron workflows.
    #[prost(message, optional, tag = "3")]
    pub versioning_override: ::core::option::Option<VersioningOverride>,
    /// When present, indicates the workflow is transitioning to a different deployment. Can
    /// indicate one of the following transitions: unversioned -> versioned, versioned -> versioned
    /// on a different deployment, or versioned -> unversioned.
    /// Not applicable to workflows with PINNED behavior.
    /// When a workflow with AUTO_UPGRADE behavior creates a new workflow task, it will automatically
    /// start a transition to the task queue's current deployment if the task queue's current
    /// deployment is different from the workflow's deployment.
    /// If the AUTO_UPGRADE workflow is stuck due to backlogged activity or workflow tasks, those
    /// tasks will be redirected to the task queue's current deployment. As soon as a poller from
    /// that deployment is available to receive the task, the workflow will automatically start a
    /// transition to that deployment and continue execution there.
    /// A deployment transition can only exist while there is a pending or started workflow task.
    /// Once the pending workflow task completes on the transition's target deployment, the
    /// transition completes and the workflow's `deployment` and `behavior` fields are updated per
    /// the worker's task completion response.
    /// Pending activities will not start new attempts during a transition. Once the transition is
    /// completed, pending activities will start their next attempt on the new deployment.
    /// Deprecated. Use version_transition.
    #[deprecated]
    #[prost(message, optional, tag = "4")]
    pub deployment_transition: ::core::option::Option<DeploymentTransition>,
    /// When present, indicates the workflow is transitioning to a different deployment version
    /// (which may belong to the same deployment name or another). Can indicate one of the following
    /// transitions: unversioned -> versioned, versioned -> versioned
    /// on a different deployment version, or versioned -> unversioned.
    /// Not applicable to workflows with PINNED behavior.
    /// When a workflow with AUTO_UPGRADE behavior creates a new workflow task, it will automatically
    /// start a transition to the task queue's current version if the task queue's current version is
    /// different from the workflow's current deployment version.
    /// If the AUTO_UPGRADE workflow is stuck due to backlogged activity or workflow tasks, those
    /// tasks will be redirected to the task queue's current version. As soon as a poller from
    /// that deployment version is available to receive the task, the workflow will automatically
    /// start a transition to that version and continue execution there.
    /// A version transition can only exist while there is a pending or started workflow task.
    /// Once the pending workflow task completes on the transition's target version, the
    /// transition completes and the workflow's `behavior`, and `deployment_version` fields are updated per the
    /// worker's task completion response.
    /// Pending activities will not start new attempts during a transition. Once the transition is
    /// completed, pending activities will start their next attempt on the new version.
    #[prost(message, optional, tag = "6")]
    pub version_transition: ::core::option::Option<DeploymentVersionTransition>,
    /// Monotonic counter reflecting the latest routing decision for this workflow execution.
    /// Used for staleness detection between history and matching when dispatching tasks to workers.
    /// Incremented when a workflow execution routes to a new deployment version, which happens
    /// when a worker of the new deployment version completes a workflow task.
    /// Note: Pinned tasks and sticky tasks send a value of 0 for this field since these tasks do not
    /// face the problem of inconsistent dispatching that arises from eventual consistency between
    /// task queues and their partitions.
    #[prost(int64, tag = "8")]
    pub revision_number: i64,
}
/// Holds information about ongoing transition of a workflow execution from one deployment to another.
/// Deprecated. Use DeploymentVersionTransition.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeploymentTransition {
    /// The target deployment of the transition. Null means a so-far-versioned workflow is
    /// transitioning to unversioned workers.
    #[prost(message, optional, tag = "1")]
    pub deployment: ::core::option::Option<super::super::deployment::v1::Deployment>,
}
/// Holds information about ongoing transition of a workflow execution from one worker
/// deployment version to another.
/// Experimental. Might change in the future.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeploymentVersionTransition {
    /// Deprecated. Use `deployment_version`.
    #[deprecated]
    #[prost(string, tag = "1")]
    pub version: ::prost::alloc::string::String,
    /// The target Version of the transition.
    /// If nil, a so-far-versioned workflow is transitioning to unversioned workers.
    #[prost(message, optional, tag = "2")]
    pub deployment_version: ::core::option::Option<
        super::super::deployment::v1::WorkerDeploymentVersion,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowExecutionConfig {
    #[prost(message, optional, tag = "1")]
    pub task_queue: ::core::option::Option<super::super::taskqueue::v1::TaskQueue>,
    #[prost(message, optional, tag = "2")]
    pub workflow_execution_timeout: ::core::option::Option<::prost_types::Duration>,
    #[prost(message, optional, tag = "3")]
    pub workflow_run_timeout: ::core::option::Option<::prost_types::Duration>,
    #[prost(message, optional, tag = "4")]
    pub default_workflow_task_timeout: ::core::option::Option<::prost_types::Duration>,
    /// User metadata provided on start workflow.
    #[prost(message, optional, tag = "5")]
    pub user_metadata: ::core::option::Option<super::super::sdk::v1::UserMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingActivityInfo {
    #[prost(string, tag = "1")]
    pub activity_id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub activity_type: ::core::option::Option<super::super::common::v1::ActivityType>,
    #[prost(enumeration = "super::super::enums::v1::PendingActivityState", tag = "3")]
    pub state: i32,
    #[prost(message, optional, tag = "4")]
    pub heartbeat_details: ::core::option::Option<super::super::common::v1::Payloads>,
    #[prost(message, optional, tag = "5")]
    pub last_heartbeat_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "6")]
    pub last_started_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(int32, tag = "7")]
    pub attempt: i32,
    #[prost(int32, tag = "8")]
    pub maximum_attempts: i32,
    #[prost(message, optional, tag = "9")]
    pub scheduled_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "10")]
    pub expiration_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "11")]
    pub last_failure: ::core::option::Option<super::super::failure::v1::Failure>,
    #[prost(string, tag = "12")]
    pub last_worker_identity: ::prost::alloc::string::String,
    /// Deprecated. The version stamp of the worker to whom this activity was most recently dispatched
    /// This field should be cleaned up when versioning-2 API is removed. \[cleanup-experimental-wv\]
    #[deprecated]
    #[prost(message, optional, tag = "15")]
    pub last_worker_version_stamp: ::core::option::Option<
        super::super::common::v1::WorkerVersionStamp,
    >,
    /// The time activity will wait until the next retry.
    /// If activity is currently running it will be next retry interval if activity failed.
    /// If activity is currently waiting it will be current retry interval.
    /// If there will be no retry it will be null.
    #[prost(message, optional, tag = "16")]
    pub current_retry_interval: ::core::option::Option<::prost_types::Duration>,
    /// The time when the last activity attempt was completed. If activity has not been completed yet then it will be null.
    #[prost(message, optional, tag = "17")]
    pub last_attempt_complete_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Next time when activity will be scheduled.
    /// If activity is currently scheduled or started it will be null.
    #[prost(message, optional, tag = "18")]
    pub next_attempt_schedule_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Indicates if activity is paused.
    #[prost(bool, tag = "19")]
    pub paused: bool,
    /// The deployment this activity was dispatched to most recently. Present only if the activity
    /// was dispatched to a versioned worker.
    /// Deprecated. Use `last_deployment_version`.
    #[deprecated]
    #[prost(message, optional, tag = "20")]
    pub last_deployment: ::core::option::Option<
        super::super::deployment::v1::Deployment,
    >,
    /// The Worker Deployment Version this activity was dispatched to most recently.
    /// Deprecated. Use `last_deployment_version`.
    #[deprecated]
    #[prost(string, tag = "21")]
    pub last_worker_deployment_version: ::prost::alloc::string::String,
    /// The Worker Deployment Version this activity was dispatched to most recently.
    /// If nil, the activity has not yet been dispatched or was last dispatched to an unversioned worker.
    #[prost(message, optional, tag = "25")]
    pub last_deployment_version: ::core::option::Option<
        super::super::deployment::v1::WorkerDeploymentVersion,
    >,
    /// Priority metadata. If this message is not present, or any fields are not
    /// present, they inherit the values from the workflow.
    #[prost(message, optional, tag = "22")]
    pub priority: ::core::option::Option<super::super::common::v1::Priority>,
    #[prost(message, optional, tag = "23")]
    pub pause_info: ::core::option::Option<pending_activity_info::PauseInfo>,
    /// Current activity options. May be different from the one used to start the activity.
    #[prost(message, optional, tag = "24")]
    pub activity_options: ::core::option::Option<
        super::super::activity::v1::ActivityOptions,
    >,
    /// Absence of `assigned_build_id` generally means this task is on an "unversioned" task queue.
    /// In rare cases, it can also mean that the task queue is versioned but we failed to write activity's
    /// independently-assigned build ID to the database. This case heals automatically once the task is dispatched.
    /// Deprecated. This field should be cleaned up when versioning-2 API is removed. \[cleanup-experimental-wv\]
    #[prost(oneof = "pending_activity_info::AssignedBuildId", tags = "13, 14")]
    pub assigned_build_id: ::core::option::Option<
        pending_activity_info::AssignedBuildId,
    >,
}
/// Nested message and enum types in `PendingActivityInfo`.
pub mod pending_activity_info {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct PauseInfo {
        /// The time when the activity was paused.
        #[prost(message, optional, tag = "1")]
        pub pause_time: ::core::option::Option<::prost_types::Timestamp>,
        #[prost(oneof = "pause_info::PausedBy", tags = "2, 4")]
        pub paused_by: ::core::option::Option<pause_info::PausedBy>,
    }
    /// Nested message and enum types in `PauseInfo`.
    pub mod pause_info {
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Manual {
            /// The identity of the actor that paused the activity.
            #[prost(string, tag = "1")]
            pub identity: ::prost::alloc::string::String,
            /// Reason for pausing the activity.
            #[prost(string, tag = "2")]
            pub reason: ::prost::alloc::string::String,
        }
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Rule {
            /// The rule that paused the activity.
            #[prost(string, tag = "1")]
            pub rule_id: ::prost::alloc::string::String,
            /// The identity of the actor that created the rule.
            #[prost(string, tag = "2")]
            pub identity: ::prost::alloc::string::String,
            /// Reason why rule was created. Populated from rule description.
            #[prost(string, tag = "3")]
            pub reason: ::prost::alloc::string::String,
        }
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum PausedBy {
            /// activity was paused by the manual intervention
            #[prost(message, tag = "2")]
            Manual(Manual),
            /// activity was paused by the rule
            #[prost(message, tag = "4")]
            Rule(Rule),
        }
    }
    /// Absence of `assigned_build_id` generally means this task is on an "unversioned" task queue.
    /// In rare cases, it can also mean that the task queue is versioned but we failed to write activity's
    /// independently-assigned build ID to the database. This case heals automatically once the task is dispatched.
    /// Deprecated. This field should be cleaned up when versioning-2 API is removed. \[cleanup-experimental-wv\]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum AssignedBuildId {
        /// Deprecated. When present, it means this activity is assigned to the build ID of its workflow.
        #[prost(message, tag = "13")]
        UseWorkflowBuildId(()),
        /// Deprecated. This means the activity is independently versioned and not bound to the build ID of its workflow.
        /// The activity will use the build id in this field instead.
        /// If the task fails and is scheduled again, the assigned build ID may change according to the latest versioning
        /// rules.
        #[prost(string, tag = "14")]
        LastIndependentlyAssignedBuildId(::prost::alloc::string::String),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingChildExecutionInfo {
    #[prost(string, tag = "1")]
    pub workflow_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub run_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub workflow_type_name: ::prost::alloc::string::String,
    #[prost(int64, tag = "4")]
    pub initiated_id: i64,
    /// Default: PARENT_CLOSE_POLICY_TERMINATE.
    #[prost(enumeration = "super::super::enums::v1::ParentClosePolicy", tag = "5")]
    pub parent_close_policy: i32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PendingWorkflowTaskInfo {
    #[prost(
        enumeration = "super::super::enums::v1::PendingWorkflowTaskState",
        tag = "1"
    )]
    pub state: i32,
    #[prost(message, optional, tag = "2")]
    pub scheduled_time: ::core::option::Option<::prost_types::Timestamp>,
    /// original_scheduled_time is the scheduled time of the first workflow task during workflow task heartbeat.
    /// Heartbeat workflow task is done by RespondWorkflowTaskComplete with ForceCreateNewWorkflowTask == true and no command
    /// In this case, OriginalScheduledTime won't change. Then when current time - original_scheduled_time exceeds
    /// some threshold, the workflow task will be forced timeout.
    #[prost(message, optional, tag = "3")]
    pub original_scheduled_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "4")]
    pub started_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(int32, tag = "5")]
    pub attempt: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResetPoints {
    #[prost(message, repeated, tag = "1")]
    pub points: ::prost::alloc::vec::Vec<ResetPointInfo>,
}
/// ResetPointInfo records the workflow event id that is the first one processed by a given
/// build id or binary checksum. A new reset point will be created if either build id or binary
/// checksum changes (although in general only one or the other will be used at a time).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResetPointInfo {
    /// Worker build id.
    #[prost(string, tag = "7")]
    pub build_id: ::prost::alloc::string::String,
    /// Deprecated. A worker binary version identifier.
    #[deprecated]
    #[prost(string, tag = "1")]
    pub binary_checksum: ::prost::alloc::string::String,
    /// The first run ID in the execution chain that was touched by this worker build.
    #[prost(string, tag = "2")]
    pub run_id: ::prost::alloc::string::String,
    /// Event ID of the first WorkflowTaskCompleted event processed by this worker build.
    #[prost(int64, tag = "3")]
    pub first_workflow_task_completed_id: i64,
    #[prost(message, optional, tag = "4")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// (-- api-linter: core::0214::resource-expiry=disabled
    ///      aip.dev/not-precedent: TTL is not defined for ResetPointInfo. --)
    /// The time that the run is deleted due to retention.
    #[prost(message, optional, tag = "5")]
    pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
    /// false if the reset point has pending childWFs/reqCancels/signalExternals.
    #[prost(bool, tag = "6")]
    pub resettable: bool,
}
/// NewWorkflowExecutionInfo is a shared message that encapsulates all the
/// required arguments to starting a workflow in different contexts.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NewWorkflowExecutionInfo {
    #[prost(string, tag = "1")]
    pub workflow_id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub workflow_type: ::core::option::Option<super::super::common::v1::WorkflowType>,
    #[prost(message, optional, tag = "3")]
    pub task_queue: ::core::option::Option<super::super::taskqueue::v1::TaskQueue>,
    /// Serialized arguments to the workflow.
    #[prost(message, optional, tag = "4")]
    pub input: ::core::option::Option<super::super::common::v1::Payloads>,
    /// Total workflow execution timeout including retries and continue as new.
    #[prost(message, optional, tag = "5")]
    pub workflow_execution_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Timeout of a single workflow run.
    #[prost(message, optional, tag = "6")]
    pub workflow_run_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Timeout of a single workflow task.
    #[prost(message, optional, tag = "7")]
    pub workflow_task_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Default: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE.
    #[prost(enumeration = "super::super::enums::v1::WorkflowIdReusePolicy", tag = "8")]
    pub workflow_id_reuse_policy: i32,
    /// The retry policy for the workflow. Will never exceed `workflow_execution_timeout`.
    #[prost(message, optional, tag = "9")]
    pub retry_policy: ::core::option::Option<super::super::common::v1::RetryPolicy>,
    /// See <https://docs.temporal.io/docs/content/what-is-a-temporal-cron-job/>
    #[prost(string, tag = "10")]
    pub cron_schedule: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "11")]
    pub memo: ::core::option::Option<super::super::common::v1::Memo>,
    #[prost(message, optional, tag = "12")]
    pub search_attributes: ::core::option::Option<
        super::super::common::v1::SearchAttributes,
    >,
    #[prost(message, optional, tag = "13")]
    pub header: ::core::option::Option<super::super::common::v1::Header>,
    /// Metadata on the workflow if it is started. This is carried over to the WorkflowExecutionConfig
    /// for use by user interfaces to display the fixed as-of-start summary and details of the
    /// workflow.
    #[prost(message, optional, tag = "14")]
    pub user_metadata: ::core::option::Option<super::super::sdk::v1::UserMetadata>,
    /// If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.
    /// To unset the override after the workflow is running, use UpdateWorkflowExecutionOptions.
    #[prost(message, optional, tag = "15")]
    pub versioning_override: ::core::option::Option<VersioningOverride>,
    /// Priority metadata
    #[prost(message, optional, tag = "16")]
    pub priority: ::core::option::Option<super::super::common::v1::Priority>,
}
/// CallbackInfo contains the state of an attached workflow callback.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CallbackInfo {
    /// Information on how this callback should be invoked (e.g. its URL and type).
    #[prost(message, optional, tag = "1")]
    pub callback: ::core::option::Option<super::super::common::v1::Callback>,
    /// Trigger for this callback.
    #[prost(message, optional, tag = "2")]
    pub trigger: ::core::option::Option<callback_info::Trigger>,
    /// The time when the callback was registered.
    #[prost(message, optional, tag = "3")]
    pub registration_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(enumeration = "super::super::enums::v1::CallbackState", tag = "4")]
    pub state: i32,
    /// The number of attempts made to deliver the callback.
    /// This number represents a minimum bound since the attempt is incremented after the callback request completes.
    #[prost(int32, tag = "5")]
    pub attempt: i32,
    /// The time when the last attempt completed.
    #[prost(message, optional, tag = "6")]
    pub last_attempt_complete_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The last attempt's failure, if any.
    #[prost(message, optional, tag = "7")]
    pub last_attempt_failure: ::core::option::Option<super::super::failure::v1::Failure>,
    /// The time when the next attempt is scheduled.
    #[prost(message, optional, tag = "8")]
    pub next_attempt_schedule_time: ::core::option::Option<::prost_types::Timestamp>,
    /// If the state is BLOCKED, blocked reason provides additional information.
    #[prost(string, tag = "9")]
    pub blocked_reason: ::prost::alloc::string::String,
}
/// Nested message and enum types in `CallbackInfo`.
pub mod callback_info {
    /// Trigger for when the workflow is closed.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct WorkflowClosed {}
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct Trigger {
        #[prost(oneof = "trigger::Variant", tags = "1")]
        pub variant: ::core::option::Option<trigger::Variant>,
    }
    /// Nested message and enum types in `Trigger`.
    pub mod trigger {
        #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
        pub enum Variant {
            #[prost(message, tag = "1")]
            WorkflowClosed(super::WorkflowClosed),
        }
    }
}
/// PendingNexusOperationInfo contains the state of a pending Nexus operation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingNexusOperationInfo {
    /// Endpoint name.
    /// Resolved to a URL via the cluster's endpoint registry.
    #[prost(string, tag = "1")]
    pub endpoint: ::prost::alloc::string::String,
    /// Service name.
    #[prost(string, tag = "2")]
    pub service: ::prost::alloc::string::String,
    /// Operation name.
    #[prost(string, tag = "3")]
    pub operation: ::prost::alloc::string::String,
    /// Operation ID. Only set for asynchronous operations after a successful StartOperation call.
    ///
    /// Deprecated. Renamed to operation_token.
    #[deprecated]
    #[prost(string, tag = "4")]
    pub operation_id: ::prost::alloc::string::String,
    /// Schedule-to-close timeout for this operation.
    /// This is the only timeout settable by a workflow.
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "5")]
    pub schedule_to_close_timeout: ::core::option::Option<::prost_types::Duration>,
    /// The time when the operation was scheduled.
    #[prost(message, optional, tag = "6")]
    pub scheduled_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(
        enumeration = "super::super::enums::v1::PendingNexusOperationState",
        tag = "7"
    )]
    pub state: i32,
    /// The number of attempts made to deliver the start operation request.
    /// This number represents a minimum bound since the attempt is incremented after the request completes.
    #[prost(int32, tag = "8")]
    pub attempt: i32,
    /// The time when the last attempt completed.
    #[prost(message, optional, tag = "9")]
    pub last_attempt_complete_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The last attempt's failure, if any.
    #[prost(message, optional, tag = "10")]
    pub last_attempt_failure: ::core::option::Option<super::super::failure::v1::Failure>,
    /// The time when the next attempt is scheduled.
    #[prost(message, optional, tag = "11")]
    pub next_attempt_schedule_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "12")]
    pub cancellation_info: ::core::option::Option<NexusOperationCancellationInfo>,
    /// The event ID of the NexusOperationScheduled event. Can be used to correlate an operation in the
    /// DescribeWorkflowExecution response with workflow history.
    #[prost(int64, tag = "13")]
    pub scheduled_event_id: i64,
    /// If the state is BLOCKED, blocked reason provides additional information.
    #[prost(string, tag = "14")]
    pub blocked_reason: ::prost::alloc::string::String,
    /// Operation token. Only set for asynchronous operations after a successful StartOperation call.
    #[prost(string, tag = "15")]
    pub operation_token: ::prost::alloc::string::String,
    /// Schedule-to-start timeout for this operation.
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "16")]
    pub schedule_to_start_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Start-to-close timeout for this operation.
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "17")]
    pub start_to_close_timeout: ::core::option::Option<::prost_types::Duration>,
}
/// NexusOperationCancellationInfo contains the state of a nexus operation cancellation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NexusOperationCancellationInfo {
    /// The time when cancellation was requested.
    #[prost(message, optional, tag = "1")]
    pub requested_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(
        enumeration = "super::super::enums::v1::NexusOperationCancellationState",
        tag = "2"
    )]
    pub state: i32,
    /// The number of attempts made to deliver the cancel operation request.
    /// This number represents a minimum bound since the attempt is incremented after the request completes.
    #[prost(int32, tag = "3")]
    pub attempt: i32,
    /// The time when the last attempt completed.
    #[prost(message, optional, tag = "4")]
    pub last_attempt_complete_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The last attempt's failure, if any.
    #[prost(message, optional, tag = "5")]
    pub last_attempt_failure: ::core::option::Option<super::super::failure::v1::Failure>,
    /// The time when the next attempt is scheduled.
    #[prost(message, optional, tag = "6")]
    pub next_attempt_schedule_time: ::core::option::Option<::prost_types::Timestamp>,
    /// If the state is BLOCKED, blocked reason provides additional information.
    #[prost(string, tag = "7")]
    pub blocked_reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowExecutionOptions {
    /// If set, takes precedence over the Versioning Behavior sent by the SDK on Workflow Task completion.
    #[prost(message, optional, tag = "1")]
    pub versioning_override: ::core::option::Option<VersioningOverride>,
    /// If set, overrides the workflow's priority sent by the SDK.
    #[prost(message, optional, tag = "2")]
    pub priority: ::core::option::Option<super::super::common::v1::Priority>,
}
/// Used to override the versioning behavior (and pinned deployment version, if applicable) of a
/// specific workflow execution. If set, this override takes precedence over worker-sent values.
/// See `WorkflowExecutionInfo.VersioningInfo` for more information.
///
/// To remove the override, call `UpdateWorkflowExecutionOptions` with a null
/// `VersioningOverride`, and use the `update_mask` to indicate that it should be mutated.
///
/// Pinned behavior overrides are automatically inherited by child workflows, workflow retries, continue-as-new
/// workflows, and cron workflows.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VersioningOverride {
    /// Required.
    /// Deprecated. Use `override`.
    #[deprecated]
    #[prost(enumeration = "super::super::enums::v1::VersioningBehavior", tag = "1")]
    pub behavior: i32,
    /// Required if behavior is `PINNED`. Must be null if behavior is `AUTO_UPGRADE`.
    /// Identifies the worker deployment to pin the workflow to.
    /// Deprecated. Use `override.pinned.version`.
    #[deprecated]
    #[prost(message, optional, tag = "2")]
    pub deployment: ::core::option::Option<super::super::deployment::v1::Deployment>,
    /// Required if behavior is `PINNED`. Must be absent if behavior is not `PINNED`.
    /// Identifies the worker deployment version to pin the workflow to, in the format
    /// "<deployment_name>.<build_id>".
    /// Deprecated. Use `override.pinned.version`.
    #[deprecated]
    #[prost(string, tag = "9")]
    pub pinned_version: ::prost::alloc::string::String,
    /// Indicates whether to override the workflow to be AutoUpgrade or Pinned.
    #[prost(oneof = "versioning_override::Override", tags = "3, 4")]
    pub r#override: ::core::option::Option<versioning_override::Override>,
}
/// Nested message and enum types in `VersioningOverride`.
pub mod versioning_override {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct PinnedOverride {
        /// Defaults to PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED.
        /// See `PinnedOverrideBehavior` for details.
        #[prost(enumeration = "PinnedOverrideBehavior", tag = "1")]
        pub behavior: i32,
        /// Specifies the Worker Deployment Version to pin this workflow to.
        /// Required if the target workflow is not already pinned to a version.
        ///
        /// If omitted and the target workflow is already pinned, the effective
        /// pinned version will be the existing pinned version.
        ///
        /// If omitted and the target workflow is not pinned, the override request
        /// will be rejected with a PreconditionFailed error.
        #[prost(message, optional, tag = "2")]
        pub version: ::core::option::Option<
            super::super::super::deployment::v1::WorkerDeploymentVersion,
        >,
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum PinnedOverrideBehavior {
        /// Unspecified.
        Unspecified = 0,
        /// Override workflow behavior to be Pinned.
        Pinned = 1,
    }
    impl PinnedOverrideBehavior {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED",
                Self::Pinned => "PINNED_OVERRIDE_BEHAVIOR_PINNED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
                "PINNED_OVERRIDE_BEHAVIOR_PINNED" => Some(Self::Pinned),
                _ => None,
            }
        }
    }
    /// Indicates whether to override the workflow to be AutoUpgrade or Pinned.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Override {
        /// Override the workflow to have Pinned behavior.
        #[prost(message, tag = "3")]
        Pinned(PinnedOverride),
        /// Override the workflow to have AutoUpgrade behavior.
        #[prost(bool, tag = "4")]
        AutoUpgrade(bool),
    }
}
/// When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and
/// there is already an existing running workflow, OnConflictOptions defines actions to be taken on
/// the existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent
/// history event in the running workflow with the changes requested in this object.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OnConflictOptions {
    /// Attaches the request ID to the running workflow.
    #[prost(bool, tag = "1")]
    pub attach_request_id: bool,
    /// Attaches the completion callbacks to the running workflow.
    #[prost(bool, tag = "2")]
    pub attach_completion_callbacks: bool,
    /// Attaches the links to the WorkflowExecutionOptionsUpdatedEvent history event.
    #[prost(bool, tag = "3")]
    pub attach_links: bool,
}
/// RequestIdInfo contains details of a request ID.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestIdInfo {
    /// The event type of the history event generated by the request.
    #[prost(enumeration = "super::super::enums::v1::EventType", tag = "1")]
    pub event_type: i32,
    /// The event id of the history event generated by the request. It's possible the event ID is not
    /// known (unflushed buffered event). In this case, the value will be zero or a negative value,
    /// representing an invalid ID.
    #[prost(int64, tag = "2")]
    pub event_id: i64,
    /// Indicate if the request is still buffered. If so, the event ID is not known and its value
    /// will be an invalid event ID.
    #[prost(bool, tag = "3")]
    pub buffered: bool,
}
/// PostResetOperation represents an operation to be performed on the new workflow execution after a workflow reset.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PostResetOperation {
    #[prost(oneof = "post_reset_operation::Variant", tags = "1, 2")]
    pub variant: ::core::option::Option<post_reset_operation::Variant>,
}
/// Nested message and enum types in `PostResetOperation`.
pub mod post_reset_operation {
    /// SignalWorkflow represents sending a signal after a workflow reset.
    /// Keep the parameter in sync with temporal.api.workflowservice.v1.SignalWorkflowExecutionRequest.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct SignalWorkflow {
        /// The workflow author-defined name of the signal to send to the workflow.
        #[prost(string, tag = "1")]
        pub signal_name: ::prost::alloc::string::String,
        /// Serialized value(s) to provide with the signal.
        #[prost(message, optional, tag = "2")]
        pub input: ::core::option::Option<super::super::super::common::v1::Payloads>,
        /// Headers that are passed with the signal to the processing workflow.
        #[prost(message, optional, tag = "3")]
        pub header: ::core::option::Option<super::super::super::common::v1::Header>,
        /// Links to be associated with the WorkflowExecutionSignaled event.
        #[prost(message, repeated, tag = "4")]
        pub links: ::prost::alloc::vec::Vec<super::super::super::common::v1::Link>,
    }
    /// UpdateWorkflowOptions represents updating workflow execution options after a workflow reset.
    /// Keep the parameters in sync with temporal.api.workflowservice.v1.UpdateWorkflowExecutionOptionsRequest.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct UpdateWorkflowOptions {
        /// Update Workflow options that were originally specified via StartWorkflowExecution. Partial updates are accepted and controlled by update_mask.
        #[prost(message, optional, tag = "1")]
        pub workflow_execution_options: ::core::option::Option<
            super::WorkflowExecutionOptions,
        >,
        /// Controls which fields from `workflow_execution_options` will be applied.
        /// To unset a field, set it to null and use the update mask to indicate that it should be mutated.
        #[prost(message, optional, tag = "2")]
        pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Variant {
        #[prost(message, tag = "1")]
        SignalWorkflow(SignalWorkflow),
        #[prost(message, tag = "2")]
        UpdateWorkflowOptions(UpdateWorkflowOptions),
    }
}
/// WorkflowExecutionPauseInfo contains the information about a workflow execution pause.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkflowExecutionPauseInfo {
    /// The identity of the client who paused the workflow execution.
    #[prost(string, tag = "1")]
    pub identity: ::prost::alloc::string::String,
    /// The time when the workflow execution was paused.
    #[prost(message, optional, tag = "2")]
    pub paused_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The reason for pausing the workflow execution.
    #[prost(string, tag = "3")]
    pub reason: ::prost::alloc::string::String,
}
