#![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_api;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_rpc;
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 SubmitBuildRequest {
pub parent: std::string::String,
pub image_uri: std::string::String,
pub service_account: std::string::String,
pub worker_pool: std::string::String,
pub tags: std::vec::Vec<std::string::String>,
pub machine_type: std::string::String,
pub release_track: google_cloud_api::model::LaunchStage,
pub client: std::string::String,
pub source: std::option::Option<crate::model::submit_build_request::Source>,
pub build_type: std::option::Option<crate::model::submit_build_request::BuildType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubmitBuildRequest {
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_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_uri = 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_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.worker_pool = v.into();
self
}
pub fn set_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.tags = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_machine_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.machine_type = v.into();
self
}
pub fn set_release_track<T: std::convert::Into<google_cloud_api::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.release_track = v.into();
self
}
pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client = v.into();
self
}
pub fn set_source<
T: std::convert::Into<std::option::Option<crate::model::submit_build_request::Source>>,
>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn storage_source(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::StorageSource>> {
#[allow(unreachable_patterns)]
self.source.as_ref().and_then(|v| match v {
crate::model::submit_build_request::Source::StorageSource(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_storage_source<
T: std::convert::Into<std::boxed::Box<crate::model::StorageSource>>,
>(
mut self,
v: T,
) -> Self {
self.source = std::option::Option::Some(
crate::model::submit_build_request::Source::StorageSource(v.into()),
);
self
}
pub fn set_build_type<
T: std::convert::Into<std::option::Option<crate::model::submit_build_request::BuildType>>,
>(
mut self,
v: T,
) -> Self {
self.build_type = v.into();
self
}
pub fn buildpack_build(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>>
{
#[allow(unreachable_patterns)]
self.build_type.as_ref().and_then(|v| match v {
crate::model::submit_build_request::BuildType::BuildpackBuild(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_buildpack_build<
T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>>,
>(
mut self,
v: T,
) -> Self {
self.build_type = std::option::Option::Some(
crate::model::submit_build_request::BuildType::BuildpackBuild(v.into()),
);
self
}
pub fn docker_build(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::submit_build_request::DockerBuild>>
{
#[allow(unreachable_patterns)]
self.build_type.as_ref().and_then(|v| match v {
crate::model::submit_build_request::BuildType::DockerBuild(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_docker_build<
T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::DockerBuild>>,
>(
mut self,
v: T,
) -> Self {
self.build_type = std::option::Option::Some(
crate::model::submit_build_request::BuildType::DockerBuild(v.into()),
);
self
}
}
impl wkt::message::Message for SubmitBuildRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest"
}
}
pub mod submit_build_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DockerBuild {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DockerBuild {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DockerBuild {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest.DockerBuild"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BuildpacksBuild {
#[deprecated]
pub runtime: std::string::String,
pub function_target: std::string::String,
pub cache_image_uri: std::string::String,
pub base_image: std::string::String,
pub environment_variables:
std::collections::HashMap<std::string::String, std::string::String>,
pub enable_automatic_updates: bool,
pub project_descriptor: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BuildpacksBuild {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.runtime = v.into();
self
}
pub fn set_function_target<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.function_target = v.into();
self
}
pub fn set_cache_image_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.cache_image_uri = v.into();
self
}
pub fn set_base_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.base_image = v.into();
self
}
pub fn set_environment_variables<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.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_enable_automatic_updates<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_automatic_updates = v.into();
self
}
pub fn set_project_descriptor<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.project_descriptor = v.into();
self
}
}
impl wkt::message::Message for BuildpacksBuild {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
StorageSource(std::boxed::Box<crate::model::StorageSource>),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BuildType {
BuildpackBuild(std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>),
DockerBuild(std::boxed::Box<crate::model::submit_build_request::DockerBuild>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SubmitBuildResponse {
pub build_operation: std::option::Option<google_cloud_longrunning::model::Operation>,
pub base_image_uri: std::string::String,
pub base_image_warning: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SubmitBuildResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_build_operation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_longrunning::model::Operation>,
{
self.build_operation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_build_operation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_longrunning::model::Operation>,
{
self.build_operation = v.map(|x| x.into());
self
}
pub fn set_base_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.base_image_uri = v.into();
self
}
pub fn set_base_image_warning<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.base_image_warning = v.into();
self
}
}
impl wkt::message::Message for SubmitBuildResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.SubmitBuildResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageSource {
pub bucket: std::string::String,
pub object: std::string::String,
pub generation: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StorageSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.object = v.into();
self
}
pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = v.into();
self
}
}
impl wkt::message::Message for StorageSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.StorageSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Condition {
pub r#type: std::string::String,
pub state: crate::model::condition::State,
pub message: std::string::String,
pub last_transition_time: std::option::Option<wkt::Timestamp>,
pub severity: crate::model::condition::Severity,
pub reasons: std::option::Option<crate::model::condition::Reasons>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Condition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::condition::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_last_transition_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_transition_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_transition_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_transition_time = v.map(|x| x.into());
self
}
pub fn set_severity<T: std::convert::Into<crate::model::condition::Severity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
pub fn set_reasons<
T: std::convert::Into<std::option::Option<crate::model::condition::Reasons>>,
>(
mut self,
v: T,
) -> Self {
self.reasons = v.into();
self
}
pub fn reason(&self) -> std::option::Option<&crate::model::condition::CommonReason> {
#[allow(unreachable_patterns)]
self.reasons.as_ref().and_then(|v| match v {
crate::model::condition::Reasons::Reason(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_reason<T: std::convert::Into<crate::model::condition::CommonReason>>(
mut self,
v: T,
) -> Self {
self.reasons =
std::option::Option::Some(crate::model::condition::Reasons::Reason(v.into()));
self
}
pub fn revision_reason(&self) -> std::option::Option<&crate::model::condition::RevisionReason> {
#[allow(unreachable_patterns)]
self.reasons.as_ref().and_then(|v| match v {
crate::model::condition::Reasons::RevisionReason(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_revision_reason<T: std::convert::Into<crate::model::condition::RevisionReason>>(
mut self,
v: T,
) -> Self {
self.reasons =
std::option::Option::Some(crate::model::condition::Reasons::RevisionReason(v.into()));
self
}
pub fn execution_reason(
&self,
) -> std::option::Option<&crate::model::condition::ExecutionReason> {
#[allow(unreachable_patterns)]
self.reasons.as_ref().and_then(|v| match v {
crate::model::condition::Reasons::ExecutionReason(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_execution_reason<T: std::convert::Into<crate::model::condition::ExecutionReason>>(
mut self,
v: T,
) -> Self {
self.reasons =
std::option::Option::Some(crate::model::condition::Reasons::ExecutionReason(v.into()));
self
}
}
impl wkt::message::Message for Condition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Condition"
}
}
pub mod condition {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
ConditionPending,
ConditionReconciling,
ConditionFailed,
ConditionSucceeded,
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::ConditionPending => std::option::Option::Some(1),
Self::ConditionReconciling => std::option::Option::Some(2),
Self::ConditionFailed => std::option::Option::Some(3),
Self::ConditionSucceeded => 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("STATE_UNSPECIFIED"),
Self::ConditionPending => std::option::Option::Some("CONDITION_PENDING"),
Self::ConditionReconciling => std::option::Option::Some("CONDITION_RECONCILING"),
Self::ConditionFailed => std::option::Option::Some("CONDITION_FAILED"),
Self::ConditionSucceeded => std::option::Option::Some("CONDITION_SUCCEEDED"),
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::ConditionPending,
2 => Self::ConditionReconciling,
3 => Self::ConditionFailed,
4 => Self::ConditionSucceeded,
_ => 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,
"CONDITION_PENDING" => Self::ConditionPending,
"CONDITION_RECONCILING" => Self::ConditionReconciling,
"CONDITION_FAILED" => Self::ConditionFailed,
"CONDITION_SUCCEEDED" => Self::ConditionSucceeded,
_ => 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::ConditionPending => serializer.serialize_i32(1),
Self::ConditionReconciling => serializer.serialize_i32(2),
Self::ConditionFailed => serializer.serialize_i32(3),
Self::ConditionSucceeded => serializer.serialize_i32(4),
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.run.v2.Condition.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Severity {
Unspecified,
Error,
Warning,
Info,
UnknownValue(severity::UnknownValue),
}
#[doc(hidden)]
pub mod severity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Severity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Error => std::option::Option::Some(1),
Self::Warning => std::option::Option::Some(2),
Self::Info => 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("SEVERITY_UNSPECIFIED"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Warning => std::option::Option::Some("WARNING"),
Self::Info => std::option::Option::Some("INFO"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Severity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Severity {
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 Severity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Error,
2 => Self::Warning,
3 => Self::Info,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Severity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SEVERITY_UNSPECIFIED" => Self::Unspecified,
"ERROR" => Self::Error,
"WARNING" => Self::Warning,
"INFO" => Self::Info,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Severity {
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::Error => serializer.serialize_i32(1),
Self::Warning => serializer.serialize_i32(2),
Self::Info => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Severity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
".google.cloud.run.v2.Condition.Severity",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CommonReason {
Undefined,
Unknown,
RevisionFailed,
ProgressDeadlineExceeded,
ContainerMissing,
ContainerPermissionDenied,
ContainerImageUnauthorized,
ContainerImageAuthorizationCheckFailed,
EncryptionKeyPermissionDenied,
EncryptionKeyCheckFailed,
SecretsAccessCheckFailed,
WaitingForOperation,
ImmediateRetry,
PostponedRetry,
Internal,
VpcNetworkNotFound,
UnknownValue(common_reason::UnknownValue),
}
#[doc(hidden)]
pub mod common_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CommonReason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Undefined => std::option::Option::Some(0),
Self::Unknown => std::option::Option::Some(1),
Self::RevisionFailed => std::option::Option::Some(3),
Self::ProgressDeadlineExceeded => std::option::Option::Some(4),
Self::ContainerMissing => std::option::Option::Some(6),
Self::ContainerPermissionDenied => std::option::Option::Some(7),
Self::ContainerImageUnauthorized => std::option::Option::Some(8),
Self::ContainerImageAuthorizationCheckFailed => std::option::Option::Some(9),
Self::EncryptionKeyPermissionDenied => std::option::Option::Some(10),
Self::EncryptionKeyCheckFailed => std::option::Option::Some(11),
Self::SecretsAccessCheckFailed => std::option::Option::Some(12),
Self::WaitingForOperation => std::option::Option::Some(13),
Self::ImmediateRetry => std::option::Option::Some(14),
Self::PostponedRetry => std::option::Option::Some(15),
Self::Internal => std::option::Option::Some(16),
Self::VpcNetworkNotFound => std::option::Option::Some(17),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Undefined => std::option::Option::Some("COMMON_REASON_UNDEFINED"),
Self::Unknown => std::option::Option::Some("UNKNOWN"),
Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
Self::ProgressDeadlineExceeded => {
std::option::Option::Some("PROGRESS_DEADLINE_EXCEEDED")
}
Self::ContainerMissing => std::option::Option::Some("CONTAINER_MISSING"),
Self::ContainerPermissionDenied => {
std::option::Option::Some("CONTAINER_PERMISSION_DENIED")
}
Self::ContainerImageUnauthorized => {
std::option::Option::Some("CONTAINER_IMAGE_UNAUTHORIZED")
}
Self::ContainerImageAuthorizationCheckFailed => {
std::option::Option::Some("CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED")
}
Self::EncryptionKeyPermissionDenied => {
std::option::Option::Some("ENCRYPTION_KEY_PERMISSION_DENIED")
}
Self::EncryptionKeyCheckFailed => {
std::option::Option::Some("ENCRYPTION_KEY_CHECK_FAILED")
}
Self::SecretsAccessCheckFailed => {
std::option::Option::Some("SECRETS_ACCESS_CHECK_FAILED")
}
Self::WaitingForOperation => std::option::Option::Some("WAITING_FOR_OPERATION"),
Self::ImmediateRetry => std::option::Option::Some("IMMEDIATE_RETRY"),
Self::PostponedRetry => std::option::Option::Some("POSTPONED_RETRY"),
Self::Internal => std::option::Option::Some("INTERNAL"),
Self::VpcNetworkNotFound => std::option::Option::Some("VPC_NETWORK_NOT_FOUND"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CommonReason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CommonReason {
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 CommonReason {
fn from(value: i32) -> Self {
match value {
0 => Self::Undefined,
1 => Self::Unknown,
3 => Self::RevisionFailed,
4 => Self::ProgressDeadlineExceeded,
6 => Self::ContainerMissing,
7 => Self::ContainerPermissionDenied,
8 => Self::ContainerImageUnauthorized,
9 => Self::ContainerImageAuthorizationCheckFailed,
10 => Self::EncryptionKeyPermissionDenied,
11 => Self::EncryptionKeyCheckFailed,
12 => Self::SecretsAccessCheckFailed,
13 => Self::WaitingForOperation,
14 => Self::ImmediateRetry,
15 => Self::PostponedRetry,
16 => Self::Internal,
17 => Self::VpcNetworkNotFound,
_ => Self::UnknownValue(common_reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CommonReason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMMON_REASON_UNDEFINED" => Self::Undefined,
"UNKNOWN" => Self::Unknown,
"REVISION_FAILED" => Self::RevisionFailed,
"PROGRESS_DEADLINE_EXCEEDED" => Self::ProgressDeadlineExceeded,
"CONTAINER_MISSING" => Self::ContainerMissing,
"CONTAINER_PERMISSION_DENIED" => Self::ContainerPermissionDenied,
"CONTAINER_IMAGE_UNAUTHORIZED" => Self::ContainerImageUnauthorized,
"CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED" => {
Self::ContainerImageAuthorizationCheckFailed
}
"ENCRYPTION_KEY_PERMISSION_DENIED" => Self::EncryptionKeyPermissionDenied,
"ENCRYPTION_KEY_CHECK_FAILED" => Self::EncryptionKeyCheckFailed,
"SECRETS_ACCESS_CHECK_FAILED" => Self::SecretsAccessCheckFailed,
"WAITING_FOR_OPERATION" => Self::WaitingForOperation,
"IMMEDIATE_RETRY" => Self::ImmediateRetry,
"POSTPONED_RETRY" => Self::PostponedRetry,
"INTERNAL" => Self::Internal,
"VPC_NETWORK_NOT_FOUND" => Self::VpcNetworkNotFound,
_ => Self::UnknownValue(common_reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CommonReason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Undefined => serializer.serialize_i32(0),
Self::Unknown => serializer.serialize_i32(1),
Self::RevisionFailed => serializer.serialize_i32(3),
Self::ProgressDeadlineExceeded => serializer.serialize_i32(4),
Self::ContainerMissing => serializer.serialize_i32(6),
Self::ContainerPermissionDenied => serializer.serialize_i32(7),
Self::ContainerImageUnauthorized => serializer.serialize_i32(8),
Self::ContainerImageAuthorizationCheckFailed => serializer.serialize_i32(9),
Self::EncryptionKeyPermissionDenied => serializer.serialize_i32(10),
Self::EncryptionKeyCheckFailed => serializer.serialize_i32(11),
Self::SecretsAccessCheckFailed => serializer.serialize_i32(12),
Self::WaitingForOperation => serializer.serialize_i32(13),
Self::ImmediateRetry => serializer.serialize_i32(14),
Self::PostponedRetry => serializer.serialize_i32(15),
Self::Internal => serializer.serialize_i32(16),
Self::VpcNetworkNotFound => serializer.serialize_i32(17),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CommonReason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommonReason>::new(
".google.cloud.run.v2.Condition.CommonReason",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RevisionReason {
Undefined,
Pending,
Reserve,
Retired,
Retiring,
Recreating,
HealthCheckContainerError,
CustomizedPathResponsePending,
MinInstancesNotProvisioned,
ActiveRevisionLimitReached,
NoDeployment,
HealthCheckSkipped,
MinInstancesWarming,
UnknownValue(revision_reason::UnknownValue),
}
#[doc(hidden)]
pub mod revision_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RevisionReason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Undefined => std::option::Option::Some(0),
Self::Pending => std::option::Option::Some(1),
Self::Reserve => std::option::Option::Some(2),
Self::Retired => std::option::Option::Some(3),
Self::Retiring => std::option::Option::Some(4),
Self::Recreating => std::option::Option::Some(5),
Self::HealthCheckContainerError => std::option::Option::Some(6),
Self::CustomizedPathResponsePending => std::option::Option::Some(7),
Self::MinInstancesNotProvisioned => std::option::Option::Some(8),
Self::ActiveRevisionLimitReached => std::option::Option::Some(9),
Self::NoDeployment => std::option::Option::Some(10),
Self::HealthCheckSkipped => std::option::Option::Some(11),
Self::MinInstancesWarming => std::option::Option::Some(12),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Undefined => std::option::Option::Some("REVISION_REASON_UNDEFINED"),
Self::Pending => std::option::Option::Some("PENDING"),
Self::Reserve => std::option::Option::Some("RESERVE"),
Self::Retired => std::option::Option::Some("RETIRED"),
Self::Retiring => std::option::Option::Some("RETIRING"),
Self::Recreating => std::option::Option::Some("RECREATING"),
Self::HealthCheckContainerError => {
std::option::Option::Some("HEALTH_CHECK_CONTAINER_ERROR")
}
Self::CustomizedPathResponsePending => {
std::option::Option::Some("CUSTOMIZED_PATH_RESPONSE_PENDING")
}
Self::MinInstancesNotProvisioned => {
std::option::Option::Some("MIN_INSTANCES_NOT_PROVISIONED")
}
Self::ActiveRevisionLimitReached => {
std::option::Option::Some("ACTIVE_REVISION_LIMIT_REACHED")
}
Self::NoDeployment => std::option::Option::Some("NO_DEPLOYMENT"),
Self::HealthCheckSkipped => std::option::Option::Some("HEALTH_CHECK_SKIPPED"),
Self::MinInstancesWarming => std::option::Option::Some("MIN_INSTANCES_WARMING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RevisionReason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RevisionReason {
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 RevisionReason {
fn from(value: i32) -> Self {
match value {
0 => Self::Undefined,
1 => Self::Pending,
2 => Self::Reserve,
3 => Self::Retired,
4 => Self::Retiring,
5 => Self::Recreating,
6 => Self::HealthCheckContainerError,
7 => Self::CustomizedPathResponsePending,
8 => Self::MinInstancesNotProvisioned,
9 => Self::ActiveRevisionLimitReached,
10 => Self::NoDeployment,
11 => Self::HealthCheckSkipped,
12 => Self::MinInstancesWarming,
_ => Self::UnknownValue(revision_reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RevisionReason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REVISION_REASON_UNDEFINED" => Self::Undefined,
"PENDING" => Self::Pending,
"RESERVE" => Self::Reserve,
"RETIRED" => Self::Retired,
"RETIRING" => Self::Retiring,
"RECREATING" => Self::Recreating,
"HEALTH_CHECK_CONTAINER_ERROR" => Self::HealthCheckContainerError,
"CUSTOMIZED_PATH_RESPONSE_PENDING" => Self::CustomizedPathResponsePending,
"MIN_INSTANCES_NOT_PROVISIONED" => Self::MinInstancesNotProvisioned,
"ACTIVE_REVISION_LIMIT_REACHED" => Self::ActiveRevisionLimitReached,
"NO_DEPLOYMENT" => Self::NoDeployment,
"HEALTH_CHECK_SKIPPED" => Self::HealthCheckSkipped,
"MIN_INSTANCES_WARMING" => Self::MinInstancesWarming,
_ => Self::UnknownValue(revision_reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RevisionReason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Undefined => serializer.serialize_i32(0),
Self::Pending => serializer.serialize_i32(1),
Self::Reserve => serializer.serialize_i32(2),
Self::Retired => serializer.serialize_i32(3),
Self::Retiring => serializer.serialize_i32(4),
Self::Recreating => serializer.serialize_i32(5),
Self::HealthCheckContainerError => serializer.serialize_i32(6),
Self::CustomizedPathResponsePending => serializer.serialize_i32(7),
Self::MinInstancesNotProvisioned => serializer.serialize_i32(8),
Self::ActiveRevisionLimitReached => serializer.serialize_i32(9),
Self::NoDeployment => serializer.serialize_i32(10),
Self::HealthCheckSkipped => serializer.serialize_i32(11),
Self::MinInstancesWarming => serializer.serialize_i32(12),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RevisionReason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RevisionReason>::new(
".google.cloud.run.v2.Condition.RevisionReason",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExecutionReason {
Undefined,
JobStatusServicePollingError,
NonZeroExitCode,
Cancelled,
Cancelling,
Deleted,
DelayedStartPending,
UnknownValue(execution_reason::UnknownValue),
}
#[doc(hidden)]
pub mod execution_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExecutionReason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Undefined => std::option::Option::Some(0),
Self::JobStatusServicePollingError => std::option::Option::Some(1),
Self::NonZeroExitCode => std::option::Option::Some(2),
Self::Cancelled => std::option::Option::Some(3),
Self::Cancelling => std::option::Option::Some(4),
Self::Deleted => std::option::Option::Some(5),
Self::DelayedStartPending => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Undefined => std::option::Option::Some("EXECUTION_REASON_UNDEFINED"),
Self::JobStatusServicePollingError => {
std::option::Option::Some("JOB_STATUS_SERVICE_POLLING_ERROR")
}
Self::NonZeroExitCode => std::option::Option::Some("NON_ZERO_EXIT_CODE"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Cancelling => std::option::Option::Some("CANCELLING"),
Self::Deleted => std::option::Option::Some("DELETED"),
Self::DelayedStartPending => std::option::Option::Some("DELAYED_START_PENDING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExecutionReason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExecutionReason {
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 ExecutionReason {
fn from(value: i32) -> Self {
match value {
0 => Self::Undefined,
1 => Self::JobStatusServicePollingError,
2 => Self::NonZeroExitCode,
3 => Self::Cancelled,
4 => Self::Cancelling,
5 => Self::Deleted,
6 => Self::DelayedStartPending,
_ => Self::UnknownValue(execution_reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExecutionReason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXECUTION_REASON_UNDEFINED" => Self::Undefined,
"JOB_STATUS_SERVICE_POLLING_ERROR" => Self::JobStatusServicePollingError,
"NON_ZERO_EXIT_CODE" => Self::NonZeroExitCode,
"CANCELLED" => Self::Cancelled,
"CANCELLING" => Self::Cancelling,
"DELETED" => Self::Deleted,
"DELAYED_START_PENDING" => Self::DelayedStartPending,
_ => Self::UnknownValue(execution_reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExecutionReason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Undefined => serializer.serialize_i32(0),
Self::JobStatusServicePollingError => serializer.serialize_i32(1),
Self::NonZeroExitCode => serializer.serialize_i32(2),
Self::Cancelled => serializer.serialize_i32(3),
Self::Cancelling => serializer.serialize_i32(4),
Self::Deleted => serializer.serialize_i32(5),
Self::DelayedStartPending => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExecutionReason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionReason>::new(
".google.cloud.run.v2.Condition.ExecutionReason",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Reasons {
Reason(crate::model::condition::CommonReason),
RevisionReason(crate::model::condition::RevisionReason),
ExecutionReason(crate::model::condition::ExecutionReason),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContainerStatus {
pub name: std::string::String,
pub image_digest: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContainerStatus {
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_image_digest<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_digest = v.into();
self
}
}
impl wkt::message::Message for ContainerStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ContainerStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetExecutionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetExecutionRequest {
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 GetExecutionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GetExecutionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListExecutionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListExecutionsRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListExecutionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListExecutionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListExecutionsResponse {
pub executions: std::vec::Vec<crate::model::Execution>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListExecutionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_executions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Execution>,
{
use std::iter::Iterator;
self.executions = 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
}
}
impl wkt::message::Message for ListExecutionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListExecutionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListExecutionsResponse {
type PageItem = crate::model::Execution;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.executions
}
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 DeleteExecutionRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteExecutionRequest {
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_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 DeleteExecutionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.DeleteExecutionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CancelExecutionRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CancelExecutionRequest {
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_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 CancelExecutionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.CancelExecutionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Execution {
pub name: std::string::String,
pub uid: std::string::String,
pub creator: std::string::String,
pub generation: i64,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub completion_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub launch_stage: google_cloud_api::model::LaunchStage,
pub job: std::string::String,
pub parallelism: i32,
pub task_count: i32,
pub template: std::option::Option<crate::model::TaskTemplate>,
pub reconciling: bool,
pub conditions: std::vec::Vec<crate::model::Condition>,
pub observed_generation: i64,
pub running_count: i32,
pub succeeded_count: i32,
pub failed_count: i32,
pub cancelled_count: i32,
pub retried_count: i32,
pub log_uri: std::string::String,
pub satisfies_pzs: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Execution {
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_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = 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
}
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_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_completion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.completion_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_completion_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.completion_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_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = 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_launch_stage<T: std::convert::Into<google_cloud_api::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job = v.into();
self
}
pub fn set_parallelism<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.parallelism = v.into();
self
}
pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.task_count = v.into();
self
}
pub fn set_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TaskTemplate>,
{
self.template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TaskTemplate>,
{
self.template = v.map(|x| x.into());
self
}
pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reconciling = v.into();
self
}
pub fn set_conditions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Condition>,
{
use std::iter::Iterator;
self.conditions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.observed_generation = v.into();
self
}
pub fn set_running_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.running_count = v.into();
self
}
pub fn set_succeeded_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.succeeded_count = v.into();
self
}
pub fn set_failed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.failed_count = v.into();
self
}
pub fn set_cancelled_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.cancelled_count = v.into();
self
}
pub fn set_retried_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.retried_count = v.into();
self
}
pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_uri = v.into();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = 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 Execution {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Execution"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionTemplate {
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub parallelism: i32,
pub task_count: i32,
pub template: std::option::Option<crate::model::TaskTemplate>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
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_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_parallelism<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.parallelism = v.into();
self
}
pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.task_count = v.into();
self
}
pub fn set_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TaskTemplate>,
{
self.template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TaskTemplate>,
{
self.template = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ExecutionTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ExecutionTemplate"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInstanceRequest {
pub parent: std::string::String,
pub instance: std::option::Option<crate::model::Instance>,
pub instance_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateInstanceRequest {
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_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Instance>,
{
self.instance = v.map(|x| x.into());
self
}
pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.instance_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 CreateInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.CreateInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInstanceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetInstanceRequest {
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 GetInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GetInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInstanceRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteInstanceRequest {
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_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 DeleteInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.DeleteInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListInstancesRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListInstancesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListInstancesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInstancesResponse {
pub instances: std::vec::Vec<crate::model::Instance>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListInstancesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instances<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Instance>,
{
use std::iter::Iterator;
self.instances = 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
}
}
impl wkt::message::Message for ListInstancesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListInstancesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
type PageItem = crate::model::Instance;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.instances
}
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 StopInstanceRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StopInstanceRequest {
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_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 StopInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.StopInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StartInstanceRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StartInstanceRequest {
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_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 StartInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.StartInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Instance {
pub name: std::string::String,
pub description: std::string::String,
pub uid: std::string::String,
pub generation: i64,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: 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 delete_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub creator: std::string::String,
pub last_modifier: std::string::String,
pub client: std::string::String,
pub client_version: std::string::String,
pub launch_stage: google_cloud_api::model::LaunchStage,
pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
pub vpc_access: std::option::Option<crate::model::VpcAccess>,
pub service_account: std::string::String,
pub containers: std::vec::Vec<crate::model::Container>,
pub volumes: std::vec::Vec<crate::model::Volume>,
pub encryption_key: std::string::String,
pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
pub node_selector: std::option::Option<crate::model::NodeSelector>,
pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
pub ingress: crate::model::IngressTraffic,
pub invoker_iam_disabled: bool,
pub iap_enabled: bool,
pub observed_generation: i64,
pub log_uri: std::string::String,
pub terminal_condition: std::option::Option<crate::model::Condition>,
pub conditions: std::vec::Vec<crate::model::Condition>,
pub container_statuses: std::vec::Vec<crate::model::ContainerStatus>,
pub satisfies_pzs: bool,
pub urls: std::vec::Vec<std::string::String>,
pub reconciling: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Instance {
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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = 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_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = 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
}
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_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_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = 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_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_modifier = v.into();
self
}
pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client = v.into();
self
}
pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_version = v.into();
self
}
pub fn set_launch_stage<T: std::convert::Into<google_cloud_api::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_binary_authorization<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BinaryAuthorization>,
{
self.binary_authorization = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BinaryAuthorization>,
{
self.binary_authorization = v.map(|x| x.into());
self
}
pub fn set_vpc_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = v.map(|x| x.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_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_volumes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Volume>,
{
use std::iter::Iterator;
self.volumes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.encryption_key = v.into();
self
}
pub fn set_encryption_key_revocation_action<
T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
>(
mut self,
v: T,
) -> Self {
self.encryption_key_revocation_action = v.into();
self
}
pub fn set_encryption_key_shutdown_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.encryption_key_shutdown_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_key_shutdown_duration<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.encryption_key_shutdown_duration = v.map(|x| x.into());
self
}
pub fn set_node_selector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = v.map(|x| x.into());
self
}
pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
self
}
pub fn set_ingress<T: std::convert::Into<crate::model::IngressTraffic>>(
mut self,
v: T,
) -> Self {
self.ingress = v.into();
self
}
pub fn set_invoker_iam_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.invoker_iam_disabled = v.into();
self
}
pub fn set_iap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.iap_enabled = v.into();
self
}
pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.observed_generation = v.into();
self
}
pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_uri = v.into();
self
}
pub fn set_terminal_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Condition>,
{
self.terminal_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_terminal_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Condition>,
{
self.terminal_condition = v.map(|x| x.into());
self
}
pub fn set_conditions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Condition>,
{
use std::iter::Iterator;
self.conditions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_container_statuses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ContainerStatus>,
{
use std::iter::Iterator;
self.container_statuses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = v.into();
self
}
pub fn set_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.urls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reconciling = 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 Instance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Instance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceSplit {
pub r#type: crate::model::InstanceSplitAllocationType,
pub revision: std::string::String,
pub percent: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceSplit {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::InstanceSplitAllocationType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
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_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.percent = v.into();
self
}
}
impl wkt::message::Message for InstanceSplit {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.InstanceSplit"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InstanceSplitStatus {
pub r#type: crate::model::InstanceSplitAllocationType,
pub revision: std::string::String,
pub percent: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InstanceSplitStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::InstanceSplitAllocationType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
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_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.percent = v.into();
self
}
}
impl wkt::message::Message for InstanceSplitStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.InstanceSplitStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateJobRequest {
pub parent: std::string::String,
pub job: std::option::Option<crate::model::Job>,
pub job_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateJobRequest {
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_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = v.map(|x| x.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_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.CreateJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetJobRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetJobRequest {
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 GetJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GetJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateJobRequest {
pub job: std::option::Option<crate::model::Job>,
pub validate_only: bool,
pub allow_missing: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateJobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_job<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Job>,
{
self.job = 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_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
}
impl wkt::message::Message for UpdateJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.UpdateJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListJobsRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListJobsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListJobsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListJobsResponse {
pub jobs: std::vec::Vec<crate::model::Job>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListJobsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_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.jobs = 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
}
}
impl wkt::message::Message for ListJobsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListJobsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListJobsResponse {
type PageItem = crate::model::Job;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.jobs
}
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 DeleteJobRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteJobRequest {
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_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 DeleteJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.DeleteJobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RunJobRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub overrides: std::option::Option<crate::model::run_job_request::Overrides>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RunJobRequest {
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_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
}
pub fn set_overrides<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::run_job_request::Overrides>,
{
self.overrides = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_overrides<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::run_job_request::Overrides>,
{
self.overrides = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RunJobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.RunJobRequest"
}
}
pub mod run_job_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Overrides {
pub container_overrides:
std::vec::Vec<crate::model::run_job_request::overrides::ContainerOverride>,
pub task_count: i32,
pub timeout: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Overrides {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_container_overrides<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::run_job_request::overrides::ContainerOverride>,
{
use std::iter::Iterator;
self.container_overrides = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.task_count = v.into();
self
}
pub fn set_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Overrides {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.RunJobRequest.Overrides"
}
}
pub mod overrides {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContainerOverride {
pub name: std::string::String,
pub args: std::vec::Vec<std::string::String>,
pub env: std::vec::Vec<crate::model::EnvVar>,
pub clear_args: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContainerOverride {
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_args<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.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_env<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EnvVar>,
{
use std::iter::Iterator;
self.env = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_clear_args<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.clear_args = v.into();
self
}
}
impl wkt::message::Message for ContainerOverride {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride"
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Job {
pub name: std::string::String,
pub uid: std::string::String,
pub generation: i64,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: 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 delete_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub creator: std::string::String,
pub last_modifier: std::string::String,
pub client: std::string::String,
pub client_version: std::string::String,
pub launch_stage: google_cloud_api::model::LaunchStage,
pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
pub template: std::option::Option<crate::model::ExecutionTemplate>,
pub observed_generation: i64,
pub terminal_condition: std::option::Option<crate::model::Condition>,
pub conditions: std::vec::Vec<crate::model::Condition>,
pub execution_count: i32,
pub latest_created_execution: std::option::Option<crate::model::ExecutionReference>,
pub reconciling: bool,
pub satisfies_pzs: bool,
pub etag: std::string::String,
pub create_execution: std::option::Option<crate::model::job::CreateExecution>,
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_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_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = 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
}
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_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_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = 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_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_modifier = v.into();
self
}
pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client = v.into();
self
}
pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_version = v.into();
self
}
pub fn set_launch_stage<T: std::convert::Into<google_cloud_api::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_binary_authorization<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BinaryAuthorization>,
{
self.binary_authorization = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BinaryAuthorization>,
{
self.binary_authorization = v.map(|x| x.into());
self
}
pub fn set_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExecutionTemplate>,
{
self.template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExecutionTemplate>,
{
self.template = v.map(|x| x.into());
self
}
pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.observed_generation = v.into();
self
}
pub fn set_terminal_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Condition>,
{
self.terminal_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_terminal_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Condition>,
{
self.terminal_condition = v.map(|x| x.into());
self
}
pub fn set_conditions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Condition>,
{
use std::iter::Iterator;
self.conditions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_execution_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.execution_count = v.into();
self
}
pub fn set_latest_created_execution<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExecutionReference>,
{
self.latest_created_execution = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_latest_created_execution<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExecutionReference>,
{
self.latest_created_execution = v.map(|x| x.into());
self
}
pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reconciling = v.into();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = 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_create_execution<
T: std::convert::Into<std::option::Option<crate::model::job::CreateExecution>>,
>(
mut self,
v: T,
) -> Self {
self.create_execution = v.into();
self
}
pub fn start_execution_token(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.create_execution.as_ref().and_then(|v| match v {
crate::model::job::CreateExecution::StartExecutionToken(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_start_execution_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.create_execution = std::option::Option::Some(
crate::model::job::CreateExecution::StartExecutionToken(v.into()),
);
self
}
pub fn run_execution_token(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.create_execution.as_ref().and_then(|v| match v {
crate::model::job::CreateExecution::RunExecutionToken(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_run_execution_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.create_execution = std::option::Option::Some(
crate::model::job::CreateExecution::RunExecutionToken(v.into()),
);
self
}
}
impl wkt::message::Message for Job {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Job"
}
}
pub mod job {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CreateExecution {
StartExecutionToken(std::string::String),
RunExecutionToken(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionReference {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub completion_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub completion_status: crate::model::execution_reference::CompletionStatus,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExecutionReference {
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_completion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.completion_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_completion_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.completion_time = v.map(|x| x.into());
self
}
pub fn set_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = v.map(|x| x.into());
self
}
pub fn set_completion_status<
T: std::convert::Into<crate::model::execution_reference::CompletionStatus>,
>(
mut self,
v: T,
) -> Self {
self.completion_status = v.into();
self
}
}
impl wkt::message::Message for ExecutionReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ExecutionReference"
}
}
pub mod execution_reference {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CompletionStatus {
Unspecified,
ExecutionSucceeded,
ExecutionFailed,
ExecutionRunning,
ExecutionPending,
ExecutionCancelled,
UnknownValue(completion_status::UnknownValue),
}
#[doc(hidden)]
pub mod completion_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CompletionStatus {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ExecutionSucceeded => std::option::Option::Some(1),
Self::ExecutionFailed => std::option::Option::Some(2),
Self::ExecutionRunning => std::option::Option::Some(3),
Self::ExecutionPending => std::option::Option::Some(4),
Self::ExecutionCancelled => 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("COMPLETION_STATUS_UNSPECIFIED"),
Self::ExecutionSucceeded => std::option::Option::Some("EXECUTION_SUCCEEDED"),
Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
Self::ExecutionRunning => std::option::Option::Some("EXECUTION_RUNNING"),
Self::ExecutionPending => std::option::Option::Some("EXECUTION_PENDING"),
Self::ExecutionCancelled => std::option::Option::Some("EXECUTION_CANCELLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CompletionStatus {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CompletionStatus {
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 CompletionStatus {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ExecutionSucceeded,
2 => Self::ExecutionFailed,
3 => Self::ExecutionRunning,
4 => Self::ExecutionPending,
5 => Self::ExecutionCancelled,
_ => Self::UnknownValue(completion_status::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CompletionStatus {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPLETION_STATUS_UNSPECIFIED" => Self::Unspecified,
"EXECUTION_SUCCEEDED" => Self::ExecutionSucceeded,
"EXECUTION_FAILED" => Self::ExecutionFailed,
"EXECUTION_RUNNING" => Self::ExecutionRunning,
"EXECUTION_PENDING" => Self::ExecutionPending,
"EXECUTION_CANCELLED" => Self::ExecutionCancelled,
_ => Self::UnknownValue(completion_status::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CompletionStatus {
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::ExecutionSucceeded => serializer.serialize_i32(1),
Self::ExecutionFailed => serializer.serialize_i32(2),
Self::ExecutionRunning => serializer.serialize_i32(3),
Self::ExecutionPending => serializer.serialize_i32(4),
Self::ExecutionCancelled => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CompletionStatus {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CompletionStatus>::new(
".google.cloud.run.v2.ExecutionReference.CompletionStatus",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Container {
pub name: std::string::String,
pub image: std::string::String,
pub source_code: std::option::Option<crate::model::SourceCode>,
pub command: std::vec::Vec<std::string::String>,
pub args: std::vec::Vec<std::string::String>,
pub env: std::vec::Vec<crate::model::EnvVar>,
pub resources: std::option::Option<crate::model::ResourceRequirements>,
pub ports: std::vec::Vec<crate::model::ContainerPort>,
pub volume_mounts: std::vec::Vec<crate::model::VolumeMount>,
pub working_dir: std::string::String,
pub liveness_probe: std::option::Option<crate::model::Probe>,
pub startup_probe: std::option::Option<crate::model::Probe>,
pub readiness_probe: std::option::Option<crate::model::Probe>,
pub depends_on: std::vec::Vec<std::string::String>,
pub base_image_uri: std::string::String,
pub build_info: std::option::Option<crate::model::BuildInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Container {
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_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image = v.into();
self
}
pub fn set_source_code<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SourceCode>,
{
self.source_code = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_code<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SourceCode>,
{
self.source_code = v.map(|x| x.into());
self
}
pub fn set_command<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.command = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_args<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.args = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_env<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EnvVar>,
{
use std::iter::Iterator;
self.env = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_resources<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ResourceRequirements>,
{
self.resources = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resources<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ResourceRequirements>,
{
self.resources = v.map(|x| x.into());
self
}
pub fn set_ports<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ContainerPort>,
{
use std::iter::Iterator;
self.ports = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_volume_mounts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VolumeMount>,
{
use std::iter::Iterator;
self.volume_mounts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_working_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.working_dir = v.into();
self
}
pub fn set_liveness_probe<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Probe>,
{
self.liveness_probe = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_liveness_probe<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Probe>,
{
self.liveness_probe = v.map(|x| x.into());
self
}
pub fn set_startup_probe<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Probe>,
{
self.startup_probe = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_startup_probe<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Probe>,
{
self.startup_probe = v.map(|x| x.into());
self
}
pub fn set_readiness_probe<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Probe>,
{
self.readiness_probe = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_readiness_probe<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Probe>,
{
self.readiness_probe = v.map(|x| x.into());
self
}
pub fn set_depends_on<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.depends_on = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_base_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.base_image_uri = v.into();
self
}
pub fn set_build_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BuildInfo>,
{
self.build_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_build_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BuildInfo>,
{
self.build_info = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Container {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Container"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourceRequirements {
pub limits: std::collections::HashMap<std::string::String, std::string::String>,
pub cpu_idle: bool,
pub startup_cpu_boost: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourceRequirements {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_limits<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.limits = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_cpu_idle<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.cpu_idle = v.into();
self
}
pub fn set_startup_cpu_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.startup_cpu_boost = v.into();
self
}
}
impl wkt::message::Message for ResourceRequirements {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ResourceRequirements"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnvVar {
pub name: std::string::String,
pub values: std::option::Option<crate::model::env_var::Values>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnvVar {
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_values<T: std::convert::Into<std::option::Option<crate::model::env_var::Values>>>(
mut self,
v: T,
) -> Self {
self.values = v.into();
self
}
pub fn value(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.values.as_ref().and_then(|v| match v {
crate::model::env_var::Values::Value(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.values = std::option::Option::Some(crate::model::env_var::Values::Value(v.into()));
self
}
pub fn value_source(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::EnvVarSource>> {
#[allow(unreachable_patterns)]
self.values.as_ref().and_then(|v| match v {
crate::model::env_var::Values::ValueSource(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_value_source<T: std::convert::Into<std::boxed::Box<crate::model::EnvVarSource>>>(
mut self,
v: T,
) -> Self {
self.values =
std::option::Option::Some(crate::model::env_var::Values::ValueSource(v.into()));
self
}
}
impl wkt::message::Message for EnvVar {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.EnvVar"
}
}
pub mod env_var {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Values {
Value(std::string::String),
ValueSource(std::boxed::Box<crate::model::EnvVarSource>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnvVarSource {
pub secret_key_ref: std::option::Option<crate::model::SecretKeySelector>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnvVarSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_secret_key_ref<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SecretKeySelector>,
{
self.secret_key_ref = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_secret_key_ref<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SecretKeySelector>,
{
self.secret_key_ref = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EnvVarSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.EnvVarSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecretKeySelector {
pub secret: std::string::String,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecretKeySelector {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.secret = v.into();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for SecretKeySelector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.SecretKeySelector"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContainerPort {
pub name: std::string::String,
pub container_port: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContainerPort {
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_container_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.container_port = v.into();
self
}
}
impl wkt::message::Message for ContainerPort {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ContainerPort"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VolumeMount {
pub name: std::string::String,
pub mount_path: std::string::String,
pub sub_path: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VolumeMount {
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_mount_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mount_path = v.into();
self
}
pub fn set_sub_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sub_path = v.into();
self
}
}
impl wkt::message::Message for VolumeMount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.VolumeMount"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Volume {
pub name: std::string::String,
pub volume_type: std::option::Option<crate::model::volume::VolumeType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Volume {
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_volume_type<
T: std::convert::Into<std::option::Option<crate::model::volume::VolumeType>>,
>(
mut self,
v: T,
) -> Self {
self.volume_type = v.into();
self
}
pub fn secret(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SecretVolumeSource>> {
#[allow(unreachable_patterns)]
self.volume_type.as_ref().and_then(|v| match v {
crate::model::volume::VolumeType::Secret(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_secret<T: std::convert::Into<std::boxed::Box<crate::model::SecretVolumeSource>>>(
mut self,
v: T,
) -> Self {
self.volume_type =
std::option::Option::Some(crate::model::volume::VolumeType::Secret(v.into()));
self
}
pub fn cloud_sql_instance(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlInstance>> {
#[allow(unreachable_patterns)]
self.volume_type.as_ref().and_then(|v| match v {
crate::model::volume::VolumeType::CloudSqlInstance(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_cloud_sql_instance<
T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlInstance>>,
>(
mut self,
v: T,
) -> Self {
self.volume_type =
std::option::Option::Some(crate::model::volume::VolumeType::CloudSqlInstance(v.into()));
self
}
pub fn empty_dir(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::EmptyDirVolumeSource>> {
#[allow(unreachable_patterns)]
self.volume_type.as_ref().and_then(|v| match v {
crate::model::volume::VolumeType::EmptyDir(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_empty_dir<
T: std::convert::Into<std::boxed::Box<crate::model::EmptyDirVolumeSource>>,
>(
mut self,
v: T,
) -> Self {
self.volume_type =
std::option::Option::Some(crate::model::volume::VolumeType::EmptyDir(v.into()));
self
}
pub fn nfs(&self) -> std::option::Option<&std::boxed::Box<crate::model::NFSVolumeSource>> {
#[allow(unreachable_patterns)]
self.volume_type.as_ref().and_then(|v| match v {
crate::model::volume::VolumeType::Nfs(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_nfs<T: std::convert::Into<std::boxed::Box<crate::model::NFSVolumeSource>>>(
mut self,
v: T,
) -> Self {
self.volume_type =
std::option::Option::Some(crate::model::volume::VolumeType::Nfs(v.into()));
self
}
pub fn gcs(&self) -> std::option::Option<&std::boxed::Box<crate::model::GCSVolumeSource>> {
#[allow(unreachable_patterns)]
self.volume_type.as_ref().and_then(|v| match v {
crate::model::volume::VolumeType::Gcs(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_gcs<T: std::convert::Into<std::boxed::Box<crate::model::GCSVolumeSource>>>(
mut self,
v: T,
) -> Self {
self.volume_type =
std::option::Option::Some(crate::model::volume::VolumeType::Gcs(v.into()));
self
}
}
impl wkt::message::Message for Volume {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Volume"
}
}
pub mod volume {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VolumeType {
Secret(std::boxed::Box<crate::model::SecretVolumeSource>),
CloudSqlInstance(std::boxed::Box<crate::model::CloudSqlInstance>),
EmptyDir(std::boxed::Box<crate::model::EmptyDirVolumeSource>),
Nfs(std::boxed::Box<crate::model::NFSVolumeSource>),
Gcs(std::boxed::Box<crate::model::GCSVolumeSource>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SecretVolumeSource {
pub secret: std::string::String,
pub items: std::vec::Vec<crate::model::VersionToPath>,
pub default_mode: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SecretVolumeSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.secret = v.into();
self
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VersionToPath>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_default_mode<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.default_mode = v.into();
self
}
}
impl wkt::message::Message for SecretVolumeSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.SecretVolumeSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VersionToPath {
pub path: std::string::String,
pub version: std::string::String,
pub mode: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VersionToPath {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_mode<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.mode = v.into();
self
}
}
impl wkt::message::Message for VersionToPath {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.VersionToPath"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudSqlInstance {
pub instances: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudSqlInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instances<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.instances = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for CloudSqlInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.CloudSqlInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EmptyDirVolumeSource {
pub medium: crate::model::empty_dir_volume_source::Medium,
pub size_limit: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EmptyDirVolumeSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_medium<T: std::convert::Into<crate::model::empty_dir_volume_source::Medium>>(
mut self,
v: T,
) -> Self {
self.medium = v.into();
self
}
pub fn set_size_limit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.size_limit = v.into();
self
}
}
impl wkt::message::Message for EmptyDirVolumeSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.EmptyDirVolumeSource"
}
}
pub mod empty_dir_volume_source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Medium {
Unspecified,
Memory,
UnknownValue(medium::UnknownValue),
}
#[doc(hidden)]
pub mod medium {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Medium {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Memory => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MEDIUM_UNSPECIFIED"),
Self::Memory => std::option::Option::Some("MEMORY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Medium {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Medium {
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 Medium {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Memory,
_ => Self::UnknownValue(medium::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Medium {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MEDIUM_UNSPECIFIED" => Self::Unspecified,
"MEMORY" => Self::Memory,
_ => Self::UnknownValue(medium::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Medium {
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::Memory => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Medium {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Medium>::new(
".google.cloud.run.v2.EmptyDirVolumeSource.Medium",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NFSVolumeSource {
pub server: std::string::String,
pub path: std::string::String,
pub read_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NFSVolumeSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_server<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.server = 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_read_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.read_only = v.into();
self
}
}
impl wkt::message::Message for NFSVolumeSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.NFSVolumeSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GCSVolumeSource {
pub bucket: std::string::String,
pub read_only: bool,
pub mount_options: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GCSVolumeSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
pub fn set_read_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.read_only = v.into();
self
}
pub fn set_mount_options<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.mount_options = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for GCSVolumeSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GCSVolumeSource"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Probe {
pub initial_delay_seconds: i32,
pub timeout_seconds: i32,
pub period_seconds: i32,
pub failure_threshold: i32,
pub probe_type: std::option::Option<crate::model::probe::ProbeType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Probe {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_initial_delay_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.initial_delay_seconds = v.into();
self
}
pub fn set_timeout_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.timeout_seconds = v.into();
self
}
pub fn set_period_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.period_seconds = v.into();
self
}
pub fn set_failure_threshold<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.failure_threshold = v.into();
self
}
pub fn set_probe_type<
T: std::convert::Into<std::option::Option<crate::model::probe::ProbeType>>,
>(
mut self,
v: T,
) -> Self {
self.probe_type = v.into();
self
}
pub fn http_get(&self) -> std::option::Option<&std::boxed::Box<crate::model::HTTPGetAction>> {
#[allow(unreachable_patterns)]
self.probe_type.as_ref().and_then(|v| match v {
crate::model::probe::ProbeType::HttpGet(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_http_get<T: std::convert::Into<std::boxed::Box<crate::model::HTTPGetAction>>>(
mut self,
v: T,
) -> Self {
self.probe_type =
std::option::Option::Some(crate::model::probe::ProbeType::HttpGet(v.into()));
self
}
pub fn tcp_socket(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::TCPSocketAction>> {
#[allow(unreachable_patterns)]
self.probe_type.as_ref().and_then(|v| match v {
crate::model::probe::ProbeType::TcpSocket(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_tcp_socket<T: std::convert::Into<std::boxed::Box<crate::model::TCPSocketAction>>>(
mut self,
v: T,
) -> Self {
self.probe_type =
std::option::Option::Some(crate::model::probe::ProbeType::TcpSocket(v.into()));
self
}
pub fn grpc(&self) -> std::option::Option<&std::boxed::Box<crate::model::GRPCAction>> {
#[allow(unreachable_patterns)]
self.probe_type.as_ref().and_then(|v| match v {
crate::model::probe::ProbeType::Grpc(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_grpc<T: std::convert::Into<std::boxed::Box<crate::model::GRPCAction>>>(
mut self,
v: T,
) -> Self {
self.probe_type = std::option::Option::Some(crate::model::probe::ProbeType::Grpc(v.into()));
self
}
}
impl wkt::message::Message for Probe {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Probe"
}
}
pub mod probe {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ProbeType {
HttpGet(std::boxed::Box<crate::model::HTTPGetAction>),
TcpSocket(std::boxed::Box<crate::model::TCPSocketAction>),
Grpc(std::boxed::Box<crate::model::GRPCAction>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HTTPGetAction {
pub path: std::string::String,
pub http_headers: std::vec::Vec<crate::model::HTTPHeader>,
pub port: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HTTPGetAction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.path = v.into();
self
}
pub fn set_http_headers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::HTTPHeader>,
{
use std::iter::Iterator;
self.http_headers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.port = v.into();
self
}
}
impl wkt::message::Message for HTTPGetAction {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.HTTPGetAction"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HTTPHeader {
pub name: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HTTPHeader {
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_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for HTTPHeader {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.HTTPHeader"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TCPSocketAction {
pub port: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TCPSocketAction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.port = v.into();
self
}
}
impl wkt::message::Message for TCPSocketAction {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.TCPSocketAction"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GRPCAction {
pub port: i32,
pub service: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GRPCAction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.port = v.into();
self
}
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 GRPCAction {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GRPCAction"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BuildInfo {
pub function_target: std::string::String,
pub source_location: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BuildInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_function_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.function_target = v.into();
self
}
pub fn set_source_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_location = v.into();
self
}
}
impl wkt::message::Message for BuildInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.BuildInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceCode {
pub source_type: std::option::Option<crate::model::source_code::SourceType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SourceCode {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_type<
T: std::convert::Into<std::option::Option<crate::model::source_code::SourceType>>,
>(
mut self,
v: T,
) -> Self {
self.source_type = v.into();
self
}
pub fn cloud_storage_source(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::source_code::CloudStorageSource>> {
#[allow(unreachable_patterns)]
self.source_type.as_ref().and_then(|v| match v {
crate::model::source_code::SourceType::CloudStorageSource(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_cloud_storage_source<
T: std::convert::Into<std::boxed::Box<crate::model::source_code::CloudStorageSource>>,
>(
mut self,
v: T,
) -> Self {
self.source_type = std::option::Option::Some(
crate::model::source_code::SourceType::CloudStorageSource(v.into()),
);
self
}
}
impl wkt::message::Message for SourceCode {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.SourceCode"
}
}
pub mod source_code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloudStorageSource {
pub bucket: std::string::String,
pub object: std::string::String,
pub generation: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloudStorageSource {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket = v.into();
self
}
pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.object = v.into();
self
}
pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = v.into();
self
}
}
impl wkt::message::Message for CloudStorageSource {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.SourceCode.CloudStorageSource"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SourceType {
CloudStorageSource(std::boxed::Box<crate::model::source_code::CloudStorageSource>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRevisionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRevisionRequest {
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 GetRevisionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GetRevisionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRevisionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRevisionsRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListRevisionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListRevisionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRevisionsResponse {
pub revisions: std::vec::Vec<crate::model::Revision>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRevisionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_revisions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Revision>,
{
use std::iter::Iterator;
self.revisions = 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
}
}
impl wkt::message::Message for ListRevisionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListRevisionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRevisionsResponse {
type PageItem = crate::model::Revision;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.revisions
}
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 DeleteRevisionRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteRevisionRequest {
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_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 DeleteRevisionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.DeleteRevisionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Revision {
pub name: std::string::String,
pub uid: std::string::String,
pub generation: i64,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: 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 delete_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub launch_stage: google_cloud_api::model::LaunchStage,
pub service: std::string::String,
pub scaling: std::option::Option<crate::model::RevisionScaling>,
pub vpc_access: std::option::Option<crate::model::VpcAccess>,
pub max_instance_request_concurrency: i32,
pub timeout: std::option::Option<wkt::Duration>,
pub service_account: std::string::String,
pub containers: std::vec::Vec<crate::model::Container>,
pub volumes: std::vec::Vec<crate::model::Volume>,
pub execution_environment: crate::model::ExecutionEnvironment,
pub encryption_key: std::string::String,
pub service_mesh: std::option::Option<crate::model::ServiceMesh>,
pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
pub reconciling: bool,
pub conditions: std::vec::Vec<crate::model::Condition>,
pub observed_generation: i64,
pub log_uri: std::string::String,
pub satisfies_pzs: bool,
pub session_affinity: bool,
pub scaling_status: std::option::Option<crate::model::RevisionScalingStatus>,
pub node_selector: std::option::Option<crate::model::NodeSelector>,
pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
pub creator: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Revision {
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_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = 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
}
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_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_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = 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_launch_stage<T: std::convert::Into<google_cloud_api::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = 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_scaling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RevisionScaling>,
{
self.scaling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scaling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RevisionScaling>,
{
self.scaling = v.map(|x| x.into());
self
}
pub fn set_vpc_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = v.map(|x| x.into());
self
}
pub fn set_max_instance_request_concurrency<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.max_instance_request_concurrency = v.into();
self
}
pub fn set_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = v.map(|x| x.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_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_volumes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Volume>,
{
use std::iter::Iterator;
self.volumes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
mut self,
v: T,
) -> Self {
self.execution_environment = v.into();
self
}
pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.encryption_key = v.into();
self
}
pub fn set_service_mesh<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceMesh>,
{
self.service_mesh = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_mesh<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceMesh>,
{
self.service_mesh = v.map(|x| x.into());
self
}
pub fn set_encryption_key_revocation_action<
T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
>(
mut self,
v: T,
) -> Self {
self.encryption_key_revocation_action = v.into();
self
}
pub fn set_encryption_key_shutdown_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.encryption_key_shutdown_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_key_shutdown_duration<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.encryption_key_shutdown_duration = v.map(|x| x.into());
self
}
pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reconciling = v.into();
self
}
pub fn set_conditions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Condition>,
{
use std::iter::Iterator;
self.conditions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.observed_generation = v.into();
self
}
pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_uri = v.into();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = v.into();
self
}
pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.session_affinity = v.into();
self
}
pub fn set_scaling_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RevisionScalingStatus>,
{
self.scaling_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scaling_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RevisionScalingStatus>,
{
self.scaling_status = v.map(|x| x.into());
self
}
pub fn set_node_selector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = v.map(|x| x.into());
self
}
pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
self
}
pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = 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 Revision {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Revision"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RevisionTemplate {
pub revision: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub scaling: std::option::Option<crate::model::RevisionScaling>,
pub vpc_access: std::option::Option<crate::model::VpcAccess>,
pub timeout: std::option::Option<wkt::Duration>,
pub service_account: std::string::String,
pub containers: std::vec::Vec<crate::model::Container>,
pub volumes: std::vec::Vec<crate::model::Volume>,
pub execution_environment: crate::model::ExecutionEnvironment,
pub encryption_key: std::string::String,
pub max_instance_request_concurrency: i32,
pub service_mesh: std::option::Option<crate::model::ServiceMesh>,
pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
pub session_affinity: bool,
pub health_check_disabled: bool,
pub node_selector: std::option::Option<crate::model::NodeSelector>,
pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RevisionTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision = 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
}
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_scaling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RevisionScaling>,
{
self.scaling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scaling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RevisionScaling>,
{
self.scaling = v.map(|x| x.into());
self
}
pub fn set_vpc_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = v.map(|x| x.into());
self
}
pub fn set_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = v.map(|x| x.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_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_volumes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Volume>,
{
use std::iter::Iterator;
self.volumes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
mut self,
v: T,
) -> Self {
self.execution_environment = v.into();
self
}
pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.encryption_key = v.into();
self
}
pub fn set_max_instance_request_concurrency<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.max_instance_request_concurrency = v.into();
self
}
pub fn set_service_mesh<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceMesh>,
{
self.service_mesh = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_mesh<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceMesh>,
{
self.service_mesh = v.map(|x| x.into());
self
}
pub fn set_encryption_key_revocation_action<
T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
>(
mut self,
v: T,
) -> Self {
self.encryption_key_revocation_action = v.into();
self
}
pub fn set_encryption_key_shutdown_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.encryption_key_shutdown_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_key_shutdown_duration<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.encryption_key_shutdown_duration = v.map(|x| x.into());
self
}
pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.session_affinity = v.into();
self
}
pub fn set_health_check_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.health_check_disabled = v.into();
self
}
pub fn set_node_selector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = v.map(|x| x.into());
self
}
pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RevisionTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.RevisionTemplate"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceRequest {
pub parent: std::string::String,
pub service: std::option::Option<crate::model::Service>,
pub service_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateServiceRequest {
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_service<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Service>,
{
self.service = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Service>,
{
self.service = v.map(|x| x.into());
self
}
pub fn set_service_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_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 CreateServiceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.CreateServiceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub service: std::option::Option<crate::model::Service>,
pub validate_only: bool,
pub allow_missing: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateServiceRequest {
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_service<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Service>,
{
self.service = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Service>,
{
self.service = 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_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
}
impl wkt::message::Message for UpdateServiceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.UpdateServiceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServicesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServicesRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListServicesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListServicesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServicesResponse {
pub services: std::vec::Vec<crate::model::Service>,
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 ListServicesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_services<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Service>,
{
use std::iter::Iterator;
self.services = 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 ListServicesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListServicesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListServicesResponse {
type PageItem = crate::model::Service;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.services
}
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 GetServiceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetServiceRequest {
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 GetServiceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GetServiceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteServiceRequest {
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_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 DeleteServiceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.DeleteServiceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Service {
pub name: std::string::String,
pub description: std::string::String,
pub uid: std::string::String,
pub generation: i64,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: 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 delete_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub creator: std::string::String,
pub last_modifier: std::string::String,
pub client: std::string::String,
pub client_version: std::string::String,
pub ingress: crate::model::IngressTraffic,
pub launch_stage: google_cloud_api::model::LaunchStage,
pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
pub template: std::option::Option<crate::model::RevisionTemplate>,
pub traffic: std::vec::Vec<crate::model::TrafficTarget>,
pub scaling: std::option::Option<crate::model::ServiceScaling>,
pub invoker_iam_disabled: bool,
pub default_uri_disabled: bool,
pub urls: std::vec::Vec<std::string::String>,
pub iap_enabled: bool,
pub multi_region_settings: std::option::Option<crate::model::service::MultiRegionSettings>,
pub custom_audiences: std::vec::Vec<std::string::String>,
pub observed_generation: i64,
pub terminal_condition: std::option::Option<crate::model::Condition>,
pub conditions: std::vec::Vec<crate::model::Condition>,
pub latest_ready_revision: std::string::String,
pub latest_created_revision: std::string::String,
pub traffic_statuses: std::vec::Vec<crate::model::TrafficTargetStatus>,
pub uri: std::string::String,
pub satisfies_pzs: bool,
pub threat_detection_enabled: bool,
pub build_config: std::option::Option<crate::model::BuildConfig>,
pub reconciling: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Service {
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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = 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_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = 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
}
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_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_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = 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_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_modifier = v.into();
self
}
pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client = v.into();
self
}
pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_version = v.into();
self
}
pub fn set_ingress<T: std::convert::Into<crate::model::IngressTraffic>>(
mut self,
v: T,
) -> Self {
self.ingress = v.into();
self
}
pub fn set_launch_stage<T: std::convert::Into<google_cloud_api::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_binary_authorization<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BinaryAuthorization>,
{
self.binary_authorization = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BinaryAuthorization>,
{
self.binary_authorization = v.map(|x| x.into());
self
}
pub fn set_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RevisionTemplate>,
{
self.template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RevisionTemplate>,
{
self.template = v.map(|x| x.into());
self
}
pub fn set_traffic<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TrafficTarget>,
{
use std::iter::Iterator;
self.traffic = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_scaling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceScaling>,
{
self.scaling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scaling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceScaling>,
{
self.scaling = v.map(|x| x.into());
self
}
pub fn set_invoker_iam_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.invoker_iam_disabled = v.into();
self
}
pub fn set_default_uri_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.default_uri_disabled = v.into();
self
}
pub fn set_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.urls = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_iap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.iap_enabled = v.into();
self
}
pub fn set_multi_region_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::service::MultiRegionSettings>,
{
self.multi_region_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_multi_region_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::service::MultiRegionSettings>,
{
self.multi_region_settings = v.map(|x| x.into());
self
}
pub fn set_custom_audiences<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.custom_audiences = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.observed_generation = v.into();
self
}
pub fn set_terminal_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Condition>,
{
self.terminal_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_terminal_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Condition>,
{
self.terminal_condition = v.map(|x| x.into());
self
}
pub fn set_conditions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Condition>,
{
use std::iter::Iterator;
self.conditions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_latest_ready_revision<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.latest_ready_revision = v.into();
self
}
pub fn set_latest_created_revision<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.latest_created_revision = v.into();
self
}
pub fn set_traffic_statuses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TrafficTargetStatus>,
{
use std::iter::Iterator;
self.traffic_statuses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = v.into();
self
}
pub fn set_threat_detection_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.threat_detection_enabled = v.into();
self
}
pub fn set_build_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BuildConfig>,
{
self.build_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_build_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BuildConfig>,
{
self.build_config = v.map(|x| x.into());
self
}
pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reconciling = 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 Service {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Service"
}
}
pub mod service {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MultiRegionSettings {
pub regions: std::vec::Vec<std::string::String>,
pub multi_region_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MultiRegionSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_regions<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.regions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_multi_region_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.multi_region_id = v.into();
self
}
}
impl wkt::message::Message for MultiRegionSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Service.MultiRegionSettings"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RevisionScalingStatus {
pub desired_min_instance_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RevisionScalingStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_desired_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.desired_min_instance_count = v.into();
self
}
}
impl wkt::message::Message for RevisionScalingStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.RevisionScalingStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetTaskRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTaskRequest {
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 GetTaskRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GetTaskRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTasksRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTasksRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListTasksRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListTasksRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTasksResponse {
pub tasks: std::vec::Vec<crate::model::Task>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTasksResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tasks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Task>,
{
use std::iter::Iterator;
self.tasks = 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
}
}
impl wkt::message::Message for ListTasksResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListTasksResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTasksResponse {
type PageItem = crate::model::Task;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.tasks
}
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 Task {
pub name: std::string::String,
pub uid: std::string::String,
pub generation: i64,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub scheduled_time: std::option::Option<wkt::Timestamp>,
pub start_time: std::option::Option<wkt::Timestamp>,
pub completion_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub job: std::string::String,
pub execution: std::string::String,
pub containers: std::vec::Vec<crate::model::Container>,
pub volumes: std::vec::Vec<crate::model::Volume>,
pub max_retries: i32,
pub timeout: std::option::Option<wkt::Duration>,
pub service_account: std::string::String,
pub execution_environment: crate::model::ExecutionEnvironment,
pub reconciling: bool,
pub conditions: std::vec::Vec<crate::model::Condition>,
pub observed_generation: i64,
pub index: i32,
pub retried: i32,
pub last_attempt_result: std::option::Option<crate::model::TaskAttemptResult>,
pub encryption_key: std::string::String,
pub vpc_access: std::option::Option<crate::model::VpcAccess>,
pub log_uri: std::string::String,
pub satisfies_pzs: bool,
pub node_selector: std::option::Option<crate::model::NodeSelector>,
pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Task {
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_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = 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
}
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_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_scheduled_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.scheduled_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scheduled_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.scheduled_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_completion_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.completion_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_completion_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.completion_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_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = 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_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.job = v.into();
self
}
pub fn set_execution<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.execution = v.into();
self
}
pub fn set_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_volumes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Volume>,
{
use std::iter::Iterator;
self.volumes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_max_retries<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_retries = v.into();
self
}
pub fn set_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = v.map(|x| x.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_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
mut self,
v: T,
) -> Self {
self.execution_environment = v.into();
self
}
pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reconciling = v.into();
self
}
pub fn set_conditions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Condition>,
{
use std::iter::Iterator;
self.conditions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.observed_generation = v.into();
self
}
pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.index = v.into();
self
}
pub fn set_retried<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.retried = v.into();
self
}
pub fn set_last_attempt_result<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TaskAttemptResult>,
{
self.last_attempt_result = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_attempt_result<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TaskAttemptResult>,
{
self.last_attempt_result = v.map(|x| x.into());
self
}
pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.encryption_key = v.into();
self
}
pub fn set_vpc_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = v.map(|x| x.into());
self
}
pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_uri = v.into();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = v.into();
self
}
pub fn set_node_selector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = v.map(|x| x.into());
self
}
pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = 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
}
}
impl wkt::message::Message for Task {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.Task"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TaskAttemptResult {
pub status: std::option::Option<google_cloud_rpc::model::Status>,
pub exit_code: i32,
pub term_signal: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TaskAttemptResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.status = v.map(|x| x.into());
self
}
pub fn set_exit_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.exit_code = v.into();
self
}
pub fn set_term_signal<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.term_signal = v.into();
self
}
}
impl wkt::message::Message for TaskAttemptResult {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.TaskAttemptResult"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TaskTemplate {
pub containers: std::vec::Vec<crate::model::Container>,
pub volumes: std::vec::Vec<crate::model::Volume>,
pub timeout: std::option::Option<wkt::Duration>,
pub service_account: std::string::String,
pub execution_environment: crate::model::ExecutionEnvironment,
pub encryption_key: std::string::String,
pub vpc_access: std::option::Option<crate::model::VpcAccess>,
pub node_selector: std::option::Option<crate::model::NodeSelector>,
pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
pub retries: std::option::Option<crate::model::task_template::Retries>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TaskTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_volumes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Volume>,
{
use std::iter::Iterator;
self.volumes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_timeout<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.timeout = v.map(|x| x.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_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
mut self,
v: T,
) -> Self {
self.execution_environment = v.into();
self
}
pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.encryption_key = v.into();
self
}
pub fn set_vpc_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = v.map(|x| x.into());
self
}
pub fn set_node_selector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = v.map(|x| x.into());
self
}
pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
self
}
pub fn set_retries<
T: std::convert::Into<std::option::Option<crate::model::task_template::Retries>>,
>(
mut self,
v: T,
) -> Self {
self.retries = v.into();
self
}
pub fn max_retries(&self) -> std::option::Option<&i32> {
#[allow(unreachable_patterns)]
self.retries.as_ref().and_then(|v| match v {
crate::model::task_template::Retries::MaxRetries(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_max_retries<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.retries =
std::option::Option::Some(crate::model::task_template::Retries::MaxRetries(v.into()));
self
}
}
impl wkt::message::Message for TaskTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.TaskTemplate"
}
}
pub mod task_template {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Retries {
MaxRetries(i32),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TrafficTarget {
pub r#type: crate::model::TrafficTargetAllocationType,
pub revision: std::string::String,
pub percent: i32,
pub tag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TrafficTarget {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::TrafficTargetAllocationType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
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_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.percent = 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 TrafficTarget {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.TrafficTarget"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TrafficTargetStatus {
pub r#type: crate::model::TrafficTargetAllocationType,
pub revision: std::string::String,
pub percent: i32,
pub tag: std::string::String,
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TrafficTargetStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::TrafficTargetAllocationType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
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_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.percent = v.into();
self
}
pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tag = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for TrafficTargetStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.TrafficTargetStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VpcAccess {
pub connector: std::string::String,
pub egress: crate::model::vpc_access::VpcEgress,
pub network_interfaces: std::vec::Vec<crate::model::vpc_access::NetworkInterface>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VpcAccess {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_connector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.connector = v.into();
self
}
pub fn set_egress<T: std::convert::Into<crate::model::vpc_access::VpcEgress>>(
mut self,
v: T,
) -> Self {
self.egress = v.into();
self
}
pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::vpc_access::NetworkInterface>,
{
use std::iter::Iterator;
self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VpcAccess {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.VpcAccess"
}
}
pub mod vpc_access {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NetworkInterface {
pub network: std::string::String,
pub subnetwork: std::string::String,
pub tags: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NetworkInterface {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.subnetwork = v.into();
self
}
pub fn set_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.tags = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NetworkInterface {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.VpcAccess.NetworkInterface"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VpcEgress {
Unspecified,
AllTraffic,
PrivateRangesOnly,
UnknownValue(vpc_egress::UnknownValue),
}
#[doc(hidden)]
pub mod vpc_egress {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VpcEgress {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AllTraffic => std::option::Option::Some(1),
Self::PrivateRangesOnly => 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("VPC_EGRESS_UNSPECIFIED"),
Self::AllTraffic => std::option::Option::Some("ALL_TRAFFIC"),
Self::PrivateRangesOnly => std::option::Option::Some("PRIVATE_RANGES_ONLY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VpcEgress {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VpcEgress {
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 VpcEgress {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::AllTraffic,
2 => Self::PrivateRangesOnly,
_ => Self::UnknownValue(vpc_egress::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VpcEgress {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VPC_EGRESS_UNSPECIFIED" => Self::Unspecified,
"ALL_TRAFFIC" => Self::AllTraffic,
"PRIVATE_RANGES_ONLY" => Self::PrivateRangesOnly,
_ => Self::UnknownValue(vpc_egress::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VpcEgress {
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::AllTraffic => serializer.serialize_i32(1),
Self::PrivateRangesOnly => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VpcEgress {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VpcEgress>::new(
".google.cloud.run.v2.VpcAccess.VpcEgress",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BinaryAuthorization {
pub breakglass_justification: std::string::String,
pub binauthz_method: std::option::Option<crate::model::binary_authorization::BinauthzMethod>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BinaryAuthorization {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_breakglass_justification<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.breakglass_justification = v.into();
self
}
pub fn set_binauthz_method<
T: std::convert::Into<std::option::Option<crate::model::binary_authorization::BinauthzMethod>>,
>(
mut self,
v: T,
) -> Self {
self.binauthz_method = v.into();
self
}
pub fn use_default(&self) -> std::option::Option<&bool> {
#[allow(unreachable_patterns)]
self.binauthz_method.as_ref().and_then(|v| match v {
crate::model::binary_authorization::BinauthzMethod::UseDefault(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_use_default<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.binauthz_method = std::option::Option::Some(
crate::model::binary_authorization::BinauthzMethod::UseDefault(v.into()),
);
self
}
pub fn policy(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.binauthz_method.as_ref().and_then(|v| match v {
crate::model::binary_authorization::BinauthzMethod::Policy(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.binauthz_method = std::option::Option::Some(
crate::model::binary_authorization::BinauthzMethod::Policy(v.into()),
);
self
}
}
impl wkt::message::Message for BinaryAuthorization {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.BinaryAuthorization"
}
}
pub mod binary_authorization {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum BinauthzMethod {
UseDefault(bool),
Policy(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RevisionScaling {
pub min_instance_count: i32,
pub max_instance_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RevisionScaling {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.min_instance_count = v.into();
self
}
pub fn set_max_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_instance_count = v.into();
self
}
}
impl wkt::message::Message for RevisionScaling {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.RevisionScaling"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceMesh {
pub mesh: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceMesh {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mesh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mesh = v.into();
self
}
}
impl wkt::message::Message for ServiceMesh {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ServiceMesh"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceScaling {
pub min_instance_count: i32,
pub scaling_mode: crate::model::service_scaling::ScalingMode,
pub max_instance_count: i32,
pub manual_instance_count: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceScaling {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.min_instance_count = v.into();
self
}
pub fn set_scaling_mode<T: std::convert::Into<crate::model::service_scaling::ScalingMode>>(
mut self,
v: T,
) -> Self {
self.scaling_mode = v.into();
self
}
pub fn set_max_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_instance_count = v.into();
self
}
pub fn set_manual_instance_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.manual_instance_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_manual_instance_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.manual_instance_count = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ServiceScaling {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ServiceScaling"
}
}
pub mod service_scaling {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ScalingMode {
Unspecified,
Automatic,
Manual,
UnknownValue(scaling_mode::UnknownValue),
}
#[doc(hidden)]
pub mod scaling_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ScalingMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Automatic => std::option::Option::Some(1),
Self::Manual => 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("SCALING_MODE_UNSPECIFIED"),
Self::Automatic => std::option::Option::Some("AUTOMATIC"),
Self::Manual => std::option::Option::Some("MANUAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ScalingMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ScalingMode {
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 ScalingMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Automatic,
2 => Self::Manual,
_ => Self::UnknownValue(scaling_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ScalingMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SCALING_MODE_UNSPECIFIED" => Self::Unspecified,
"AUTOMATIC" => Self::Automatic,
"MANUAL" => Self::Manual,
_ => Self::UnknownValue(scaling_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ScalingMode {
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::Automatic => serializer.serialize_i32(1),
Self::Manual => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ScalingMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ScalingMode>::new(
".google.cloud.run.v2.ServiceScaling.ScalingMode",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkerPoolScaling {
pub manual_instance_count: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WorkerPoolScaling {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_manual_instance_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.manual_instance_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_manual_instance_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.manual_instance_count = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for WorkerPoolScaling {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.WorkerPoolScaling"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NodeSelector {
pub accelerator: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NodeSelector {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_accelerator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.accelerator = v.into();
self
}
}
impl wkt::message::Message for NodeSelector {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.NodeSelector"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BuildConfig {
pub name: std::string::String,
pub source_location: std::string::String,
pub function_target: std::string::String,
pub image_uri: std::string::String,
pub base_image: std::string::String,
pub enable_automatic_updates: bool,
pub worker_pool: std::string::String,
pub environment_variables: std::collections::HashMap<std::string::String, std::string::String>,
pub service_account: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BuildConfig {
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_source_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_location = v.into();
self
}
pub fn set_function_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.function_target = v.into();
self
}
pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_uri = v.into();
self
}
pub fn set_base_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.base_image = v.into();
self
}
pub fn set_enable_automatic_updates<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_automatic_updates = v.into();
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_environment_variables<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.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_account = v.into();
self
}
}
impl wkt::message::Message for BuildConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.BuildConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkerPoolRequest {
pub parent: std::string::String,
pub worker_pool: std::option::Option<crate::model::WorkerPool>,
pub worker_pool_id: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateWorkerPoolRequest {
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_worker_pool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkerPool>,
{
self.worker_pool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkerPool>,
{
self.worker_pool = v.map(|x| x.into());
self
}
pub fn set_worker_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.worker_pool_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 CreateWorkerPoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.CreateWorkerPoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateWorkerPoolRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub worker_pool: std::option::Option<crate::model::WorkerPool>,
pub validate_only: bool,
pub allow_missing: bool,
pub force_new_revision: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateWorkerPoolRequest {
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_worker_pool<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkerPool>,
{
self.worker_pool = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkerPool>,
{
self.worker_pool = 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_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
pub fn set_force_new_revision<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force_new_revision = v.into();
self
}
}
impl wkt::message::Message for UpdateWorkerPoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.UpdateWorkerPoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkerPoolsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWorkerPoolsRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListWorkerPoolsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListWorkerPoolsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkerPoolsResponse {
pub worker_pools: std::vec::Vec<crate::model::WorkerPool>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWorkerPoolsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_worker_pools<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::WorkerPool>,
{
use std::iter::Iterator;
self.worker_pools = 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
}
}
impl wkt::message::Message for ListWorkerPoolsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.ListWorkerPoolsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListWorkerPoolsResponse {
type PageItem = crate::model::WorkerPool;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.worker_pools
}
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 GetWorkerPoolRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetWorkerPoolRequest {
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 GetWorkerPoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.GetWorkerPoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWorkerPoolRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteWorkerPoolRequest {
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_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 DeleteWorkerPoolRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.DeleteWorkerPoolRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkerPool {
pub name: std::string::String,
pub description: std::string::String,
pub uid: std::string::String,
pub generation: i64,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: 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 delete_time: std::option::Option<wkt::Timestamp>,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub creator: std::string::String,
pub last_modifier: std::string::String,
pub client: std::string::String,
pub client_version: std::string::String,
pub launch_stage: google_cloud_api::model::LaunchStage,
pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
pub template: std::option::Option<crate::model::WorkerPoolRevisionTemplate>,
pub instance_splits: std::vec::Vec<crate::model::InstanceSplit>,
pub scaling: std::option::Option<crate::model::WorkerPoolScaling>,
pub observed_generation: i64,
pub terminal_condition: std::option::Option<crate::model::Condition>,
pub conditions: std::vec::Vec<crate::model::Condition>,
pub latest_ready_revision: std::string::String,
pub latest_created_revision: std::string::String,
pub instance_split_statuses: std::vec::Vec<crate::model::InstanceSplitStatus>,
pub threat_detection_enabled: bool,
#[deprecated]
pub custom_audiences: std::vec::Vec<std::string::String>,
pub satisfies_pzs: bool,
pub reconciling: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WorkerPool {
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_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = 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_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.generation = 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
}
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_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_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = 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_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.creator = v.into();
self
}
pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_modifier = v.into();
self
}
pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client = v.into();
self
}
pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.client_version = v.into();
self
}
pub fn set_launch_stage<T: std::convert::Into<google_cloud_api::model::LaunchStage>>(
mut self,
v: T,
) -> Self {
self.launch_stage = v.into();
self
}
pub fn set_binary_authorization<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BinaryAuthorization>,
{
self.binary_authorization = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BinaryAuthorization>,
{
self.binary_authorization = v.map(|x| x.into());
self
}
pub fn set_template<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkerPoolRevisionTemplate>,
{
self.template = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkerPoolRevisionTemplate>,
{
self.template = v.map(|x| x.into());
self
}
pub fn set_instance_splits<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::InstanceSplit>,
{
use std::iter::Iterator;
self.instance_splits = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_scaling<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WorkerPoolScaling>,
{
self.scaling = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scaling<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WorkerPoolScaling>,
{
self.scaling = v.map(|x| x.into());
self
}
pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.observed_generation = v.into();
self
}
pub fn set_terminal_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Condition>,
{
self.terminal_condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_terminal_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Condition>,
{
self.terminal_condition = v.map(|x| x.into());
self
}
pub fn set_conditions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Condition>,
{
use std::iter::Iterator;
self.conditions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_latest_ready_revision<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.latest_ready_revision = v.into();
self
}
pub fn set_latest_created_revision<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.latest_created_revision = v.into();
self
}
pub fn set_instance_split_statuses<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::InstanceSplitStatus>,
{
use std::iter::Iterator;
self.instance_split_statuses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_threat_detection_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.threat_detection_enabled = v.into();
self
}
#[deprecated]
pub fn set_custom_audiences<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.custom_audiences = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.satisfies_pzs = v.into();
self
}
pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.reconciling = 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 WorkerPool {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.WorkerPool"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkerPoolRevisionTemplate {
pub revision: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
pub vpc_access: std::option::Option<crate::model::VpcAccess>,
pub service_account: std::string::String,
pub containers: std::vec::Vec<crate::model::Container>,
pub volumes: std::vec::Vec<crate::model::Volume>,
pub encryption_key: std::string::String,
pub service_mesh: std::option::Option<crate::model::ServiceMesh>,
pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
pub node_selector: std::option::Option<crate::model::NodeSelector>,
pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WorkerPoolRevisionTemplate {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision = 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
}
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_vpc_access<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VpcAccess>,
{
self.vpc_access = v.map(|x| x.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_containers<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Container>,
{
use std::iter::Iterator;
self.containers = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_volumes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Volume>,
{
use std::iter::Iterator;
self.volumes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.encryption_key = v.into();
self
}
pub fn set_service_mesh<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceMesh>,
{
self.service_mesh = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_mesh<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceMesh>,
{
self.service_mesh = v.map(|x| x.into());
self
}
pub fn set_encryption_key_revocation_action<
T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
>(
mut self,
v: T,
) -> Self {
self.encryption_key_revocation_action = v.into();
self
}
pub fn set_encryption_key_shutdown_duration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.encryption_key_shutdown_duration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_encryption_key_shutdown_duration<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.encryption_key_shutdown_duration = v.map(|x| x.into());
self
}
pub fn set_node_selector<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NodeSelector>,
{
self.node_selector = v.map(|x| x.into());
self
}
pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for WorkerPoolRevisionTemplate {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.run.v2.WorkerPoolRevisionTemplate"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum InstanceSplitAllocationType {
Unspecified,
Latest,
Revision,
UnknownValue(instance_split_allocation_type::UnknownValue),
}
#[doc(hidden)]
pub mod instance_split_allocation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl InstanceSplitAllocationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Latest => std::option::Option::Some(1),
Self::Revision => 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("INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED")
}
Self::Latest => std::option::Option::Some("INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST"),
Self::Revision => std::option::Option::Some("INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for InstanceSplitAllocationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for InstanceSplitAllocationType {
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 InstanceSplitAllocationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Latest,
2 => Self::Revision,
_ => Self::UnknownValue(instance_split_allocation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for InstanceSplitAllocationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST" => Self::Latest,
"INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION" => Self::Revision,
_ => Self::UnknownValue(instance_split_allocation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for InstanceSplitAllocationType {
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::Latest => serializer.serialize_i32(1),
Self::Revision => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for InstanceSplitAllocationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<InstanceSplitAllocationType>::new(
".google.cloud.run.v2.InstanceSplitAllocationType",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TrafficTargetAllocationType {
Unspecified,
Latest,
Revision,
UnknownValue(traffic_target_allocation_type::UnknownValue),
}
#[doc(hidden)]
pub mod traffic_target_allocation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl TrafficTargetAllocationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Latest => std::option::Option::Some(1),
Self::Revision => 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("TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED")
}
Self::Latest => std::option::Option::Some("TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"),
Self::Revision => std::option::Option::Some("TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for TrafficTargetAllocationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for TrafficTargetAllocationType {
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 TrafficTargetAllocationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Latest,
2 => Self::Revision,
_ => Self::UnknownValue(traffic_target_allocation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for TrafficTargetAllocationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST" => Self::Latest,
"TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION" => Self::Revision,
_ => Self::UnknownValue(traffic_target_allocation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for TrafficTargetAllocationType {
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::Latest => serializer.serialize_i32(1),
Self::Revision => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for TrafficTargetAllocationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<TrafficTargetAllocationType>::new(
".google.cloud.run.v2.TrafficTargetAllocationType",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum IngressTraffic {
Unspecified,
All,
InternalOnly,
InternalLoadBalancer,
None,
UnknownValue(ingress_traffic::UnknownValue),
}
#[doc(hidden)]
pub mod ingress_traffic {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl IngressTraffic {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::All => std::option::Option::Some(1),
Self::InternalOnly => std::option::Option::Some(2),
Self::InternalLoadBalancer => std::option::Option::Some(3),
Self::None => 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("INGRESS_TRAFFIC_UNSPECIFIED"),
Self::All => std::option::Option::Some("INGRESS_TRAFFIC_ALL"),
Self::InternalOnly => std::option::Option::Some("INGRESS_TRAFFIC_INTERNAL_ONLY"),
Self::InternalLoadBalancer => {
std::option::Option::Some("INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER")
}
Self::None => std::option::Option::Some("INGRESS_TRAFFIC_NONE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for IngressTraffic {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for IngressTraffic {
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 IngressTraffic {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::All,
2 => Self::InternalOnly,
3 => Self::InternalLoadBalancer,
4 => Self::None,
_ => Self::UnknownValue(ingress_traffic::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for IngressTraffic {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"INGRESS_TRAFFIC_UNSPECIFIED" => Self::Unspecified,
"INGRESS_TRAFFIC_ALL" => Self::All,
"INGRESS_TRAFFIC_INTERNAL_ONLY" => Self::InternalOnly,
"INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER" => Self::InternalLoadBalancer,
"INGRESS_TRAFFIC_NONE" => Self::None,
_ => Self::UnknownValue(ingress_traffic::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for IngressTraffic {
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::All => serializer.serialize_i32(1),
Self::InternalOnly => serializer.serialize_i32(2),
Self::InternalLoadBalancer => serializer.serialize_i32(3),
Self::None => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for IngressTraffic {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngressTraffic>::new(
".google.cloud.run.v2.IngressTraffic",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExecutionEnvironment {
Unspecified,
Gen1,
Gen2,
UnknownValue(execution_environment::UnknownValue),
}
#[doc(hidden)]
pub mod execution_environment {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExecutionEnvironment {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Gen1 => std::option::Option::Some(1),
Self::Gen2 => 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("EXECUTION_ENVIRONMENT_UNSPECIFIED"),
Self::Gen1 => std::option::Option::Some("EXECUTION_ENVIRONMENT_GEN1"),
Self::Gen2 => std::option::Option::Some("EXECUTION_ENVIRONMENT_GEN2"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExecutionEnvironment {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExecutionEnvironment {
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 ExecutionEnvironment {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Gen1,
2 => Self::Gen2,
_ => Self::UnknownValue(execution_environment::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExecutionEnvironment {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXECUTION_ENVIRONMENT_UNSPECIFIED" => Self::Unspecified,
"EXECUTION_ENVIRONMENT_GEN1" => Self::Gen1,
"EXECUTION_ENVIRONMENT_GEN2" => Self::Gen2,
_ => Self::UnknownValue(execution_environment::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExecutionEnvironment {
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::Gen1 => serializer.serialize_i32(1),
Self::Gen2 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironment {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionEnvironment>::new(
".google.cloud.run.v2.ExecutionEnvironment",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EncryptionKeyRevocationAction {
Unspecified,
PreventNew,
Shutdown,
UnknownValue(encryption_key_revocation_action::UnknownValue),
}
#[doc(hidden)]
pub mod encryption_key_revocation_action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EncryptionKeyRevocationAction {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PreventNew => std::option::Option::Some(1),
Self::Shutdown => 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("ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED")
}
Self::PreventNew => std::option::Option::Some("PREVENT_NEW"),
Self::Shutdown => std::option::Option::Some("SHUTDOWN"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EncryptionKeyRevocationAction {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EncryptionKeyRevocationAction {
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 EncryptionKeyRevocationAction {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PreventNew,
2 => Self::Shutdown,
_ => Self::UnknownValue(encryption_key_revocation_action::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EncryptionKeyRevocationAction {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" => Self::Unspecified,
"PREVENT_NEW" => Self::PreventNew,
"SHUTDOWN" => Self::Shutdown,
_ => Self::UnknownValue(encryption_key_revocation_action::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EncryptionKeyRevocationAction {
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::PreventNew => serializer.serialize_i32(1),
Self::Shutdown => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EncryptionKeyRevocationAction {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<EncryptionKeyRevocationAction>::new(
".google.cloud.run.v2.EncryptionKeyRevocationAction",
),
)
}
}