#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_type;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomationEvent {
pub message: std::string::String,
pub automation: std::string::String,
pub pipeline_uid: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_automation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.automation = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for AutomationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AutomationEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomationRunEvent {
pub message: std::string::String,
pub automation_run: std::string::String,
pub pipeline_uid: std::string::String,
pub automation_id: std::string::String,
pub rule_id: std::string::String,
pub destination_target_id: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomationRunEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_automation_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.automation_run = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.automation_id = v.into();
self
}
pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rule_id = v.into();
self
}
pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_target_id = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for AutomationRunEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AutomationRunEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeliveryPipeline {
pub name: std::string::String,
pub uid: std::string::String,
pub description: std::string::String,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub condition: std::option::Option<crate::model::PipelineCondition>,
pub etag: std::string::String,
pub suspended: bool,
pub pipeline: std::option::Option<crate::model::delivery_pipeline::Pipeline>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeliveryPipeline {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PipelineCondition>,
{
self.condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PipelineCondition>,
{
self.condition = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.suspended = v.into();
self
}
pub fn set_pipeline<
T: std::convert::Into<std::option::Option<crate::model::delivery_pipeline::Pipeline>>,
>(
mut self,
v: T,
) -> Self {
self.pipeline = v.into();
self
}
pub fn serial_pipeline(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SerialPipeline>> {
#[allow(unreachable_patterns)]
self.pipeline.as_ref().and_then(|v| match v {
crate::model::delivery_pipeline::Pipeline::SerialPipeline(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_serial_pipeline<
T: std::convert::Into<std::boxed::Box<crate::model::SerialPipeline>>,
>(
mut self,
v: T,
) -> Self {
self.pipeline = std::option::Option::Some(
crate::model::delivery_pipeline::Pipeline::SerialPipeline(v.into()),
);
self
}
}
impl wkt::message::Message for DeliveryPipeline {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeliveryPipeline"
}
}
pub mod delivery_pipeline {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Pipeline {
SerialPipeline(std::boxed::Box<crate::model::SerialPipeline>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SerialPipeline {
pub stages: std::vec::Vec<crate::model::Stage>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SerialPipeline {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_stages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Stage>,
{
use std::iter::Iterator;
self.stages = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SerialPipeline {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.SerialPipeline"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Stage {
pub target_id: std::string::String,
pub profiles: std::vec::Vec<std::string::String>,
pub strategy: std::option::Option<crate::model::Strategy>,
pub deploy_parameters: std::vec::Vec<crate::model::DeployParameters>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Stage {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_profiles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.profiles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_strategy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Strategy>,
{
self.strategy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_strategy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Strategy>,
{
self.strategy = v.map(|x| x.into());
self
}
pub fn set_deploy_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DeployParameters>,
{
use std::iter::Iterator;
self.deploy_parameters = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Stage {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Stage"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployParameters {
pub values: std::collections::HashMap<std::string::String, std::string::String>,
pub match_target_labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployParameters {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_values<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_match_target_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.match_target_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for DeployParameters {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployParameters"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Strategy {
pub deployment_strategy: std::option::Option<crate::model::strategy::DeploymentStrategy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Strategy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_deployment_strategy<
T: std::convert::Into<std::option::Option<crate::model::strategy::DeploymentStrategy>>,
>(
mut self,
v: T,
) -> Self {
self.deployment_strategy = v.into();
self
}
pub fn standard(&self) -> std::option::Option<&std::boxed::Box<crate::model::Standard>> {
#[allow(unreachable_patterns)]
self.deployment_strategy.as_ref().and_then(|v| match v {
crate::model::strategy::DeploymentStrategy::Standard(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_standard<T: std::convert::Into<std::boxed::Box<crate::model::Standard>>>(
mut self,
v: T,
) -> Self {
self.deployment_strategy = std::option::Option::Some(
crate::model::strategy::DeploymentStrategy::Standard(v.into()),
);
self
}
pub fn canary(&self) -> std::option::Option<&std::boxed::Box<crate::model::Canary>> {
#[allow(unreachable_patterns)]
self.deployment_strategy.as_ref().and_then(|v| match v {
crate::model::strategy::DeploymentStrategy::Canary(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_canary<T: std::convert::Into<std::boxed::Box<crate::model::Canary>>>(
mut self,
v: T,
) -> Self {
self.deployment_strategy =
std::option::Option::Some(crate::model::strategy::DeploymentStrategy::Canary(v.into()));
self
}
}
impl wkt::message::Message for Strategy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Strategy"
}
}
pub mod strategy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DeploymentStrategy {
Standard(std::boxed::Box<crate::model::Standard>),
Canary(std::boxed::Box<crate::model::Canary>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Predeploy {
pub actions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Predeploy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.actions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Predeploy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Predeploy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Postdeploy {
pub actions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Postdeploy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.actions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Postdeploy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Postdeploy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Standard {
pub verify: bool,
pub predeploy: std::option::Option<crate::model::Predeploy>,
pub postdeploy: std::option::Option<crate::model::Postdeploy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Standard {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verify = v.into();
self
}
pub fn set_predeploy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Predeploy>,
{
self.predeploy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Predeploy>,
{
self.predeploy = v.map(|x| x.into());
self
}
pub fn set_postdeploy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Postdeploy>,
{
self.postdeploy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Postdeploy>,
{
self.postdeploy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Standard {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Standard"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Canary {
pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
pub mode: std::option::Option<crate::model::canary::Mode>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Canary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_runtime_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RuntimeConfig>,
{
self.runtime_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RuntimeConfig>,
{
self.runtime_config = v.map(|x| x.into());
self
}
pub fn set_mode<T: std::convert::Into<std::option::Option<crate::model::canary::Mode>>>(
mut self,
v: T,
) -> Self {
self.mode = v.into();
self
}
pub fn canary_deployment(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CanaryDeployment>> {
#[allow(unreachable_patterns)]
self.mode.as_ref().and_then(|v| match v {
crate::model::canary::Mode::CanaryDeployment(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_canary_deployment<
T: std::convert::Into<std::boxed::Box<crate::model::CanaryDeployment>>,
>(
mut self,
v: T,
) -> Self {
self.mode =
std::option::Option::Some(crate::model::canary::Mode::CanaryDeployment(v.into()));
self
}
pub fn custom_canary_deployment(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CustomCanaryDeployment>> {
#[allow(unreachable_patterns)]
self.mode.as_ref().and_then(|v| match v {
crate::model::canary::Mode::CustomCanaryDeployment(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_custom_canary_deployment<
T: std::convert::Into<std::boxed::Box<crate::model::CustomCanaryDeployment>>,
>(
mut self,
v: T,
) -> Self {
self.mode =
std::option::Option::Some(crate::model::canary::Mode::CustomCanaryDeployment(v.into()));
self
}
}
impl wkt::message::Message for Canary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Canary"
}
}
pub mod canary {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mode {
CanaryDeployment(std::boxed::Box<crate::model::CanaryDeployment>),
CustomCanaryDeployment(std::boxed::Box<crate::model::CustomCanaryDeployment>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CanaryDeployment {
pub percentages: std::vec::Vec<i32>,
pub verify: bool,
pub predeploy: std::option::Option<crate::model::Predeploy>,
pub postdeploy: std::option::Option<crate::model::Postdeploy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CanaryDeployment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_percentages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<i32>,
{
use std::iter::Iterator;
self.percentages = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verify = v.into();
self
}
pub fn set_predeploy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Predeploy>,
{
self.predeploy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Predeploy>,
{
self.predeploy = v.map(|x| x.into());
self
}
pub fn set_postdeploy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Postdeploy>,
{
self.postdeploy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Postdeploy>,
{
self.postdeploy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CanaryDeployment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CanaryDeployment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomCanaryDeployment {
pub phase_configs: std::vec::Vec<crate::model::custom_canary_deployment::PhaseConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomCanaryDeployment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_phase_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::custom_canary_deployment::PhaseConfig>,
{
use std::iter::Iterator;
self.phase_configs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CustomCanaryDeployment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment"
}
}
pub mod custom_canary_deployment {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PhaseConfig {
pub phase_id: std::string::String,
pub percentage: i32,
pub profiles: std::vec::Vec<std::string::String>,
pub verify: bool,
pub predeploy: std::option::Option<crate::model::Predeploy>,
pub postdeploy: std::option::Option<crate::model::Postdeploy>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PhaseConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phase_id = v.into();
self
}
pub fn set_percentage<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.percentage = v.into();
self
}
pub fn set_profiles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.profiles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_verify<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verify = v.into();
self
}
pub fn set_predeploy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Predeploy>,
{
self.predeploy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_predeploy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Predeploy>,
{
self.predeploy = v.map(|x| x.into());
self
}
pub fn set_postdeploy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Postdeploy>,
{
self.postdeploy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_postdeploy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Postdeploy>,
{
self.postdeploy = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PhaseConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CustomCanaryDeployment.PhaseConfig"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KubernetesConfig {
pub service_definition: std::option::Option<crate::model::kubernetes_config::ServiceDefinition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KubernetesConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_definition<
T: std::convert::Into<std::option::Option<crate::model::kubernetes_config::ServiceDefinition>>,
>(
mut self,
v: T,
) -> Self {
self.service_definition = v.into();
self
}
pub fn gateway_service_mesh(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>
{
#[allow(unreachable_patterns)]
self.service_definition.as_ref().and_then(|v| match v {
crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_gateway_service_mesh<
T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>>,
>(
mut self,
v: T,
) -> Self {
self.service_definition = std::option::Option::Some(
crate::model::kubernetes_config::ServiceDefinition::GatewayServiceMesh(v.into()),
);
self
}
pub fn service_networking(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>
{
#[allow(unreachable_patterns)]
self.service_definition.as_ref().and_then(|v| match v {
crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_service_networking<
T: std::convert::Into<std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>>,
>(
mut self,
v: T,
) -> Self {
self.service_definition = std::option::Option::Some(
crate::model::kubernetes_config::ServiceDefinition::ServiceNetworking(v.into()),
);
self
}
}
impl wkt::message::Message for KubernetesConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig"
}
}
pub mod kubernetes_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GatewayServiceMesh {
pub http_route: std::string::String,
pub service: std::string::String,
pub deployment: std::string::String,
pub route_update_wait_time: std::option::Option<wkt::Duration>,
pub stable_cutback_duration: std::option::Option<wkt::Duration>,
pub pod_selector_label: std::string::String,
pub route_destinations: std::option::Option<
crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GatewayServiceMesh {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_http_route<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.http_route = v.into();
self
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deployment = v.into();
self
}
pub fn set_route_update_wait_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.route_update_wait_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_route_update_wait_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.route_update_wait_time = v.map(|x| x.into());
self
}
pub fn set_stable_cutback_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.stable_cutback_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_stable_cutback_duration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.stable_cutback_duration = v.map(|x| x.into());
self
}
pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.pod_selector_label = v.into();
self
}
pub fn set_route_destinations<T>(mut self, v: T) -> Self
where
T: std::convert::Into<
crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
>,
{
self.route_destinations = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_route_destinations<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<
crate::model::kubernetes_config::gateway_service_mesh::RouteDestinations,
>,
{
self.route_destinations = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GatewayServiceMesh {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh"
}
}
pub mod gateway_service_mesh {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteDestinations {
pub destination_ids: std::vec::Vec<std::string::String>,
pub propagate_service: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteDestinations {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_destination_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.destination_ids = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_propagate_service<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.propagate_service = v.into();
self
}
}
impl wkt::message::Message for RouteDestinations {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.GatewayServiceMesh.RouteDestinations"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceNetworking {
pub service: std::string::String,
pub deployment: std::string::String,
pub disable_pod_overprovisioning: bool,
pub pod_selector_label: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceNetworking {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deployment = v.into();
self
}
pub fn set_disable_pod_overprovisioning<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.disable_pod_overprovisioning = v.into();
self
}
pub fn set_pod_selector_label<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.pod_selector_label = v.into();
self
}
}
impl wkt::message::Message for ServiceNetworking {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.KubernetesConfig.ServiceNetworking"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ServiceDefinition {
GatewayServiceMesh(std::boxed::Box<crate::model::kubernetes_config::GatewayServiceMesh>),
ServiceNetworking(std::boxed::Box<crate::model::kubernetes_config::ServiceNetworking>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudRunConfig {
pub automatic_traffic_control: bool,
pub canary_revision_tags: std::vec::Vec<std::string::String>,
pub prior_revision_tags: std::vec::Vec<std::string::String>,
pub stable_revision_tags: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudRunConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_automatic_traffic_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.automatic_traffic_control = v.into();
self
}
pub fn set_canary_revision_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.canary_revision_tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_prior_revision_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.prior_revision_tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_stable_revision_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.stable_revision_tags = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CloudRunConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CloudRunConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuntimeConfig {
pub runtime_config: std::option::Option<crate::model::runtime_config::RuntimeConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuntimeConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_runtime_config<
T: std::convert::Into<std::option::Option<crate::model::runtime_config::RuntimeConfig>>,
>(
mut self,
v: T,
) -> Self {
self.runtime_config = v.into();
self
}
pub fn kubernetes(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesConfig>> {
#[allow(unreachable_patterns)]
self.runtime_config.as_ref().and_then(|v| match v {
crate::model::runtime_config::RuntimeConfig::Kubernetes(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_kubernetes<
T: std::convert::Into<std::boxed::Box<crate::model::KubernetesConfig>>,
>(
mut self,
v: T,
) -> Self {
self.runtime_config = std::option::Option::Some(
crate::model::runtime_config::RuntimeConfig::Kubernetes(v.into()),
);
self
}
pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunConfig>> {
#[allow(unreachable_patterns)]
self.runtime_config.as_ref().and_then(|v| match v {
crate::model::runtime_config::RuntimeConfig::CloudRun(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunConfig>>>(
mut self,
v: T,
) -> Self {
self.runtime_config = std::option::Option::Some(
crate::model::runtime_config::RuntimeConfig::CloudRun(v.into()),
);
self
}
}
impl wkt::message::Message for RuntimeConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RuntimeConfig"
}
}
pub mod runtime_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RuntimeConfig {
Kubernetes(std::boxed::Box<crate::model::KubernetesConfig>),
CloudRun(std::boxed::Box<crate::model::CloudRunConfig>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PipelineReadyCondition {
pub status: bool,
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PipelineReadyCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.status = v.into();
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PipelineReadyCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PipelineReadyCondition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetsPresentCondition {
pub status: bool,
pub missing_targets: std::vec::Vec<std::string::String>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetsPresentCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.status = v.into();
self
}
pub fn set_missing_targets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.missing_targets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TargetsPresentCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TargetsPresentCondition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetsTypeCondition {
pub status: bool,
pub error_details: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetsTypeCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.status = v.into();
self
}
pub fn set_error_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.error_details = v.into();
self
}
}
impl wkt::message::Message for TargetsTypeCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TargetsTypeCondition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PipelineCondition {
pub pipeline_ready_condition: std::option::Option<crate::model::PipelineReadyCondition>,
pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
pub targets_type_condition: std::option::Option<crate::model::TargetsTypeCondition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PipelineCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pipeline_ready_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PipelineReadyCondition>,
{
self.pipeline_ready_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_pipeline_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PipelineReadyCondition>,
{
self.pipeline_ready_condition = v.map(|x| x.into());
self
}
pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TargetsPresentCondition>,
{
self.targets_present_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TargetsPresentCondition>,
{
self.targets_present_condition = v.map(|x| x.into());
self
}
pub fn set_targets_type_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TargetsTypeCondition>,
{
self.targets_type_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_targets_type_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TargetsTypeCondition>,
{
self.targets_type_condition = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PipelineCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PipelineCondition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDeliveryPipelinesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDeliveryPipelinesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDeliveryPipelinesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDeliveryPipelinesResponse {
pub delivery_pipelines: std::vec::Vec<crate::model::DeliveryPipeline>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDeliveryPipelinesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_delivery_pipelines<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DeliveryPipeline>,
{
use std::iter::Iterator;
self.delivery_pipelines = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDeliveryPipelinesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListDeliveryPipelinesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDeliveryPipelinesResponse {
type PageItem = crate::model::DeliveryPipeline;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.delivery_pipelines
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDeliveryPipelineRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDeliveryPipelineRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDeliveryPipelineRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetDeliveryPipelineRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDeliveryPipelineRequest {
pub parent: std::string::String,
pub delivery_pipeline_id: std::string::String,
pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
pub request_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDeliveryPipelineRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_delivery_pipeline_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.delivery_pipeline_id = v.into();
self
}
pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeliveryPipeline>,
{
self.delivery_pipeline = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeliveryPipeline>,
{
self.delivery_pipeline = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateDeliveryPipelineRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateDeliveryPipelineRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDeliveryPipelineRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipeline>,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDeliveryPipelineRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeliveryPipeline>,
{
self.delivery_pipeline = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeliveryPipeline>,
{
self.delivery_pipeline = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateDeliveryPipelineRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.UpdateDeliveryPipelineRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDeliveryPipelineRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub force: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDeliveryPipelineRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteDeliveryPipelineRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeleteDeliveryPipelineRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RollbackTargetConfig {
pub rollout: std::option::Option<crate::model::Rollout>,
pub starting_phase_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RollbackTargetConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rollout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Rollout>,
{
self.rollout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Rollout>,
{
self.rollout = v.map(|x| x.into());
self
}
pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.starting_phase_id = v.into();
self
}
}
impl wkt::message::Message for RollbackTargetConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RollbackTargetConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RollbackTargetRequest {
pub name: std::string::String,
pub target_id: std::string::String,
pub rollout_id: std::string::String,
pub release_id: std::string::String,
pub rollout_to_roll_back: std::string::String,
pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
pub validate_only: bool,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RollbackTargetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout_id = v.into();
self
}
pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release_id = v.into();
self
}
pub fn set_rollout_to_roll_back<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rollout_to_roll_back = v.into();
self
}
pub fn set_rollback_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RollbackTargetConfig>,
{
self.rollback_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RollbackTargetConfig>,
{
self.rollback_config = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RollbackTargetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RollbackTargetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RollbackTargetResponse {
pub rollback_config: std::option::Option<crate::model::RollbackTargetConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RollbackTargetResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rollback_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RollbackTargetConfig>,
{
self.rollback_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rollback_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RollbackTargetConfig>,
{
self.rollback_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RollbackTargetResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RollbackTargetResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Target {
pub name: std::string::String,
pub target_id: std::string::String,
pub uid: std::string::String,
pub description: std::string::String,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub require_approval: bool,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub associated_entities:
std::collections::HashMap<std::string::String, crate::model::AssociatedEntities>,
pub etag: std::string::String,
pub execution_configs: std::vec::Vec<crate::model::ExecutionConfig>,
pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
pub deployment_target: std::option::Option<crate::model::target::DeploymentTarget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Target {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_require_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.require_approval = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_associated_entities<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::AssociatedEntities>,
{
use std::iter::Iterator;
self.associated_entities = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_execution_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ExecutionConfig>,
{
use std::iter::Iterator;
self.execution_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_deployment_target<
T: std::convert::Into<std::option::Option<crate::model::target::DeploymentTarget>>,
>(
mut self,
v: T,
) -> Self {
self.deployment_target = v.into();
self
}
pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkeCluster>> {
#[allow(unreachable_patterns)]
self.deployment_target.as_ref().and_then(|v| match v {
crate::model::target::DeploymentTarget::Gke(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::GkeCluster>>>(
mut self,
v: T,
) -> Self {
self.deployment_target =
std::option::Option::Some(crate::model::target::DeploymentTarget::Gke(v.into()));
self
}
pub fn anthos_cluster(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AnthosCluster>> {
#[allow(unreachable_patterns)]
self.deployment_target.as_ref().and_then(|v| match v {
crate::model::target::DeploymentTarget::AnthosCluster(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_anthos_cluster<
T: std::convert::Into<std::boxed::Box<crate::model::AnthosCluster>>,
>(
mut self,
v: T,
) -> Self {
self.deployment_target = std::option::Option::Some(
crate::model::target::DeploymentTarget::AnthosCluster(v.into()),
);
self
}
pub fn run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunLocation>> {
#[allow(unreachable_patterns)]
self.deployment_target.as_ref().and_then(|v| match v {
crate::model::target::DeploymentTarget::Run(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRunLocation>>>(
mut self,
v: T,
) -> Self {
self.deployment_target =
std::option::Option::Some(crate::model::target::DeploymentTarget::Run(v.into()));
self
}
pub fn multi_target(&self) -> std::option::Option<&std::boxed::Box<crate::model::MultiTarget>> {
#[allow(unreachable_patterns)]
self.deployment_target.as_ref().and_then(|v| match v {
crate::model::target::DeploymentTarget::MultiTarget(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_multi_target<T: std::convert::Into<std::boxed::Box<crate::model::MultiTarget>>>(
mut self,
v: T,
) -> Self {
self.deployment_target = std::option::Option::Some(
crate::model::target::DeploymentTarget::MultiTarget(v.into()),
);
self
}
pub fn custom_target(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CustomTarget>> {
#[allow(unreachable_patterns)]
self.deployment_target.as_ref().and_then(|v| match v {
crate::model::target::DeploymentTarget::CustomTarget(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_custom_target<T: std::convert::Into<std::boxed::Box<crate::model::CustomTarget>>>(
mut self,
v: T,
) -> Self {
self.deployment_target = std::option::Option::Some(
crate::model::target::DeploymentTarget::CustomTarget(v.into()),
);
self
}
}
impl wkt::message::Message for Target {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Target"
}
}
pub mod target {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DeploymentTarget {
Gke(std::boxed::Box<crate::model::GkeCluster>),
AnthosCluster(std::boxed::Box<crate::model::AnthosCluster>),
Run(std::boxed::Box<crate::model::CloudRunLocation>),
MultiTarget(std::boxed::Box<crate::model::MultiTarget>),
CustomTarget(std::boxed::Box<crate::model::CustomTarget>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionConfig {
pub usages: std::vec::Vec<crate::model::execution_config::ExecutionEnvironmentUsage>,
pub worker_pool: std::string::String,
pub service_account: std::string::String,
pub artifact_storage: std::string::String,
pub execution_timeout: std::option::Option<wkt::Duration>,
pub verbose: bool,
pub execution_environment:
std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_usages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::execution_config::ExecutionEnvironmentUsage>,
{
use std::iter::Iterator;
self.usages = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.worker_pool = v.into();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.artifact_storage = v.into();
self
}
pub fn set_execution_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.execution_timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.execution_timeout = v.map(|x| x.into());
self
}
pub fn set_verbose<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.verbose = v.into();
self
}
pub fn set_execution_environment<
T: std::convert::Into<
std::option::Option<crate::model::execution_config::ExecutionEnvironment>,
>,
>(
mut self,
v: T,
) -> Self {
self.execution_environment = v.into();
self
}
pub fn default_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::DefaultPool>> {
#[allow(unreachable_patterns)]
self.execution_environment.as_ref().and_then(|v| match v {
crate::model::execution_config::ExecutionEnvironment::DefaultPool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_default_pool<T: std::convert::Into<std::boxed::Box<crate::model::DefaultPool>>>(
mut self,
v: T,
) -> Self {
self.execution_environment = std::option::Option::Some(
crate::model::execution_config::ExecutionEnvironment::DefaultPool(v.into()),
);
self
}
pub fn private_pool(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrivatePool>> {
#[allow(unreachable_patterns)]
self.execution_environment.as_ref().and_then(|v| match v {
crate::model::execution_config::ExecutionEnvironment::PrivatePool(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_private_pool<T: std::convert::Into<std::boxed::Box<crate::model::PrivatePool>>>(
mut self,
v: T,
) -> Self {
self.execution_environment = std::option::Option::Some(
crate::model::execution_config::ExecutionEnvironment::PrivatePool(v.into()),
);
self
}
}
impl wkt::message::Message for ExecutionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ExecutionConfig"
}
}
pub mod execution_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExecutionEnvironmentUsage {
Unspecified,
Render,
Deploy,
Verify,
Predeploy,
Postdeploy,
UnknownValue(execution_environment_usage::UnknownValue),
}
#[doc(hidden)]
pub mod execution_environment_usage {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExecutionEnvironmentUsage {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Render => std::option::Option::Some(1),
Self::Deploy => std::option::Option::Some(2),
Self::Verify => std::option::Option::Some(3),
Self::Predeploy => std::option::Option::Some(4),
Self::Postdeploy => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED")
}
Self::Render => std::option::Option::Some("RENDER"),
Self::Deploy => std::option::Option::Some("DEPLOY"),
Self::Verify => std::option::Option::Some("VERIFY"),
Self::Predeploy => std::option::Option::Some("PREDEPLOY"),
Self::Postdeploy => std::option::Option::Some("POSTDEPLOY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExecutionEnvironmentUsage {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExecutionEnvironmentUsage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ExecutionEnvironmentUsage {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Render,
2 => Self::Deploy,
3 => Self::Verify,
4 => Self::Predeploy,
5 => Self::Postdeploy,
_ => Self::UnknownValue(execution_environment_usage::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExecutionEnvironmentUsage {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXECUTION_ENVIRONMENT_USAGE_UNSPECIFIED" => Self::Unspecified,
"RENDER" => Self::Render,
"DEPLOY" => Self::Deploy,
"VERIFY" => Self::Verify,
"PREDEPLOY" => Self::Predeploy,
"POSTDEPLOY" => Self::Postdeploy,
_ => Self::UnknownValue(execution_environment_usage::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExecutionEnvironmentUsage {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Render => serializer.serialize_i32(1),
Self::Deploy => serializer.serialize_i32(2),
Self::Verify => serializer.serialize_i32(3),
Self::Predeploy => serializer.serialize_i32(4),
Self::Postdeploy => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironmentUsage {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<ExecutionEnvironmentUsage>::new(
".google.cloud.deploy.v1.ExecutionConfig.ExecutionEnvironmentUsage",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExecutionEnvironment {
DefaultPool(std::boxed::Box<crate::model::DefaultPool>),
PrivatePool(std::boxed::Box<crate::model::PrivatePool>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DefaultPool {
pub service_account: std::string::String,
pub artifact_storage: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DefaultPool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.artifact_storage = v.into();
self
}
}
impl wkt::message::Message for DefaultPool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DefaultPool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PrivatePool {
pub worker_pool: std::string::String,
pub service_account: std::string::String,
pub artifact_storage: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PrivatePool {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.worker_pool = v.into();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_artifact_storage<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.artifact_storage = v.into();
self
}
}
impl wkt::message::Message for PrivatePool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PrivatePool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GkeCluster {
pub cluster: std::string::String,
pub internal_ip: bool,
pub proxy_url: std::string::String,
pub dns_endpoint: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GkeCluster {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.cluster = v.into();
self
}
pub fn set_internal_ip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.internal_ip = v.into();
self
}
pub fn set_proxy_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.proxy_url = v.into();
self
}
pub fn set_dns_endpoint<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.dns_endpoint = v.into();
self
}
}
impl wkt::message::Message for GkeCluster {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GkeCluster"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AnthosCluster {
pub membership: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AnthosCluster {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_membership<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.membership = v.into();
self
}
}
impl wkt::message::Message for AnthosCluster {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AnthosCluster"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudRunLocation {
pub location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudRunLocation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
}
impl wkt::message::Message for CloudRunLocation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CloudRunLocation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MultiTarget {
pub target_ids: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MultiTarget {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_ids<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.target_ids = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MultiTarget {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.MultiTarget"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomTarget {
pub custom_target_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomTarget {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.custom_target_type = v.into();
self
}
}
impl wkt::message::Message for CustomTarget {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CustomTarget"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AssociatedEntities {
pub gke_clusters: std::vec::Vec<crate::model::GkeCluster>,
pub anthos_clusters: std::vec::Vec<crate::model::AnthosCluster>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AssociatedEntities {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_gke_clusters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GkeCluster>,
{
use std::iter::Iterator;
self.gke_clusters = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_anthos_clusters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AnthosCluster>,
{
use std::iter::Iterator;
self.anthos_clusters = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AssociatedEntities {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AssociatedEntities"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTargetsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTargetsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListTargetsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListTargetsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTargetsResponse {
pub targets: std::vec::Vec<crate::model::Target>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTargetsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_targets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Target>,
{
use std::iter::Iterator;
self.targets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListTargetsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListTargetsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTargetsResponse {
type PageItem = crate::model::Target;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.targets
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetTargetRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTargetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetTargetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetTargetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTargetRequest {
pub parent: std::string::String,
pub target_id: std::string::String,
pub target: std::option::Option<crate::model::Target>,
pub request_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTargetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_target<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Target>,
{
self.target = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Target>,
{
self.target = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateTargetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateTargetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTargetRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub target: std::option::Option<crate::model::Target>,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTargetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_target<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Target>,
{
self.target = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Target>,
{
self.target = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateTargetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.UpdateTargetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTargetRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTargetRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteTargetRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeleteTargetRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomTargetType {
pub name: std::string::String,
pub custom_target_type_id: std::string::String,
pub uid: std::string::String,
pub description: std::string::String,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub definition: std::option::Option<crate::model::custom_target_type::Definition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomTargetType {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.custom_target_type_id = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_definition<
T: std::convert::Into<std::option::Option<crate::model::custom_target_type::Definition>>,
>(
mut self,
v: T,
) -> Self {
self.definition = v.into();
self
}
pub fn custom_actions(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CustomTargetSkaffoldActions>> {
#[allow(unreachable_patterns)]
self.definition.as_ref().and_then(|v| match v {
crate::model::custom_target_type::Definition::CustomActions(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_custom_actions<
T: std::convert::Into<std::boxed::Box<crate::model::CustomTargetSkaffoldActions>>,
>(
mut self,
v: T,
) -> Self {
self.definition = std::option::Option::Some(
crate::model::custom_target_type::Definition::CustomActions(v.into()),
);
self
}
}
impl wkt::message::Message for CustomTargetType {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CustomTargetType"
}
}
pub mod custom_target_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Definition {
CustomActions(std::boxed::Box<crate::model::CustomTargetSkaffoldActions>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomTargetSkaffoldActions {
pub render_action: std::string::String,
pub deploy_action: std::string::String,
pub include_skaffold_modules: std::vec::Vec<crate::model::SkaffoldModules>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomTargetSkaffoldActions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_render_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.render_action = v.into();
self
}
pub fn set_deploy_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deploy_action = v.into();
self
}
pub fn set_include_skaffold_modules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SkaffoldModules>,
{
use std::iter::Iterator;
self.include_skaffold_modules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CustomTargetSkaffoldActions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CustomTargetSkaffoldActions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SkaffoldModules {
pub configs: std::vec::Vec<std::string::String>,
pub source: std::option::Option<crate::model::skaffold_modules::Source>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SkaffoldModules {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::skaffold_modules::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn git(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>
{
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::skaffold_modules::Source::Git(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_git<
T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>>,
>(
mut self,
v: T,
) -> Self {
self.source =
std::option::Option::Some(crate::model::skaffold_modules::Source::Git(v.into()));
self
}
pub fn google_cloud_storage(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>
{
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::skaffold_modules::Source::GoogleCloudStorage(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_google_cloud_storage<
T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::skaffold_modules::Source::GoogleCloudStorage(v.into()),
);
self
}
pub fn google_cloud_build_repo(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>
{
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_google_cloud_build_repo<
T: std::convert::Into<std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::skaffold_modules::Source::GoogleCloudBuildRepo(v.into()),
);
self
}
}
impl wkt::message::Message for SkaffoldModules {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules"
}
}
pub mod skaffold_modules {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SkaffoldGitSource {
pub repo: std::string::String,
pub path: std::string::String,
pub r#ref: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SkaffoldGitSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_repo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.repo = v.into();
self
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#ref = v.into();
self
}
}
impl wkt::message::Message for SkaffoldGitSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGitSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SkaffoldGCSSource {
pub source: std::string::String,
pub path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SkaffoldGCSSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
}
impl wkt::message::Message for SkaffoldGCSSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCSSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SkaffoldGCBRepoSource {
pub repository: std::string::String,
pub path: std::string::String,
pub r#ref: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SkaffoldGCBRepoSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.repository = v.into();
self
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#ref = v.into();
self
}
}
impl wkt::message::Message for SkaffoldGCBRepoSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.SkaffoldModules.SkaffoldGCBRepoSource"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
Git(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGitSource>),
GoogleCloudStorage(std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCSSource>),
GoogleCloudBuildRepo(
std::boxed::Box<crate::model::skaffold_modules::SkaffoldGCBRepoSource>,
),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCustomTargetTypesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCustomTargetTypesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListCustomTargetTypesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCustomTargetTypesResponse {
pub custom_target_types: std::vec::Vec<crate::model::CustomTargetType>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCustomTargetTypesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_custom_target_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CustomTargetType>,
{
use std::iter::Iterator;
self.custom_target_types = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListCustomTargetTypesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListCustomTargetTypesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCustomTargetTypesResponse {
type PageItem = crate::model::CustomTargetType;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.custom_target_types
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCustomTargetTypeRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCustomTargetTypeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetCustomTargetTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetCustomTargetTypeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCustomTargetTypeRequest {
pub parent: std::string::String,
pub custom_target_type_id: std::string::String,
pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
pub request_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCustomTargetTypeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_custom_target_type_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.custom_target_type_id = v.into();
self
}
pub fn set_custom_target_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomTargetType>,
{
self.custom_target_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomTargetType>,
{
self.custom_target_type = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateCustomTargetTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateCustomTargetTypeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCustomTargetTypeRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub custom_target_type: std::option::Option<crate::model::CustomTargetType>,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCustomTargetTypeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_custom_target_type<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomTargetType>,
{
self.custom_target_type = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_target_type<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomTargetType>,
{
self.custom_target_type = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateCustomTargetTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.UpdateCustomTargetTypeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCustomTargetTypeRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCustomTargetTypeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteCustomTargetTypeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeleteCustomTargetTypeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployPolicy {
pub name: std::string::String,
pub uid: std::string::String,
pub description: std::string::String,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub suspended: bool,
pub selectors: std::vec::Vec<crate::model::DeployPolicyResourceSelector>,
pub rules: std::vec::Vec<crate::model::PolicyRule>,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.suspended = v.into();
self
}
pub fn set_selectors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DeployPolicyResourceSelector>,
{
use std::iter::Iterator;
self.selectors = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PolicyRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeployPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployPolicy"
}
}
pub mod deploy_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Invoker {
Unspecified,
User,
DeployAutomation,
UnknownValue(invoker::UnknownValue),
}
#[doc(hidden)]
pub mod invoker {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Invoker {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::User => std::option::Option::Some(1),
Self::DeployAutomation => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("INVOKER_UNSPECIFIED"),
Self::User => std::option::Option::Some("USER"),
Self::DeployAutomation => std::option::Option::Some("DEPLOY_AUTOMATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Invoker {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Invoker {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Invoker {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::User,
2 => Self::DeployAutomation,
_ => Self::UnknownValue(invoker::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Invoker {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"INVOKER_UNSPECIFIED" => Self::Unspecified,
"USER" => Self::User,
"DEPLOY_AUTOMATION" => Self::DeployAutomation,
_ => Self::UnknownValue(invoker::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Invoker {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::User => serializer.serialize_i32(1),
Self::DeployAutomation => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Invoker {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Invoker>::new(
".google.cloud.deploy.v1.DeployPolicy.Invoker",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployPolicyResourceSelector {
pub delivery_pipeline: std::option::Option<crate::model::DeliveryPipelineAttribute>,
pub target: std::option::Option<crate::model::TargetAttribute>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployPolicyResourceSelector {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_delivery_pipeline<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
{
self.delivery_pipeline = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delivery_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeliveryPipelineAttribute>,
{
self.delivery_pipeline = v.map(|x| x.into());
self
}
pub fn set_target<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TargetAttribute>,
{
self.target = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TargetAttribute>,
{
self.target = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DeployPolicyResourceSelector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployPolicyResourceSelector"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeliveryPipelineAttribute {
pub id: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeliveryPipelineAttribute {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for DeliveryPipelineAttribute {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineAttribute"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetAttribute {
pub id: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetAttribute {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for TargetAttribute {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TargetAttribute"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyRule {
#[allow(missing_docs)]
pub rule: std::option::Option<crate::model::policy_rule::Rule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rule<T: std::convert::Into<std::option::Option<crate::model::policy_rule::Rule>>>(
mut self,
v: T,
) -> Self {
self.rule = v.into();
self
}
pub fn rollout_restriction(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::RolloutRestriction>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::policy_rule::Rule::RolloutRestriction(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_rollout_restriction<
T: std::convert::Into<std::boxed::Box<crate::model::RolloutRestriction>>,
>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(crate::model::policy_rule::Rule::RolloutRestriction(
v.into(),
));
self
}
}
impl wkt::message::Message for PolicyRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PolicyRule"
}
}
pub mod policy_rule {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Rule {
RolloutRestriction(std::boxed::Box<crate::model::RolloutRestriction>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RolloutRestriction {
pub id: std::string::String,
pub invokers: std::vec::Vec<crate::model::deploy_policy::Invoker>,
pub actions: std::vec::Vec<crate::model::rollout_restriction::RolloutActions>,
pub time_windows: std::option::Option<crate::model::TimeWindows>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RolloutRestriction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_invokers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::deploy_policy::Invoker>,
{
use std::iter::Iterator;
self.invokers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::rollout_restriction::RolloutActions>,
{
use std::iter::Iterator;
self.actions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_time_windows<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TimeWindows>,
{
self.time_windows = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_windows<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TimeWindows>,
{
self.time_windows = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RolloutRestriction {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RolloutRestriction"
}
}
pub mod rollout_restriction {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RolloutActions {
Unspecified,
Advance,
Approve,
Cancel,
Create,
IgnoreJob,
RetryJob,
Rollback,
TerminateJobrun,
UnknownValue(rollout_actions::UnknownValue),
}
#[doc(hidden)]
pub mod rollout_actions {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RolloutActions {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Advance => std::option::Option::Some(1),
Self::Approve => std::option::Option::Some(2),
Self::Cancel => std::option::Option::Some(3),
Self::Create => std::option::Option::Some(4),
Self::IgnoreJob => std::option::Option::Some(5),
Self::RetryJob => std::option::Option::Some(6),
Self::Rollback => std::option::Option::Some(7),
Self::TerminateJobrun => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ROLLOUT_ACTIONS_UNSPECIFIED"),
Self::Advance => std::option::Option::Some("ADVANCE"),
Self::Approve => std::option::Option::Some("APPROVE"),
Self::Cancel => std::option::Option::Some("CANCEL"),
Self::Create => std::option::Option::Some("CREATE"),
Self::IgnoreJob => std::option::Option::Some("IGNORE_JOB"),
Self::RetryJob => std::option::Option::Some("RETRY_JOB"),
Self::Rollback => std::option::Option::Some("ROLLBACK"),
Self::TerminateJobrun => std::option::Option::Some("TERMINATE_JOBRUN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RolloutActions {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RolloutActions {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RolloutActions {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Advance,
2 => Self::Approve,
3 => Self::Cancel,
4 => Self::Create,
5 => Self::IgnoreJob,
6 => Self::RetryJob,
7 => Self::Rollback,
8 => Self::TerminateJobrun,
_ => Self::UnknownValue(rollout_actions::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RolloutActions {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROLLOUT_ACTIONS_UNSPECIFIED" => Self::Unspecified,
"ADVANCE" => Self::Advance,
"APPROVE" => Self::Approve,
"CANCEL" => Self::Cancel,
"CREATE" => Self::Create,
"IGNORE_JOB" => Self::IgnoreJob,
"RETRY_JOB" => Self::RetryJob,
"ROLLBACK" => Self::Rollback,
"TERMINATE_JOBRUN" => Self::TerminateJobrun,
_ => Self::UnknownValue(rollout_actions::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RolloutActions {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Advance => serializer.serialize_i32(1),
Self::Approve => serializer.serialize_i32(2),
Self::Cancel => serializer.serialize_i32(3),
Self::Create => serializer.serialize_i32(4),
Self::IgnoreJob => serializer.serialize_i32(5),
Self::RetryJob => serializer.serialize_i32(6),
Self::Rollback => serializer.serialize_i32(7),
Self::TerminateJobrun => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RolloutActions {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutActions>::new(
".google.cloud.deploy.v1.RolloutRestriction.RolloutActions",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimeWindows {
pub time_zone: std::string::String,
pub one_time_windows: std::vec::Vec<crate::model::OneTimeWindow>,
pub weekly_windows: std::vec::Vec<crate::model::WeeklyWindow>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TimeWindows {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
pub fn set_one_time_windows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::OneTimeWindow>,
{
use std::iter::Iterator;
self.one_time_windows = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_weekly_windows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::WeeklyWindow>,
{
use std::iter::Iterator;
self.weekly_windows = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TimeWindows {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TimeWindows"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OneTimeWindow {
pub start_date: std::option::Option<google_cloud_type::model::Date>,
pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
pub end_date: std::option::Option<google_cloud_type::model::Date>,
pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OneTimeWindow {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_date<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.start_date = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_date<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.start_date = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_date<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.end_date = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_date<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.end_date = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for OneTimeWindow {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.OneTimeWindow"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WeeklyWindow {
pub days_of_week: std::vec::Vec<google_cloud_type::model::DayOfWeek>,
pub start_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
pub end_time: std::option::Option<google_cloud_type::model::TimeOfDay>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WeeklyWindow {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_days_of_week<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_type::model::DayOfWeek>,
{
use std::iter::Iterator;
self.days_of_week = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::TimeOfDay>,
{
self.end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for WeeklyWindow {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.WeeklyWindow"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyViolation {
pub policy_violation_details: std::vec::Vec<crate::model::PolicyViolationDetails>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyViolation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_policy_violation_details<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PolicyViolationDetails>,
{
use std::iter::Iterator;
self.policy_violation_details = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PolicyViolation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PolicyViolation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyViolationDetails {
pub policy: std::string::String,
pub rule_id: std::string::String,
pub failure_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyViolationDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.policy = v.into();
self
}
pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rule_id = v.into();
self
}
pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.failure_message = v.into();
self
}
}
impl wkt::message::Message for PolicyViolationDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PolicyViolationDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Release {
pub name: std::string::String,
pub uid: std::string::String,
pub description: std::string::String,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub abandoned: bool,
pub create_time: std::option::Option<wkt::Timestamp>,
pub render_start_time: std::option::Option<wkt::Timestamp>,
pub render_end_time: std::option::Option<wkt::Timestamp>,
pub skaffold_config_uri: std::string::String,
pub skaffold_config_path: std::string::String,
pub build_artifacts: std::vec::Vec<crate::model::BuildArtifact>,
pub delivery_pipeline_snapshot: std::option::Option<crate::model::DeliveryPipeline>,
pub target_snapshots: std::vec::Vec<crate::model::Target>,
pub custom_target_type_snapshots: std::vec::Vec<crate::model::CustomTargetType>,
pub render_state: crate::model::release::RenderState,
pub etag: std::string::String,
pub skaffold_version: std::string::String,
pub target_artifacts:
std::collections::HashMap<std::string::String, crate::model::TargetArtifact>,
pub target_renders:
std::collections::HashMap<std::string::String, crate::model::release::TargetRender>,
pub condition: std::option::Option<crate::model::release::ReleaseCondition>,
pub deploy_parameters: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Release {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_abandoned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.abandoned = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_render_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.render_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_render_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.render_start_time = v.map(|x| x.into());
self
}
pub fn set_render_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.render_end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_render_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.render_end_time = v.map(|x| x.into());
self
}
pub fn set_skaffold_config_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.skaffold_config_uri = v.into();
self
}
pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.skaffold_config_path = v.into();
self
}
pub fn set_build_artifacts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BuildArtifact>,
{
use std::iter::Iterator;
self.build_artifacts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_delivery_pipeline_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeliveryPipeline>,
{
self.delivery_pipeline_snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delivery_pipeline_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeliveryPipeline>,
{
self.delivery_pipeline_snapshot = v.map(|x| x.into());
self
}
pub fn set_target_snapshots<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Target>,
{
use std::iter::Iterator;
self.target_snapshots = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_custom_target_type_snapshots<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CustomTargetType>,
{
use std::iter::Iterator;
self.custom_target_type_snapshots = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
mut self,
v: T,
) -> Self {
self.render_state = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_skaffold_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.skaffold_version = v.into();
self
}
pub fn set_target_artifacts<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::TargetArtifact>,
{
use std::iter::Iterator;
self.target_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_target_renders<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::release::TargetRender>,
{
use std::iter::Iterator;
self.target_renders = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::release::ReleaseCondition>,
{
self.condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::release::ReleaseCondition>,
{
self.condition = v.map(|x| x.into());
self
}
pub fn set_deploy_parameters<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.deploy_parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for Release {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Release"
}
}
pub mod release {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetRender {
pub rendering_build: std::string::String,
pub rendering_state: crate::model::release::target_render::TargetRenderState,
pub metadata: std::option::Option<crate::model::RenderMetadata>,
pub failure_cause: crate::model::release::target_render::FailureCause,
pub failure_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetRender {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rendering_build<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rendering_build = v.into();
self
}
pub fn set_rendering_state<
T: std::convert::Into<crate::model::release::target_render::TargetRenderState>,
>(
mut self,
v: T,
) -> Self {
self.rendering_state = v.into();
self
}
pub fn set_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RenderMetadata>,
{
self.metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RenderMetadata>,
{
self.metadata = v.map(|x| x.into());
self
}
pub fn set_failure_cause<
T: std::convert::Into<crate::model::release::target_render::FailureCause>,
>(
mut self,
v: T,
) -> Self {
self.failure_cause = v.into();
self
}
pub fn set_failure_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.failure_message = v.into();
self
}
}
impl wkt::message::Message for TargetRender {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Release.TargetRender"
}
}
pub mod target_render {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TargetRenderState {
Unspecified,
Succeeded,
Failed,
InProgress,
UnknownValue(target_render_state::UnknownValue),
}
#[doc(hidden)]
pub mod target_render_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TargetRenderState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::InProgress => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("TARGET_RENDER_STATE_UNSPECIFIED")
}
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TargetRenderState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TargetRenderState {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for TargetRenderState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
3 => Self::InProgress,
_ => Self::UnknownValue(target_render_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TargetRenderState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TARGET_RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"IN_PROGRESS" => Self::InProgress,
_ => Self::UnknownValue(target_render_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TargetRenderState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::InProgress => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TargetRenderState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetRenderState>::new(
".google.cloud.deploy.v1.Release.TargetRender.TargetRenderState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FailureCause {
Unspecified,
CloudBuildUnavailable,
ExecutionFailed,
CloudBuildRequestFailed,
VerificationConfigNotFound,
CustomActionNotFound,
DeploymentStrategyNotSupported,
RenderFeatureNotSupported,
UnknownValue(failure_cause::UnknownValue),
}
#[doc(hidden)]
pub mod failure_cause {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FailureCause {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CloudBuildUnavailable => std::option::Option::Some(1),
Self::ExecutionFailed => std::option::Option::Some(2),
Self::CloudBuildRequestFailed => std::option::Option::Some(3),
Self::VerificationConfigNotFound => std::option::Option::Some(4),
Self::CustomActionNotFound => std::option::Option::Some(5),
Self::DeploymentStrategyNotSupported => std::option::Option::Some(6),
Self::RenderFeatureNotSupported => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
Self::CloudBuildUnavailable => {
std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE")
}
Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
Self::CloudBuildRequestFailed => {
std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
}
Self::VerificationConfigNotFound => {
std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
}
Self::CustomActionNotFound => {
std::option::Option::Some("CUSTOM_ACTION_NOT_FOUND")
}
Self::DeploymentStrategyNotSupported => {
std::option::Option::Some("DEPLOYMENT_STRATEGY_NOT_SUPPORTED")
}
Self::RenderFeatureNotSupported => {
std::option::Option::Some("RENDER_FEATURE_NOT_SUPPORTED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FailureCause {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FailureCause {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FailureCause {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CloudBuildUnavailable,
2 => Self::ExecutionFailed,
3 => Self::CloudBuildRequestFailed,
4 => Self::VerificationConfigNotFound,
5 => Self::CustomActionNotFound,
6 => Self::DeploymentStrategyNotSupported,
7 => Self::RenderFeatureNotSupported,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FailureCause {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
"CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
"EXECUTION_FAILED" => Self::ExecutionFailed,
"CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
"VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
"CUSTOM_ACTION_NOT_FOUND" => Self::CustomActionNotFound,
"DEPLOYMENT_STRATEGY_NOT_SUPPORTED" => Self::DeploymentStrategyNotSupported,
"RENDER_FEATURE_NOT_SUPPORTED" => Self::RenderFeatureNotSupported,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FailureCause {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CloudBuildUnavailable => serializer.serialize_i32(1),
Self::ExecutionFailed => serializer.serialize_i32(2),
Self::CloudBuildRequestFailed => serializer.serialize_i32(3),
Self::VerificationConfigNotFound => serializer.serialize_i32(4),
Self::CustomActionNotFound => serializer.serialize_i32(5),
Self::DeploymentStrategyNotSupported => serializer.serialize_i32(6),
Self::RenderFeatureNotSupported => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FailureCause {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
".google.cloud.deploy.v1.Release.TargetRender.FailureCause",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReleaseReadyCondition {
pub status: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReleaseReadyCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.status = v.into();
self
}
}
impl wkt::message::Message for ReleaseReadyCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseReadyCondition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SkaffoldSupportedCondition {
pub status: bool,
pub skaffold_support_state: crate::model::SkaffoldSupportState,
pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
pub support_expiration_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SkaffoldSupportedCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_status<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.status = v.into();
self
}
pub fn set_skaffold_support_state<
T: std::convert::Into<crate::model::SkaffoldSupportState>,
>(
mut self,
v: T,
) -> Self {
self.skaffold_support_state = v.into();
self
}
pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.maintenance_mode_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.maintenance_mode_time = v.map(|x| x.into());
self
}
pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.support_expiration_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.support_expiration_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SkaffoldSupportedCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Release.SkaffoldSupportedCondition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReleaseCondition {
pub release_ready_condition:
std::option::Option<crate::model::release::ReleaseReadyCondition>,
pub skaffold_supported_condition:
std::option::Option<crate::model::release::SkaffoldSupportedCondition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReleaseCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_release_ready_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
{
self.release_ready_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_release_ready_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::release::ReleaseReadyCondition>,
{
self.release_ready_condition = v.map(|x| x.into());
self
}
pub fn set_skaffold_supported_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
{
self.skaffold_supported_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_skaffold_supported_condition<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::release::SkaffoldSupportedCondition>,
{
self.skaffold_supported_condition = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ReleaseCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Release.ReleaseCondition"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RenderState {
Unspecified,
Succeeded,
Failed,
InProgress,
UnknownValue(render_state::UnknownValue),
}
#[doc(hidden)]
pub mod render_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RenderState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::InProgress => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RENDER_STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RenderState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RenderState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RenderState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
3 => Self::InProgress,
_ => Self::UnknownValue(render_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RenderState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RENDER_STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"IN_PROGRESS" => Self::InProgress,
_ => Self::UnknownValue(render_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RenderState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::InProgress => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RenderState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RenderState>::new(
".google.cloud.deploy.v1.Release.RenderState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDeployPolicyRequest {
pub parent: std::string::String,
pub deploy_policy_id: std::string::String,
pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
pub request_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDeployPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_deploy_policy_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.deploy_policy_id = v.into();
self
}
pub fn set_deploy_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeployPolicy>,
{
self.deploy_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeployPolicy>,
{
self.deploy_policy = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateDeployPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateDeployPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDeployPolicyRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub deploy_policy: std::option::Option<crate::model::DeployPolicy>,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDeployPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_deploy_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeployPolicy>,
{
self.deploy_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deploy_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeployPolicy>,
{
self.deploy_policy = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateDeployPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.UpdateDeployPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDeployPolicyRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDeployPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteDeployPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeleteDeployPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDeployPoliciesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDeployPoliciesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDeployPoliciesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDeployPoliciesResponse {
pub deploy_policies: std::vec::Vec<crate::model::DeployPolicy>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDeployPoliciesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_deploy_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DeployPolicy>,
{
use std::iter::Iterator;
self.deploy_policies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDeployPoliciesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListDeployPoliciesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDeployPoliciesResponse {
type PageItem = crate::model::DeployPolicy;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.deploy_policies
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDeployPolicyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDeployPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDeployPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetDeployPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BuildArtifact {
pub image: std::string::String,
pub tag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BuildArtifact {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image = v.into();
self
}
pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tag = v.into();
self
}
}
impl wkt::message::Message for BuildArtifact {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.BuildArtifact"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetArtifact {
pub skaffold_config_path: std::string::String,
pub manifest_path: std::string::String,
pub phase_artifacts: std::collections::HashMap<
std::string::String,
crate::model::target_artifact::PhaseArtifact,
>,
#[allow(missing_docs)]
pub uri: std::option::Option<crate::model::target_artifact::Uri>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetArtifact {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.skaffold_config_path = v.into();
self
}
pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.manifest_path = v.into();
self
}
pub fn set_phase_artifacts<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::target_artifact::PhaseArtifact>,
{
use std::iter::Iterator;
self.phase_artifacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_uri<
T: std::convert::Into<std::option::Option<crate::model::target_artifact::Uri>>,
>(
mut self,
v: T,
) -> Self {
self.uri = v.into();
self
}
pub fn artifact_uri(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.uri.as_ref().and_then(|v| match v {
crate::model::target_artifact::Uri::ArtifactUri(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri =
std::option::Option::Some(crate::model::target_artifact::Uri::ArtifactUri(v.into()));
self
}
}
impl wkt::message::Message for TargetArtifact {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TargetArtifact"
}
}
pub mod target_artifact {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PhaseArtifact {
pub skaffold_config_path: std::string::String,
pub manifest_path: std::string::String,
pub job_manifests_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PhaseArtifact {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_skaffold_config_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.skaffold_config_path = v.into();
self
}
pub fn set_manifest_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.manifest_path = v.into();
self
}
pub fn set_job_manifests_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.job_manifests_path = v.into();
self
}
}
impl wkt::message::Message for PhaseArtifact {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TargetArtifact.PhaseArtifact"
}
}
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Uri {
ArtifactUri(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployArtifact {
pub artifact_uri: std::string::String,
pub manifest_paths: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployArtifact {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.artifact_uri = v.into();
self
}
pub fn set_manifest_paths<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.manifest_paths = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DeployArtifact {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployArtifact"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudRunRenderMetadata {
pub service: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudRunRenderMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
}
impl wkt::message::Message for CloudRunRenderMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CloudRunRenderMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RenderMetadata {
pub cloud_run: std::option::Option<crate::model::CloudRunRenderMetadata>,
pub custom: std::option::Option<crate::model::CustomMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RenderMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_run<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
{
self.cloud_run = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudRunRenderMetadata>,
{
self.cloud_run = v.map(|x| x.into());
self
}
pub fn set_custom<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomMetadata>,
{
self.custom = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomMetadata>,
{
self.custom = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RenderMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RenderMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReleasesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReleasesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListReleasesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListReleasesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReleasesResponse {
pub releases: std::vec::Vec<crate::model::Release>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReleasesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_releases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Release>,
{
use std::iter::Iterator;
self.releases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListReleasesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListReleasesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListReleasesResponse {
type PageItem = crate::model::Release;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.releases
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetReleaseRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetReleaseRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetReleaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetReleaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateReleaseRequest {
pub parent: std::string::String,
pub release_id: std::string::String,
pub release: std::option::Option<crate::model::Release>,
pub request_id: std::string::String,
pub validate_only: bool,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateReleaseRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_release_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release_id = v.into();
self
}
pub fn set_release<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Release>,
{
self.release = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_release<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Release>,
{
self.release = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CreateReleaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateReleaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Rollout {
pub name: std::string::String,
pub uid: std::string::String,
pub description: std::string::String,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub approve_time: std::option::Option<wkt::Timestamp>,
pub enqueue_time: std::option::Option<wkt::Timestamp>,
pub deploy_start_time: std::option::Option<wkt::Timestamp>,
pub deploy_end_time: std::option::Option<wkt::Timestamp>,
pub target_id: std::string::String,
pub approval_state: crate::model::rollout::ApprovalState,
pub state: crate::model::rollout::State,
pub failure_reason: std::string::String,
pub deploying_build: std::string::String,
pub etag: std::string::String,
pub deploy_failure_cause: crate::model::rollout::FailureCause,
pub phases: std::vec::Vec<crate::model::Phase>,
pub metadata: std::option::Option<crate::model::Metadata>,
pub controller_rollout: std::string::String,
pub rollback_of_rollout: std::string::String,
pub rolled_back_by_rollouts: std::vec::Vec<std::string::String>,
pub active_repair_automation_run: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Rollout {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_approve_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.approve_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_approve_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.approve_time = v.map(|x| x.into());
self
}
pub fn set_enqueue_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.enqueue_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_enqueue_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.enqueue_time = v.map(|x| x.into());
self
}
pub fn set_deploy_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.deploy_start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deploy_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.deploy_start_time = v.map(|x| x.into());
self
}
pub fn set_deploy_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.deploy_end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deploy_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.deploy_end_time = v.map(|x| x.into());
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_approval_state<T: std::convert::Into<crate::model::rollout::ApprovalState>>(
mut self,
v: T,
) -> Self {
self.approval_state = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::rollout::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.failure_reason = v.into();
self
}
pub fn set_deploying_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deploying_build = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_deploy_failure_cause<T: std::convert::Into<crate::model::rollout::FailureCause>>(
mut self,
v: T,
) -> Self {
self.deploy_failure_cause = v.into();
self
}
pub fn set_phases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Phase>,
{
use std::iter::Iterator;
self.phases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Metadata>,
{
self.metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Metadata>,
{
self.metadata = v.map(|x| x.into());
self
}
pub fn set_controller_rollout<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.controller_rollout = v.into();
self
}
pub fn set_rollback_of_rollout<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rollback_of_rollout = v.into();
self
}
pub fn set_rolled_back_by_rollouts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.rolled_back_by_rollouts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_active_repair_automation_run<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.active_repair_automation_run = v.into();
self
}
}
impl wkt::message::Message for Rollout {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Rollout"
}
}
pub mod rollout {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ApprovalState {
Unspecified,
NeedsApproval,
DoesNotNeedApproval,
Approved,
Rejected,
UnknownValue(approval_state::UnknownValue),
}
#[doc(hidden)]
pub mod approval_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ApprovalState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NeedsApproval => std::option::Option::Some(1),
Self::DoesNotNeedApproval => std::option::Option::Some(2),
Self::Approved => std::option::Option::Some(3),
Self::Rejected => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("APPROVAL_STATE_UNSPECIFIED"),
Self::NeedsApproval => std::option::Option::Some("NEEDS_APPROVAL"),
Self::DoesNotNeedApproval => std::option::Option::Some("DOES_NOT_NEED_APPROVAL"),
Self::Approved => std::option::Option::Some("APPROVED"),
Self::Rejected => std::option::Option::Some("REJECTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ApprovalState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ApprovalState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ApprovalState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NeedsApproval,
2 => Self::DoesNotNeedApproval,
3 => Self::Approved,
4 => Self::Rejected,
_ => Self::UnknownValue(approval_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ApprovalState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"APPROVAL_STATE_UNSPECIFIED" => Self::Unspecified,
"NEEDS_APPROVAL" => Self::NeedsApproval,
"DOES_NOT_NEED_APPROVAL" => Self::DoesNotNeedApproval,
"APPROVED" => Self::Approved,
"REJECTED" => Self::Rejected,
_ => Self::UnknownValue(approval_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ApprovalState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NeedsApproval => serializer.serialize_i32(1),
Self::DoesNotNeedApproval => serializer.serialize_i32(2),
Self::Approved => serializer.serialize_i32(3),
Self::Rejected => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ApprovalState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApprovalState>::new(
".google.cloud.deploy.v1.Rollout.ApprovalState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Succeeded,
Failed,
InProgress,
PendingApproval,
ApprovalRejected,
Pending,
PendingRelease,
Cancelling,
Cancelled,
Halted,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::InProgress => std::option::Option::Some(3),
Self::PendingApproval => std::option::Option::Some(4),
Self::ApprovalRejected => std::option::Option::Some(5),
Self::Pending => std::option::Option::Some(6),
Self::PendingRelease => std::option::Option::Some(7),
Self::Cancelling => std::option::Option::Some(8),
Self::Cancelled => std::option::Option::Some(9),
Self::Halted => std::option::Option::Some(10),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::PendingApproval => std::option::Option::Some("PENDING_APPROVAL"),
Self::ApprovalRejected => std::option::Option::Some("APPROVAL_REJECTED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Halted => std::option::Option::Some("HALTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
3 => Self::InProgress,
4 => Self::PendingApproval,
5 => Self::ApprovalRejected,
6 => Self::Pending,
7 => Self::PendingRelease,
8 => Self::Cancelling,
9 => Self::Cancelled,
10 => Self::Halted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"IN_PROGRESS" => Self::InProgress,
"PENDING_APPROVAL" => Self::PendingApproval,
"APPROVAL_REJECTED" => Self::ApprovalRejected,
"PENDING" => Self::Pending,
"PENDING_RELEASE" => Self::PendingRelease,
"CANCELLING" => Self::Cancelling,
"CANCELLED" => Self::Cancelled,
"HALTED" => Self::Halted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::InProgress => serializer.serialize_i32(3),
Self::PendingApproval => serializer.serialize_i32(4),
Self::ApprovalRejected => serializer.serialize_i32(5),
Self::Pending => serializer.serialize_i32(6),
Self::PendingRelease => serializer.serialize_i32(7),
Self::Cancelling => serializer.serialize_i32(8),
Self::Cancelled => serializer.serialize_i32(9),
Self::Halted => serializer.serialize_i32(10),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.deploy.v1.Rollout.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FailureCause {
Unspecified,
CloudBuildUnavailable,
ExecutionFailed,
DeadlineExceeded,
ReleaseFailed,
ReleaseAbandoned,
VerificationConfigNotFound,
CloudBuildRequestFailed,
OperationFeatureNotSupported,
UnknownValue(failure_cause::UnknownValue),
}
#[doc(hidden)]
pub mod failure_cause {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FailureCause {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CloudBuildUnavailable => std::option::Option::Some(1),
Self::ExecutionFailed => std::option::Option::Some(2),
Self::DeadlineExceeded => std::option::Option::Some(3),
Self::ReleaseFailed => std::option::Option::Some(4),
Self::ReleaseAbandoned => std::option::Option::Some(5),
Self::VerificationConfigNotFound => std::option::Option::Some(6),
Self::CloudBuildRequestFailed => std::option::Option::Some(7),
Self::OperationFeatureNotSupported => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
Self::ReleaseFailed => std::option::Option::Some("RELEASE_FAILED"),
Self::ReleaseAbandoned => std::option::Option::Some("RELEASE_ABANDONED"),
Self::VerificationConfigNotFound => {
std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
}
Self::CloudBuildRequestFailed => {
std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
}
Self::OperationFeatureNotSupported => {
std::option::Option::Some("OPERATION_FEATURE_NOT_SUPPORTED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FailureCause {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FailureCause {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FailureCause {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CloudBuildUnavailable,
2 => Self::ExecutionFailed,
3 => Self::DeadlineExceeded,
4 => Self::ReleaseFailed,
5 => Self::ReleaseAbandoned,
6 => Self::VerificationConfigNotFound,
7 => Self::CloudBuildRequestFailed,
8 => Self::OperationFeatureNotSupported,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FailureCause {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
"CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
"EXECUTION_FAILED" => Self::ExecutionFailed,
"DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
"RELEASE_FAILED" => Self::ReleaseFailed,
"RELEASE_ABANDONED" => Self::ReleaseAbandoned,
"VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
"CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
"OPERATION_FEATURE_NOT_SUPPORTED" => Self::OperationFeatureNotSupported,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FailureCause {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CloudBuildUnavailable => serializer.serialize_i32(1),
Self::ExecutionFailed => serializer.serialize_i32(2),
Self::DeadlineExceeded => serializer.serialize_i32(3),
Self::ReleaseFailed => serializer.serialize_i32(4),
Self::ReleaseAbandoned => serializer.serialize_i32(5),
Self::VerificationConfigNotFound => serializer.serialize_i32(6),
Self::CloudBuildRequestFailed => serializer.serialize_i32(7),
Self::OperationFeatureNotSupported => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FailureCause {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
".google.cloud.deploy.v1.Rollout.FailureCause",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Metadata {
pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
pub automation: std::option::Option<crate::model::AutomationRolloutMetadata>,
pub custom: std::option::Option<crate::model::CustomMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Metadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_run<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudRunMetadata>,
{
self.cloud_run = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudRunMetadata>,
{
self.cloud_run = v.map(|x| x.into());
self
}
pub fn set_automation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
{
self.automation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutomationRolloutMetadata>,
{
self.automation = v.map(|x| x.into());
self
}
pub fn set_custom<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomMetadata>,
{
self.custom = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomMetadata>,
{
self.custom = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Metadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Metadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployJobRunMetadata {
pub cloud_run: std::option::Option<crate::model::CloudRunMetadata>,
pub custom_target: std::option::Option<crate::model::CustomTargetDeployMetadata>,
pub custom: std::option::Option<crate::model::CustomMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployJobRunMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cloud_run<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CloudRunMetadata>,
{
self.cloud_run = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cloud_run<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CloudRunMetadata>,
{
self.cloud_run = v.map(|x| x.into());
self
}
pub fn set_custom_target<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
{
self.custom_target = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_target<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomTargetDeployMetadata>,
{
self.custom_target = v.map(|x| x.into());
self
}
pub fn set_custom<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomMetadata>,
{
self.custom = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomMetadata>,
{
self.custom = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DeployJobRunMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployJobRunMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudRunMetadata {
pub service: std::string::String,
pub service_urls: std::vec::Vec<std::string::String>,
pub revision: std::string::String,
pub job: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudRunMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_service_urls<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.service_urls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision = v.into();
self
}
pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job = v.into();
self
}
}
impl wkt::message::Message for CloudRunMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CloudRunMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomTargetDeployMetadata {
pub skip_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomTargetDeployMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.skip_message = v.into();
self
}
}
impl wkt::message::Message for CustomTargetDeployMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CustomTargetDeployMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomationRolloutMetadata {
pub promote_automation_run: std::string::String,
pub advance_automation_runs: std::vec::Vec<std::string::String>,
pub repair_automation_runs: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomationRolloutMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_promote_automation_run<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.promote_automation_run = v.into();
self
}
pub fn set_advance_automation_runs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.advance_automation_runs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_repair_automation_runs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.repair_automation_runs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AutomationRolloutMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AutomationRolloutMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomMetadata {
pub values: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_values<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.values = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for CustomMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CustomMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Phase {
pub id: std::string::String,
pub state: crate::model::phase::State,
pub skip_message: std::string::String,
pub jobs: std::option::Option<crate::model::phase::Jobs>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Phase {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::phase::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.skip_message = v.into();
self
}
pub fn set_jobs<T: std::convert::Into<std::option::Option<crate::model::phase::Jobs>>>(
mut self,
v: T,
) -> Self {
self.jobs = v.into();
self
}
pub fn deployment_jobs(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeploymentJobs>> {
#[allow(unreachable_patterns)]
self.jobs.as_ref().and_then(|v| match v {
crate::model::phase::Jobs::DeploymentJobs(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_deployment_jobs<
T: std::convert::Into<std::boxed::Box<crate::model::DeploymentJobs>>,
>(
mut self,
v: T,
) -> Self {
self.jobs = std::option::Option::Some(crate::model::phase::Jobs::DeploymentJobs(v.into()));
self
}
pub fn child_rollout_jobs(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ChildRolloutJobs>> {
#[allow(unreachable_patterns)]
self.jobs.as_ref().and_then(|v| match v {
crate::model::phase::Jobs::ChildRolloutJobs(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_child_rollout_jobs<
T: std::convert::Into<std::boxed::Box<crate::model::ChildRolloutJobs>>,
>(
mut self,
v: T,
) -> Self {
self.jobs =
std::option::Option::Some(crate::model::phase::Jobs::ChildRolloutJobs(v.into()));
self
}
}
impl wkt::message::Message for Phase {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Phase"
}
}
pub mod phase {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
InProgress,
Succeeded,
Failed,
Aborted,
Skipped,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::InProgress => std::option::Option::Some(2),
Self::Succeeded => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::Aborted => std::option::Option::Some(5),
Self::Skipped => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Aborted => std::option::Option::Some("ABORTED"),
Self::Skipped => std::option::Option::Some("SKIPPED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::InProgress,
3 => Self::Succeeded,
4 => Self::Failed,
5 => Self::Aborted,
6 => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"IN_PROGRESS" => Self::InProgress,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"ABORTED" => Self::Aborted,
"SKIPPED" => Self::Skipped,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::InProgress => serializer.serialize_i32(2),
Self::Succeeded => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::Aborted => serializer.serialize_i32(5),
Self::Skipped => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.deploy.v1.Phase.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Jobs {
DeploymentJobs(std::boxed::Box<crate::model::DeploymentJobs>),
ChildRolloutJobs(std::boxed::Box<crate::model::ChildRolloutJobs>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeploymentJobs {
pub predeploy_job: std::option::Option<crate::model::Job>,
pub deploy_job: std::option::Option<crate::model::Job>,
pub verify_job: std::option::Option<crate::model::Job>,
pub postdeploy_job: std::option::Option<crate::model::Job>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeploymentJobs {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_predeploy_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.predeploy_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_predeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.predeploy_job = v.map(|x| x.into());
self
}
pub fn set_deploy_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.deploy_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deploy_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.deploy_job = v.map(|x| x.into());
self
}
pub fn set_verify_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.verify_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_verify_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.verify_job = v.map(|x| x.into());
self
}
pub fn set_postdeploy_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.postdeploy_job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_postdeploy_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.postdeploy_job = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DeploymentJobs {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeploymentJobs"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChildRolloutJobs {
pub create_rollout_jobs: std::vec::Vec<crate::model::Job>,
pub advance_rollout_jobs: std::vec::Vec<crate::model::Job>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChildRolloutJobs {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_create_rollout_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Job>,
{
use std::iter::Iterator;
self.create_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_advance_rollout_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Job>,
{
use std::iter::Iterator;
self.advance_rollout_jobs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ChildRolloutJobs {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ChildRolloutJobs"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Job {
pub id: std::string::String,
pub state: crate::model::job::State,
pub skip_message: std::string::String,
pub job_run: std::string::String,
pub job_type: std::option::Option<crate::model::job::JobType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Job {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::job::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_skip_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.skip_message = v.into();
self
}
pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_run = v.into();
self
}
pub fn set_job_type<T: std::convert::Into<std::option::Option<crate::model::job::JobType>>>(
mut self,
v: T,
) -> Self {
self.job_type = v.into();
self
}
pub fn deploy_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeployJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::job::JobType::DeployJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_deploy_job<T: std::convert::Into<std::boxed::Box<crate::model::DeployJob>>>(
mut self,
v: T,
) -> Self {
self.job_type = std::option::Option::Some(crate::model::job::JobType::DeployJob(v.into()));
self
}
pub fn verify_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::job::JobType::VerifyJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_verify_job<T: std::convert::Into<std::boxed::Box<crate::model::VerifyJob>>>(
mut self,
v: T,
) -> Self {
self.job_type = std::option::Option::Some(crate::model::job::JobType::VerifyJob(v.into()));
self
}
pub fn predeploy_job(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::job::JobType::PredeployJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_predeploy_job<T: std::convert::Into<std::boxed::Box<crate::model::PredeployJob>>>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::job::JobType::PredeployJob(v.into()));
self
}
pub fn postdeploy_job(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::job::JobType::PostdeployJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_postdeploy_job<
T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJob>>,
>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::job::JobType::PostdeployJob(v.into()));
self
}
pub fn create_child_rollout_job(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::job::JobType::CreateChildRolloutJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_create_child_rollout_job<
T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJob>>,
>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::job::JobType::CreateChildRolloutJob(v.into()));
self
}
pub fn advance_child_rollout_job(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJob>> {
#[allow(unreachable_patterns)]
self.job_type.as_ref().and_then(|v| match v {
crate::model::job::JobType::AdvanceChildRolloutJob(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_advance_child_rollout_job<
T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJob>>,
>(
mut self,
v: T,
) -> Self {
self.job_type =
std::option::Option::Some(crate::model::job::JobType::AdvanceChildRolloutJob(v.into()));
self
}
}
impl wkt::message::Message for Job {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Job"
}
}
pub mod job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Pending,
Disabled,
InProgress,
Succeeded,
Failed,
Aborted,
Skipped,
Ignored,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Disabled => std::option::Option::Some(2),
Self::InProgress => std::option::Option::Some(3),
Self::Succeeded => std::option::Option::Some(4),
Self::Failed => std::option::Option::Some(5),
Self::Aborted => std::option::Option::Some(6),
Self::Skipped => std::option::Option::Some(7),
Self::Ignored => std::option::Option::Some(8),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Aborted => std::option::Option::Some("ABORTED"),
Self::Skipped => std::option::Option::Some("SKIPPED"),
Self::Ignored => std::option::Option::Some("IGNORED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::Disabled,
3 => Self::InProgress,
4 => Self::Succeeded,
5 => Self::Failed,
6 => Self::Aborted,
7 => Self::Skipped,
8 => Self::Ignored,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"DISABLED" => Self::Disabled,
"IN_PROGRESS" => Self::InProgress,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"ABORTED" => Self::Aborted,
"SKIPPED" => Self::Skipped,
"IGNORED" => Self::Ignored,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Disabled => serializer.serialize_i32(2),
Self::InProgress => serializer.serialize_i32(3),
Self::Succeeded => serializer.serialize_i32(4),
Self::Failed => serializer.serialize_i32(5),
Self::Aborted => serializer.serialize_i32(6),
Self::Skipped => serializer.serialize_i32(7),
Self::Ignored => serializer.serialize_i32(8),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.deploy.v1.Job.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum JobType {
DeployJob(std::boxed::Box<crate::model::DeployJob>),
VerifyJob(std::boxed::Box<crate::model::VerifyJob>),
PredeployJob(std::boxed::Box<crate::model::PredeployJob>),
PostdeployJob(std::boxed::Box<crate::model::PostdeployJob>),
CreateChildRolloutJob(std::boxed::Box<crate::model::CreateChildRolloutJob>),
AdvanceChildRolloutJob(std::boxed::Box<crate::model::AdvanceChildRolloutJob>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployJob {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployJob {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeployJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployJob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyJob {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyJob {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for VerifyJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.VerifyJob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PredeployJob {
pub actions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PredeployJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.actions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PredeployJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PredeployJob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostdeployJob {
pub actions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostdeployJob {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.actions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PostdeployJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PostdeployJob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateChildRolloutJob {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateChildRolloutJob {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateChildRolloutJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdvanceChildRolloutJob {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdvanceChildRolloutJob {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for AdvanceChildRolloutJob {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJob"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRolloutsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRolloutsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListRolloutsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListRolloutsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRolloutsResponse {
pub rollouts: std::vec::Vec<crate::model::Rollout>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRolloutsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rollouts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Rollout>,
{
use std::iter::Iterator;
self.rollouts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListRolloutsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListRolloutsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRolloutsResponse {
type PageItem = crate::model::Rollout;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.rollouts
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRolloutRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRolloutRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetRolloutRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetRolloutRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRolloutRequest {
pub parent: std::string::String,
pub rollout_id: std::string::String,
pub rollout: std::option::Option<crate::model::Rollout>,
pub request_id: std::string::String,
pub validate_only: bool,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub starting_phase_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRolloutRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout_id = v.into();
self
}
pub fn set_rollout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Rollout>,
{
self.rollout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rollout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Rollout>,
{
self.rollout = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_starting_phase_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.starting_phase_id = v.into();
self
}
}
impl wkt::message::Message for CreateRolloutRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateRolloutRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub target: std::string::String,
pub verb: std::string::String,
pub status_message: std::string::String,
pub requested_cancellation: bool,
pub api_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApproveRolloutRequest {
pub name: std::string::String,
pub approved: bool,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApproveRolloutRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_approved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.approved = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ApproveRolloutRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApproveRolloutResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ApproveRolloutResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ApproveRolloutResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ApproveRolloutResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdvanceRolloutRequest {
pub name: std::string::String,
pub phase_id: std::string::String,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdvanceRolloutRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phase_id = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AdvanceRolloutRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdvanceRolloutResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdvanceRolloutResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for AdvanceRolloutResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelRolloutRequest {
pub name: std::string::String,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelRolloutRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CancelRolloutRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CancelRolloutRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelRolloutResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelRolloutResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CancelRolloutResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CancelRolloutResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IgnoreJobRequest {
pub rollout: std::string::String,
pub phase_id: std::string::String,
pub job_id: std::string::String,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IgnoreJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phase_id = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for IgnoreJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.IgnoreJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IgnoreJobResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IgnoreJobResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for IgnoreJobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.IgnoreJobResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetryJobRequest {
pub rollout: std::string::String,
pub phase_id: std::string::String,
pub job_id: std::string::String,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetryJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phase_id = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RetryJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RetryJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetryJobResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetryJobResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for RetryJobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RetryJobResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AbandonReleaseRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AbandonReleaseRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for AbandonReleaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AbandonReleaseResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AbandonReleaseResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for AbandonReleaseResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AbandonReleaseResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobRun {
pub name: std::string::String,
pub uid: std::string::String,
pub phase_id: std::string::String,
pub job_id: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::job_run::State,
pub etag: std::string::String,
pub job_run: std::option::Option<crate::model::job_run::JobRun>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phase_id = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::job_run::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_job_run<
T: std::convert::Into<std::option::Option<crate::model::job_run::JobRun>>,
>(
mut self,
v: T,
) -> Self {
self.job_run = v.into();
self
}
pub fn deploy_job_run(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeployJobRun>> {
#[allow(unreachable_patterns)]
self.job_run.as_ref().and_then(|v| match v {
crate::model::job_run::JobRun::DeployJobRun(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_deploy_job_run<
T: std::convert::Into<std::boxed::Box<crate::model::DeployJobRun>>,
>(
mut self,
v: T,
) -> Self {
self.job_run =
std::option::Option::Some(crate::model::job_run::JobRun::DeployJobRun(v.into()));
self
}
pub fn verify_job_run(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::VerifyJobRun>> {
#[allow(unreachable_patterns)]
self.job_run.as_ref().and_then(|v| match v {
crate::model::job_run::JobRun::VerifyJobRun(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_verify_job_run<
T: std::convert::Into<std::boxed::Box<crate::model::VerifyJobRun>>,
>(
mut self,
v: T,
) -> Self {
self.job_run =
std::option::Option::Some(crate::model::job_run::JobRun::VerifyJobRun(v.into()));
self
}
pub fn predeploy_job_run(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PredeployJobRun>> {
#[allow(unreachable_patterns)]
self.job_run.as_ref().and_then(|v| match v {
crate::model::job_run::JobRun::PredeployJobRun(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_predeploy_job_run<
T: std::convert::Into<std::boxed::Box<crate::model::PredeployJobRun>>,
>(
mut self,
v: T,
) -> Self {
self.job_run =
std::option::Option::Some(crate::model::job_run::JobRun::PredeployJobRun(v.into()));
self
}
pub fn postdeploy_job_run(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PostdeployJobRun>> {
#[allow(unreachable_patterns)]
self.job_run.as_ref().and_then(|v| match v {
crate::model::job_run::JobRun::PostdeployJobRun(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_postdeploy_job_run<
T: std::convert::Into<std::boxed::Box<crate::model::PostdeployJobRun>>,
>(
mut self,
v: T,
) -> Self {
self.job_run =
std::option::Option::Some(crate::model::job_run::JobRun::PostdeployJobRun(v.into()));
self
}
pub fn create_child_rollout_job_run(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateChildRolloutJobRun>> {
#[allow(unreachable_patterns)]
self.job_run.as_ref().and_then(|v| match v {
crate::model::job_run::JobRun::CreateChildRolloutJobRun(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create_child_rollout_job_run<
T: std::convert::Into<std::boxed::Box<crate::model::CreateChildRolloutJobRun>>,
>(
mut self,
v: T,
) -> Self {
self.job_run = std::option::Option::Some(
crate::model::job_run::JobRun::CreateChildRolloutJobRun(v.into()),
);
self
}
pub fn advance_child_rollout_job_run(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>> {
#[allow(unreachable_patterns)]
self.job_run.as_ref().and_then(|v| match v {
crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_advance_child_rollout_job_run<
T: std::convert::Into<std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>>,
>(
mut self,
v: T,
) -> Self {
self.job_run = std::option::Option::Some(
crate::model::job_run::JobRun::AdvanceChildRolloutJobRun(v.into()),
);
self
}
}
impl wkt::message::Message for JobRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.JobRun"
}
}
pub mod job_run {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
InProgress,
Succeeded,
Failed,
Terminating,
Terminated,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::InProgress => std::option::Option::Some(1),
Self::Succeeded => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::Terminating => std::option::Option::Some(4),
Self::Terminated => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Terminating => std::option::Option::Some("TERMINATING"),
Self::Terminated => std::option::Option::Some("TERMINATED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::InProgress,
2 => Self::Succeeded,
3 => Self::Failed,
4 => Self::Terminating,
5 => Self::Terminated,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"IN_PROGRESS" => Self::InProgress,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"TERMINATING" => Self::Terminating,
"TERMINATED" => Self::Terminated,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::InProgress => serializer.serialize_i32(1),
Self::Succeeded => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::Terminating => serializer.serialize_i32(4),
Self::Terminated => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.deploy.v1.JobRun.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum JobRun {
DeployJobRun(std::boxed::Box<crate::model::DeployJobRun>),
VerifyJobRun(std::boxed::Box<crate::model::VerifyJobRun>),
PredeployJobRun(std::boxed::Box<crate::model::PredeployJobRun>),
PostdeployJobRun(std::boxed::Box<crate::model::PostdeployJobRun>),
CreateChildRolloutJobRun(std::boxed::Box<crate::model::CreateChildRolloutJobRun>),
AdvanceChildRolloutJobRun(std::boxed::Box<crate::model::AdvanceChildRolloutJobRun>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployJobRun {
pub build: std::string::String,
pub failure_cause: crate::model::deploy_job_run::FailureCause,
pub failure_message: std::string::String,
pub metadata: std::option::Option<crate::model::DeployJobRunMetadata>,
pub artifact: std::option::Option<crate::model::DeployArtifact>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployJobRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.build = v.into();
self
}
pub fn set_failure_cause<T: std::convert::Into<crate::model::deploy_job_run::FailureCause>>(
mut self,
v: T,
) -> Self {
self.failure_cause = v.into();
self
}
pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.failure_message = v.into();
self
}
pub fn set_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeployJobRunMetadata>,
{
self.metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeployJobRunMetadata>,
{
self.metadata = v.map(|x| x.into());
self
}
pub fn set_artifact<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeployArtifact>,
{
self.artifact = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_artifact<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeployArtifact>,
{
self.artifact = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DeployJobRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployJobRun"
}
}
pub mod deploy_job_run {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FailureCause {
Unspecified,
CloudBuildUnavailable,
ExecutionFailed,
DeadlineExceeded,
MissingResourcesForCanary,
CloudBuildRequestFailed,
DeployFeatureNotSupported,
UnknownValue(failure_cause::UnknownValue),
}
#[doc(hidden)]
pub mod failure_cause {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FailureCause {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CloudBuildUnavailable => std::option::Option::Some(1),
Self::ExecutionFailed => std::option::Option::Some(2),
Self::DeadlineExceeded => std::option::Option::Some(3),
Self::MissingResourcesForCanary => std::option::Option::Some(4),
Self::CloudBuildRequestFailed => std::option::Option::Some(5),
Self::DeployFeatureNotSupported => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
Self::MissingResourcesForCanary => {
std::option::Option::Some("MISSING_RESOURCES_FOR_CANARY")
}
Self::CloudBuildRequestFailed => {
std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
}
Self::DeployFeatureNotSupported => {
std::option::Option::Some("DEPLOY_FEATURE_NOT_SUPPORTED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FailureCause {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FailureCause {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FailureCause {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CloudBuildUnavailable,
2 => Self::ExecutionFailed,
3 => Self::DeadlineExceeded,
4 => Self::MissingResourcesForCanary,
5 => Self::CloudBuildRequestFailed,
6 => Self::DeployFeatureNotSupported,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FailureCause {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
"CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
"EXECUTION_FAILED" => Self::ExecutionFailed,
"DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
"MISSING_RESOURCES_FOR_CANARY" => Self::MissingResourcesForCanary,
"CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
"DEPLOY_FEATURE_NOT_SUPPORTED" => Self::DeployFeatureNotSupported,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FailureCause {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CloudBuildUnavailable => serializer.serialize_i32(1),
Self::ExecutionFailed => serializer.serialize_i32(2),
Self::DeadlineExceeded => serializer.serialize_i32(3),
Self::MissingResourcesForCanary => serializer.serialize_i32(4),
Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
Self::DeployFeatureNotSupported => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FailureCause {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
".google.cloud.deploy.v1.DeployJobRun.FailureCause",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VerifyJobRun {
pub build: std::string::String,
pub artifact_uri: std::string::String,
pub event_log_path: std::string::String,
pub failure_cause: crate::model::verify_job_run::FailureCause,
pub failure_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VerifyJobRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.build = v.into();
self
}
pub fn set_artifact_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.artifact_uri = v.into();
self
}
pub fn set_event_log_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.event_log_path = v.into();
self
}
pub fn set_failure_cause<T: std::convert::Into<crate::model::verify_job_run::FailureCause>>(
mut self,
v: T,
) -> Self {
self.failure_cause = v.into();
self
}
pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.failure_message = v.into();
self
}
}
impl wkt::message::Message for VerifyJobRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.VerifyJobRun"
}
}
pub mod verify_job_run {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FailureCause {
Unspecified,
CloudBuildUnavailable,
ExecutionFailed,
DeadlineExceeded,
VerificationConfigNotFound,
CloudBuildRequestFailed,
UnknownValue(failure_cause::UnknownValue),
}
#[doc(hidden)]
pub mod failure_cause {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FailureCause {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CloudBuildUnavailable => std::option::Option::Some(1),
Self::ExecutionFailed => std::option::Option::Some(2),
Self::DeadlineExceeded => std::option::Option::Some(3),
Self::VerificationConfigNotFound => std::option::Option::Some(4),
Self::CloudBuildRequestFailed => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
Self::VerificationConfigNotFound => {
std::option::Option::Some("VERIFICATION_CONFIG_NOT_FOUND")
}
Self::CloudBuildRequestFailed => {
std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FailureCause {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FailureCause {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FailureCause {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CloudBuildUnavailable,
2 => Self::ExecutionFailed,
3 => Self::DeadlineExceeded,
4 => Self::VerificationConfigNotFound,
5 => Self::CloudBuildRequestFailed,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FailureCause {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
"CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
"EXECUTION_FAILED" => Self::ExecutionFailed,
"DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
"VERIFICATION_CONFIG_NOT_FOUND" => Self::VerificationConfigNotFound,
"CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FailureCause {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CloudBuildUnavailable => serializer.serialize_i32(1),
Self::ExecutionFailed => serializer.serialize_i32(2),
Self::DeadlineExceeded => serializer.serialize_i32(3),
Self::VerificationConfigNotFound => serializer.serialize_i32(4),
Self::CloudBuildRequestFailed => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FailureCause {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
".google.cloud.deploy.v1.VerifyJobRun.FailureCause",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PredeployJobRun {
pub build: std::string::String,
pub failure_cause: crate::model::predeploy_job_run::FailureCause,
pub failure_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PredeployJobRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.build = v.into();
self
}
pub fn set_failure_cause<
T: std::convert::Into<crate::model::predeploy_job_run::FailureCause>,
>(
mut self,
v: T,
) -> Self {
self.failure_cause = v.into();
self
}
pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.failure_message = v.into();
self
}
}
impl wkt::message::Message for PredeployJobRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PredeployJobRun"
}
}
pub mod predeploy_job_run {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FailureCause {
Unspecified,
CloudBuildUnavailable,
ExecutionFailed,
DeadlineExceeded,
CloudBuildRequestFailed,
UnknownValue(failure_cause::UnknownValue),
}
#[doc(hidden)]
pub mod failure_cause {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FailureCause {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CloudBuildUnavailable => std::option::Option::Some(1),
Self::ExecutionFailed => std::option::Option::Some(2),
Self::DeadlineExceeded => std::option::Option::Some(3),
Self::CloudBuildRequestFailed => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
Self::CloudBuildRequestFailed => {
std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FailureCause {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FailureCause {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FailureCause {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CloudBuildUnavailable,
2 => Self::ExecutionFailed,
3 => Self::DeadlineExceeded,
4 => Self::CloudBuildRequestFailed,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FailureCause {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
"CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
"EXECUTION_FAILED" => Self::ExecutionFailed,
"DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
"CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FailureCause {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CloudBuildUnavailable => serializer.serialize_i32(1),
Self::ExecutionFailed => serializer.serialize_i32(2),
Self::DeadlineExceeded => serializer.serialize_i32(3),
Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FailureCause {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
".google.cloud.deploy.v1.PredeployJobRun.FailureCause",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PostdeployJobRun {
pub build: std::string::String,
pub failure_cause: crate::model::postdeploy_job_run::FailureCause,
pub failure_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PostdeployJobRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.build = v.into();
self
}
pub fn set_failure_cause<
T: std::convert::Into<crate::model::postdeploy_job_run::FailureCause>,
>(
mut self,
v: T,
) -> Self {
self.failure_cause = v.into();
self
}
pub fn set_failure_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.failure_message = v.into();
self
}
}
impl wkt::message::Message for PostdeployJobRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PostdeployJobRun"
}
}
pub mod postdeploy_job_run {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum FailureCause {
Unspecified,
CloudBuildUnavailable,
ExecutionFailed,
DeadlineExceeded,
CloudBuildRequestFailed,
UnknownValue(failure_cause::UnknownValue),
}
#[doc(hidden)]
pub mod failure_cause {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl FailureCause {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CloudBuildUnavailable => std::option::Option::Some(1),
Self::ExecutionFailed => std::option::Option::Some(2),
Self::DeadlineExceeded => std::option::Option::Some(3),
Self::CloudBuildRequestFailed => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FAILURE_CAUSE_UNSPECIFIED"),
Self::CloudBuildUnavailable => std::option::Option::Some("CLOUD_BUILD_UNAVAILABLE"),
Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
Self::DeadlineExceeded => std::option::Option::Some("DEADLINE_EXCEEDED"),
Self::CloudBuildRequestFailed => {
std::option::Option::Some("CLOUD_BUILD_REQUEST_FAILED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for FailureCause {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for FailureCause {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for FailureCause {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CloudBuildUnavailable,
2 => Self::ExecutionFailed,
3 => Self::DeadlineExceeded,
4 => Self::CloudBuildRequestFailed,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for FailureCause {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FAILURE_CAUSE_UNSPECIFIED" => Self::Unspecified,
"CLOUD_BUILD_UNAVAILABLE" => Self::CloudBuildUnavailable,
"EXECUTION_FAILED" => Self::ExecutionFailed,
"DEADLINE_EXCEEDED" => Self::DeadlineExceeded,
"CLOUD_BUILD_REQUEST_FAILED" => Self::CloudBuildRequestFailed,
_ => Self::UnknownValue(failure_cause::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for FailureCause {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CloudBuildUnavailable => serializer.serialize_i32(1),
Self::ExecutionFailed => serializer.serialize_i32(2),
Self::DeadlineExceeded => serializer.serialize_i32(3),
Self::CloudBuildRequestFailed => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for FailureCause {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureCause>::new(
".google.cloud.deploy.v1.PostdeployJobRun.FailureCause",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateChildRolloutJobRun {
pub rollout: std::string::String,
pub rollout_phase_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateChildRolloutJobRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rollout_phase_id = v.into();
self
}
}
impl wkt::message::Message for CreateChildRolloutJobRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateChildRolloutJobRun"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdvanceChildRolloutJobRun {
pub rollout: std::string::String,
pub rollout_phase_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdvanceChildRolloutJobRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_rollout_phase_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.rollout_phase_id = v.into();
self
}
}
impl wkt::message::Message for AdvanceChildRolloutJobRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AdvanceChildRolloutJobRun"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobRunsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListJobRunsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListJobRunsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListJobRunsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobRunsResponse {
pub job_runs: std::vec::Vec<crate::model::JobRun>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListJobRunsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_job_runs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::JobRun>,
{
use std::iter::Iterator;
self.job_runs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListJobRunsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListJobRunsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListJobRunsResponse {
type PageItem = crate::model::JobRun;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.job_runs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetJobRunRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetJobRunRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetJobRunRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetJobRunRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TerminateJobRunRequest {
pub name: std::string::String,
pub override_deploy_policy: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TerminateJobRunRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_override_deploy_policy<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.override_deploy_policy = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TerminateJobRunRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TerminateJobRunResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TerminateJobRunResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for TerminateJobRunResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TerminateJobRunResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Config {
pub name: std::string::String,
pub supported_versions: std::vec::Vec<crate::model::SkaffoldVersion>,
pub default_skaffold_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Config {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_supported_versions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SkaffoldVersion>,
{
use std::iter::Iterator;
self.supported_versions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_default_skaffold_version<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.default_skaffold_version = v.into();
self
}
}
impl wkt::message::Message for Config {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Config"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SkaffoldVersion {
pub version: std::string::String,
pub maintenance_mode_time: std::option::Option<wkt::Timestamp>,
pub support_expiration_time: std::option::Option<wkt::Timestamp>,
pub support_end_date: std::option::Option<google_cloud_type::model::Date>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SkaffoldVersion {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_maintenance_mode_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.maintenance_mode_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_maintenance_mode_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.maintenance_mode_time = v.map(|x| x.into());
self
}
pub fn set_support_expiration_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.support_expiration_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_support_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.support_expiration_time = v.map(|x| x.into());
self
}
pub fn set_support_end_date<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.support_end_date = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_support_end_date<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Date>,
{
self.support_end_date = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SkaffoldVersion {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.SkaffoldVersion"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Automation {
pub name: std::string::String,
pub uid: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub etag: std::string::String,
pub suspended: bool,
pub service_account: std::string::String,
pub selector: std::option::Option<crate::model::AutomationResourceSelector>,
pub rules: std::vec::Vec<crate::model::AutomationRule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Automation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.suspended = v.into();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_selector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutomationResourceSelector>,
{
self.selector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_selector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutomationResourceSelector>,
{
self.selector = v.map(|x| x.into());
self
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AutomationRule>,
{
use std::iter::Iterator;
self.rules = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Automation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Automation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomationResourceSelector {
pub targets: std::vec::Vec<crate::model::TargetAttribute>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomationResourceSelector {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_targets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TargetAttribute>,
{
use std::iter::Iterator;
self.targets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AutomationResourceSelector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AutomationResourceSelector"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomationRule {
pub rule: std::option::Option<crate::model::automation_rule::Rule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomationRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rule<
T: std::convert::Into<std::option::Option<crate::model::automation_rule::Rule>>,
>(
mut self,
v: T,
) -> Self {
self.rule = v.into();
self
}
pub fn promote_release_rule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseRule>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::automation_rule::Rule::PromoteReleaseRule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_promote_release_rule<
T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseRule>>,
>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(
crate::model::automation_rule::Rule::PromoteReleaseRule(v.into()),
);
self
}
pub fn advance_rollout_rule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutRule>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::automation_rule::Rule::AdvanceRolloutRule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_advance_rollout_rule<
T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutRule>>,
>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(
crate::model::automation_rule::Rule::AdvanceRolloutRule(v.into()),
);
self
}
pub fn repair_rollout_rule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutRule>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::automation_rule::Rule::RepairRolloutRule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_repair_rollout_rule<
T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutRule>>,
>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(
crate::model::automation_rule::Rule::RepairRolloutRule(v.into()),
);
self
}
pub fn timed_promote_release_rule(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseRule>> {
#[allow(unreachable_patterns)]
self.rule.as_ref().and_then(|v| match v {
crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_timed_promote_release_rule<
T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseRule>>,
>(
mut self,
v: T,
) -> Self {
self.rule = std::option::Option::Some(
crate::model::automation_rule::Rule::TimedPromoteReleaseRule(v.into()),
);
self
}
}
impl wkt::message::Message for AutomationRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AutomationRule"
}
}
pub mod automation_rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Rule {
PromoteReleaseRule(std::boxed::Box<crate::model::PromoteReleaseRule>),
AdvanceRolloutRule(std::boxed::Box<crate::model::AdvanceRolloutRule>),
RepairRolloutRule(std::boxed::Box<crate::model::RepairRolloutRule>),
TimedPromoteReleaseRule(std::boxed::Box<crate::model::TimedPromoteReleaseRule>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimedPromoteReleaseRule {
pub id: std::string::String,
pub destination_target_id: std::string::String,
pub schedule: std::string::String,
pub time_zone: std::string::String,
pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
pub destination_phase: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TimedPromoteReleaseRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_target_id = v.into();
self
}
pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.schedule = v.into();
self
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutomationRuleCondition>,
{
self.condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutomationRuleCondition>,
{
self.condition = v.map(|x| x.into());
self
}
pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_phase = v.into();
self
}
}
impl wkt::message::Message for TimedPromoteReleaseRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PromoteReleaseRule {
pub id: std::string::String,
pub wait: std::option::Option<wkt::Duration>,
pub destination_target_id: std::string::String,
pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
pub destination_phase: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PromoteReleaseRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_wait<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = v.map(|x| x.into());
self
}
pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_target_id = v.into();
self
}
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutomationRuleCondition>,
{
self.condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutomationRuleCondition>,
{
self.condition = v.map(|x| x.into());
self
}
pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_phase = v.into();
self
}
}
impl wkt::message::Message for PromoteReleaseRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdvanceRolloutRule {
pub id: std::string::String,
pub source_phases: std::vec::Vec<std::string::String>,
pub wait: std::option::Option<wkt::Duration>,
pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdvanceRolloutRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_source_phases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.source_phases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_wait<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = v.map(|x| x.into());
self
}
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutomationRuleCondition>,
{
self.condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutomationRuleCondition>,
{
self.condition = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AdvanceRolloutRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RepairRolloutRule {
pub id: std::string::String,
pub phases: std::vec::Vec<std::string::String>,
pub jobs: std::vec::Vec<std::string::String>,
pub condition: std::option::Option<crate::model::AutomationRuleCondition>,
pub repair_phases: std::vec::Vec<crate::model::RepairPhaseConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RepairRolloutRule {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_phases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.phases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_jobs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.jobs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutomationRuleCondition>,
{
self.condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutomationRuleCondition>,
{
self.condition = v.map(|x| x.into());
self
}
pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RepairPhaseConfig>,
{
use std::iter::Iterator;
self.repair_phases = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RepairRolloutRule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RepairRolloutRule"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RepairPhaseConfig {
pub repair_phase: std::option::Option<crate::model::repair_phase_config::RepairPhase>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RepairPhaseConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_repair_phase<
T: std::convert::Into<std::option::Option<crate::model::repair_phase_config::RepairPhase>>,
>(
mut self,
v: T,
) -> Self {
self.repair_phase = v.into();
self
}
pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Retry>> {
#[allow(unreachable_patterns)]
self.repair_phase.as_ref().and_then(|v| match v {
crate::model::repair_phase_config::RepairPhase::Retry(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::Retry>>>(
mut self,
v: T,
) -> Self {
self.repair_phase = std::option::Option::Some(
crate::model::repair_phase_config::RepairPhase::Retry(v.into()),
);
self
}
pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::Rollback>> {
#[allow(unreachable_patterns)]
self.repair_phase.as_ref().and_then(|v| match v {
crate::model::repair_phase_config::RepairPhase::Rollback(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::Rollback>>>(
mut self,
v: T,
) -> Self {
self.repair_phase = std::option::Option::Some(
crate::model::repair_phase_config::RepairPhase::Rollback(v.into()),
);
self
}
}
impl wkt::message::Message for RepairPhaseConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RepairPhaseConfig"
}
}
pub mod repair_phase_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RepairPhase {
Retry(std::boxed::Box<crate::model::Retry>),
Rollback(std::boxed::Box<crate::model::Rollback>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Retry {
pub attempts: i64,
pub wait: std::option::Option<wkt::Duration>,
pub backoff_mode: crate::model::BackoffMode,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Retry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.attempts = v.into();
self
}
pub fn set_wait<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = v.map(|x| x.into());
self
}
pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
mut self,
v: T,
) -> Self {
self.backoff_mode = v.into();
self
}
}
impl wkt::message::Message for Retry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Retry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Rollback {
pub destination_phase: std::string::String,
pub disable_rollback_if_rollout_pending: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Rollback {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_phase = v.into();
self
}
pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.disable_rollback_if_rollout_pending = v.into();
self
}
}
impl wkt::message::Message for Rollback {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.Rollback"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomationRuleCondition {
pub targets_present_condition: std::option::Option<crate::model::TargetsPresentCondition>,
pub rule_type_condition:
std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomationRuleCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_targets_present_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TargetsPresentCondition>,
{
self.targets_present_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_targets_present_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TargetsPresentCondition>,
{
self.targets_present_condition = v.map(|x| x.into());
self
}
pub fn set_rule_type_condition<
T: std::convert::Into<
std::option::Option<crate::model::automation_rule_condition::RuleTypeCondition>,
>,
>(
mut self,
v: T,
) -> Self {
self.rule_type_condition = v.into();
self
}
pub fn timed_promote_release_condition(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseCondition>> {
#[allow(unreachable_patterns)]
self.rule_type_condition.as_ref().and_then(|v| match v {
crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_timed_promote_release_condition<
T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseCondition>>,
>(
mut self,
v: T,
) -> Self {
self.rule_type_condition = std::option::Option::Some(
crate::model::automation_rule_condition::RuleTypeCondition::TimedPromoteReleaseCondition(
v.into()
)
);
self
}
}
impl wkt::message::Message for AutomationRuleCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AutomationRuleCondition"
}
}
pub mod automation_rule_condition {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RuleTypeCondition {
TimedPromoteReleaseCondition(std::boxed::Box<crate::model::TimedPromoteReleaseCondition>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimedPromoteReleaseCondition {
pub next_promotion_time: std::option::Option<wkt::Timestamp>,
pub targets_list: std::vec::Vec<crate::model::timed_promote_release_condition::Targets>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TimedPromoteReleaseCondition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_next_promotion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.next_promotion_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_next_promotion_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.next_promotion_time = v.map(|x| x.into());
self
}
pub fn set_targets_list<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::timed_promote_release_condition::Targets>,
{
use std::iter::Iterator;
self.targets_list = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TimedPromoteReleaseCondition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition"
}
}
pub mod timed_promote_release_condition {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Targets {
pub source_target_id: std::string::String,
pub destination_target_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Targets {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_target_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_target_id = v.into();
self
}
pub fn set_destination_target_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_target_id = v.into();
self
}
}
impl wkt::message::Message for Targets {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseCondition.Targets"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAutomationRequest {
pub parent: std::string::String,
pub automation_id: std::string::String,
pub automation: std::option::Option<crate::model::Automation>,
pub request_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateAutomationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.automation_id = v.into();
self
}
pub fn set_automation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Automation>,
{
self.automation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Automation>,
{
self.automation = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateAutomationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CreateAutomationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAutomationRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub automation: std::option::Option<crate::model::Automation>,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAutomationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_automation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Automation>,
{
self.automation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_automation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Automation>,
{
self.automation = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateAutomationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.UpdateAutomationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAutomationRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub allow_missing: bool,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteAutomationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteAutomationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeleteAutomationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAutomationsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAutomationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListAutomationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListAutomationsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAutomationsResponse {
pub automations: std::vec::Vec<crate::model::Automation>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAutomationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_automations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Automation>,
{
use std::iter::Iterator;
self.automations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListAutomationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListAutomationsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationsResponse {
type PageItem = crate::model::Automation;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.automations
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAutomationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAutomationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAutomationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetAutomationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutomationRun {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub service_account: std::string::String,
pub automation_snapshot: std::option::Option<crate::model::Automation>,
pub target_id: std::string::String,
pub state: crate::model::automation_run::State,
pub state_description: std::string::String,
pub policy_violation: std::option::Option<crate::model::PolicyViolation>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub rule_id: std::string::String,
pub automation_id: std::string::String,
pub wait_until_time: std::option::Option<wkt::Timestamp>,
pub operation: std::option::Option<crate::model::automation_run::Operation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutomationRun {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
pub fn set_automation_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Automation>,
{
self.automation_snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_automation_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Automation>,
{
self.automation_snapshot = v.map(|x| x.into());
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::automation_run::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_state_description<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.state_description = v.into();
self
}
pub fn set_policy_violation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PolicyViolation>,
{
self.policy_violation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_policy_violation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PolicyViolation>,
{
self.policy_violation = v.map(|x| x.into());
self
}
pub fn set_expire_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = v.map(|x| x.into());
self
}
pub fn set_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rule_id = v.into();
self
}
pub fn set_automation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.automation_id = v.into();
self
}
pub fn set_wait_until_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.wait_until_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_wait_until_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.wait_until_time = v.map(|x| x.into());
self
}
pub fn set_operation<
T: std::convert::Into<std::option::Option<crate::model::automation_run::Operation>>,
>(
mut self,
v: T,
) -> Self {
self.operation = v.into();
self
}
pub fn promote_release_operation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::PromoteReleaseOperation>> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::automation_run::Operation::PromoteReleaseOperation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_promote_release_operation<
T: std::convert::Into<std::boxed::Box<crate::model::PromoteReleaseOperation>>,
>(
mut self,
v: T,
) -> Self {
self.operation = std::option::Option::Some(
crate::model::automation_run::Operation::PromoteReleaseOperation(v.into()),
);
self
}
pub fn advance_rollout_operation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AdvanceRolloutOperation>> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::automation_run::Operation::AdvanceRolloutOperation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_advance_rollout_operation<
T: std::convert::Into<std::boxed::Box<crate::model::AdvanceRolloutOperation>>,
>(
mut self,
v: T,
) -> Self {
self.operation = std::option::Option::Some(
crate::model::automation_run::Operation::AdvanceRolloutOperation(v.into()),
);
self
}
pub fn repair_rollout_operation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::RepairRolloutOperation>> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::automation_run::Operation::RepairRolloutOperation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_repair_rollout_operation<
T: std::convert::Into<std::boxed::Box<crate::model::RepairRolloutOperation>>,
>(
mut self,
v: T,
) -> Self {
self.operation = std::option::Option::Some(
crate::model::automation_run::Operation::RepairRolloutOperation(v.into()),
);
self
}
pub fn timed_promote_release_operation(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TimedPromoteReleaseOperation>> {
#[allow(unreachable_patterns)]
self.operation.as_ref().and_then(|v| match v {
crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_timed_promote_release_operation<
T: std::convert::Into<std::boxed::Box<crate::model::TimedPromoteReleaseOperation>>,
>(
mut self,
v: T,
) -> Self {
self.operation = std::option::Option::Some(
crate::model::automation_run::Operation::TimedPromoteReleaseOperation(v.into()),
);
self
}
}
impl wkt::message::Message for AutomationRun {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AutomationRun"
}
}
pub mod automation_run {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Succeeded,
Cancelled,
Failed,
InProgress,
Pending,
Aborted,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Cancelled => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::InProgress => std::option::Option::Some(4),
Self::Pending => std::option::Option::Some(5),
Self::Aborted => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Aborted => std::option::Option::Some("ABORTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Cancelled,
3 => Self::Failed,
4 => Self::InProgress,
5 => Self::Pending,
6 => Self::Aborted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"CANCELLED" => Self::Cancelled,
"FAILED" => Self::Failed,
"IN_PROGRESS" => Self::InProgress,
"PENDING" => Self::Pending,
"ABORTED" => Self::Aborted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Cancelled => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::InProgress => serializer.serialize_i32(4),
Self::Pending => serializer.serialize_i32(5),
Self::Aborted => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.deploy.v1.AutomationRun.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Operation {
PromoteReleaseOperation(std::boxed::Box<crate::model::PromoteReleaseOperation>),
AdvanceRolloutOperation(std::boxed::Box<crate::model::AdvanceRolloutOperation>),
RepairRolloutOperation(std::boxed::Box<crate::model::RepairRolloutOperation>),
TimedPromoteReleaseOperation(std::boxed::Box<crate::model::TimedPromoteReleaseOperation>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PromoteReleaseOperation {
pub target_id: std::string::String,
pub wait: std::option::Option<wkt::Duration>,
pub rollout: std::string::String,
pub phase: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PromoteReleaseOperation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_wait<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = v.map(|x| x.into());
self
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phase = v.into();
self
}
}
impl wkt::message::Message for PromoteReleaseOperation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.PromoteReleaseOperation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AdvanceRolloutOperation {
pub source_phase: std::string::String,
pub wait: std::option::Option<wkt::Duration>,
pub rollout: std::string::String,
pub destination_phase: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AdvanceRolloutOperation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_phase = v.into();
self
}
pub fn set_wait<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = v.map(|x| x.into());
self
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_phase = v.into();
self
}
}
impl wkt::message::Message for AdvanceRolloutOperation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.AdvanceRolloutOperation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RepairRolloutOperation {
pub rollout: std::string::String,
pub current_repair_phase_index: i64,
pub repair_phases: std::vec::Vec<crate::model::RepairPhase>,
pub phase_id: std::string::String,
pub job_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RepairRolloutOperation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_current_repair_phase_index<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.current_repair_phase_index = v.into();
self
}
pub fn set_repair_phases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RepairPhase>,
{
use std::iter::Iterator;
self.repair_phases = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_phase_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phase_id = v.into();
self
}
pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_id = v.into();
self
}
}
impl wkt::message::Message for RepairRolloutOperation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RepairRolloutOperation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimedPromoteReleaseOperation {
pub target_id: std::string::String,
pub release: std::string::String,
pub phase: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TimedPromoteReleaseOperation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release = v.into();
self
}
pub fn set_phase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.phase = v.into();
self
}
}
impl wkt::message::Message for TimedPromoteReleaseOperation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TimedPromoteReleaseOperation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RepairPhase {
pub repair_phase: std::option::Option<crate::model::repair_phase::RepairPhase>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RepairPhase {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_repair_phase<
T: std::convert::Into<std::option::Option<crate::model::repair_phase::RepairPhase>>,
>(
mut self,
v: T,
) -> Self {
self.repair_phase = v.into();
self
}
pub fn retry(&self) -> std::option::Option<&std::boxed::Box<crate::model::RetryPhase>> {
#[allow(unreachable_patterns)]
self.repair_phase.as_ref().and_then(|v| match v {
crate::model::repair_phase::RepairPhase::Retry(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_retry<T: std::convert::Into<std::boxed::Box<crate::model::RetryPhase>>>(
mut self,
v: T,
) -> Self {
self.repair_phase =
std::option::Option::Some(crate::model::repair_phase::RepairPhase::Retry(v.into()));
self
}
pub fn rollback(&self) -> std::option::Option<&std::boxed::Box<crate::model::RollbackAttempt>> {
#[allow(unreachable_patterns)]
self.repair_phase.as_ref().and_then(|v| match v {
crate::model::repair_phase::RepairPhase::Rollback(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_rollback<T: std::convert::Into<std::boxed::Box<crate::model::RollbackAttempt>>>(
mut self,
v: T,
) -> Self {
self.repair_phase =
std::option::Option::Some(crate::model::repair_phase::RepairPhase::Rollback(v.into()));
self
}
}
impl wkt::message::Message for RepairPhase {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RepairPhase"
}
}
pub mod repair_phase {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RepairPhase {
Retry(std::boxed::Box<crate::model::RetryPhase>),
Rollback(std::boxed::Box<crate::model::RollbackAttempt>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetryPhase {
pub total_attempts: i64,
pub backoff_mode: crate::model::BackoffMode,
pub attempts: std::vec::Vec<crate::model::RetryAttempt>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetryPhase {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_total_attempts<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.total_attempts = v.into();
self
}
pub fn set_backoff_mode<T: std::convert::Into<crate::model::BackoffMode>>(
mut self,
v: T,
) -> Self {
self.backoff_mode = v.into();
self
}
pub fn set_attempts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RetryAttempt>,
{
use std::iter::Iterator;
self.attempts = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for RetryPhase {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RetryPhase"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetryAttempt {
pub attempt: i64,
pub wait: std::option::Option<wkt::Duration>,
pub state: crate::model::RepairState,
pub state_desc: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetryAttempt {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attempt<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.attempt = v.into();
self
}
pub fn set_wait<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_wait<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.wait = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_desc = v.into();
self
}
}
impl wkt::message::Message for RetryAttempt {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RetryAttempt"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RollbackAttempt {
pub destination_phase: std::string::String,
pub rollout_id: std::string::String,
pub state: crate::model::RepairState,
pub state_desc: std::string::String,
pub disable_rollback_if_rollout_pending: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RollbackAttempt {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_destination_phase<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_phase = v.into();
self
}
pub fn set_rollout_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout_id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::RepairState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_state_desc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.state_desc = v.into();
self
}
pub fn set_disable_rollback_if_rollout_pending<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.disable_rollback_if_rollout_pending = v.into();
self
}
}
impl wkt::message::Message for RollbackAttempt {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RollbackAttempt"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAutomationRunsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAutomationRunsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListAutomationRunsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAutomationRunsResponse {
pub automation_runs: std::vec::Vec<crate::model::AutomationRun>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAutomationRunsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_automation_runs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AutomationRun>,
{
use std::iter::Iterator;
self.automation_runs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListAutomationRunsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ListAutomationRunsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAutomationRunsResponse {
type PageItem = crate::model::AutomationRun;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.automation_runs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAutomationRunRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAutomationRunRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAutomationRunRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.GetAutomationRunRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelAutomationRunRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelAutomationRunRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for CancelAutomationRunRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelAutomationRunResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelAutomationRunResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CancelAutomationRunResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CancelAutomationRunResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomTargetTypeNotificationEvent {
pub message: std::string::String,
pub custom_target_type_uid: std::string::String,
pub custom_target_type: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomTargetTypeNotificationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_custom_target_type_uid<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.custom_target_type_uid = v.into();
self
}
pub fn set_custom_target_type<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.custom_target_type = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for CustomTargetTypeNotificationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.CustomTargetTypeNotificationEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeliveryPipelineNotificationEvent {
pub message: std::string::String,
pub pipeline_uid: std::string::String,
pub delivery_pipeline: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeliveryPipelineNotificationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.delivery_pipeline = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for DeliveryPipelineNotificationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeliveryPipelineNotificationEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployPolicyEvaluationEvent {
pub message: std::string::String,
pub rule_type: std::string::String,
pub rule: std::string::String,
pub pipeline_uid: std::string::String,
pub delivery_pipeline: std::string::String,
pub target_uid: std::string::String,
pub target: std::string::String,
pub invoker: crate::model::deploy_policy::Invoker,
pub deploy_policy: std::string::String,
pub deploy_policy_uid: std::string::String,
pub allowed: bool,
pub verdict: crate::model::deploy_policy_evaluation_event::PolicyVerdict,
pub overrides:
std::vec::Vec<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployPolicyEvaluationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_rule_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rule_type = v.into();
self
}
pub fn set_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rule = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_delivery_pipeline<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.delivery_pipeline = v.into();
self
}
pub fn set_target_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_uid = v.into();
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_invoker<T: std::convert::Into<crate::model::deploy_policy::Invoker>>(
mut self,
v: T,
) -> Self {
self.invoker = v.into();
self
}
pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deploy_policy = v.into();
self
}
pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.deploy_policy_uid = v.into();
self
}
pub fn set_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allowed = v.into();
self
}
pub fn set_verdict<
T: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdict>,
>(
mut self,
v: T,
) -> Self {
self.verdict = v.into();
self
}
pub fn set_overrides<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::deploy_policy_evaluation_event::PolicyVerdictOverride>,
{
use std::iter::Iterator;
self.overrides = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DeployPolicyEvaluationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployPolicyEvaluationEvent"
}
}
pub mod deploy_policy_evaluation_event {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PolicyVerdict {
Unspecified,
AllowedByPolicy,
DeniedByPolicy,
UnknownValue(policy_verdict::UnknownValue),
}
#[doc(hidden)]
pub mod policy_verdict {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PolicyVerdict {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AllowedByPolicy => std::option::Option::Some(1),
Self::DeniedByPolicy => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("POLICY_VERDICT_UNSPECIFIED"),
Self::AllowedByPolicy => std::option::Option::Some("ALLOWED_BY_POLICY"),
Self::DeniedByPolicy => std::option::Option::Some("DENIED_BY_POLICY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PolicyVerdict {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PolicyVerdict {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PolicyVerdict {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::AllowedByPolicy,
2 => Self::DeniedByPolicy,
_ => Self::UnknownValue(policy_verdict::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PolicyVerdict {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POLICY_VERDICT_UNSPECIFIED" => Self::Unspecified,
"ALLOWED_BY_POLICY" => Self::AllowedByPolicy,
"DENIED_BY_POLICY" => Self::DeniedByPolicy,
_ => Self::UnknownValue(policy_verdict::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PolicyVerdict {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::AllowedByPolicy => serializer.serialize_i32(1),
Self::DeniedByPolicy => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PolicyVerdict {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdict>::new(
".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdict",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PolicyVerdictOverride {
Unspecified,
PolicyOverridden,
PolicySuspended,
UnknownValue(policy_verdict_override::UnknownValue),
}
#[doc(hidden)]
pub mod policy_verdict_override {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PolicyVerdictOverride {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PolicyOverridden => std::option::Option::Some(1),
Self::PolicySuspended => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("POLICY_VERDICT_OVERRIDE_UNSPECIFIED")
}
Self::PolicyOverridden => std::option::Option::Some("POLICY_OVERRIDDEN"),
Self::PolicySuspended => std::option::Option::Some("POLICY_SUSPENDED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PolicyVerdictOverride {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PolicyVerdictOverride {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PolicyVerdictOverride {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PolicyOverridden,
2 => Self::PolicySuspended,
_ => Self::UnknownValue(policy_verdict_override::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PolicyVerdictOverride {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POLICY_VERDICT_OVERRIDE_UNSPECIFIED" => Self::Unspecified,
"POLICY_OVERRIDDEN" => Self::PolicyOverridden,
"POLICY_SUSPENDED" => Self::PolicySuspended,
_ => Self::UnknownValue(policy_verdict_override::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PolicyVerdictOverride {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::PolicyOverridden => serializer.serialize_i32(1),
Self::PolicySuspended => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PolicyVerdictOverride {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyVerdictOverride>::new(
".google.cloud.deploy.v1.DeployPolicyEvaluationEvent.PolicyVerdictOverride",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeployPolicyNotificationEvent {
pub message: std::string::String,
pub deploy_policy: std::string::String,
pub deploy_policy_uid: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeployPolicyNotificationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_deploy_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.deploy_policy = v.into();
self
}
pub fn set_deploy_policy_uid<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.deploy_policy_uid = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for DeployPolicyNotificationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.DeployPolicyNotificationEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct JobRunNotificationEvent {
pub message: std::string::String,
pub job_run: std::string::String,
pub pipeline_uid: std::string::String,
pub release_uid: std::string::String,
pub release: std::string::String,
pub rollout_uid: std::string::String,
pub rollout: std::string::String,
pub target_id: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl JobRunNotificationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_job_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job_run = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release_uid = v.into();
self
}
pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release = v.into();
self
}
pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout_uid = v.into();
self
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for JobRunNotificationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.JobRunNotificationEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReleaseNotificationEvent {
pub message: std::string::String,
pub pipeline_uid: std::string::String,
pub release_uid: std::string::String,
pub release: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReleaseNotificationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release_uid = v.into();
self
}
pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for ReleaseNotificationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ReleaseNotificationEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReleaseRenderEvent {
pub message: std::string::String,
pub pipeline_uid: std::string::String,
pub release: std::string::String,
pub r#type: crate::model::Type,
pub release_render_state: crate::model::release::RenderState,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReleaseRenderEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_release_render_state<T: std::convert::Into<crate::model::release::RenderState>>(
mut self,
v: T,
) -> Self {
self.release_render_state = v.into();
self
}
}
impl wkt::message::Message for ReleaseRenderEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.ReleaseRenderEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RolloutNotificationEvent {
pub message: std::string::String,
pub pipeline_uid: std::string::String,
pub release_uid: std::string::String,
pub release: std::string::String,
pub rollout_uid: std::string::String,
pub rollout: std::string::String,
pub target_id: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RolloutNotificationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release_uid = v.into();
self
}
pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release = v.into();
self
}
pub fn set_rollout_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout_uid = v.into();
self
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for RolloutNotificationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RolloutNotificationEvent"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RolloutUpdateEvent {
pub message: std::string::String,
pub pipeline_uid: std::string::String,
pub release_uid: std::string::String,
pub release: std::string::String,
pub rollout: std::string::String,
pub target_id: std::string::String,
pub r#type: crate::model::Type,
pub rollout_update_type: crate::model::rollout_update_event::RolloutUpdateType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RolloutUpdateEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_pipeline_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.pipeline_uid = v.into();
self
}
pub fn set_release_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release_uid = v.into();
self
}
pub fn set_release<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.release = v.into();
self
}
pub fn set_rollout<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.rollout = v.into();
self
}
pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_id = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_rollout_update_type<
T: std::convert::Into<crate::model::rollout_update_event::RolloutUpdateType>,
>(
mut self,
v: T,
) -> Self {
self.rollout_update_type = v.into();
self
}
}
impl wkt::message::Message for RolloutUpdateEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.RolloutUpdateEvent"
}
}
pub mod rollout_update_event {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RolloutUpdateType {
Unspecified,
Pending,
PendingRelease,
InProgress,
Cancelling,
Cancelled,
Halted,
Succeeded,
Failed,
ApprovalRequired,
Approved,
Rejected,
AdvanceRequired,
Advanced,
UnknownValue(rollout_update_type::UnknownValue),
}
#[doc(hidden)]
pub mod rollout_update_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RolloutUpdateType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::PendingRelease => std::option::Option::Some(2),
Self::InProgress => std::option::Option::Some(3),
Self::Cancelling => std::option::Option::Some(4),
Self::Cancelled => std::option::Option::Some(5),
Self::Halted => std::option::Option::Some(6),
Self::Succeeded => std::option::Option::Some(7),
Self::Failed => std::option::Option::Some(8),
Self::ApprovalRequired => std::option::Option::Some(9),
Self::Approved => std::option::Option::Some(10),
Self::Rejected => std::option::Option::Some(11),
Self::AdvanceRequired => std::option::Option::Some(12),
Self::Advanced => std::option::Option::Some(13),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ROLLOUT_UPDATE_TYPE_UNSPECIFIED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::PendingRelease => std::option::Option::Some("PENDING_RELEASE"),
Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Halted => std::option::Option::Some("HALTED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::ApprovalRequired => std::option::Option::Some("APPROVAL_REQUIRED"),
Self::Approved => std::option::Option::Some("APPROVED"),
Self::Rejected => std::option::Option::Some("REJECTED"),
Self::AdvanceRequired => std::option::Option::Some("ADVANCE_REQUIRED"),
Self::Advanced => std::option::Option::Some("ADVANCED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RolloutUpdateType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RolloutUpdateType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RolloutUpdateType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Pending,
2 => Self::PendingRelease,
3 => Self::InProgress,
4 => Self::Cancelling,
5 => Self::Cancelled,
6 => Self::Halted,
7 => Self::Succeeded,
8 => Self::Failed,
9 => Self::ApprovalRequired,
10 => Self::Approved,
11 => Self::Rejected,
12 => Self::AdvanceRequired,
13 => Self::Advanced,
_ => Self::UnknownValue(rollout_update_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RolloutUpdateType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROLLOUT_UPDATE_TYPE_UNSPECIFIED" => Self::Unspecified,
"PENDING" => Self::Pending,
"PENDING_RELEASE" => Self::PendingRelease,
"IN_PROGRESS" => Self::InProgress,
"CANCELLING" => Self::Cancelling,
"CANCELLED" => Self::Cancelled,
"HALTED" => Self::Halted,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
"APPROVAL_REQUIRED" => Self::ApprovalRequired,
"APPROVED" => Self::Approved,
"REJECTED" => Self::Rejected,
"ADVANCE_REQUIRED" => Self::AdvanceRequired,
"ADVANCED" => Self::Advanced,
_ => Self::UnknownValue(rollout_update_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RolloutUpdateType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::PendingRelease => serializer.serialize_i32(2),
Self::InProgress => serializer.serialize_i32(3),
Self::Cancelling => serializer.serialize_i32(4),
Self::Cancelled => serializer.serialize_i32(5),
Self::Halted => serializer.serialize_i32(6),
Self::Succeeded => serializer.serialize_i32(7),
Self::Failed => serializer.serialize_i32(8),
Self::ApprovalRequired => serializer.serialize_i32(9),
Self::Approved => serializer.serialize_i32(10),
Self::Rejected => serializer.serialize_i32(11),
Self::AdvanceRequired => serializer.serialize_i32(12),
Self::Advanced => serializer.serialize_i32(13),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RolloutUpdateType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutUpdateType>::new(
".google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TargetNotificationEvent {
pub message: std::string::String,
pub target: std::string::String,
pub r#type: crate::model::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TargetNotificationEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for TargetNotificationEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.deploy.v1.TargetNotificationEvent"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SkaffoldSupportState {
Unspecified,
Supported,
MaintenanceMode,
Unsupported,
UnknownValue(skaffold_support_state::UnknownValue),
}
#[doc(hidden)]
pub mod skaffold_support_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SkaffoldSupportState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Supported => std::option::Option::Some(1),
Self::MaintenanceMode => std::option::Option::Some(2),
Self::Unsupported => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSPECIFIED"),
Self::Supported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_SUPPORTED"),
Self::MaintenanceMode => {
std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE")
}
Self::Unsupported => std::option::Option::Some("SKAFFOLD_SUPPORT_STATE_UNSUPPORTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SkaffoldSupportState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SkaffoldSupportState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SkaffoldSupportState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Supported,
2 => Self::MaintenanceMode,
3 => Self::Unsupported,
_ => Self::UnknownValue(skaffold_support_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SkaffoldSupportState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SKAFFOLD_SUPPORT_STATE_UNSPECIFIED" => Self::Unspecified,
"SKAFFOLD_SUPPORT_STATE_SUPPORTED" => Self::Supported,
"SKAFFOLD_SUPPORT_STATE_MAINTENANCE_MODE" => Self::MaintenanceMode,
"SKAFFOLD_SUPPORT_STATE_UNSUPPORTED" => Self::Unsupported,
_ => Self::UnknownValue(skaffold_support_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SkaffoldSupportState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Supported => serializer.serialize_i32(1),
Self::MaintenanceMode => serializer.serialize_i32(2),
Self::Unsupported => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SkaffoldSupportState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SkaffoldSupportState>::new(
".google.cloud.deploy.v1.SkaffoldSupportState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BackoffMode {
Unspecified,
Linear,
Exponential,
UnknownValue(backoff_mode::UnknownValue),
}
#[doc(hidden)]
pub mod backoff_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl BackoffMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Linear => std::option::Option::Some(1),
Self::Exponential => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("BACKOFF_MODE_UNSPECIFIED"),
Self::Linear => std::option::Option::Some("BACKOFF_MODE_LINEAR"),
Self::Exponential => std::option::Option::Some("BACKOFF_MODE_EXPONENTIAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for BackoffMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for BackoffMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for BackoffMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Linear,
2 => Self::Exponential,
_ => Self::UnknownValue(backoff_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for BackoffMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BACKOFF_MODE_UNSPECIFIED" => Self::Unspecified,
"BACKOFF_MODE_LINEAR" => Self::Linear,
"BACKOFF_MODE_EXPONENTIAL" => Self::Exponential,
_ => Self::UnknownValue(backoff_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for BackoffMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Linear => serializer.serialize_i32(1),
Self::Exponential => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for BackoffMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackoffMode>::new(
".google.cloud.deploy.v1.BackoffMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RepairState {
Unspecified,
Succeeded,
Cancelled,
Failed,
InProgress,
Pending,
Aborted,
UnknownValue(repair_state::UnknownValue),
}
#[doc(hidden)]
pub mod repair_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RepairState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Cancelled => std::option::Option::Some(2),
Self::Failed => std::option::Option::Some(3),
Self::InProgress => std::option::Option::Some(4),
Self::Pending => std::option::Option::Some(5),
Self::Aborted => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("REPAIR_STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("REPAIR_STATE_SUCCEEDED"),
Self::Cancelled => std::option::Option::Some("REPAIR_STATE_CANCELLED"),
Self::Failed => std::option::Option::Some("REPAIR_STATE_FAILED"),
Self::InProgress => std::option::Option::Some("REPAIR_STATE_IN_PROGRESS"),
Self::Pending => std::option::Option::Some("REPAIR_STATE_PENDING"),
Self::Aborted => std::option::Option::Some("REPAIR_STATE_ABORTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RepairState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RepairState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RepairState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Cancelled,
3 => Self::Failed,
4 => Self::InProgress,
5 => Self::Pending,
7 => Self::Aborted,
_ => Self::UnknownValue(repair_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RepairState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REPAIR_STATE_UNSPECIFIED" => Self::Unspecified,
"REPAIR_STATE_SUCCEEDED" => Self::Succeeded,
"REPAIR_STATE_CANCELLED" => Self::Cancelled,
"REPAIR_STATE_FAILED" => Self::Failed,
"REPAIR_STATE_IN_PROGRESS" => Self::InProgress,
"REPAIR_STATE_PENDING" => Self::Pending,
"REPAIR_STATE_ABORTED" => Self::Aborted,
_ => Self::UnknownValue(repair_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RepairState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Succeeded => serializer.serialize_i32(1),
Self::Cancelled => serializer.serialize_i32(2),
Self::Failed => serializer.serialize_i32(3),
Self::InProgress => serializer.serialize_i32(4),
Self::Pending => serializer.serialize_i32(5),
Self::Aborted => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RepairState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RepairState>::new(
".google.cloud.deploy.v1.RepairState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
PubsubNotificationFailure,
ResourceStateChange,
ProcessAborted,
RestrictionViolated,
ResourceDeleted,
RolloutUpdate,
DeployPolicyEvaluation,
#[deprecated]
RenderStatuesChange,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PubsubNotificationFailure => std::option::Option::Some(1),
Self::ResourceStateChange => std::option::Option::Some(3),
Self::ProcessAborted => std::option::Option::Some(4),
Self::RestrictionViolated => std::option::Option::Some(5),
Self::ResourceDeleted => std::option::Option::Some(6),
Self::RolloutUpdate => std::option::Option::Some(7),
Self::DeployPolicyEvaluation => std::option::Option::Some(8),
Self::RenderStatuesChange => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::PubsubNotificationFailure => {
std::option::Option::Some("TYPE_PUBSUB_NOTIFICATION_FAILURE")
}
Self::ResourceStateChange => std::option::Option::Some("TYPE_RESOURCE_STATE_CHANGE"),
Self::ProcessAborted => std::option::Option::Some("TYPE_PROCESS_ABORTED"),
Self::RestrictionViolated => std::option::Option::Some("TYPE_RESTRICTION_VIOLATED"),
Self::ResourceDeleted => std::option::Option::Some("TYPE_RESOURCE_DELETED"),
Self::RolloutUpdate => std::option::Option::Some("TYPE_ROLLOUT_UPDATE"),
Self::DeployPolicyEvaluation => {
std::option::Option::Some("TYPE_DEPLOY_POLICY_EVALUATION")
}
Self::RenderStatuesChange => std::option::Option::Some("TYPE_RENDER_STATUES_CHANGE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PubsubNotificationFailure,
2 => Self::RenderStatuesChange,
3 => Self::ResourceStateChange,
4 => Self::ProcessAborted,
5 => Self::RestrictionViolated,
6 => Self::ResourceDeleted,
7 => Self::RolloutUpdate,
8 => Self::DeployPolicyEvaluation,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"TYPE_PUBSUB_NOTIFICATION_FAILURE" => Self::PubsubNotificationFailure,
"TYPE_RESOURCE_STATE_CHANGE" => Self::ResourceStateChange,
"TYPE_PROCESS_ABORTED" => Self::ProcessAborted,
"TYPE_RESTRICTION_VIOLATED" => Self::RestrictionViolated,
"TYPE_RESOURCE_DELETED" => Self::ResourceDeleted,
"TYPE_ROLLOUT_UPDATE" => Self::RolloutUpdate,
"TYPE_DEPLOY_POLICY_EVALUATION" => Self::DeployPolicyEvaluation,
"TYPE_RENDER_STATUES_CHANGE" => Self::RenderStatuesChange,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::PubsubNotificationFailure => serializer.serialize_i32(1),
Self::ResourceStateChange => serializer.serialize_i32(3),
Self::ProcessAborted => serializer.serialize_i32(4),
Self::RestrictionViolated => serializer.serialize_i32(5),
Self::ResourceDeleted => serializer.serialize_i32(6),
Self::RolloutUpdate => serializer.serialize_i32(7),
Self::DeployPolicyEvaluation => serializer.serialize_i32(8),
Self::RenderStatuesChange => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.cloud.deploy.v1.Type",
))
}
}