// This file is @generated by prost-build.
/// Worker Deployment options set in SDK that need to be sent to server in every poll.
/// Experimental. Worker Deployments are experimental and might significantly change in the future.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerDeploymentOptions {
    /// Required when `worker_versioning_mode==VERSIONED`.
    #[prost(string, tag = "1")]
    pub deployment_name: ::prost::alloc::string::String,
    /// The Build ID of the worker. Required when `worker_versioning_mode==VERSIONED`, in which case,
    /// the worker will be part of a Deployment Version.
    #[prost(string, tag = "2")]
    pub build_id: ::prost::alloc::string::String,
    /// Required. Versioning Mode for this worker. Must be the same for all workers with the
    /// same `deployment_name` and `build_id` combination, across all Task Queues.
    /// When `worker_versioning_mode==VERSIONED`, the worker will be part of a Deployment Version.
    #[prost(enumeration = "super::super::enums::v1::WorkerVersioningMode", tag = "3")]
    pub worker_versioning_mode: i32,
}
/// `Deployment` identifies a deployment of Temporal workers. The combination of deployment series
/// name + build ID serves as the identifier. User can use `WorkerDeploymentOptions` in their worker
/// programs to specify these values.
/// Deprecated.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Deployment {
    /// Different versions of the same worker service/application are related together by having a
    /// shared series name.
    /// Out of all deployments of a series, one can be designated as the current deployment, which
    /// receives new workflow executions and new tasks of workflows with
    /// `VERSIONING_BEHAVIOR_AUTO_UPGRADE` versioning behavior.
    #[prost(string, tag = "1")]
    pub series_name: ::prost::alloc::string::String,
    /// Build ID changes with each version of the worker when the worker program code and/or config
    /// changes.
    #[prost(string, tag = "2")]
    pub build_id: ::prost::alloc::string::String,
}
/// `DeploymentInfo` holds information about a deployment. Deployment information is tracked
/// automatically by server as soon as the first poll from that deployment reaches the server. There
/// can be multiple task queue workers in a single deployment which are listed in this message.
/// Deprecated.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeploymentInfo {
    #[prost(message, optional, tag = "1")]
    pub deployment: ::core::option::Option<Deployment>,
    #[prost(message, optional, tag = "2")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, repeated, tag = "3")]
    pub task_queue_infos: ::prost::alloc::vec::Vec<deployment_info::TaskQueueInfo>,
    /// A user-defined set of key-values. Can be updated as part of write operations to the
    /// deployment, such as `SetCurrentDeployment`.
    #[prost(map = "string, message", tag = "4")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::common::v1::Payload,
    >,
    /// If this deployment is the current deployment of its deployment series.
    #[prost(bool, tag = "5")]
    pub is_current: bool,
}
/// Nested message and enum types in `DeploymentInfo`.
pub mod deployment_info {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct TaskQueueInfo {
        #[prost(string, tag = "1")]
        pub name: ::prost::alloc::string::String,
        #[prost(
            enumeration = "super::super::super::enums::v1::TaskQueueType",
            tag = "2"
        )]
        pub r#type: i32,
        /// When server saw the first poller for this task queue in this deployment.
        #[prost(message, optional, tag = "3")]
        pub first_poller_time: ::core::option::Option<::prost_types::Timestamp>,
    }
}
/// Used as part of Deployment write APIs to update metadata attached to a deployment.
/// Deprecated.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateDeploymentMetadata {
    #[prost(map = "string, message", tag = "1")]
    pub upsert_entries: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::common::v1::Payload,
    >,
    /// List of keys to remove from the metadata.
    #[prost(string, repeated, tag = "2")]
    pub remove_entries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// DeploymentListInfo is an abbreviated set of fields from DeploymentInfo that's returned in
/// ListDeployments.
/// Deprecated.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeploymentListInfo {
    #[prost(message, optional, tag = "1")]
    pub deployment: ::core::option::Option<Deployment>,
    #[prost(message, optional, tag = "2")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// If this deployment is the current deployment of its deployment series.
    #[prost(bool, tag = "3")]
    pub is_current: bool,
}
/// A Worker Deployment Version (Version, for short) represents all workers of the same
/// code and config within a Deployment. Workers of the same Version are expected to
/// behave exactly the same so when executions move between them there are no
/// non-determinism issues.
/// Worker Deployment Versions are created in Temporal server automatically when
/// their first poller arrives to the server.
/// Experimental. Worker Deployments are experimental and might significantly change in the future.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerDeploymentVersionInfo {
    /// Deprecated. Use `deployment_version`.
    #[deprecated]
    #[prost(string, tag = "1")]
    pub version: ::prost::alloc::string::String,
    /// The status of the Worker Deployment Version.
    #[prost(
        enumeration = "super::super::enums::v1::WorkerDeploymentVersionStatus",
        tag = "14"
    )]
    pub status: i32,
    /// Required.
    #[prost(message, optional, tag = "11")]
    pub deployment_version: ::core::option::Option<WorkerDeploymentVersion>,
    #[prost(string, tag = "2")]
    pub deployment_name: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Last time `current_since_time`, `ramping_since_time, or `ramp_percentage` of this version changed.
    #[prost(message, optional, tag = "4")]
    pub routing_changed_time: ::core::option::Option<::prost_types::Timestamp>,
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --)
    /// Unset if not current.
    #[prost(message, optional, tag = "5")]
    pub current_since_time: ::core::option::Option<::prost_types::Timestamp>,
    /// (-- api-linter: core::0140::prepositions=disabled
    ///      aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --)
    /// Unset if not ramping. Updated when the version first starts ramping, not on each ramp change.
    #[prost(message, optional, tag = "6")]
    pub ramping_since_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Timestamp when this version first became current or ramping.
    #[prost(message, optional, tag = "12")]
    pub first_activation_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Timestamp when this version last became current.
    /// Can be used to determine whether a version has ever been Current.
    #[prost(message, optional, tag = "15")]
    pub last_current_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Timestamp when this version last stopped being current or ramping.
    /// Cleared if the version becomes current or ramping again.
    #[prost(message, optional, tag = "13")]
    pub last_deactivation_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Range: \[0, 100\]. Must be zero if the version is not ramping (i.e. `ramping_since_time` is nil).
    /// Can be in the range \[0, 100\] if the version is ramping.
    #[prost(float, tag = "7")]
    pub ramp_percentage: f32,
    /// All the Task Queues that have ever polled from this Deployment version.
    /// Deprecated. Use `version_task_queues` in DescribeWorkerDeploymentVersionResponse instead.
    #[prost(message, repeated, tag = "8")]
    pub task_queue_infos: ::prost::alloc::vec::Vec<
        worker_deployment_version_info::VersionTaskQueueInfo,
    >,
    /// Helps user determine when it is safe to decommission the workers of this
    /// Version. Not present when version is current or ramping.
    /// Current limitations:
    /// - Not supported for Unversioned mode.
    /// - Periodically refreshed, may have delays up to few minutes (consult the
    ///    last_checked_time value).
    /// - Refreshed only when version is not current or ramping AND the status is not
    ///    "drained" yet.
    /// - Once the status is changed to "drained", it is not changed until the Version
    ///    becomes Current or Ramping again, at which time the drainage info is cleared.
    ///    This means if the Version is "drained" but new workflows are sent to it via
    ///    Pinned Versioning Override, the status does not account for those Pinned-override
    ///    executions and remains "drained".
    #[prost(message, optional, tag = "9")]
    pub drainage_info: ::core::option::Option<VersionDrainageInfo>,
    /// Arbitrary user-provided metadata attached to this version.
    #[prost(message, optional, tag = "10")]
    pub metadata: ::core::option::Option<VersionMetadata>,
}
/// Nested message and enum types in `WorkerDeploymentVersionInfo`.
pub mod worker_deployment_version_info {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct VersionTaskQueueInfo {
        #[prost(string, tag = "1")]
        pub name: ::prost::alloc::string::String,
        #[prost(
            enumeration = "super::super::super::enums::v1::TaskQueueType",
            tag = "2"
        )]
        pub r#type: i32,
    }
}
/// Information about workflow drainage to help the user determine when it is safe
/// to decommission a Version. Not present while version is current or ramping.
/// Experimental. Worker Deployments are experimental and might significantly change in the future.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct VersionDrainageInfo {
    /// Set to DRAINING when the version first stops accepting new executions (is no longer current or ramping).
    /// Set to DRAINED when no more open pinned workflows exist on this version.
    #[prost(enumeration = "super::super::enums::v1::VersionDrainageStatus", tag = "1")]
    pub status: i32,
    /// Last time the drainage status changed.
    #[prost(message, optional, tag = "2")]
    pub last_changed_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Last time the system checked for drainage of this version.
    #[prost(message, optional, tag = "3")]
    pub last_checked_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// A Worker Deployment (Deployment, for short) represents all workers serving
/// a shared set of Task Queues. Typically, a Deployment represents one service or
/// application.
/// A Deployment contains multiple Deployment Versions, each representing a different
/// version of workers. (see documentation of WorkerDeploymentVersionInfo)
/// Deployment records are created in Temporal server automatically when their
/// first poller arrives to the server.
/// Experimental. Worker Deployments are experimental and might significantly change in the future.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerDeploymentInfo {
    /// Identifies a Worker Deployment. Must be unique within the namespace.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be
    /// cleaned up automatically if all the following conditions meet:
    /// - It does not receive new executions (is not current or ramping)
    /// - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status)
    /// - It is drained (see WorkerDeploymentVersionInfo.drainage_status)
    #[prost(message, repeated, tag = "2")]
    pub version_summaries: ::prost::alloc::vec::Vec<
        worker_deployment_info::WorkerDeploymentVersionSummary,
    >,
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "4")]
    pub routing_config: ::core::option::Option<RoutingConfig>,
    /// Identity of the last client who modified the configuration of this Deployment. Set to the
    /// `identity` value sent by APIs such as `SetWorkerDeploymentCurrentVersion` and
    /// `SetWorkerDeploymentRampingVersion`.
    #[prost(string, tag = "5")]
    pub last_modifier_identity: ::prost::alloc::string::String,
    /// Identity of the client that has the exclusive right to make changes to this Worker Deployment.
    /// Empty by default.
    /// If this is set, clients whose identity does not match `manager_identity` will not be able to make changes
    /// to this Worker Deployment. They can either set their own identity as the manager or unset the field to proceed.
    #[prost(string, tag = "6")]
    pub manager_identity: ::prost::alloc::string::String,
    /// Indicates whether the routing_config has been fully propagated to all
    /// relevant task queues and their partitions.
    #[prost(
        enumeration = "super::super::enums::v1::RoutingConfigUpdateState",
        tag = "7"
    )]
    pub routing_config_update_state: i32,
}
/// Nested message and enum types in `WorkerDeploymentInfo`.
pub mod worker_deployment_info {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct WorkerDeploymentVersionSummary {
        /// Deprecated. Use `deployment_version`.
        #[deprecated]
        #[prost(string, tag = "1")]
        pub version: ::prost::alloc::string::String,
        /// The status of the Worker Deployment Version.
        #[prost(
            enumeration = "super::super::super::enums::v1::WorkerDeploymentVersionStatus",
            tag = "11"
        )]
        pub status: i32,
        /// Required.
        #[prost(message, optional, tag = "4")]
        pub deployment_version: ::core::option::Option<super::WorkerDeploymentVersion>,
        #[prost(message, optional, tag = "2")]
        pub create_time: ::core::option::Option<::prost_types::Timestamp>,
        /// Deprecated. Use `drainage_info` instead.
        #[prost(
            enumeration = "super::super::super::enums::v1::VersionDrainageStatus",
            tag = "3"
        )]
        pub drainage_status: i32,
        /// Information about workflow drainage to help the user determine when it is safe
        /// to decommission a Version. Not present while version is current or ramping
        #[prost(message, optional, tag = "5")]
        pub drainage_info: ::core::option::Option<super::VersionDrainageInfo>,
        /// Unset if not current.
        /// (-- api-linter: core::0140::prepositions=disabled
        ///      aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --)
        #[prost(message, optional, tag = "6")]
        pub current_since_time: ::core::option::Option<::prost_types::Timestamp>,
        /// Unset if not ramping. Updated when the version first starts ramping, not on each ramp change.
        /// (-- api-linter: core::0140::prepositions=disabled
        ///      aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --)
        #[prost(message, optional, tag = "7")]
        pub ramping_since_time: ::core::option::Option<::prost_types::Timestamp>,
        /// Last time `current_since_time`, `ramping_since_time, or `ramp_percentage` of this version changed.
        #[prost(message, optional, tag = "8")]
        pub routing_update_time: ::core::option::Option<::prost_types::Timestamp>,
        /// Timestamp when this version first became current or ramping.
        #[prost(message, optional, tag = "9")]
        pub first_activation_time: ::core::option::Option<::prost_types::Timestamp>,
        /// Timestamp when this version last became current.
        /// Can be used to determine whether a version has ever been Current.
        #[prost(message, optional, tag = "12")]
        pub last_current_time: ::core::option::Option<::prost_types::Timestamp>,
        /// Timestamp when this version last stopped being current or ramping.
        /// Cleared if the version becomes current or ramping again.
        #[prost(message, optional, tag = "10")]
        pub last_deactivation_time: ::core::option::Option<::prost_types::Timestamp>,
    }
}
/// A Worker Deployment Version (Version, for short) represents a
/// version of workers within a Worker Deployment. (see documentation of WorkerDeploymentVersionInfo)
/// Version records are created in Temporal server automatically when their
/// first poller arrives to the server.
/// Experimental. Worker Deployment Versions are experimental and might significantly change in the future.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerDeploymentVersion {
    /// A unique identifier for this Version within the Deployment it is a part of.
    /// Not necessarily unique within the namespace.
    /// The combination of `deployment_name` and `build_id` uniquely identifies this
    /// Version within the namespace, because Deployment names are unique within a namespace.
    #[prost(string, tag = "1")]
    pub build_id: ::prost::alloc::string::String,
    /// Identifies the Worker Deployment this Version is part of.
    #[prost(string, tag = "2")]
    pub deployment_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VersionMetadata {
    /// Arbitrary key-values.
    #[prost(map = "string, message", tag = "1")]
    pub entries: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::common::v1::Payload,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoutingConfig {
    /// Specifies which Deployment Version should receive new workflow executions and tasks of
    /// existing unversioned or AutoUpgrade workflows.
    /// Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set)  goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.).
    /// Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage
    /// is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`).
    #[prost(message, optional, tag = "7")]
    pub current_deployment_version: ::core::option::Option<WorkerDeploymentVersion>,
    /// Deprecated. Use `current_deployment_version`.
    #[deprecated]
    #[prost(string, tag = "1")]
    pub current_version: ::prost::alloc::string::String,
    /// When ramp percentage is non-zero, that portion of traffic is shifted from the Current Version to the Ramping Version.
    /// Must always be different from `current_deployment_version` unless both are nil.
    /// Nil value represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
    /// Note that it is possible to ramp from one Version to another Version, or from unversioned
    /// workers to a particular Version, or from a particular Version to unversioned workers.
    #[prost(message, optional, tag = "9")]
    pub ramping_deployment_version: ::core::option::Option<WorkerDeploymentVersion>,
    /// Deprecated. Use `ramping_deployment_version`.
    #[deprecated]
    #[prost(string, tag = "2")]
    pub ramping_version: ::prost::alloc::string::String,
    /// Percentage of tasks that are routed to the Ramping Version instead of the Current Version.
    /// Valid range: \[0, 100\]. A 100% value means the Ramping Version is receiving full traffic but
    /// not yet "promoted" to be the Current Version, likely due to pending validations.
    /// A 0% value means the Ramping Version is receiving no traffic.
    #[prost(float, tag = "3")]
    pub ramping_version_percentage: f32,
    /// Last time current version was changed.
    #[prost(message, optional, tag = "4")]
    pub current_version_changed_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Last time ramping version was changed. Not updated if only the ramp percentage changes.
    #[prost(message, optional, tag = "5")]
    pub ramping_version_changed_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Last time ramping version percentage was changed.
    /// If ramping version is changed, this is also updated, even if the percentage stays the same.
    #[prost(message, optional, tag = "6")]
    pub ramping_version_percentage_changed_time: ::core::option::Option<
        ::prost_types::Timestamp,
    >,
    /// Monotonically increasing value which is incremented on every mutation
    /// to any field of this message to achieve eventual consistency between task queues and their partitions.
    #[prost(int64, tag = "10")]
    pub revision_number: i64,
}
/// Used as part of WorkflowExecutionStartedEventAttributes to pass down the AutoUpgrade behavior and source deployment version
/// to a workflow execution whose parent/previous workflow has an AutoUpgrade behavior.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InheritedAutoUpgradeInfo {
    /// The source deployment version of the parent/previous workflow.
    #[prost(message, optional, tag = "1")]
    pub source_deployment_version: ::core::option::Option<WorkerDeploymentVersion>,
    /// The revision number of the source deployment version of the parent/previous workflow.
    #[prost(int64, tag = "2")]
    pub source_deployment_revision_number: i64,
}
