// This file is @generated by prost-build.
/// The outcome of a completed activity execution: either a successful result or a failure.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivityExecutionOutcome {
    #[prost(oneof = "activity_execution_outcome::Value", tags = "1, 2")]
    pub value: ::core::option::Option<activity_execution_outcome::Value>,
}
/// Nested message and enum types in `ActivityExecutionOutcome`.
pub mod activity_execution_outcome {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Value {
        /// The result if the activity completed successfully.
        #[prost(message, tag = "1")]
        Result(super::super::super::common::v1::Payloads),
        /// The failure if the activity completed unsuccessfully.
        #[prost(message, tag = "2")]
        Failure(super::super::super::failure::v1::Failure),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivityOptions {
    #[prost(message, optional, tag = "1")]
    pub task_queue: ::core::option::Option<super::super::taskqueue::v1::TaskQueue>,
    /// Indicates how long the caller is willing to wait for an activity completion. Limits how long
    /// retries will be attempted. Either this or `start_to_close_timeout` must be specified.
    ///
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "2")]
    pub schedule_to_close_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Limits time an activity task can stay in a task queue before a worker picks it up. This
    /// timeout is always non retryable, as all a retry would achieve is to put it back into the same
    /// queue. Defaults to `schedule_to_close_timeout` or workflow execution timeout if not
    /// specified.
    ///
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "3")]
    pub schedule_to_start_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Maximum time an activity is allowed to execute after being picked up by a worker. This
    /// timeout is always retryable. Either this or `schedule_to_close_timeout` must be
    /// specified.
    ///
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "4")]
    pub start_to_close_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Maximum permitted time between successful worker heartbeats.
    #[prost(message, optional, tag = "5")]
    pub heartbeat_timeout: ::core::option::Option<::prost_types::Duration>,
    /// The retry policy for the activity. Will never exceed `schedule_to_close_timeout`.
    #[prost(message, optional, tag = "6")]
    pub retry_policy: ::core::option::Option<super::super::common::v1::RetryPolicy>,
    /// 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 = "7")]
    pub priority: ::core::option::Option<super::super::common::v1::Priority>,
}
/// Information about a standalone activity.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivityExecutionInfo {
    /// Unique identifier of this activity within its namespace along with run ID (below).
    #[prost(string, tag = "1")]
    pub activity_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub run_id: ::prost::alloc::string::String,
    /// The type of the activity, a string that maps to a registered activity on a worker.
    #[prost(message, optional, tag = "3")]
    pub activity_type: ::core::option::Option<super::super::common::v1::ActivityType>,
    /// A general status for this activity, indicates whether it is currently running or in one of the terminal statuses.
    #[prost(enumeration = "super::super::enums::v1::ActivityExecutionStatus", tag = "4")]
    pub status: i32,
    /// More detailed breakdown of ACTIVITY_EXECUTION_STATUS_RUNNING.
    #[prost(enumeration = "super::super::enums::v1::PendingActivityState", tag = "5")]
    pub run_state: i32,
    #[prost(string, tag = "6")]
    pub task_queue: ::prost::alloc::string::String,
    /// Indicates how long the caller is willing to wait for an activity completion. Limits how long
    /// retries will be attempted.
    ///
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "7")]
    pub schedule_to_close_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Limits time an activity task can stay in a task queue before a worker picks it up. This
    /// timeout is always non retryable, as all a retry would achieve is to put it back into the same
    /// queue. Defaults to `schedule_to_close_timeout`.
    ///
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "8")]
    pub schedule_to_start_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Maximum time a single activity attempt is allowed to execute after being picked up by a worker. This
    /// timeout is always retryable.
    ///
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: "to" is used to indicate interval. --)
    #[prost(message, optional, tag = "9")]
    pub start_to_close_timeout: ::core::option::Option<::prost_types::Duration>,
    /// Maximum permitted time between successful worker heartbeats.
    #[prost(message, optional, tag = "10")]
    pub heartbeat_timeout: ::core::option::Option<::prost_types::Duration>,
    /// The retry policy for the activity. Will never exceed `schedule_to_close_timeout`.
    #[prost(message, optional, tag = "11")]
    pub retry_policy: ::core::option::Option<super::super::common::v1::RetryPolicy>,
    /// Details provided in the last recorded activity heartbeat.
    #[prost(message, optional, tag = "12")]
    pub heartbeat_details: ::core::option::Option<super::super::common::v1::Payloads>,
    /// Time the last heartbeat was recorded.
    #[prost(message, optional, tag = "13")]
    pub last_heartbeat_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Time the last attempt was started.
    #[prost(message, optional, tag = "14")]
    pub last_started_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The attempt this activity is currently on. Incremented each time a new attempt is scheduled.
    #[prost(int32, tag = "15")]
    pub attempt: i32,
    /// How long this activity has been running for, including all attempts and backoff between attempts.
    #[prost(message, optional, tag = "16")]
    pub execution_duration: ::core::option::Option<::prost_types::Duration>,
    /// Time the activity was originally scheduled via a StartActivityExecution request.
    #[prost(message, optional, tag = "17")]
    pub schedule_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Scheduled time + schedule to close timeout.
    #[prost(message, optional, tag = "18")]
    pub expiration_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Time when the activity transitioned to a closed state.
    #[prost(message, optional, tag = "19")]
    pub close_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Failure details from the last failed attempt.
    #[prost(message, optional, tag = "20")]
    pub last_failure: ::core::option::Option<super::super::failure::v1::Failure>,
    #[prost(string, tag = "21")]
    pub last_worker_identity: ::prost::alloc::string::String,
    /// Time from the last attempt failure to the next activity retry.
    /// If the activity is currently running, this represents the next retry interval in case the attempt fails.
    /// If activity is currently backing off between attempt, this represents the current retry interval.
    /// If there is no next retry allowed, this field will be null.
    /// This interval is typically calculated from the specified retry policy, but may be modified if an activity fails
    /// with a retryable application failure specifying a retry delay.
    #[prost(message, optional, tag = "22")]
    pub current_retry_interval: ::core::option::Option<::prost_types::Duration>,
    /// The time when the last activity attempt completed. If activity has not been completed yet, it will be null.
    #[prost(message, optional, tag = "23")]
    pub last_attempt_complete_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The time when the next activity attempt will be scheduled.
    /// If activity is currently scheduled or started, this field will be null.
    #[prost(message, optional, tag = "24")]
    pub next_attempt_schedule_time: ::core::option::Option<::prost_types::Timestamp>,
    /// 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.
    #[prost(message, optional, tag = "26")]
    pub priority: ::core::option::Option<super::super::common::v1::Priority>,
    /// Incremented each time the activity's state is mutated in persistence.
    #[prost(int64, tag = "27")]
    pub state_transition_count: i64,
    /// Updated once on scheduled and once on terminal status.
    #[prost(int64, tag = "28")]
    pub state_size_bytes: i64,
    #[prost(message, optional, tag = "29")]
    pub search_attributes: ::core::option::Option<
        super::super::common::v1::SearchAttributes,
    >,
    #[prost(message, optional, tag = "30")]
    pub header: ::core::option::Option<super::super::common::v1::Header>,
    /// Metadata for use by user interfaces to display the fixed as-of-start summary and details of the activity.
    #[prost(message, optional, tag = "31")]
    pub user_metadata: ::core::option::Option<super::super::sdk::v1::UserMetadata>,
    /// Set if activity cancelation was requested.
    #[prost(string, tag = "32")]
    pub canceled_reason: ::prost::alloc::string::String,
}
/// Limited activity information returned in the list response.
/// When adding fields here, ensure that it is also present in ActivityExecutionInfo (note that it
/// may already be present in ActivityExecutionInfo but not at the top-level).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivityExecutionListInfo {
    /// A unique identifier of this activity within its namespace along with run ID (below).
    #[prost(string, tag = "1")]
    pub activity_id: ::prost::alloc::string::String,
    /// The run ID of the standalone activity.
    #[prost(string, tag = "2")]
    pub run_id: ::prost::alloc::string::String,
    /// The type of the activity, a string that maps to a registered activity on a worker.
    #[prost(message, optional, tag = "3")]
    pub activity_type: ::core::option::Option<super::super::common::v1::ActivityType>,
    /// Time the activity was originally scheduled via a StartActivityExecution request.
    #[prost(message, optional, tag = "4")]
    pub schedule_time: ::core::option::Option<::prost_types::Timestamp>,
    /// If the activity is in a terminal status, this field represents the time the activity transitioned to that status.
    #[prost(message, optional, tag = "5")]
    pub close_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Only scheduled and terminal statuses appear here. More detailed information in PendingActivityInfo but not
    /// available in the list response.
    #[prost(enumeration = "super::super::enums::v1::ActivityExecutionStatus", tag = "6")]
    pub status: i32,
    /// Search attributes from the start request.
    #[prost(message, optional, tag = "7")]
    pub search_attributes: ::core::option::Option<
        super::super::common::v1::SearchAttributes,
    >,
    /// The task queue this activity was scheduled on when it was originally started, updated on activity options update.
    #[prost(string, tag = "8")]
    pub task_queue: ::prost::alloc::string::String,
    /// Updated on terminal status.
    #[prost(int64, tag = "9")]
    pub state_transition_count: i64,
    /// Updated once on scheduled and once on terminal status.
    #[prost(int64, tag = "10")]
    pub state_size_bytes: i64,
    /// The difference between close time and scheduled time.
    /// This field is only populated if the activity is closed.
    #[prost(message, optional, tag = "11")]
    pub execution_duration: ::core::option::Option<::prost_types::Duration>,
}
