google_cloud_run_v2/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate api;
21extern crate async_trait;
22extern crate bytes;
23extern crate gax;
24extern crate gaxi;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38/// Request message for submitting a Build.
39#[serde_with::serde_as]
40#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
41#[serde(default, rename_all = "camelCase")]
42#[non_exhaustive]
43pub struct SubmitBuildRequest {
44    /// Required. The project and location to build in. Location must be a region,
45    /// e.g., 'us-central1' or 'global' if the global builder is to be used.
46    /// Format:
47    /// `projects/{project}/locations/{location}`
48    #[serde(skip_serializing_if = "std::string::String::is_empty")]
49    pub parent: std::string::String,
50
51    /// Required. Artifact Registry URI to store the built image.
52    #[serde(skip_serializing_if = "std::string::String::is_empty")]
53    pub image_uri: std::string::String,
54
55    /// Optional. The service account to use for the build. If not set, the default
56    /// Cloud Build service account for the project will be used.
57    #[serde(skip_serializing_if = "std::string::String::is_empty")]
58    pub service_account: std::string::String,
59
60    /// Optional. Name of the Cloud Build Custom Worker Pool that should be used to
61    /// build the function. The format of this field is
62    /// `projects/{project}/locations/{region}/workerPools/{workerPool}` where
63    /// `{project}` and `{region}` are the project id and region respectively where
64    /// the worker pool is defined and `{workerPool}` is the short name of the
65    /// worker pool.
66    #[serde(skip_serializing_if = "std::string::String::is_empty")]
67    pub worker_pool: std::string::String,
68
69    /// Optional. Additional tags to annotate the build.
70    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
71    pub tags: std::vec::Vec<std::string::String>,
72
73    /// Location of source.
74    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
75    pub source: std::option::Option<crate::model::submit_build_request::Source>,
76
77    /// Build type must be one of the following.
78    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
79    pub build_type: std::option::Option<crate::model::submit_build_request::BuildType>,
80
81    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
82    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
83}
84
85impl SubmitBuildRequest {
86    pub fn new() -> Self {
87        std::default::Default::default()
88    }
89
90    /// Sets the value of [parent][crate::model::SubmitBuildRequest::parent].
91    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
92        self.parent = v.into();
93        self
94    }
95
96    /// Sets the value of [image_uri][crate::model::SubmitBuildRequest::image_uri].
97    pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
98        self.image_uri = v.into();
99        self
100    }
101
102    /// Sets the value of [service_account][crate::model::SubmitBuildRequest::service_account].
103    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
104        self.service_account = v.into();
105        self
106    }
107
108    /// Sets the value of [worker_pool][crate::model::SubmitBuildRequest::worker_pool].
109    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110        self.worker_pool = v.into();
111        self
112    }
113
114    /// Sets the value of [tags][crate::model::SubmitBuildRequest::tags].
115    pub fn set_tags<T, V>(mut self, v: T) -> Self
116    where
117        T: std::iter::IntoIterator<Item = V>,
118        V: std::convert::Into<std::string::String>,
119    {
120        use std::iter::Iterator;
121        self.tags = v.into_iter().map(|i| i.into()).collect();
122        self
123    }
124
125    /// Sets the value of [source][crate::model::SubmitBuildRequest::source].
126    ///
127    /// Note that all the setters affecting `source` are mutually
128    /// exclusive.
129    pub fn set_source<
130        T: std::convert::Into<std::option::Option<crate::model::submit_build_request::Source>>,
131    >(
132        mut self,
133        v: T,
134    ) -> Self {
135        self.source = v.into();
136        self
137    }
138
139    /// The value of [source][crate::model::SubmitBuildRequest::source]
140    /// if it holds a `StorageSource`, `None` if the field is not set or
141    /// holds a different branch.
142    pub fn storage_source(
143        &self,
144    ) -> std::option::Option<&std::boxed::Box<crate::model::StorageSource>> {
145        #[allow(unreachable_patterns)]
146        self.source.as_ref().and_then(|v| match v {
147            crate::model::submit_build_request::Source::StorageSource(v) => {
148                std::option::Option::Some(v)
149            }
150            _ => std::option::Option::None,
151        })
152    }
153
154    /// Sets the value of [source][crate::model::SubmitBuildRequest::source]
155    /// to hold a `StorageSource`.
156    ///
157    /// Note that all the setters affecting `source` are
158    /// mutually exclusive.
159    pub fn set_storage_source<
160        T: std::convert::Into<std::boxed::Box<crate::model::StorageSource>>,
161    >(
162        mut self,
163        v: T,
164    ) -> Self {
165        self.source = std::option::Option::Some(
166            crate::model::submit_build_request::Source::StorageSource(v.into()),
167        );
168        self
169    }
170
171    /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type].
172    ///
173    /// Note that all the setters affecting `build_type` are mutually
174    /// exclusive.
175    pub fn set_build_type<
176        T: std::convert::Into<std::option::Option<crate::model::submit_build_request::BuildType>>,
177    >(
178        mut self,
179        v: T,
180    ) -> Self {
181        self.build_type = v.into();
182        self
183    }
184
185    /// The value of [build_type][crate::model::SubmitBuildRequest::build_type]
186    /// if it holds a `BuildpackBuild`, `None` if the field is not set or
187    /// holds a different branch.
188    pub fn buildpack_build(
189        &self,
190    ) -> std::option::Option<&std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>>
191    {
192        #[allow(unreachable_patterns)]
193        self.build_type.as_ref().and_then(|v| match v {
194            crate::model::submit_build_request::BuildType::BuildpackBuild(v) => {
195                std::option::Option::Some(v)
196            }
197            _ => std::option::Option::None,
198        })
199    }
200
201    /// The value of [build_type][crate::model::SubmitBuildRequest::build_type]
202    /// if it holds a `DockerBuild`, `None` if the field is not set or
203    /// holds a different branch.
204    pub fn docker_build(
205        &self,
206    ) -> std::option::Option<&std::boxed::Box<crate::model::submit_build_request::DockerBuild>>
207    {
208        #[allow(unreachable_patterns)]
209        self.build_type.as_ref().and_then(|v| match v {
210            crate::model::submit_build_request::BuildType::DockerBuild(v) => {
211                std::option::Option::Some(v)
212            }
213            _ => std::option::Option::None,
214        })
215    }
216
217    /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type]
218    /// to hold a `BuildpackBuild`.
219    ///
220    /// Note that all the setters affecting `build_type` are
221    /// mutually exclusive.
222    pub fn set_buildpack_build<
223        T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>>,
224    >(
225        mut self,
226        v: T,
227    ) -> Self {
228        self.build_type = std::option::Option::Some(
229            crate::model::submit_build_request::BuildType::BuildpackBuild(v.into()),
230        );
231        self
232    }
233
234    /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type]
235    /// to hold a `DockerBuild`.
236    ///
237    /// Note that all the setters affecting `build_type` are
238    /// mutually exclusive.
239    pub fn set_docker_build<
240        T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::DockerBuild>>,
241    >(
242        mut self,
243        v: T,
244    ) -> Self {
245        self.build_type = std::option::Option::Some(
246            crate::model::submit_build_request::BuildType::DockerBuild(v.into()),
247        );
248        self
249    }
250}
251
252impl wkt::message::Message for SubmitBuildRequest {
253    fn typename() -> &'static str {
254        "type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest"
255    }
256}
257
258/// Defines additional types related to [SubmitBuildRequest].
259pub mod submit_build_request {
260    #[allow(unused_imports)]
261    use super::*;
262
263    /// Build the source using Docker. This means the source has a Dockerfile.
264    #[serde_with::serde_as]
265    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
266    #[serde(default, rename_all = "camelCase")]
267    #[non_exhaustive]
268    pub struct DockerBuild {
269        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
270        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
271    }
272
273    impl DockerBuild {
274        pub fn new() -> Self {
275            std::default::Default::default()
276        }
277    }
278
279    impl wkt::message::Message for DockerBuild {
280        fn typename() -> &'static str {
281            "type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest.DockerBuild"
282        }
283    }
284
285    /// Build the source using Buildpacks.
286    #[serde_with::serde_as]
287    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
288    #[serde(default, rename_all = "camelCase")]
289    #[non_exhaustive]
290    pub struct BuildpacksBuild {
291        /// The runtime name, e.g. 'go113'. Leave blank for generic builds.
292        #[serde(skip_serializing_if = "std::string::String::is_empty")]
293        pub runtime: std::string::String,
294
295        /// Optional. Name of the function target if the source is a function source.
296        /// Required for function builds.
297        #[serde(skip_serializing_if = "std::string::String::is_empty")]
298        pub function_target: std::string::String,
299
300        /// Optional. cache_image_uri is the GCR/AR URL where the cache image will be
301        /// stored. cache_image_uri is optional and omitting it will disable caching.
302        /// This URL must be stable across builds. It is used to derive a
303        /// build-specific temporary URL by substituting the tag with the build ID.
304        /// The build will clean up the temporary image on a best-effort basis.
305        #[serde(skip_serializing_if = "std::string::String::is_empty")]
306        pub cache_image_uri: std::string::String,
307
308        /// Optional. The base image to use for the build.
309        #[serde(skip_serializing_if = "std::string::String::is_empty")]
310        pub base_image: std::string::String,
311
312        /// Optional. User-provided build-time environment variables.
313        #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
314        pub environment_variables:
315            std::collections::HashMap<std::string::String, std::string::String>,
316
317        /// Optional. Whether or not the application container will be enrolled in
318        /// automatic base image updates. When true, the application will be built on
319        /// a scratch base image, so the base layers can be appended at run time.
320        pub enable_automatic_updates: bool,
321
322        /// Optional. project_descriptor stores the path to the project descriptor
323        /// file. When empty, it means that there is no project descriptor file in
324        /// the source.
325        #[serde(skip_serializing_if = "std::string::String::is_empty")]
326        pub project_descriptor: std::string::String,
327
328        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
329        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
330    }
331
332    impl BuildpacksBuild {
333        pub fn new() -> Self {
334            std::default::Default::default()
335        }
336
337        /// Sets the value of [runtime][crate::model::submit_build_request::BuildpacksBuild::runtime].
338        pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
339            self.runtime = v.into();
340            self
341        }
342
343        /// Sets the value of [function_target][crate::model::submit_build_request::BuildpacksBuild::function_target].
344        pub fn set_function_target<T: std::convert::Into<std::string::String>>(
345            mut self,
346            v: T,
347        ) -> Self {
348            self.function_target = v.into();
349            self
350        }
351
352        /// Sets the value of [cache_image_uri][crate::model::submit_build_request::BuildpacksBuild::cache_image_uri].
353        pub fn set_cache_image_uri<T: std::convert::Into<std::string::String>>(
354            mut self,
355            v: T,
356        ) -> Self {
357            self.cache_image_uri = v.into();
358            self
359        }
360
361        /// Sets the value of [base_image][crate::model::submit_build_request::BuildpacksBuild::base_image].
362        pub fn set_base_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
363            self.base_image = v.into();
364            self
365        }
366
367        /// Sets the value of [enable_automatic_updates][crate::model::submit_build_request::BuildpacksBuild::enable_automatic_updates].
368        pub fn set_enable_automatic_updates<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
369            self.enable_automatic_updates = v.into();
370            self
371        }
372
373        /// Sets the value of [project_descriptor][crate::model::submit_build_request::BuildpacksBuild::project_descriptor].
374        pub fn set_project_descriptor<T: std::convert::Into<std::string::String>>(
375            mut self,
376            v: T,
377        ) -> Self {
378            self.project_descriptor = v.into();
379            self
380        }
381
382        /// Sets the value of [environment_variables][crate::model::submit_build_request::BuildpacksBuild::environment_variables].
383        pub fn set_environment_variables<T, K, V>(mut self, v: T) -> Self
384        where
385            T: std::iter::IntoIterator<Item = (K, V)>,
386            K: std::convert::Into<std::string::String>,
387            V: std::convert::Into<std::string::String>,
388        {
389            use std::iter::Iterator;
390            self.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
391            self
392        }
393    }
394
395    impl wkt::message::Message for BuildpacksBuild {
396        fn typename() -> &'static str {
397            "type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild"
398        }
399    }
400
401    /// Location of source.
402    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
403    #[serde(rename_all = "camelCase")]
404    #[non_exhaustive]
405    pub enum Source {
406        /// Required. Source for the build.
407        StorageSource(std::boxed::Box<crate::model::StorageSource>),
408    }
409
410    /// Build type must be one of the following.
411    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
412    #[serde(rename_all = "camelCase")]
413    #[non_exhaustive]
414    pub enum BuildType {
415        /// Build the source using Buildpacks.
416        BuildpackBuild(std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>),
417        /// Build the source using Docker. This means the source has a Dockerfile.
418        DockerBuild(std::boxed::Box<crate::model::submit_build_request::DockerBuild>),
419    }
420}
421
422/// Response message for submitting a Build.
423#[serde_with::serde_as]
424#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
425#[serde(default, rename_all = "camelCase")]
426#[non_exhaustive]
427pub struct SubmitBuildResponse {
428    /// Cloud Build operation to be polled via CloudBuild API.
429    #[serde(skip_serializing_if = "std::option::Option::is_none")]
430    pub build_operation: std::option::Option<longrunning::model::Operation>,
431
432    /// URI of the base builder image in Artifact Registry being used in the build.
433    /// Used to opt into automatic base image updates.
434    #[serde(skip_serializing_if = "std::string::String::is_empty")]
435    pub base_image_uri: std::string::String,
436
437    /// Warning message for the base image.
438    #[serde(skip_serializing_if = "std::string::String::is_empty")]
439    pub base_image_warning: std::string::String,
440
441    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
442    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
443}
444
445impl SubmitBuildResponse {
446    pub fn new() -> Self {
447        std::default::Default::default()
448    }
449
450    /// Sets the value of [build_operation][crate::model::SubmitBuildResponse::build_operation].
451    pub fn set_build_operation<
452        T: std::convert::Into<std::option::Option<longrunning::model::Operation>>,
453    >(
454        mut self,
455        v: T,
456    ) -> Self {
457        self.build_operation = v.into();
458        self
459    }
460
461    /// Sets the value of [base_image_uri][crate::model::SubmitBuildResponse::base_image_uri].
462    pub fn set_base_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
463        self.base_image_uri = v.into();
464        self
465    }
466
467    /// Sets the value of [base_image_warning][crate::model::SubmitBuildResponse::base_image_warning].
468    pub fn set_base_image_warning<T: std::convert::Into<std::string::String>>(
469        mut self,
470        v: T,
471    ) -> Self {
472        self.base_image_warning = v.into();
473        self
474    }
475}
476
477impl wkt::message::Message for SubmitBuildResponse {
478    fn typename() -> &'static str {
479        "type.googleapis.com/google.cloud.run.v2.SubmitBuildResponse"
480    }
481}
482
483/// Location of the source in an archive file in Google Cloud Storage.
484#[serde_with::serde_as]
485#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
486#[serde(default, rename_all = "camelCase")]
487#[non_exhaustive]
488pub struct StorageSource {
489    /// Required. Google Cloud Storage bucket containing the source (see
490    /// [Bucket Name
491    /// Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
492    #[serde(skip_serializing_if = "std::string::String::is_empty")]
493    pub bucket: std::string::String,
494
495    /// Required. Google Cloud Storage object containing the source.
496    ///
497    /// This object must be a gzipped archive file (`.tar.gz`) containing source to
498    /// build.
499    #[serde(skip_serializing_if = "std::string::String::is_empty")]
500    pub object: std::string::String,
501
502    /// Optional. Google Cloud Storage generation for the object. If the generation
503    /// is omitted, the latest generation will be used.
504    #[serde_as(as = "serde_with::DisplayFromStr")]
505    pub generation: i64,
506
507    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
508    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
509}
510
511impl StorageSource {
512    pub fn new() -> Self {
513        std::default::Default::default()
514    }
515
516    /// Sets the value of [bucket][crate::model::StorageSource::bucket].
517    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
518        self.bucket = v.into();
519        self
520    }
521
522    /// Sets the value of [object][crate::model::StorageSource::object].
523    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
524        self.object = v.into();
525        self
526    }
527
528    /// Sets the value of [generation][crate::model::StorageSource::generation].
529    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
530        self.generation = v.into();
531        self
532    }
533}
534
535impl wkt::message::Message for StorageSource {
536    fn typename() -> &'static str {
537        "type.googleapis.com/google.cloud.run.v2.StorageSource"
538    }
539}
540
541/// Defines a status condition for a resource.
542#[serde_with::serde_as]
543#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
544#[serde(default, rename_all = "camelCase")]
545#[non_exhaustive]
546pub struct Condition {
547    /// type is used to communicate the status of the reconciliation process.
548    /// See also:
549    /// <https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting>
550    /// Types common to all resources include:
551    ///
552    /// * "Ready": True when the Resource is ready.
553    #[serde(rename = "type")]
554    #[serde(skip_serializing_if = "std::string::String::is_empty")]
555    pub r#type: std::string::String,
556
557    /// State of the condition.
558    pub state: crate::model::condition::State,
559
560    /// Human readable message indicating details about the current status.
561    #[serde(skip_serializing_if = "std::string::String::is_empty")]
562    pub message: std::string::String,
563
564    /// Last time the condition transitioned from one status to another.
565    #[serde(skip_serializing_if = "std::option::Option::is_none")]
566    pub last_transition_time: std::option::Option<wkt::Timestamp>,
567
568    /// How to interpret failures of this condition, one of Error, Warning, Info
569    pub severity: crate::model::condition::Severity,
570
571    /// The reason for this condition. Depending on the condition type,
572    /// it will populate one of these fields.
573    /// Successful conditions cannot have a reason.
574    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
575    pub reasons: std::option::Option<crate::model::condition::Reasons>,
576
577    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
578    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
579}
580
581impl Condition {
582    pub fn new() -> Self {
583        std::default::Default::default()
584    }
585
586    /// Sets the value of [r#type][crate::model::Condition::type].
587    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
588        self.r#type = v.into();
589        self
590    }
591
592    /// Sets the value of [state][crate::model::Condition::state].
593    pub fn set_state<T: std::convert::Into<crate::model::condition::State>>(
594        mut self,
595        v: T,
596    ) -> Self {
597        self.state = v.into();
598        self
599    }
600
601    /// Sets the value of [message][crate::model::Condition::message].
602    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
603        self.message = v.into();
604        self
605    }
606
607    /// Sets the value of [last_transition_time][crate::model::Condition::last_transition_time].
608    pub fn set_last_transition_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
609        mut self,
610        v: T,
611    ) -> Self {
612        self.last_transition_time = v.into();
613        self
614    }
615
616    /// Sets the value of [severity][crate::model::Condition::severity].
617    pub fn set_severity<T: std::convert::Into<crate::model::condition::Severity>>(
618        mut self,
619        v: T,
620    ) -> Self {
621        self.severity = v.into();
622        self
623    }
624
625    /// Sets the value of [reasons][crate::model::Condition::reasons].
626    ///
627    /// Note that all the setters affecting `reasons` are mutually
628    /// exclusive.
629    pub fn set_reasons<
630        T: std::convert::Into<std::option::Option<crate::model::condition::Reasons>>,
631    >(
632        mut self,
633        v: T,
634    ) -> Self {
635        self.reasons = v.into();
636        self
637    }
638
639    /// The value of [reasons][crate::model::Condition::reasons]
640    /// if it holds a `Reason`, `None` if the field is not set or
641    /// holds a different branch.
642    pub fn reason(&self) -> std::option::Option<&crate::model::condition::CommonReason> {
643        #[allow(unreachable_patterns)]
644        self.reasons.as_ref().and_then(|v| match v {
645            crate::model::condition::Reasons::Reason(v) => std::option::Option::Some(v),
646            _ => std::option::Option::None,
647        })
648    }
649
650    /// The value of [reasons][crate::model::Condition::reasons]
651    /// if it holds a `RevisionReason`, `None` if the field is not set or
652    /// holds a different branch.
653    pub fn revision_reason(&self) -> std::option::Option<&crate::model::condition::RevisionReason> {
654        #[allow(unreachable_patterns)]
655        self.reasons.as_ref().and_then(|v| match v {
656            crate::model::condition::Reasons::RevisionReason(v) => std::option::Option::Some(v),
657            _ => std::option::Option::None,
658        })
659    }
660
661    /// The value of [reasons][crate::model::Condition::reasons]
662    /// if it holds a `ExecutionReason`, `None` if the field is not set or
663    /// holds a different branch.
664    pub fn execution_reason(
665        &self,
666    ) -> std::option::Option<&crate::model::condition::ExecutionReason> {
667        #[allow(unreachable_patterns)]
668        self.reasons.as_ref().and_then(|v| match v {
669            crate::model::condition::Reasons::ExecutionReason(v) => std::option::Option::Some(v),
670            _ => std::option::Option::None,
671        })
672    }
673
674    /// Sets the value of [reasons][crate::model::Condition::reasons]
675    /// to hold a `Reason`.
676    ///
677    /// Note that all the setters affecting `reasons` are
678    /// mutually exclusive.
679    pub fn set_reason<T: std::convert::Into<crate::model::condition::CommonReason>>(
680        mut self,
681        v: T,
682    ) -> Self {
683        self.reasons =
684            std::option::Option::Some(crate::model::condition::Reasons::Reason(v.into()));
685        self
686    }
687
688    /// Sets the value of [reasons][crate::model::Condition::reasons]
689    /// to hold a `RevisionReason`.
690    ///
691    /// Note that all the setters affecting `reasons` are
692    /// mutually exclusive.
693    pub fn set_revision_reason<T: std::convert::Into<crate::model::condition::RevisionReason>>(
694        mut self,
695        v: T,
696    ) -> Self {
697        self.reasons =
698            std::option::Option::Some(crate::model::condition::Reasons::RevisionReason(v.into()));
699        self
700    }
701
702    /// Sets the value of [reasons][crate::model::Condition::reasons]
703    /// to hold a `ExecutionReason`.
704    ///
705    /// Note that all the setters affecting `reasons` are
706    /// mutually exclusive.
707    pub fn set_execution_reason<T: std::convert::Into<crate::model::condition::ExecutionReason>>(
708        mut self,
709        v: T,
710    ) -> Self {
711        self.reasons =
712            std::option::Option::Some(crate::model::condition::Reasons::ExecutionReason(v.into()));
713        self
714    }
715}
716
717impl wkt::message::Message for Condition {
718    fn typename() -> &'static str {
719        "type.googleapis.com/google.cloud.run.v2.Condition"
720    }
721}
722
723/// Defines additional types related to [Condition].
724pub mod condition {
725    #[allow(unused_imports)]
726    use super::*;
727
728    /// Represents the possible Condition states.
729    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
730    pub struct State(i32);
731
732    impl State {
733        /// The default value. This value is used if the state is omitted.
734        pub const STATE_UNSPECIFIED: State = State::new(0);
735
736        /// Transient state: Reconciliation has not started yet.
737        pub const CONDITION_PENDING: State = State::new(1);
738
739        /// Transient state: reconciliation is still in progress.
740        pub const CONDITION_RECONCILING: State = State::new(2);
741
742        /// Terminal state: Reconciliation did not succeed.
743        pub const CONDITION_FAILED: State = State::new(3);
744
745        /// Terminal state: Reconciliation completed successfully.
746        pub const CONDITION_SUCCEEDED: State = State::new(4);
747
748        /// Creates a new State instance.
749        pub(crate) const fn new(value: i32) -> Self {
750            Self(value)
751        }
752
753        /// Gets the enum value.
754        pub fn value(&self) -> i32 {
755            self.0
756        }
757
758        /// Gets the enum value as a string.
759        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
760            match self.0 {
761                0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
762                1 => std::borrow::Cow::Borrowed("CONDITION_PENDING"),
763                2 => std::borrow::Cow::Borrowed("CONDITION_RECONCILING"),
764                3 => std::borrow::Cow::Borrowed("CONDITION_FAILED"),
765                4 => std::borrow::Cow::Borrowed("CONDITION_SUCCEEDED"),
766                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
767            }
768        }
769
770        /// Creates an enum value from the value name.
771        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
772            match name {
773                "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
774                "CONDITION_PENDING" => std::option::Option::Some(Self::CONDITION_PENDING),
775                "CONDITION_RECONCILING" => std::option::Option::Some(Self::CONDITION_RECONCILING),
776                "CONDITION_FAILED" => std::option::Option::Some(Self::CONDITION_FAILED),
777                "CONDITION_SUCCEEDED" => std::option::Option::Some(Self::CONDITION_SUCCEEDED),
778                _ => std::option::Option::None,
779            }
780        }
781    }
782
783    impl std::convert::From<i32> for State {
784        fn from(value: i32) -> Self {
785            Self::new(value)
786        }
787    }
788
789    impl std::default::Default for State {
790        fn default() -> Self {
791            Self::new(0)
792        }
793    }
794
795    /// Represents the severity of the condition failures.
796    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
797    pub struct Severity(i32);
798
799    impl Severity {
800        /// Unspecified severity
801        pub const SEVERITY_UNSPECIFIED: Severity = Severity::new(0);
802
803        /// Error severity.
804        pub const ERROR: Severity = Severity::new(1);
805
806        /// Warning severity.
807        pub const WARNING: Severity = Severity::new(2);
808
809        /// Info severity.
810        pub const INFO: Severity = Severity::new(3);
811
812        /// Creates a new Severity instance.
813        pub(crate) const fn new(value: i32) -> Self {
814            Self(value)
815        }
816
817        /// Gets the enum value.
818        pub fn value(&self) -> i32 {
819            self.0
820        }
821
822        /// Gets the enum value as a string.
823        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
824            match self.0 {
825                0 => std::borrow::Cow::Borrowed("SEVERITY_UNSPECIFIED"),
826                1 => std::borrow::Cow::Borrowed("ERROR"),
827                2 => std::borrow::Cow::Borrowed("WARNING"),
828                3 => std::borrow::Cow::Borrowed("INFO"),
829                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
830            }
831        }
832
833        /// Creates an enum value from the value name.
834        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
835            match name {
836                "SEVERITY_UNSPECIFIED" => std::option::Option::Some(Self::SEVERITY_UNSPECIFIED),
837                "ERROR" => std::option::Option::Some(Self::ERROR),
838                "WARNING" => std::option::Option::Some(Self::WARNING),
839                "INFO" => std::option::Option::Some(Self::INFO),
840                _ => std::option::Option::None,
841            }
842        }
843    }
844
845    impl std::convert::From<i32> for Severity {
846        fn from(value: i32) -> Self {
847            Self::new(value)
848        }
849    }
850
851    impl std::default::Default for Severity {
852        fn default() -> Self {
853            Self::new(0)
854        }
855    }
856
857    /// Reasons common to all types of conditions.
858    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
859    pub struct CommonReason(i32);
860
861    impl CommonReason {
862        /// Default value.
863        pub const COMMON_REASON_UNDEFINED: CommonReason = CommonReason::new(0);
864
865        /// Reason unknown. Further details will be in message.
866        pub const UNKNOWN: CommonReason = CommonReason::new(1);
867
868        /// Revision creation process failed.
869        pub const REVISION_FAILED: CommonReason = CommonReason::new(3);
870
871        /// Timed out waiting for completion.
872        pub const PROGRESS_DEADLINE_EXCEEDED: CommonReason = CommonReason::new(4);
873
874        /// The container image path is incorrect.
875        pub const CONTAINER_MISSING: CommonReason = CommonReason::new(6);
876
877        /// Insufficient permissions on the container image.
878        pub const CONTAINER_PERMISSION_DENIED: CommonReason = CommonReason::new(7);
879
880        /// Container image is not authorized by policy.
881        pub const CONTAINER_IMAGE_UNAUTHORIZED: CommonReason = CommonReason::new(8);
882
883        /// Container image policy authorization check failed.
884        pub const CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED: CommonReason = CommonReason::new(9);
885
886        /// Insufficient permissions on encryption key.
887        pub const ENCRYPTION_KEY_PERMISSION_DENIED: CommonReason = CommonReason::new(10);
888
889        /// Permission check on encryption key failed.
890        pub const ENCRYPTION_KEY_CHECK_FAILED: CommonReason = CommonReason::new(11);
891
892        /// At least one Access check on secrets failed.
893        pub const SECRETS_ACCESS_CHECK_FAILED: CommonReason = CommonReason::new(12);
894
895        /// Waiting for operation to complete.
896        pub const WAITING_FOR_OPERATION: CommonReason = CommonReason::new(13);
897
898        /// System will retry immediately.
899        pub const IMMEDIATE_RETRY: CommonReason = CommonReason::new(14);
900
901        /// System will retry later; current attempt failed.
902        pub const POSTPONED_RETRY: CommonReason = CommonReason::new(15);
903
904        /// An internal error occurred. Further information may be in the message.
905        pub const INTERNAL: CommonReason = CommonReason::new(16);
906
907        /// Creates a new CommonReason instance.
908        pub(crate) const fn new(value: i32) -> Self {
909            Self(value)
910        }
911
912        /// Gets the enum value.
913        pub fn value(&self) -> i32 {
914            self.0
915        }
916
917        /// Gets the enum value as a string.
918        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
919            match self.0 {
920                0 => std::borrow::Cow::Borrowed("COMMON_REASON_UNDEFINED"),
921                1 => std::borrow::Cow::Borrowed("UNKNOWN"),
922                3 => std::borrow::Cow::Borrowed("REVISION_FAILED"),
923                4 => std::borrow::Cow::Borrowed("PROGRESS_DEADLINE_EXCEEDED"),
924                6 => std::borrow::Cow::Borrowed("CONTAINER_MISSING"),
925                7 => std::borrow::Cow::Borrowed("CONTAINER_PERMISSION_DENIED"),
926                8 => std::borrow::Cow::Borrowed("CONTAINER_IMAGE_UNAUTHORIZED"),
927                9 => std::borrow::Cow::Borrowed("CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED"),
928                10 => std::borrow::Cow::Borrowed("ENCRYPTION_KEY_PERMISSION_DENIED"),
929                11 => std::borrow::Cow::Borrowed("ENCRYPTION_KEY_CHECK_FAILED"),
930                12 => std::borrow::Cow::Borrowed("SECRETS_ACCESS_CHECK_FAILED"),
931                13 => std::borrow::Cow::Borrowed("WAITING_FOR_OPERATION"),
932                14 => std::borrow::Cow::Borrowed("IMMEDIATE_RETRY"),
933                15 => std::borrow::Cow::Borrowed("POSTPONED_RETRY"),
934                16 => std::borrow::Cow::Borrowed("INTERNAL"),
935                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
936            }
937        }
938
939        /// Creates an enum value from the value name.
940        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
941            match name {
942                "COMMON_REASON_UNDEFINED" => {
943                    std::option::Option::Some(Self::COMMON_REASON_UNDEFINED)
944                }
945                "UNKNOWN" => std::option::Option::Some(Self::UNKNOWN),
946                "REVISION_FAILED" => std::option::Option::Some(Self::REVISION_FAILED),
947                "PROGRESS_DEADLINE_EXCEEDED" => {
948                    std::option::Option::Some(Self::PROGRESS_DEADLINE_EXCEEDED)
949                }
950                "CONTAINER_MISSING" => std::option::Option::Some(Self::CONTAINER_MISSING),
951                "CONTAINER_PERMISSION_DENIED" => {
952                    std::option::Option::Some(Self::CONTAINER_PERMISSION_DENIED)
953                }
954                "CONTAINER_IMAGE_UNAUTHORIZED" => {
955                    std::option::Option::Some(Self::CONTAINER_IMAGE_UNAUTHORIZED)
956                }
957                "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED" => {
958                    std::option::Option::Some(Self::CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED)
959                }
960                "ENCRYPTION_KEY_PERMISSION_DENIED" => {
961                    std::option::Option::Some(Self::ENCRYPTION_KEY_PERMISSION_DENIED)
962                }
963                "ENCRYPTION_KEY_CHECK_FAILED" => {
964                    std::option::Option::Some(Self::ENCRYPTION_KEY_CHECK_FAILED)
965                }
966                "SECRETS_ACCESS_CHECK_FAILED" => {
967                    std::option::Option::Some(Self::SECRETS_ACCESS_CHECK_FAILED)
968                }
969                "WAITING_FOR_OPERATION" => std::option::Option::Some(Self::WAITING_FOR_OPERATION),
970                "IMMEDIATE_RETRY" => std::option::Option::Some(Self::IMMEDIATE_RETRY),
971                "POSTPONED_RETRY" => std::option::Option::Some(Self::POSTPONED_RETRY),
972                "INTERNAL" => std::option::Option::Some(Self::INTERNAL),
973                _ => std::option::Option::None,
974            }
975        }
976    }
977
978    impl std::convert::From<i32> for CommonReason {
979        fn from(value: i32) -> Self {
980            Self::new(value)
981        }
982    }
983
984    impl std::default::Default for CommonReason {
985        fn default() -> Self {
986            Self::new(0)
987        }
988    }
989
990    /// Reasons specific to Revision resource.
991    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
992    pub struct RevisionReason(i32);
993
994    impl RevisionReason {
995        /// Default value.
996        pub const REVISION_REASON_UNDEFINED: RevisionReason = RevisionReason::new(0);
997
998        /// Revision in Pending state.
999        pub const PENDING: RevisionReason = RevisionReason::new(1);
1000
1001        /// Revision is in Reserve state.
1002        pub const RESERVE: RevisionReason = RevisionReason::new(2);
1003
1004        /// Revision is Retired.
1005        pub const RETIRED: RevisionReason = RevisionReason::new(3);
1006
1007        /// Revision is being retired.
1008        pub const RETIRING: RevisionReason = RevisionReason::new(4);
1009
1010        /// Revision is being recreated.
1011        pub const RECREATING: RevisionReason = RevisionReason::new(5);
1012
1013        /// There was a health check error.
1014        pub const HEALTH_CHECK_CONTAINER_ERROR: RevisionReason = RevisionReason::new(6);
1015
1016        /// Health check failed due to user error from customized path of the
1017        /// container. System will retry.
1018        pub const CUSTOMIZED_PATH_RESPONSE_PENDING: RevisionReason = RevisionReason::new(7);
1019
1020        /// A revision with min_instance_count > 0 was created and is reserved, but
1021        /// it was not configured to serve traffic, so it's not live. This can also
1022        /// happen momentarily during traffic migration.
1023        pub const MIN_INSTANCES_NOT_PROVISIONED: RevisionReason = RevisionReason::new(8);
1024
1025        /// The maximum allowed number of active revisions has been reached.
1026        pub const ACTIVE_REVISION_LIMIT_REACHED: RevisionReason = RevisionReason::new(9);
1027
1028        /// There was no deployment defined.
1029        /// This value is no longer used, but Services created in older versions of
1030        /// the API might contain this value.
1031        pub const NO_DEPLOYMENT: RevisionReason = RevisionReason::new(10);
1032
1033        /// A revision's container has no port specified since the revision is of a
1034        /// manually scaled service with 0 instance count
1035        pub const HEALTH_CHECK_SKIPPED: RevisionReason = RevisionReason::new(11);
1036
1037        /// A revision with min_instance_count > 0 was created and is waiting for
1038        /// enough instances to begin a traffic migration.
1039        pub const MIN_INSTANCES_WARMING: RevisionReason = RevisionReason::new(12);
1040
1041        /// Creates a new RevisionReason instance.
1042        pub(crate) const fn new(value: i32) -> Self {
1043            Self(value)
1044        }
1045
1046        /// Gets the enum value.
1047        pub fn value(&self) -> i32 {
1048            self.0
1049        }
1050
1051        /// Gets the enum value as a string.
1052        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1053            match self.0 {
1054                0 => std::borrow::Cow::Borrowed("REVISION_REASON_UNDEFINED"),
1055                1 => std::borrow::Cow::Borrowed("PENDING"),
1056                2 => std::borrow::Cow::Borrowed("RESERVE"),
1057                3 => std::borrow::Cow::Borrowed("RETIRED"),
1058                4 => std::borrow::Cow::Borrowed("RETIRING"),
1059                5 => std::borrow::Cow::Borrowed("RECREATING"),
1060                6 => std::borrow::Cow::Borrowed("HEALTH_CHECK_CONTAINER_ERROR"),
1061                7 => std::borrow::Cow::Borrowed("CUSTOMIZED_PATH_RESPONSE_PENDING"),
1062                8 => std::borrow::Cow::Borrowed("MIN_INSTANCES_NOT_PROVISIONED"),
1063                9 => std::borrow::Cow::Borrowed("ACTIVE_REVISION_LIMIT_REACHED"),
1064                10 => std::borrow::Cow::Borrowed("NO_DEPLOYMENT"),
1065                11 => std::borrow::Cow::Borrowed("HEALTH_CHECK_SKIPPED"),
1066                12 => std::borrow::Cow::Borrowed("MIN_INSTANCES_WARMING"),
1067                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1068            }
1069        }
1070
1071        /// Creates an enum value from the value name.
1072        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1073            match name {
1074                "REVISION_REASON_UNDEFINED" => {
1075                    std::option::Option::Some(Self::REVISION_REASON_UNDEFINED)
1076                }
1077                "PENDING" => std::option::Option::Some(Self::PENDING),
1078                "RESERVE" => std::option::Option::Some(Self::RESERVE),
1079                "RETIRED" => std::option::Option::Some(Self::RETIRED),
1080                "RETIRING" => std::option::Option::Some(Self::RETIRING),
1081                "RECREATING" => std::option::Option::Some(Self::RECREATING),
1082                "HEALTH_CHECK_CONTAINER_ERROR" => {
1083                    std::option::Option::Some(Self::HEALTH_CHECK_CONTAINER_ERROR)
1084                }
1085                "CUSTOMIZED_PATH_RESPONSE_PENDING" => {
1086                    std::option::Option::Some(Self::CUSTOMIZED_PATH_RESPONSE_PENDING)
1087                }
1088                "MIN_INSTANCES_NOT_PROVISIONED" => {
1089                    std::option::Option::Some(Self::MIN_INSTANCES_NOT_PROVISIONED)
1090                }
1091                "ACTIVE_REVISION_LIMIT_REACHED" => {
1092                    std::option::Option::Some(Self::ACTIVE_REVISION_LIMIT_REACHED)
1093                }
1094                "NO_DEPLOYMENT" => std::option::Option::Some(Self::NO_DEPLOYMENT),
1095                "HEALTH_CHECK_SKIPPED" => std::option::Option::Some(Self::HEALTH_CHECK_SKIPPED),
1096                "MIN_INSTANCES_WARMING" => std::option::Option::Some(Self::MIN_INSTANCES_WARMING),
1097                _ => std::option::Option::None,
1098            }
1099        }
1100    }
1101
1102    impl std::convert::From<i32> for RevisionReason {
1103        fn from(value: i32) -> Self {
1104            Self::new(value)
1105        }
1106    }
1107
1108    impl std::default::Default for RevisionReason {
1109        fn default() -> Self {
1110            Self::new(0)
1111        }
1112    }
1113
1114    /// Reasons specific to Execution resource.
1115    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1116    pub struct ExecutionReason(i32);
1117
1118    impl ExecutionReason {
1119        /// Default value.
1120        pub const EXECUTION_REASON_UNDEFINED: ExecutionReason = ExecutionReason::new(0);
1121
1122        /// Internal system error getting execution status. System will retry.
1123        pub const JOB_STATUS_SERVICE_POLLING_ERROR: ExecutionReason = ExecutionReason::new(1);
1124
1125        /// A task reached its retry limit and the last attempt failed due to the
1126        /// user container exiting with a non-zero exit code.
1127        pub const NON_ZERO_EXIT_CODE: ExecutionReason = ExecutionReason::new(2);
1128
1129        /// The execution was cancelled by users.
1130        pub const CANCELLED: ExecutionReason = ExecutionReason::new(3);
1131
1132        /// The execution is in the process of being cancelled.
1133        pub const CANCELLING: ExecutionReason = ExecutionReason::new(4);
1134
1135        /// The execution was deleted.
1136        pub const DELETED: ExecutionReason = ExecutionReason::new(5);
1137
1138        /// Creates a new ExecutionReason instance.
1139        pub(crate) const fn new(value: i32) -> Self {
1140            Self(value)
1141        }
1142
1143        /// Gets the enum value.
1144        pub fn value(&self) -> i32 {
1145            self.0
1146        }
1147
1148        /// Gets the enum value as a string.
1149        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1150            match self.0 {
1151                0 => std::borrow::Cow::Borrowed("EXECUTION_REASON_UNDEFINED"),
1152                1 => std::borrow::Cow::Borrowed("JOB_STATUS_SERVICE_POLLING_ERROR"),
1153                2 => std::borrow::Cow::Borrowed("NON_ZERO_EXIT_CODE"),
1154                3 => std::borrow::Cow::Borrowed("CANCELLED"),
1155                4 => std::borrow::Cow::Borrowed("CANCELLING"),
1156                5 => std::borrow::Cow::Borrowed("DELETED"),
1157                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1158            }
1159        }
1160
1161        /// Creates an enum value from the value name.
1162        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1163            match name {
1164                "EXECUTION_REASON_UNDEFINED" => {
1165                    std::option::Option::Some(Self::EXECUTION_REASON_UNDEFINED)
1166                }
1167                "JOB_STATUS_SERVICE_POLLING_ERROR" => {
1168                    std::option::Option::Some(Self::JOB_STATUS_SERVICE_POLLING_ERROR)
1169                }
1170                "NON_ZERO_EXIT_CODE" => std::option::Option::Some(Self::NON_ZERO_EXIT_CODE),
1171                "CANCELLED" => std::option::Option::Some(Self::CANCELLED),
1172                "CANCELLING" => std::option::Option::Some(Self::CANCELLING),
1173                "DELETED" => std::option::Option::Some(Self::DELETED),
1174                _ => std::option::Option::None,
1175            }
1176        }
1177    }
1178
1179    impl std::convert::From<i32> for ExecutionReason {
1180        fn from(value: i32) -> Self {
1181            Self::new(value)
1182        }
1183    }
1184
1185    impl std::default::Default for ExecutionReason {
1186        fn default() -> Self {
1187            Self::new(0)
1188        }
1189    }
1190
1191    /// The reason for this condition. Depending on the condition type,
1192    /// it will populate one of these fields.
1193    /// Successful conditions cannot have a reason.
1194    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1195    #[serde(rename_all = "camelCase")]
1196    #[non_exhaustive]
1197    pub enum Reasons {
1198        /// Output only. A common (service-level) reason for this condition.
1199        Reason(crate::model::condition::CommonReason),
1200        /// Output only. A reason for the revision condition.
1201        RevisionReason(crate::model::condition::RevisionReason),
1202        /// Output only. A reason for the execution condition.
1203        ExecutionReason(crate::model::condition::ExecutionReason),
1204    }
1205}
1206
1207/// Request message for obtaining a Execution by its full name.
1208#[serde_with::serde_as]
1209#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1210#[serde(default, rename_all = "camelCase")]
1211#[non_exhaustive]
1212pub struct GetExecutionRequest {
1213    /// Required. The full name of the Execution.
1214    /// Format:
1215    /// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
1216    /// where `{project}` can be project id or number.
1217    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1218    pub name: std::string::String,
1219
1220    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1221    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1222}
1223
1224impl GetExecutionRequest {
1225    pub fn new() -> Self {
1226        std::default::Default::default()
1227    }
1228
1229    /// Sets the value of [name][crate::model::GetExecutionRequest::name].
1230    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1231        self.name = v.into();
1232        self
1233    }
1234}
1235
1236impl wkt::message::Message for GetExecutionRequest {
1237    fn typename() -> &'static str {
1238        "type.googleapis.com/google.cloud.run.v2.GetExecutionRequest"
1239    }
1240}
1241
1242/// Request message for retrieving a list of Executions.
1243#[serde_with::serde_as]
1244#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1245#[serde(default, rename_all = "camelCase")]
1246#[non_exhaustive]
1247pub struct ListExecutionsRequest {
1248    /// Required. The Execution from which the Executions should be listed.
1249    /// To list all Executions across Jobs, use "-" instead of Job name.
1250    /// Format: `projects/{project}/locations/{location}/jobs/{job}`, where
1251    /// `{project}` can be project id or number.
1252    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1253    pub parent: std::string::String,
1254
1255    /// Maximum number of Executions to return in this call.
1256    pub page_size: i32,
1257
1258    /// A page token received from a previous call to ListExecutions.
1259    /// All other parameters must match.
1260    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1261    pub page_token: std::string::String,
1262
1263    /// If true, returns deleted (but unexpired) resources along with active ones.
1264    pub show_deleted: bool,
1265
1266    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1267    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1268}
1269
1270impl ListExecutionsRequest {
1271    pub fn new() -> Self {
1272        std::default::Default::default()
1273    }
1274
1275    /// Sets the value of [parent][crate::model::ListExecutionsRequest::parent].
1276    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1277        self.parent = v.into();
1278        self
1279    }
1280
1281    /// Sets the value of [page_size][crate::model::ListExecutionsRequest::page_size].
1282    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1283        self.page_size = v.into();
1284        self
1285    }
1286
1287    /// Sets the value of [page_token][crate::model::ListExecutionsRequest::page_token].
1288    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1289        self.page_token = v.into();
1290        self
1291    }
1292
1293    /// Sets the value of [show_deleted][crate::model::ListExecutionsRequest::show_deleted].
1294    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1295        self.show_deleted = v.into();
1296        self
1297    }
1298}
1299
1300impl wkt::message::Message for ListExecutionsRequest {
1301    fn typename() -> &'static str {
1302        "type.googleapis.com/google.cloud.run.v2.ListExecutionsRequest"
1303    }
1304}
1305
1306/// Response message containing a list of Executions.
1307#[serde_with::serde_as]
1308#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1309#[serde(default, rename_all = "camelCase")]
1310#[non_exhaustive]
1311pub struct ListExecutionsResponse {
1312    /// The resulting list of Executions.
1313    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1314    pub executions: std::vec::Vec<crate::model::Execution>,
1315
1316    /// A token indicating there are more items than page_size. Use it in the next
1317    /// ListExecutions request to continue.
1318    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1319    pub next_page_token: std::string::String,
1320
1321    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1322    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1323}
1324
1325impl ListExecutionsResponse {
1326    pub fn new() -> Self {
1327        std::default::Default::default()
1328    }
1329
1330    /// Sets the value of [next_page_token][crate::model::ListExecutionsResponse::next_page_token].
1331    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1332        self.next_page_token = v.into();
1333        self
1334    }
1335
1336    /// Sets the value of [executions][crate::model::ListExecutionsResponse::executions].
1337    pub fn set_executions<T, V>(mut self, v: T) -> Self
1338    where
1339        T: std::iter::IntoIterator<Item = V>,
1340        V: std::convert::Into<crate::model::Execution>,
1341    {
1342        use std::iter::Iterator;
1343        self.executions = v.into_iter().map(|i| i.into()).collect();
1344        self
1345    }
1346}
1347
1348impl wkt::message::Message for ListExecutionsResponse {
1349    fn typename() -> &'static str {
1350        "type.googleapis.com/google.cloud.run.v2.ListExecutionsResponse"
1351    }
1352}
1353
1354#[doc(hidden)]
1355impl gax::paginator::internal::PageableResponse for ListExecutionsResponse {
1356    type PageItem = crate::model::Execution;
1357
1358    fn items(self) -> std::vec::Vec<Self::PageItem> {
1359        self.executions
1360    }
1361
1362    fn next_page_token(&self) -> std::string::String {
1363        use std::clone::Clone;
1364        self.next_page_token.clone()
1365    }
1366}
1367
1368/// Request message for deleting an Execution.
1369#[serde_with::serde_as]
1370#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1371#[serde(default, rename_all = "camelCase")]
1372#[non_exhaustive]
1373pub struct DeleteExecutionRequest {
1374    /// Required. The name of the Execution to delete.
1375    /// Format:
1376    /// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
1377    /// where `{project}` can be project id or number.
1378    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1379    pub name: std::string::String,
1380
1381    /// Indicates that the request should be validated without actually
1382    /// deleting any resources.
1383    pub validate_only: bool,
1384
1385    /// A system-generated fingerprint for this version of the resource.
1386    /// This may be used to detect modification conflict during updates.
1387    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1388    pub etag: std::string::String,
1389
1390    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1391    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1392}
1393
1394impl DeleteExecutionRequest {
1395    pub fn new() -> Self {
1396        std::default::Default::default()
1397    }
1398
1399    /// Sets the value of [name][crate::model::DeleteExecutionRequest::name].
1400    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1401        self.name = v.into();
1402        self
1403    }
1404
1405    /// Sets the value of [validate_only][crate::model::DeleteExecutionRequest::validate_only].
1406    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1407        self.validate_only = v.into();
1408        self
1409    }
1410
1411    /// Sets the value of [etag][crate::model::DeleteExecutionRequest::etag].
1412    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1413        self.etag = v.into();
1414        self
1415    }
1416}
1417
1418impl wkt::message::Message for DeleteExecutionRequest {
1419    fn typename() -> &'static str {
1420        "type.googleapis.com/google.cloud.run.v2.DeleteExecutionRequest"
1421    }
1422}
1423
1424/// Request message for deleting an Execution.
1425#[serde_with::serde_as]
1426#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1427#[serde(default, rename_all = "camelCase")]
1428#[non_exhaustive]
1429pub struct CancelExecutionRequest {
1430    /// Required. The name of the Execution to cancel.
1431    /// Format:
1432    /// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
1433    /// where `{project}` can be project id or number.
1434    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1435    pub name: std::string::String,
1436
1437    /// Indicates that the request should be validated without actually
1438    /// cancelling any resources.
1439    pub validate_only: bool,
1440
1441    /// A system-generated fingerprint for this version of the resource.
1442    /// This may be used to detect modification conflict during updates.
1443    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1444    pub etag: std::string::String,
1445
1446    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1447    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1448}
1449
1450impl CancelExecutionRequest {
1451    pub fn new() -> Self {
1452        std::default::Default::default()
1453    }
1454
1455    /// Sets the value of [name][crate::model::CancelExecutionRequest::name].
1456    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1457        self.name = v.into();
1458        self
1459    }
1460
1461    /// Sets the value of [validate_only][crate::model::CancelExecutionRequest::validate_only].
1462    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1463        self.validate_only = v.into();
1464        self
1465    }
1466
1467    /// Sets the value of [etag][crate::model::CancelExecutionRequest::etag].
1468    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1469        self.etag = v.into();
1470        self
1471    }
1472}
1473
1474impl wkt::message::Message for CancelExecutionRequest {
1475    fn typename() -> &'static str {
1476        "type.googleapis.com/google.cloud.run.v2.CancelExecutionRequest"
1477    }
1478}
1479
1480/// Execution represents the configuration of a single execution. A execution an
1481/// immutable resource that references a container image which is run to
1482/// completion.
1483#[serde_with::serde_as]
1484#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1485#[serde(default, rename_all = "camelCase")]
1486#[non_exhaustive]
1487pub struct Execution {
1488    /// Output only. The unique name of this Execution.
1489    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1490    pub name: std::string::String,
1491
1492    /// Output only. Server assigned unique identifier for the Execution. The value
1493    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
1494    /// deleted.
1495    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1496    pub uid: std::string::String,
1497
1498    /// Output only. Email address of the authenticated creator.
1499    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1500    pub creator: std::string::String,
1501
1502    /// Output only. A number that monotonically increases every time the user
1503    /// modifies the desired state.
1504    #[serde_as(as = "serde_with::DisplayFromStr")]
1505    pub generation: i64,
1506
1507    /// Output only. Unstructured key value map that can be used to organize and
1508    /// categorize objects. User-provided labels are shared with Google's billing
1509    /// system, so they can be used to filter, or break down billing charges by
1510    /// team, component, environment, state, etc. For more information, visit
1511    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
1512    /// <https://cloud.google.com/run/docs/configuring/labels>
1513    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1514    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1515
1516    /// Output only. Unstructured key value map that may
1517    /// be set by external tools to store and arbitrary metadata.
1518    /// They are not queryable and should be preserved
1519    /// when modifying objects.
1520    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1521    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
1522
1523    /// Output only. Represents time when the execution was acknowledged by the
1524    /// execution controller. It is not guaranteed to be set in happens-before
1525    /// order across separate operations.
1526    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1527    pub create_time: std::option::Option<wkt::Timestamp>,
1528
1529    /// Output only. Represents time when the execution started to run.
1530    /// It is not guaranteed to be set in happens-before order across separate
1531    /// operations.
1532    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1533    pub start_time: std::option::Option<wkt::Timestamp>,
1534
1535    /// Output only. Represents time when the execution was completed. It is not
1536    /// guaranteed to be set in happens-before order across separate operations.
1537    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1538    pub completion_time: std::option::Option<wkt::Timestamp>,
1539
1540    /// Output only. The last-modified time.
1541    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1542    pub update_time: std::option::Option<wkt::Timestamp>,
1543
1544    /// Output only. For a deleted resource, the deletion time. It is only
1545    /// populated as a response to a Delete request.
1546    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1547    pub delete_time: std::option::Option<wkt::Timestamp>,
1548
1549    /// Output only. For a deleted resource, the time after which it will be
1550    /// permamently deleted. It is only populated as a response to a Delete
1551    /// request.
1552    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1553    pub expire_time: std::option::Option<wkt::Timestamp>,
1554
1555    /// The least stable launch stage needed to create this resource, as defined by
1556    /// [Google Cloud Platform Launch
1557    /// Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports
1558    /// `ALPHA`, `BETA`, and `GA`.
1559    ///
1560    /// Note that this value might not be what was used
1561    /// as input. For example, if ALPHA was provided as input in the parent
1562    /// resource, but only BETA and GA-level features are were, this field will be
1563    /// BETA.
1564    pub launch_stage: api::model::LaunchStage,
1565
1566    /// Output only. The name of the parent Job.
1567    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1568    pub job: std::string::String,
1569
1570    /// Output only. Specifies the maximum desired number of tasks the execution
1571    /// should run at any given time. Must be <= task_count. The actual number of
1572    /// tasks running in steady state will be less than this number when
1573    /// ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when
1574    /// the work left to do is less than max parallelism.
1575    pub parallelism: i32,
1576
1577    /// Output only. Specifies the desired number of tasks the execution should
1578    /// run. Setting to 1 means that parallelism is limited to 1 and the success of
1579    /// that task signals the success of the execution.
1580    pub task_count: i32,
1581
1582    /// Output only. The template used to create tasks for this execution.
1583    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1584    pub template: std::option::Option<crate::model::TaskTemplate>,
1585
1586    /// Output only. Indicates whether the resource's reconciliation is still in
1587    /// progress. See comments in `Job.reconciling` for additional information on
1588    /// reconciliation process in Cloud Run.
1589    pub reconciling: bool,
1590
1591    /// Output only. The Condition of this Execution, containing its readiness
1592    /// status, and detailed error information in case it did not reach the desired
1593    /// state.
1594    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1595    pub conditions: std::vec::Vec<crate::model::Condition>,
1596
1597    /// Output only. The generation of this Execution. See comments in
1598    /// `reconciling` for additional information on reconciliation process in Cloud
1599    /// Run.
1600    #[serde_as(as = "serde_with::DisplayFromStr")]
1601    pub observed_generation: i64,
1602
1603    /// Output only. The number of actively running tasks.
1604    pub running_count: i32,
1605
1606    /// Output only. The number of tasks which reached phase Succeeded.
1607    pub succeeded_count: i32,
1608
1609    /// Output only. The number of tasks which reached phase Failed.
1610    pub failed_count: i32,
1611
1612    /// Output only. The number of tasks which reached phase Cancelled.
1613    pub cancelled_count: i32,
1614
1615    /// Output only. The number of tasks which have retried at least once.
1616    pub retried_count: i32,
1617
1618    /// Output only. URI where logs for this execution can be found in Cloud
1619    /// Console.
1620    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1621    pub log_uri: std::string::String,
1622
1623    /// Output only. Reserved for future use.
1624    pub satisfies_pzs: bool,
1625
1626    /// Output only. A system-generated fingerprint for this version of the
1627    /// resource. May be used to detect modification conflict during updates.
1628    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1629    pub etag: std::string::String,
1630
1631    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1632    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1633}
1634
1635impl Execution {
1636    pub fn new() -> Self {
1637        std::default::Default::default()
1638    }
1639
1640    /// Sets the value of [name][crate::model::Execution::name].
1641    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1642        self.name = v.into();
1643        self
1644    }
1645
1646    /// Sets the value of [uid][crate::model::Execution::uid].
1647    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648        self.uid = v.into();
1649        self
1650    }
1651
1652    /// Sets the value of [creator][crate::model::Execution::creator].
1653    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1654        self.creator = v.into();
1655        self
1656    }
1657
1658    /// Sets the value of [generation][crate::model::Execution::generation].
1659    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1660        self.generation = v.into();
1661        self
1662    }
1663
1664    /// Sets the value of [create_time][crate::model::Execution::create_time].
1665    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1666        mut self,
1667        v: T,
1668    ) -> Self {
1669        self.create_time = v.into();
1670        self
1671    }
1672
1673    /// Sets the value of [start_time][crate::model::Execution::start_time].
1674    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1675        mut self,
1676        v: T,
1677    ) -> Self {
1678        self.start_time = v.into();
1679        self
1680    }
1681
1682    /// Sets the value of [completion_time][crate::model::Execution::completion_time].
1683    pub fn set_completion_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1684        mut self,
1685        v: T,
1686    ) -> Self {
1687        self.completion_time = v.into();
1688        self
1689    }
1690
1691    /// Sets the value of [update_time][crate::model::Execution::update_time].
1692    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1693        mut self,
1694        v: T,
1695    ) -> Self {
1696        self.update_time = v.into();
1697        self
1698    }
1699
1700    /// Sets the value of [delete_time][crate::model::Execution::delete_time].
1701    pub fn set_delete_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1702        mut self,
1703        v: T,
1704    ) -> Self {
1705        self.delete_time = v.into();
1706        self
1707    }
1708
1709    /// Sets the value of [expire_time][crate::model::Execution::expire_time].
1710    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1711        mut self,
1712        v: T,
1713    ) -> Self {
1714        self.expire_time = v.into();
1715        self
1716    }
1717
1718    /// Sets the value of [launch_stage][crate::model::Execution::launch_stage].
1719    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
1720        mut self,
1721        v: T,
1722    ) -> Self {
1723        self.launch_stage = v.into();
1724        self
1725    }
1726
1727    /// Sets the value of [job][crate::model::Execution::job].
1728    pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1729        self.job = v.into();
1730        self
1731    }
1732
1733    /// Sets the value of [parallelism][crate::model::Execution::parallelism].
1734    pub fn set_parallelism<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1735        self.parallelism = v.into();
1736        self
1737    }
1738
1739    /// Sets the value of [task_count][crate::model::Execution::task_count].
1740    pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1741        self.task_count = v.into();
1742        self
1743    }
1744
1745    /// Sets the value of [template][crate::model::Execution::template].
1746    pub fn set_template<T: std::convert::Into<std::option::Option<crate::model::TaskTemplate>>>(
1747        mut self,
1748        v: T,
1749    ) -> Self {
1750        self.template = v.into();
1751        self
1752    }
1753
1754    /// Sets the value of [reconciling][crate::model::Execution::reconciling].
1755    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1756        self.reconciling = v.into();
1757        self
1758    }
1759
1760    /// Sets the value of [observed_generation][crate::model::Execution::observed_generation].
1761    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1762        self.observed_generation = v.into();
1763        self
1764    }
1765
1766    /// Sets the value of [running_count][crate::model::Execution::running_count].
1767    pub fn set_running_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1768        self.running_count = v.into();
1769        self
1770    }
1771
1772    /// Sets the value of [succeeded_count][crate::model::Execution::succeeded_count].
1773    pub fn set_succeeded_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1774        self.succeeded_count = v.into();
1775        self
1776    }
1777
1778    /// Sets the value of [failed_count][crate::model::Execution::failed_count].
1779    pub fn set_failed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1780        self.failed_count = v.into();
1781        self
1782    }
1783
1784    /// Sets the value of [cancelled_count][crate::model::Execution::cancelled_count].
1785    pub fn set_cancelled_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1786        self.cancelled_count = v.into();
1787        self
1788    }
1789
1790    /// Sets the value of [retried_count][crate::model::Execution::retried_count].
1791    pub fn set_retried_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1792        self.retried_count = v.into();
1793        self
1794    }
1795
1796    /// Sets the value of [log_uri][crate::model::Execution::log_uri].
1797    pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1798        self.log_uri = v.into();
1799        self
1800    }
1801
1802    /// Sets the value of [satisfies_pzs][crate::model::Execution::satisfies_pzs].
1803    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1804        self.satisfies_pzs = v.into();
1805        self
1806    }
1807
1808    /// Sets the value of [etag][crate::model::Execution::etag].
1809    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1810        self.etag = v.into();
1811        self
1812    }
1813
1814    /// Sets the value of [conditions][crate::model::Execution::conditions].
1815    pub fn set_conditions<T, V>(mut self, v: T) -> Self
1816    where
1817        T: std::iter::IntoIterator<Item = V>,
1818        V: std::convert::Into<crate::model::Condition>,
1819    {
1820        use std::iter::Iterator;
1821        self.conditions = v.into_iter().map(|i| i.into()).collect();
1822        self
1823    }
1824
1825    /// Sets the value of [labels][crate::model::Execution::labels].
1826    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1827    where
1828        T: std::iter::IntoIterator<Item = (K, V)>,
1829        K: std::convert::Into<std::string::String>,
1830        V: std::convert::Into<std::string::String>,
1831    {
1832        use std::iter::Iterator;
1833        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1834        self
1835    }
1836
1837    /// Sets the value of [annotations][crate::model::Execution::annotations].
1838    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1839    where
1840        T: std::iter::IntoIterator<Item = (K, V)>,
1841        K: std::convert::Into<std::string::String>,
1842        V: std::convert::Into<std::string::String>,
1843    {
1844        use std::iter::Iterator;
1845        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1846        self
1847    }
1848}
1849
1850impl wkt::message::Message for Execution {
1851    fn typename() -> &'static str {
1852        "type.googleapis.com/google.cloud.run.v2.Execution"
1853    }
1854}
1855
1856/// ExecutionTemplate describes the data an execution should have when created
1857/// from a template.
1858#[serde_with::serde_as]
1859#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1860#[serde(default, rename_all = "camelCase")]
1861#[non_exhaustive]
1862pub struct ExecutionTemplate {
1863    /// Unstructured key value map that can be used to organize and categorize
1864    /// objects.
1865    /// User-provided labels are shared with Google's billing system, so they can
1866    /// be used to filter, or break down billing charges by team, component,
1867    /// environment, state, etc. For more information, visit
1868    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
1869    /// <https://cloud.google.com/run/docs/configuring/labels>.
1870    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1871    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1872
1873    /// Unstructured key value map that may be set by external tools to store and
1874    /// arbitrary metadata. They are not queryable and should be preserved
1875    /// when modifying objects.
1876    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1877    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
1878
1879    /// Specifies the maximum desired number of tasks the execution should run at
1880    /// given time. Must be <= task_count.
1881    /// When the job is run, if this field is 0 or unset, the maximum possible
1882    /// value will be used for that execution.
1883    /// The actual number of tasks running in steady state will be less than this
1884    /// number when there are fewer tasks waiting to be completed remaining,
1885    /// i.e. when the work left to do is less than max parallelism.
1886    pub parallelism: i32,
1887
1888    /// Specifies the desired number of tasks the execution should run.
1889    /// Setting to 1 means that parallelism is limited to 1 and the success of
1890    /// that task signals the success of the execution. Defaults to 1.
1891    pub task_count: i32,
1892
1893    /// Required. Describes the task(s) that will be created when executing an
1894    /// execution.
1895    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1896    pub template: std::option::Option<crate::model::TaskTemplate>,
1897
1898    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1899    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1900}
1901
1902impl ExecutionTemplate {
1903    pub fn new() -> Self {
1904        std::default::Default::default()
1905    }
1906
1907    /// Sets the value of [parallelism][crate::model::ExecutionTemplate::parallelism].
1908    pub fn set_parallelism<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1909        self.parallelism = v.into();
1910        self
1911    }
1912
1913    /// Sets the value of [task_count][crate::model::ExecutionTemplate::task_count].
1914    pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1915        self.task_count = v.into();
1916        self
1917    }
1918
1919    /// Sets the value of [template][crate::model::ExecutionTemplate::template].
1920    pub fn set_template<T: std::convert::Into<std::option::Option<crate::model::TaskTemplate>>>(
1921        mut self,
1922        v: T,
1923    ) -> Self {
1924        self.template = v.into();
1925        self
1926    }
1927
1928    /// Sets the value of [labels][crate::model::ExecutionTemplate::labels].
1929    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1930    where
1931        T: std::iter::IntoIterator<Item = (K, V)>,
1932        K: std::convert::Into<std::string::String>,
1933        V: std::convert::Into<std::string::String>,
1934    {
1935        use std::iter::Iterator;
1936        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1937        self
1938    }
1939
1940    /// Sets the value of [annotations][crate::model::ExecutionTemplate::annotations].
1941    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1942    where
1943        T: std::iter::IntoIterator<Item = (K, V)>,
1944        K: std::convert::Into<std::string::String>,
1945        V: std::convert::Into<std::string::String>,
1946    {
1947        use std::iter::Iterator;
1948        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1949        self
1950    }
1951}
1952
1953impl wkt::message::Message for ExecutionTemplate {
1954    fn typename() -> &'static str {
1955        "type.googleapis.com/google.cloud.run.v2.ExecutionTemplate"
1956    }
1957}
1958
1959/// Request message for creating a Job.
1960#[serde_with::serde_as]
1961#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1962#[serde(default, rename_all = "camelCase")]
1963#[non_exhaustive]
1964pub struct CreateJobRequest {
1965    /// Required. The location and project in which this Job should be created.
1966    /// Format: projects/{project}/locations/{location}, where {project} can be
1967    /// project id or number.
1968    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1969    pub parent: std::string::String,
1970
1971    /// Required. The Job instance to create.
1972    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1973    pub job: std::option::Option<crate::model::Job>,
1974
1975    /// Required. The unique identifier for the Job. The name of the job becomes
1976    /// {parent}/jobs/{job_id}.
1977    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1978    pub job_id: std::string::String,
1979
1980    /// Indicates that the request should be validated and default values
1981    /// populated, without persisting the request or creating any resources.
1982    pub validate_only: bool,
1983
1984    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1985    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1986}
1987
1988impl CreateJobRequest {
1989    pub fn new() -> Self {
1990        std::default::Default::default()
1991    }
1992
1993    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
1994    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1995        self.parent = v.into();
1996        self
1997    }
1998
1999    /// Sets the value of [job][crate::model::CreateJobRequest::job].
2000    pub fn set_job<T: std::convert::Into<std::option::Option<crate::model::Job>>>(
2001        mut self,
2002        v: T,
2003    ) -> Self {
2004        self.job = v.into();
2005        self
2006    }
2007
2008    /// Sets the value of [job_id][crate::model::CreateJobRequest::job_id].
2009    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2010        self.job_id = v.into();
2011        self
2012    }
2013
2014    /// Sets the value of [validate_only][crate::model::CreateJobRequest::validate_only].
2015    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2016        self.validate_only = v.into();
2017        self
2018    }
2019}
2020
2021impl wkt::message::Message for CreateJobRequest {
2022    fn typename() -> &'static str {
2023        "type.googleapis.com/google.cloud.run.v2.CreateJobRequest"
2024    }
2025}
2026
2027/// Request message for obtaining a Job by its full name.
2028#[serde_with::serde_as]
2029#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2030#[serde(default, rename_all = "camelCase")]
2031#[non_exhaustive]
2032pub struct GetJobRequest {
2033    /// Required. The full name of the Job.
2034    /// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
2035    /// can be project id or number.
2036    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2037    pub name: std::string::String,
2038
2039    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2040    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2041}
2042
2043impl GetJobRequest {
2044    pub fn new() -> Self {
2045        std::default::Default::default()
2046    }
2047
2048    /// Sets the value of [name][crate::model::GetJobRequest::name].
2049    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2050        self.name = v.into();
2051        self
2052    }
2053}
2054
2055impl wkt::message::Message for GetJobRequest {
2056    fn typename() -> &'static str {
2057        "type.googleapis.com/google.cloud.run.v2.GetJobRequest"
2058    }
2059}
2060
2061/// Request message for updating a Job.
2062#[serde_with::serde_as]
2063#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2064#[serde(default, rename_all = "camelCase")]
2065#[non_exhaustive]
2066pub struct UpdateJobRequest {
2067    /// Required. The Job to be updated.
2068    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2069    pub job: std::option::Option<crate::model::Job>,
2070
2071    /// Indicates that the request should be validated and default values
2072    /// populated, without persisting the request or updating any resources.
2073    pub validate_only: bool,
2074
2075    /// Optional. If set to true, and if the Job does not exist, it will create a
2076    /// new one. Caller must have both create and update permissions for this call
2077    /// if this is set to true.
2078    pub allow_missing: bool,
2079
2080    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2081    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2082}
2083
2084impl UpdateJobRequest {
2085    pub fn new() -> Self {
2086        std::default::Default::default()
2087    }
2088
2089    /// Sets the value of [job][crate::model::UpdateJobRequest::job].
2090    pub fn set_job<T: std::convert::Into<std::option::Option<crate::model::Job>>>(
2091        mut self,
2092        v: T,
2093    ) -> Self {
2094        self.job = v.into();
2095        self
2096    }
2097
2098    /// Sets the value of [validate_only][crate::model::UpdateJobRequest::validate_only].
2099    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2100        self.validate_only = v.into();
2101        self
2102    }
2103
2104    /// Sets the value of [allow_missing][crate::model::UpdateJobRequest::allow_missing].
2105    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2106        self.allow_missing = v.into();
2107        self
2108    }
2109}
2110
2111impl wkt::message::Message for UpdateJobRequest {
2112    fn typename() -> &'static str {
2113        "type.googleapis.com/google.cloud.run.v2.UpdateJobRequest"
2114    }
2115}
2116
2117/// Request message for retrieving a list of Jobs.
2118#[serde_with::serde_as]
2119#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2120#[serde(default, rename_all = "camelCase")]
2121#[non_exhaustive]
2122pub struct ListJobsRequest {
2123    /// Required. The location and project to list resources on.
2124    /// Format: projects/{project}/locations/{location}, where {project} can be
2125    /// project id or number.
2126    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2127    pub parent: std::string::String,
2128
2129    /// Maximum number of Jobs to return in this call.
2130    pub page_size: i32,
2131
2132    /// A page token received from a previous call to ListJobs.
2133    /// All other parameters must match.
2134    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2135    pub page_token: std::string::String,
2136
2137    /// If true, returns deleted (but unexpired) resources along with active ones.
2138    pub show_deleted: bool,
2139
2140    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2141    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2142}
2143
2144impl ListJobsRequest {
2145    pub fn new() -> Self {
2146        std::default::Default::default()
2147    }
2148
2149    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
2150    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2151        self.parent = v.into();
2152        self
2153    }
2154
2155    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
2156    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2157        self.page_size = v.into();
2158        self
2159    }
2160
2161    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
2162    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2163        self.page_token = v.into();
2164        self
2165    }
2166
2167    /// Sets the value of [show_deleted][crate::model::ListJobsRequest::show_deleted].
2168    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2169        self.show_deleted = v.into();
2170        self
2171    }
2172}
2173
2174impl wkt::message::Message for ListJobsRequest {
2175    fn typename() -> &'static str {
2176        "type.googleapis.com/google.cloud.run.v2.ListJobsRequest"
2177    }
2178}
2179
2180/// Response message containing a list of Jobs.
2181#[serde_with::serde_as]
2182#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2183#[serde(default, rename_all = "camelCase")]
2184#[non_exhaustive]
2185pub struct ListJobsResponse {
2186    /// The resulting list of Jobs.
2187    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2188    pub jobs: std::vec::Vec<crate::model::Job>,
2189
2190    /// A token indicating there are more items than page_size. Use it in the next
2191    /// ListJobs request to continue.
2192    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2193    pub next_page_token: std::string::String,
2194
2195    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2196    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2197}
2198
2199impl ListJobsResponse {
2200    pub fn new() -> Self {
2201        std::default::Default::default()
2202    }
2203
2204    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
2205    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2206        self.next_page_token = v.into();
2207        self
2208    }
2209
2210    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
2211    pub fn set_jobs<T, V>(mut self, v: T) -> Self
2212    where
2213        T: std::iter::IntoIterator<Item = V>,
2214        V: std::convert::Into<crate::model::Job>,
2215    {
2216        use std::iter::Iterator;
2217        self.jobs = v.into_iter().map(|i| i.into()).collect();
2218        self
2219    }
2220}
2221
2222impl wkt::message::Message for ListJobsResponse {
2223    fn typename() -> &'static str {
2224        "type.googleapis.com/google.cloud.run.v2.ListJobsResponse"
2225    }
2226}
2227
2228#[doc(hidden)]
2229impl gax::paginator::internal::PageableResponse for ListJobsResponse {
2230    type PageItem = crate::model::Job;
2231
2232    fn items(self) -> std::vec::Vec<Self::PageItem> {
2233        self.jobs
2234    }
2235
2236    fn next_page_token(&self) -> std::string::String {
2237        use std::clone::Clone;
2238        self.next_page_token.clone()
2239    }
2240}
2241
2242/// Request message to delete a Job by its full name.
2243#[serde_with::serde_as]
2244#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2245#[serde(default, rename_all = "camelCase")]
2246#[non_exhaustive]
2247pub struct DeleteJobRequest {
2248    /// Required. The full name of the Job.
2249    /// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
2250    /// can be project id or number.
2251    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2252    pub name: std::string::String,
2253
2254    /// Indicates that the request should be validated without actually
2255    /// deleting any resources.
2256    pub validate_only: bool,
2257
2258    /// A system-generated fingerprint for this version of the
2259    /// resource. May be used to detect modification conflict during updates.
2260    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2261    pub etag: std::string::String,
2262
2263    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2264    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2265}
2266
2267impl DeleteJobRequest {
2268    pub fn new() -> Self {
2269        std::default::Default::default()
2270    }
2271
2272    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
2273    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2274        self.name = v.into();
2275        self
2276    }
2277
2278    /// Sets the value of [validate_only][crate::model::DeleteJobRequest::validate_only].
2279    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2280        self.validate_only = v.into();
2281        self
2282    }
2283
2284    /// Sets the value of [etag][crate::model::DeleteJobRequest::etag].
2285    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2286        self.etag = v.into();
2287        self
2288    }
2289}
2290
2291impl wkt::message::Message for DeleteJobRequest {
2292    fn typename() -> &'static str {
2293        "type.googleapis.com/google.cloud.run.v2.DeleteJobRequest"
2294    }
2295}
2296
2297/// Request message to create a new Execution of a Job.
2298#[serde_with::serde_as]
2299#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2300#[serde(default, rename_all = "camelCase")]
2301#[non_exhaustive]
2302pub struct RunJobRequest {
2303    /// Required. The full name of the Job.
2304    /// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
2305    /// can be project id or number.
2306    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2307    pub name: std::string::String,
2308
2309    /// Indicates that the request should be validated without actually
2310    /// deleting any resources.
2311    pub validate_only: bool,
2312
2313    /// A system-generated fingerprint for this version of the
2314    /// resource. May be used to detect modification conflict during updates.
2315    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2316    pub etag: std::string::String,
2317
2318    /// Overrides specification for a given execution of a job. If provided,
2319    /// overrides will be applied to update the execution or task spec.
2320    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2321    pub overrides: std::option::Option<crate::model::run_job_request::Overrides>,
2322
2323    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2324    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2325}
2326
2327impl RunJobRequest {
2328    pub fn new() -> Self {
2329        std::default::Default::default()
2330    }
2331
2332    /// Sets the value of [name][crate::model::RunJobRequest::name].
2333    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2334        self.name = v.into();
2335        self
2336    }
2337
2338    /// Sets the value of [validate_only][crate::model::RunJobRequest::validate_only].
2339    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2340        self.validate_only = v.into();
2341        self
2342    }
2343
2344    /// Sets the value of [etag][crate::model::RunJobRequest::etag].
2345    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2346        self.etag = v.into();
2347        self
2348    }
2349
2350    /// Sets the value of [overrides][crate::model::RunJobRequest::overrides].
2351    pub fn set_overrides<
2352        T: std::convert::Into<std::option::Option<crate::model::run_job_request::Overrides>>,
2353    >(
2354        mut self,
2355        v: T,
2356    ) -> Self {
2357        self.overrides = v.into();
2358        self
2359    }
2360}
2361
2362impl wkt::message::Message for RunJobRequest {
2363    fn typename() -> &'static str {
2364        "type.googleapis.com/google.cloud.run.v2.RunJobRequest"
2365    }
2366}
2367
2368/// Defines additional types related to [RunJobRequest].
2369pub mod run_job_request {
2370    #[allow(unused_imports)]
2371    use super::*;
2372
2373    /// RunJob Overrides that contains Execution fields to be overridden.
2374    #[serde_with::serde_as]
2375    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2376    #[serde(default, rename_all = "camelCase")]
2377    #[non_exhaustive]
2378    pub struct Overrides {
2379        /// Per container override specification.
2380        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2381        pub container_overrides:
2382            std::vec::Vec<crate::model::run_job_request::overrides::ContainerOverride>,
2383
2384        /// Optional. The desired number of tasks the execution should run. Will
2385        /// replace existing task_count value.
2386        pub task_count: i32,
2387
2388        /// Duration in seconds the task may be active before the system will
2389        /// actively try to mark it failed and kill associated containers. Will
2390        /// replace existing timeout_seconds value.
2391        #[serde(skip_serializing_if = "std::option::Option::is_none")]
2392        pub timeout: std::option::Option<wkt::Duration>,
2393
2394        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2395        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2396    }
2397
2398    impl Overrides {
2399        pub fn new() -> Self {
2400            std::default::Default::default()
2401        }
2402
2403        /// Sets the value of [task_count][crate::model::run_job_request::Overrides::task_count].
2404        pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2405            self.task_count = v.into();
2406            self
2407        }
2408
2409        /// Sets the value of [timeout][crate::model::run_job_request::Overrides::timeout].
2410        pub fn set_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
2411            mut self,
2412            v: T,
2413        ) -> Self {
2414            self.timeout = v.into();
2415            self
2416        }
2417
2418        /// Sets the value of [container_overrides][crate::model::run_job_request::Overrides::container_overrides].
2419        pub fn set_container_overrides<T, V>(mut self, v: T) -> Self
2420        where
2421            T: std::iter::IntoIterator<Item = V>,
2422            V: std::convert::Into<crate::model::run_job_request::overrides::ContainerOverride>,
2423        {
2424            use std::iter::Iterator;
2425            self.container_overrides = v.into_iter().map(|i| i.into()).collect();
2426            self
2427        }
2428    }
2429
2430    impl wkt::message::Message for Overrides {
2431        fn typename() -> &'static str {
2432            "type.googleapis.com/google.cloud.run.v2.RunJobRequest.Overrides"
2433        }
2434    }
2435
2436    /// Defines additional types related to [Overrides].
2437    pub mod overrides {
2438        #[allow(unused_imports)]
2439        use super::*;
2440
2441        /// Per-container override specification.
2442        #[serde_with::serde_as]
2443        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2444        #[serde(default, rename_all = "camelCase")]
2445        #[non_exhaustive]
2446        pub struct ContainerOverride {
2447            /// The name of the container specified as a DNS_LABEL.
2448            #[serde(skip_serializing_if = "std::string::String::is_empty")]
2449            pub name: std::string::String,
2450
2451            /// Optional. Arguments to the entrypoint. Will replace existing args for
2452            /// override.
2453            #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2454            pub args: std::vec::Vec<std::string::String>,
2455
2456            /// List of environment variables to set in the container. Will be merged
2457            /// with existing env for override.
2458            #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2459            pub env: std::vec::Vec<crate::model::EnvVar>,
2460
2461            /// Optional. True if the intention is to clear out existing args list.
2462            pub clear_args: bool,
2463
2464            #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2465            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2466        }
2467
2468        impl ContainerOverride {
2469            pub fn new() -> Self {
2470                std::default::Default::default()
2471            }
2472
2473            /// Sets the value of [name][crate::model::run_job_request::overrides::ContainerOverride::name].
2474            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2475                self.name = v.into();
2476                self
2477            }
2478
2479            /// Sets the value of [clear_args][crate::model::run_job_request::overrides::ContainerOverride::clear_args].
2480            pub fn set_clear_args<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2481                self.clear_args = v.into();
2482                self
2483            }
2484
2485            /// Sets the value of [args][crate::model::run_job_request::overrides::ContainerOverride::args].
2486            pub fn set_args<T, V>(mut self, v: T) -> Self
2487            where
2488                T: std::iter::IntoIterator<Item = V>,
2489                V: std::convert::Into<std::string::String>,
2490            {
2491                use std::iter::Iterator;
2492                self.args = v.into_iter().map(|i| i.into()).collect();
2493                self
2494            }
2495
2496            /// Sets the value of [env][crate::model::run_job_request::overrides::ContainerOverride::env].
2497            pub fn set_env<T, V>(mut self, v: T) -> Self
2498            where
2499                T: std::iter::IntoIterator<Item = V>,
2500                V: std::convert::Into<crate::model::EnvVar>,
2501            {
2502                use std::iter::Iterator;
2503                self.env = v.into_iter().map(|i| i.into()).collect();
2504                self
2505            }
2506        }
2507
2508        impl wkt::message::Message for ContainerOverride {
2509            fn typename() -> &'static str {
2510                "type.googleapis.com/google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride"
2511            }
2512        }
2513    }
2514}
2515
2516/// Job represents the configuration of a single job, which references a
2517/// container image that is run to completion.
2518#[serde_with::serde_as]
2519#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2520#[serde(default, rename_all = "camelCase")]
2521#[non_exhaustive]
2522pub struct Job {
2523    /// The fully qualified name of this Job.
2524    ///
2525    /// Format:
2526    /// projects/{project}/locations/{location}/jobs/{job}
2527    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2528    pub name: std::string::String,
2529
2530    /// Output only. Server assigned unique identifier for the Execution. The value
2531    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
2532    /// deleted.
2533    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2534    pub uid: std::string::String,
2535
2536    /// Output only. A number that monotonically increases every time the user
2537    /// modifies the desired state.
2538    #[serde_as(as = "serde_with::DisplayFromStr")]
2539    pub generation: i64,
2540
2541    /// Unstructured key value map that can be used to organize and categorize
2542    /// objects.
2543    /// User-provided labels are shared with Google's billing system, so they can
2544    /// be used to filter, or break down billing charges by team, component,
2545    /// environment, state, etc. For more information, visit
2546    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
2547    /// <https://cloud.google.com/run/docs/configuring/labels>.
2548    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2549    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2550
2551    /// Unstructured key value map that may
2552    /// be set by external tools to store and arbitrary metadata.
2553    /// They are not queryable and should be preserved
2554    /// when modifying objects.
2555    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2556    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
2557
2558    /// Output only. The creation time.
2559    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2560    pub create_time: std::option::Option<wkt::Timestamp>,
2561
2562    /// Output only. The last-modified time.
2563    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2564    pub update_time: std::option::Option<wkt::Timestamp>,
2565
2566    /// Output only. The deletion time. It is only populated as a response to a
2567    /// Delete request.
2568    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2569    pub delete_time: std::option::Option<wkt::Timestamp>,
2570
2571    /// Output only. For a deleted resource, the time after which it will be
2572    /// permamently deleted.
2573    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2574    pub expire_time: std::option::Option<wkt::Timestamp>,
2575
2576    /// Output only. Email address of the authenticated creator.
2577    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2578    pub creator: std::string::String,
2579
2580    /// Output only. Email address of the last authenticated modifier.
2581    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2582    pub last_modifier: std::string::String,
2583
2584    /// Arbitrary identifier for the API client.
2585    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2586    pub client: std::string::String,
2587
2588    /// Arbitrary version identifier for the API client.
2589    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2590    pub client_version: std::string::String,
2591
2592    /// The launch stage as defined by [Google Cloud Platform
2593    /// Launch Stages](https://cloud.google.com/terms/launch-stages).
2594    /// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
2595    /// is assumed.
2596    /// Set the launch stage to a preview stage on input to allow use of preview
2597    /// features in that stage. On read (or output), describes whether the resource
2598    /// uses preview features.
2599    ///
2600    /// For example, if ALPHA is provided as input, but only BETA and GA-level
2601    /// features are used, this field will be BETA on output.
2602    pub launch_stage: api::model::LaunchStage,
2603
2604    /// Settings for the Binary Authorization feature.
2605    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2606    pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
2607
2608    /// Required. The template used to create executions for this Job.
2609    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2610    pub template: std::option::Option<crate::model::ExecutionTemplate>,
2611
2612    /// Output only. The generation of this Job. See comments in `reconciling` for
2613    /// additional information on reconciliation process in Cloud Run.
2614    #[serde_as(as = "serde_with::DisplayFromStr")]
2615    pub observed_generation: i64,
2616
2617    /// Output only. The Condition of this Job, containing its readiness status,
2618    /// and detailed error information in case it did not reach the desired state.
2619    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2620    pub terminal_condition: std::option::Option<crate::model::Condition>,
2621
2622    /// Output only. The Conditions of all other associated sub-resources. They
2623    /// contain additional diagnostics information in case the Job does not reach
2624    /// its desired state. See comments in `reconciling` for additional information
2625    /// on reconciliation process in Cloud Run.
2626    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2627    pub conditions: std::vec::Vec<crate::model::Condition>,
2628
2629    /// Output only. Number of executions created for this job.
2630    pub execution_count: i32,
2631
2632    /// Output only. Name of the last created execution.
2633    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2634    pub latest_created_execution: std::option::Option<crate::model::ExecutionReference>,
2635
2636    /// Output only. Returns true if the Job is currently being acted upon by the
2637    /// system to bring it into the desired state.
2638    ///
2639    /// When a new Job is created, or an existing one is updated, Cloud Run
2640    /// will asynchronously perform all necessary steps to bring the Job to the
2641    /// desired state. This process is called reconciliation.
2642    /// While reconciliation is in process, `observed_generation` and
2643    /// `latest_succeeded_execution`, will have transient values that might
2644    /// mismatch the intended state: Once reconciliation is over (and this field is
2645    /// false), there are two possible outcomes: reconciliation succeeded and the
2646    /// state matches the Job, or there was an error,  and reconciliation failed.
2647    /// This state can be found in `terminal_condition.state`.
2648    ///
2649    /// If reconciliation succeeded, the following fields will match:
2650    /// `observed_generation` and `generation`, `latest_succeeded_execution` and
2651    /// `latest_created_execution`.
2652    ///
2653    /// If reconciliation failed, `observed_generation` and
2654    /// `latest_succeeded_execution` will have the state of the last succeeded
2655    /// execution or empty for newly created Job. Additional information on the
2656    /// failure can be found in `terminal_condition` and `conditions`.
2657    pub reconciling: bool,
2658
2659    /// Output only. Reserved for future use.
2660    pub satisfies_pzs: bool,
2661
2662    /// Output only. A system-generated fingerprint for this version of the
2663    /// resource. May be used to detect modification conflict during updates.
2664    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2665    pub etag: std::string::String,
2666
2667    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2668    pub create_execution: std::option::Option<crate::model::job::CreateExecution>,
2669
2670    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2671    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2672}
2673
2674impl Job {
2675    pub fn new() -> Self {
2676        std::default::Default::default()
2677    }
2678
2679    /// Sets the value of [name][crate::model::Job::name].
2680    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2681        self.name = v.into();
2682        self
2683    }
2684
2685    /// Sets the value of [uid][crate::model::Job::uid].
2686    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2687        self.uid = v.into();
2688        self
2689    }
2690
2691    /// Sets the value of [generation][crate::model::Job::generation].
2692    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2693        self.generation = v.into();
2694        self
2695    }
2696
2697    /// Sets the value of [create_time][crate::model::Job::create_time].
2698    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2699        mut self,
2700        v: T,
2701    ) -> Self {
2702        self.create_time = v.into();
2703        self
2704    }
2705
2706    /// Sets the value of [update_time][crate::model::Job::update_time].
2707    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2708        mut self,
2709        v: T,
2710    ) -> Self {
2711        self.update_time = v.into();
2712        self
2713    }
2714
2715    /// Sets the value of [delete_time][crate::model::Job::delete_time].
2716    pub fn set_delete_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2717        mut self,
2718        v: T,
2719    ) -> Self {
2720        self.delete_time = v.into();
2721        self
2722    }
2723
2724    /// Sets the value of [expire_time][crate::model::Job::expire_time].
2725    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2726        mut self,
2727        v: T,
2728    ) -> Self {
2729        self.expire_time = v.into();
2730        self
2731    }
2732
2733    /// Sets the value of [creator][crate::model::Job::creator].
2734    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2735        self.creator = v.into();
2736        self
2737    }
2738
2739    /// Sets the value of [last_modifier][crate::model::Job::last_modifier].
2740    pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2741        self.last_modifier = v.into();
2742        self
2743    }
2744
2745    /// Sets the value of [client][crate::model::Job::client].
2746    pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2747        self.client = v.into();
2748        self
2749    }
2750
2751    /// Sets the value of [client_version][crate::model::Job::client_version].
2752    pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2753        self.client_version = v.into();
2754        self
2755    }
2756
2757    /// Sets the value of [launch_stage][crate::model::Job::launch_stage].
2758    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
2759        mut self,
2760        v: T,
2761    ) -> Self {
2762        self.launch_stage = v.into();
2763        self
2764    }
2765
2766    /// Sets the value of [binary_authorization][crate::model::Job::binary_authorization].
2767    pub fn set_binary_authorization<
2768        T: std::convert::Into<std::option::Option<crate::model::BinaryAuthorization>>,
2769    >(
2770        mut self,
2771        v: T,
2772    ) -> Self {
2773        self.binary_authorization = v.into();
2774        self
2775    }
2776
2777    /// Sets the value of [template][crate::model::Job::template].
2778    pub fn set_template<
2779        T: std::convert::Into<std::option::Option<crate::model::ExecutionTemplate>>,
2780    >(
2781        mut self,
2782        v: T,
2783    ) -> Self {
2784        self.template = v.into();
2785        self
2786    }
2787
2788    /// Sets the value of [observed_generation][crate::model::Job::observed_generation].
2789    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2790        self.observed_generation = v.into();
2791        self
2792    }
2793
2794    /// Sets the value of [terminal_condition][crate::model::Job::terminal_condition].
2795    pub fn set_terminal_condition<
2796        T: std::convert::Into<std::option::Option<crate::model::Condition>>,
2797    >(
2798        mut self,
2799        v: T,
2800    ) -> Self {
2801        self.terminal_condition = v.into();
2802        self
2803    }
2804
2805    /// Sets the value of [execution_count][crate::model::Job::execution_count].
2806    pub fn set_execution_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2807        self.execution_count = v.into();
2808        self
2809    }
2810
2811    /// Sets the value of [latest_created_execution][crate::model::Job::latest_created_execution].
2812    pub fn set_latest_created_execution<
2813        T: std::convert::Into<std::option::Option<crate::model::ExecutionReference>>,
2814    >(
2815        mut self,
2816        v: T,
2817    ) -> Self {
2818        self.latest_created_execution = v.into();
2819        self
2820    }
2821
2822    /// Sets the value of [reconciling][crate::model::Job::reconciling].
2823    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2824        self.reconciling = v.into();
2825        self
2826    }
2827
2828    /// Sets the value of [satisfies_pzs][crate::model::Job::satisfies_pzs].
2829    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2830        self.satisfies_pzs = v.into();
2831        self
2832    }
2833
2834    /// Sets the value of [etag][crate::model::Job::etag].
2835    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2836        self.etag = v.into();
2837        self
2838    }
2839
2840    /// Sets the value of [conditions][crate::model::Job::conditions].
2841    pub fn set_conditions<T, V>(mut self, v: T) -> Self
2842    where
2843        T: std::iter::IntoIterator<Item = V>,
2844        V: std::convert::Into<crate::model::Condition>,
2845    {
2846        use std::iter::Iterator;
2847        self.conditions = v.into_iter().map(|i| i.into()).collect();
2848        self
2849    }
2850
2851    /// Sets the value of [labels][crate::model::Job::labels].
2852    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2853    where
2854        T: std::iter::IntoIterator<Item = (K, V)>,
2855        K: std::convert::Into<std::string::String>,
2856        V: std::convert::Into<std::string::String>,
2857    {
2858        use std::iter::Iterator;
2859        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2860        self
2861    }
2862
2863    /// Sets the value of [annotations][crate::model::Job::annotations].
2864    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
2865    where
2866        T: std::iter::IntoIterator<Item = (K, V)>,
2867        K: std::convert::Into<std::string::String>,
2868        V: std::convert::Into<std::string::String>,
2869    {
2870        use std::iter::Iterator;
2871        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2872        self
2873    }
2874
2875    /// Sets the value of [create_execution][crate::model::Job::create_execution].
2876    ///
2877    /// Note that all the setters affecting `create_execution` are mutually
2878    /// exclusive.
2879    pub fn set_create_execution<
2880        T: std::convert::Into<std::option::Option<crate::model::job::CreateExecution>>,
2881    >(
2882        mut self,
2883        v: T,
2884    ) -> Self {
2885        self.create_execution = v.into();
2886        self
2887    }
2888
2889    /// The value of [create_execution][crate::model::Job::create_execution]
2890    /// if it holds a `StartExecutionToken`, `None` if the field is not set or
2891    /// holds a different branch.
2892    pub fn start_execution_token(&self) -> std::option::Option<&std::string::String> {
2893        #[allow(unreachable_patterns)]
2894        self.create_execution.as_ref().and_then(|v| match v {
2895            crate::model::job::CreateExecution::StartExecutionToken(v) => {
2896                std::option::Option::Some(v)
2897            }
2898            _ => std::option::Option::None,
2899        })
2900    }
2901
2902    /// The value of [create_execution][crate::model::Job::create_execution]
2903    /// if it holds a `RunExecutionToken`, `None` if the field is not set or
2904    /// holds a different branch.
2905    pub fn run_execution_token(&self) -> std::option::Option<&std::string::String> {
2906        #[allow(unreachable_patterns)]
2907        self.create_execution.as_ref().and_then(|v| match v {
2908            crate::model::job::CreateExecution::RunExecutionToken(v) => {
2909                std::option::Option::Some(v)
2910            }
2911            _ => std::option::Option::None,
2912        })
2913    }
2914
2915    /// Sets the value of [create_execution][crate::model::Job::create_execution]
2916    /// to hold a `StartExecutionToken`.
2917    ///
2918    /// Note that all the setters affecting `create_execution` are
2919    /// mutually exclusive.
2920    pub fn set_start_execution_token<T: std::convert::Into<std::string::String>>(
2921        mut self,
2922        v: T,
2923    ) -> Self {
2924        self.create_execution = std::option::Option::Some(
2925            crate::model::job::CreateExecution::StartExecutionToken(v.into()),
2926        );
2927        self
2928    }
2929
2930    /// Sets the value of [create_execution][crate::model::Job::create_execution]
2931    /// to hold a `RunExecutionToken`.
2932    ///
2933    /// Note that all the setters affecting `create_execution` are
2934    /// mutually exclusive.
2935    pub fn set_run_execution_token<T: std::convert::Into<std::string::String>>(
2936        mut self,
2937        v: T,
2938    ) -> Self {
2939        self.create_execution = std::option::Option::Some(
2940            crate::model::job::CreateExecution::RunExecutionToken(v.into()),
2941        );
2942        self
2943    }
2944}
2945
2946impl wkt::message::Message for Job {
2947    fn typename() -> &'static str {
2948        "type.googleapis.com/google.cloud.run.v2.Job"
2949    }
2950}
2951
2952/// Defines additional types related to [Job].
2953pub mod job {
2954    #[allow(unused_imports)]
2955    use super::*;
2956
2957    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2958    #[serde(rename_all = "camelCase")]
2959    #[non_exhaustive]
2960    pub enum CreateExecution {
2961        /// A unique string used as a suffix creating a new execution. The Job will
2962        /// become ready when the execution is successfully started.
2963        /// The sum of job name and token length must be fewer than 63 characters.
2964        StartExecutionToken(std::string::String),
2965        /// A unique string used as a suffix for creating a new execution. The Job
2966        /// will become ready when the execution is successfully completed.
2967        /// The sum of job name and token length must be fewer than 63 characters.
2968        RunExecutionToken(std::string::String),
2969    }
2970}
2971
2972/// Reference to an Execution. Use /Executions.GetExecution with the given name
2973/// to get full execution including the latest status.
2974#[serde_with::serde_as]
2975#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2976#[serde(default, rename_all = "camelCase")]
2977#[non_exhaustive]
2978pub struct ExecutionReference {
2979    /// Name of the execution.
2980    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2981    pub name: std::string::String,
2982
2983    /// Creation timestamp of the execution.
2984    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2985    pub create_time: std::option::Option<wkt::Timestamp>,
2986
2987    /// Creation timestamp of the execution.
2988    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2989    pub completion_time: std::option::Option<wkt::Timestamp>,
2990
2991    /// The deletion time of the execution. It is only
2992    /// populated as a response to a Delete request.
2993    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2994    pub delete_time: std::option::Option<wkt::Timestamp>,
2995
2996    /// Status for the execution completion.
2997    pub completion_status: crate::model::execution_reference::CompletionStatus,
2998
2999    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3000    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3001}
3002
3003impl ExecutionReference {
3004    pub fn new() -> Self {
3005        std::default::Default::default()
3006    }
3007
3008    /// Sets the value of [name][crate::model::ExecutionReference::name].
3009    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3010        self.name = v.into();
3011        self
3012    }
3013
3014    /// Sets the value of [create_time][crate::model::ExecutionReference::create_time].
3015    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3016        mut self,
3017        v: T,
3018    ) -> Self {
3019        self.create_time = v.into();
3020        self
3021    }
3022
3023    /// Sets the value of [completion_time][crate::model::ExecutionReference::completion_time].
3024    pub fn set_completion_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3025        mut self,
3026        v: T,
3027    ) -> Self {
3028        self.completion_time = v.into();
3029        self
3030    }
3031
3032    /// Sets the value of [delete_time][crate::model::ExecutionReference::delete_time].
3033    pub fn set_delete_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3034        mut self,
3035        v: T,
3036    ) -> Self {
3037        self.delete_time = v.into();
3038        self
3039    }
3040
3041    /// Sets the value of [completion_status][crate::model::ExecutionReference::completion_status].
3042    pub fn set_completion_status<
3043        T: std::convert::Into<crate::model::execution_reference::CompletionStatus>,
3044    >(
3045        mut self,
3046        v: T,
3047    ) -> Self {
3048        self.completion_status = v.into();
3049        self
3050    }
3051}
3052
3053impl wkt::message::Message for ExecutionReference {
3054    fn typename() -> &'static str {
3055        "type.googleapis.com/google.cloud.run.v2.ExecutionReference"
3056    }
3057}
3058
3059/// Defines additional types related to [ExecutionReference].
3060pub mod execution_reference {
3061    #[allow(unused_imports)]
3062    use super::*;
3063
3064    /// Possible execution completion status.
3065    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3066    pub struct CompletionStatus(i32);
3067
3068    impl CompletionStatus {
3069        /// The default value. This value is used if the state is omitted.
3070        pub const COMPLETION_STATUS_UNSPECIFIED: CompletionStatus = CompletionStatus::new(0);
3071
3072        /// Job execution has succeeded.
3073        pub const EXECUTION_SUCCEEDED: CompletionStatus = CompletionStatus::new(1);
3074
3075        /// Job execution has failed.
3076        pub const EXECUTION_FAILED: CompletionStatus = CompletionStatus::new(2);
3077
3078        /// Job execution is running normally.
3079        pub const EXECUTION_RUNNING: CompletionStatus = CompletionStatus::new(3);
3080
3081        /// Waiting for backing resources to be provisioned.
3082        pub const EXECUTION_PENDING: CompletionStatus = CompletionStatus::new(4);
3083
3084        /// Job execution has been cancelled by the user.
3085        pub const EXECUTION_CANCELLED: CompletionStatus = CompletionStatus::new(5);
3086
3087        /// Creates a new CompletionStatus instance.
3088        pub(crate) const fn new(value: i32) -> Self {
3089            Self(value)
3090        }
3091
3092        /// Gets the enum value.
3093        pub fn value(&self) -> i32 {
3094            self.0
3095        }
3096
3097        /// Gets the enum value as a string.
3098        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3099            match self.0 {
3100                0 => std::borrow::Cow::Borrowed("COMPLETION_STATUS_UNSPECIFIED"),
3101                1 => std::borrow::Cow::Borrowed("EXECUTION_SUCCEEDED"),
3102                2 => std::borrow::Cow::Borrowed("EXECUTION_FAILED"),
3103                3 => std::borrow::Cow::Borrowed("EXECUTION_RUNNING"),
3104                4 => std::borrow::Cow::Borrowed("EXECUTION_PENDING"),
3105                5 => std::borrow::Cow::Borrowed("EXECUTION_CANCELLED"),
3106                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3107            }
3108        }
3109
3110        /// Creates an enum value from the value name.
3111        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3112            match name {
3113                "COMPLETION_STATUS_UNSPECIFIED" => {
3114                    std::option::Option::Some(Self::COMPLETION_STATUS_UNSPECIFIED)
3115                }
3116                "EXECUTION_SUCCEEDED" => std::option::Option::Some(Self::EXECUTION_SUCCEEDED),
3117                "EXECUTION_FAILED" => std::option::Option::Some(Self::EXECUTION_FAILED),
3118                "EXECUTION_RUNNING" => std::option::Option::Some(Self::EXECUTION_RUNNING),
3119                "EXECUTION_PENDING" => std::option::Option::Some(Self::EXECUTION_PENDING),
3120                "EXECUTION_CANCELLED" => std::option::Option::Some(Self::EXECUTION_CANCELLED),
3121                _ => std::option::Option::None,
3122            }
3123        }
3124    }
3125
3126    impl std::convert::From<i32> for CompletionStatus {
3127        fn from(value: i32) -> Self {
3128            Self::new(value)
3129        }
3130    }
3131
3132    impl std::default::Default for CompletionStatus {
3133        fn default() -> Self {
3134            Self::new(0)
3135        }
3136    }
3137}
3138
3139/// A single application container.
3140/// This specifies both the container to run, the command to run in the container
3141/// and the arguments to supply to it.
3142/// Note that additional arguments can be supplied by the system to the container
3143/// at runtime.
3144#[serde_with::serde_as]
3145#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3146#[serde(default, rename_all = "camelCase")]
3147#[non_exhaustive]
3148pub struct Container {
3149    /// Name of the container specified as a DNS_LABEL (RFC 1123).
3150    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3151    pub name: std::string::String,
3152
3153    /// Required. Name of the container image in Dockerhub, Google Artifact
3154    /// Registry, or Google Container Registry. If the host is not provided,
3155    /// Dockerhub is assumed.
3156    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3157    pub image: std::string::String,
3158
3159    /// Entrypoint array. Not executed within a shell.
3160    /// The docker image's ENTRYPOINT is used if this is not provided.
3161    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3162    pub command: std::vec::Vec<std::string::String>,
3163
3164    /// Arguments to the entrypoint.
3165    /// The docker image's CMD is used if this is not provided.
3166    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3167    pub args: std::vec::Vec<std::string::String>,
3168
3169    /// List of environment variables to set in the container.
3170    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3171    pub env: std::vec::Vec<crate::model::EnvVar>,
3172
3173    /// Compute Resource requirements by this container.
3174    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3175    pub resources: std::option::Option<crate::model::ResourceRequirements>,
3176
3177    /// List of ports to expose from the container. Only a single port can be
3178    /// specified. The specified ports must be listening on all interfaces
3179    /// (0.0.0.0) within the container to be accessible.
3180    ///
3181    /// If omitted, a port number will be chosen and passed to the container
3182    /// through the PORT environment variable for the container to listen on.
3183    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3184    pub ports: std::vec::Vec<crate::model::ContainerPort>,
3185
3186    /// Volume to mount into the container's filesystem.
3187    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3188    pub volume_mounts: std::vec::Vec<crate::model::VolumeMount>,
3189
3190    /// Container's working directory.
3191    /// If not specified, the container runtime's default will be used, which
3192    /// might be configured in the container image.
3193    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3194    pub working_dir: std::string::String,
3195
3196    /// Periodic probe of container liveness.
3197    /// Container will be restarted if the probe fails.
3198    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3199    pub liveness_probe: std::option::Option<crate::model::Probe>,
3200
3201    /// Startup probe of application within the container.
3202    /// All other probes are disabled if a startup probe is provided, until it
3203    /// succeeds. Container will not be added to service endpoints if the probe
3204    /// fails.
3205    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3206    pub startup_probe: std::option::Option<crate::model::Probe>,
3207
3208    /// Names of the containers that must start before this container.
3209    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3210    pub depends_on: std::vec::Vec<std::string::String>,
3211
3212    /// Base image for this container. Only supported for services. If set, it
3213    /// indicates that the service is enrolled into automatic base image update.
3214    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3215    pub base_image_uri: std::string::String,
3216
3217    /// Output only. The build info of the container image.
3218    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3219    pub build_info: std::option::Option<crate::model::BuildInfo>,
3220
3221    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3222    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3223}
3224
3225impl Container {
3226    pub fn new() -> Self {
3227        std::default::Default::default()
3228    }
3229
3230    /// Sets the value of [name][crate::model::Container::name].
3231    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3232        self.name = v.into();
3233        self
3234    }
3235
3236    /// Sets the value of [image][crate::model::Container::image].
3237    pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3238        self.image = v.into();
3239        self
3240    }
3241
3242    /// Sets the value of [resources][crate::model::Container::resources].
3243    pub fn set_resources<
3244        T: std::convert::Into<std::option::Option<crate::model::ResourceRequirements>>,
3245    >(
3246        mut self,
3247        v: T,
3248    ) -> Self {
3249        self.resources = v.into();
3250        self
3251    }
3252
3253    /// Sets the value of [working_dir][crate::model::Container::working_dir].
3254    pub fn set_working_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3255        self.working_dir = v.into();
3256        self
3257    }
3258
3259    /// Sets the value of [liveness_probe][crate::model::Container::liveness_probe].
3260    pub fn set_liveness_probe<T: std::convert::Into<std::option::Option<crate::model::Probe>>>(
3261        mut self,
3262        v: T,
3263    ) -> Self {
3264        self.liveness_probe = v.into();
3265        self
3266    }
3267
3268    /// Sets the value of [startup_probe][crate::model::Container::startup_probe].
3269    pub fn set_startup_probe<T: std::convert::Into<std::option::Option<crate::model::Probe>>>(
3270        mut self,
3271        v: T,
3272    ) -> Self {
3273        self.startup_probe = v.into();
3274        self
3275    }
3276
3277    /// Sets the value of [base_image_uri][crate::model::Container::base_image_uri].
3278    pub fn set_base_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3279        self.base_image_uri = v.into();
3280        self
3281    }
3282
3283    /// Sets the value of [build_info][crate::model::Container::build_info].
3284    pub fn set_build_info<T: std::convert::Into<std::option::Option<crate::model::BuildInfo>>>(
3285        mut self,
3286        v: T,
3287    ) -> Self {
3288        self.build_info = v.into();
3289        self
3290    }
3291
3292    /// Sets the value of [command][crate::model::Container::command].
3293    pub fn set_command<T, V>(mut self, v: T) -> Self
3294    where
3295        T: std::iter::IntoIterator<Item = V>,
3296        V: std::convert::Into<std::string::String>,
3297    {
3298        use std::iter::Iterator;
3299        self.command = v.into_iter().map(|i| i.into()).collect();
3300        self
3301    }
3302
3303    /// Sets the value of [args][crate::model::Container::args].
3304    pub fn set_args<T, V>(mut self, v: T) -> Self
3305    where
3306        T: std::iter::IntoIterator<Item = V>,
3307        V: std::convert::Into<std::string::String>,
3308    {
3309        use std::iter::Iterator;
3310        self.args = v.into_iter().map(|i| i.into()).collect();
3311        self
3312    }
3313
3314    /// Sets the value of [env][crate::model::Container::env].
3315    pub fn set_env<T, V>(mut self, v: T) -> Self
3316    where
3317        T: std::iter::IntoIterator<Item = V>,
3318        V: std::convert::Into<crate::model::EnvVar>,
3319    {
3320        use std::iter::Iterator;
3321        self.env = v.into_iter().map(|i| i.into()).collect();
3322        self
3323    }
3324
3325    /// Sets the value of [ports][crate::model::Container::ports].
3326    pub fn set_ports<T, V>(mut self, v: T) -> Self
3327    where
3328        T: std::iter::IntoIterator<Item = V>,
3329        V: std::convert::Into<crate::model::ContainerPort>,
3330    {
3331        use std::iter::Iterator;
3332        self.ports = v.into_iter().map(|i| i.into()).collect();
3333        self
3334    }
3335
3336    /// Sets the value of [volume_mounts][crate::model::Container::volume_mounts].
3337    pub fn set_volume_mounts<T, V>(mut self, v: T) -> Self
3338    where
3339        T: std::iter::IntoIterator<Item = V>,
3340        V: std::convert::Into<crate::model::VolumeMount>,
3341    {
3342        use std::iter::Iterator;
3343        self.volume_mounts = v.into_iter().map(|i| i.into()).collect();
3344        self
3345    }
3346
3347    /// Sets the value of [depends_on][crate::model::Container::depends_on].
3348    pub fn set_depends_on<T, V>(mut self, v: T) -> Self
3349    where
3350        T: std::iter::IntoIterator<Item = V>,
3351        V: std::convert::Into<std::string::String>,
3352    {
3353        use std::iter::Iterator;
3354        self.depends_on = v.into_iter().map(|i| i.into()).collect();
3355        self
3356    }
3357}
3358
3359impl wkt::message::Message for Container {
3360    fn typename() -> &'static str {
3361        "type.googleapis.com/google.cloud.run.v2.Container"
3362    }
3363}
3364
3365/// ResourceRequirements describes the compute resource requirements.
3366#[serde_with::serde_as]
3367#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3368#[serde(default, rename_all = "camelCase")]
3369#[non_exhaustive]
3370pub struct ResourceRequirements {
3371    /// Only `memory` and `cpu` keys in the map are supported.
3372    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3373    pub limits: std::collections::HashMap<std::string::String, std::string::String>,
3374
3375    /// Determines whether CPU is only allocated during requests (true by default).
3376    /// However, if ResourceRequirements is set, the caller must explicitly
3377    /// set this field to true to preserve the default behavior.
3378    pub cpu_idle: bool,
3379
3380    /// Determines whether CPU should be boosted on startup of a new container
3381    /// instance above the requested CPU threshold, this can help reduce cold-start
3382    /// latency.
3383    pub startup_cpu_boost: bool,
3384
3385    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3386    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3387}
3388
3389impl ResourceRequirements {
3390    pub fn new() -> Self {
3391        std::default::Default::default()
3392    }
3393
3394    /// Sets the value of [cpu_idle][crate::model::ResourceRequirements::cpu_idle].
3395    pub fn set_cpu_idle<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3396        self.cpu_idle = v.into();
3397        self
3398    }
3399
3400    /// Sets the value of [startup_cpu_boost][crate::model::ResourceRequirements::startup_cpu_boost].
3401    pub fn set_startup_cpu_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3402        self.startup_cpu_boost = v.into();
3403        self
3404    }
3405
3406    /// Sets the value of [limits][crate::model::ResourceRequirements::limits].
3407    pub fn set_limits<T, K, V>(mut self, v: T) -> Self
3408    where
3409        T: std::iter::IntoIterator<Item = (K, V)>,
3410        K: std::convert::Into<std::string::String>,
3411        V: std::convert::Into<std::string::String>,
3412    {
3413        use std::iter::Iterator;
3414        self.limits = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3415        self
3416    }
3417}
3418
3419impl wkt::message::Message for ResourceRequirements {
3420    fn typename() -> &'static str {
3421        "type.googleapis.com/google.cloud.run.v2.ResourceRequirements"
3422    }
3423}
3424
3425/// EnvVar represents an environment variable present in a Container.
3426#[serde_with::serde_as]
3427#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3428#[serde(default, rename_all = "camelCase")]
3429#[non_exhaustive]
3430pub struct EnvVar {
3431    /// Required. Name of the environment variable. Must not exceed 32768
3432    /// characters.
3433    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3434    pub name: std::string::String,
3435
3436    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3437    pub values: std::option::Option<crate::model::env_var::Values>,
3438
3439    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3440    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3441}
3442
3443impl EnvVar {
3444    pub fn new() -> Self {
3445        std::default::Default::default()
3446    }
3447
3448    /// Sets the value of [name][crate::model::EnvVar::name].
3449    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3450        self.name = v.into();
3451        self
3452    }
3453
3454    /// Sets the value of [values][crate::model::EnvVar::values].
3455    ///
3456    /// Note that all the setters affecting `values` are mutually
3457    /// exclusive.
3458    pub fn set_values<T: std::convert::Into<std::option::Option<crate::model::env_var::Values>>>(
3459        mut self,
3460        v: T,
3461    ) -> Self {
3462        self.values = v.into();
3463        self
3464    }
3465
3466    /// The value of [values][crate::model::EnvVar::values]
3467    /// if it holds a `Value`, `None` if the field is not set or
3468    /// holds a different branch.
3469    pub fn value(&self) -> std::option::Option<&std::string::String> {
3470        #[allow(unreachable_patterns)]
3471        self.values.as_ref().and_then(|v| match v {
3472            crate::model::env_var::Values::Value(v) => std::option::Option::Some(v),
3473            _ => std::option::Option::None,
3474        })
3475    }
3476
3477    /// The value of [values][crate::model::EnvVar::values]
3478    /// if it holds a `ValueSource`, `None` if the field is not set or
3479    /// holds a different branch.
3480    pub fn value_source(
3481        &self,
3482    ) -> std::option::Option<&std::boxed::Box<crate::model::EnvVarSource>> {
3483        #[allow(unreachable_patterns)]
3484        self.values.as_ref().and_then(|v| match v {
3485            crate::model::env_var::Values::ValueSource(v) => std::option::Option::Some(v),
3486            _ => std::option::Option::None,
3487        })
3488    }
3489
3490    /// Sets the value of [values][crate::model::EnvVar::values]
3491    /// to hold a `Value`.
3492    ///
3493    /// Note that all the setters affecting `values` are
3494    /// mutually exclusive.
3495    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3496        self.values = std::option::Option::Some(crate::model::env_var::Values::Value(v.into()));
3497        self
3498    }
3499
3500    /// Sets the value of [values][crate::model::EnvVar::values]
3501    /// to hold a `ValueSource`.
3502    ///
3503    /// Note that all the setters affecting `values` are
3504    /// mutually exclusive.
3505    pub fn set_value_source<T: std::convert::Into<std::boxed::Box<crate::model::EnvVarSource>>>(
3506        mut self,
3507        v: T,
3508    ) -> Self {
3509        self.values =
3510            std::option::Option::Some(crate::model::env_var::Values::ValueSource(v.into()));
3511        self
3512    }
3513}
3514
3515impl wkt::message::Message for EnvVar {
3516    fn typename() -> &'static str {
3517        "type.googleapis.com/google.cloud.run.v2.EnvVar"
3518    }
3519}
3520
3521/// Defines additional types related to [EnvVar].
3522pub mod env_var {
3523    #[allow(unused_imports)]
3524    use super::*;
3525
3526    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3527    #[serde(rename_all = "camelCase")]
3528    #[non_exhaustive]
3529    pub enum Values {
3530        /// Literal value of the environment variable.
3531        /// Defaults to "", and the maximum length is 32768 bytes.
3532        /// Variable references are not supported in Cloud Run.
3533        Value(std::string::String),
3534        /// Source for the environment variable's value.
3535        ValueSource(std::boxed::Box<crate::model::EnvVarSource>),
3536    }
3537}
3538
3539/// EnvVarSource represents a source for the value of an EnvVar.
3540#[serde_with::serde_as]
3541#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3542#[serde(default, rename_all = "camelCase")]
3543#[non_exhaustive]
3544pub struct EnvVarSource {
3545    /// Selects a secret and a specific version from Cloud Secret Manager.
3546    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3547    pub secret_key_ref: std::option::Option<crate::model::SecretKeySelector>,
3548
3549    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3550    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3551}
3552
3553impl EnvVarSource {
3554    pub fn new() -> Self {
3555        std::default::Default::default()
3556    }
3557
3558    /// Sets the value of [secret_key_ref][crate::model::EnvVarSource::secret_key_ref].
3559    pub fn set_secret_key_ref<
3560        T: std::convert::Into<std::option::Option<crate::model::SecretKeySelector>>,
3561    >(
3562        mut self,
3563        v: T,
3564    ) -> Self {
3565        self.secret_key_ref = v.into();
3566        self
3567    }
3568}
3569
3570impl wkt::message::Message for EnvVarSource {
3571    fn typename() -> &'static str {
3572        "type.googleapis.com/google.cloud.run.v2.EnvVarSource"
3573    }
3574}
3575
3576/// SecretEnvVarSource represents a source for the value of an EnvVar.
3577#[serde_with::serde_as]
3578#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3579#[serde(default, rename_all = "camelCase")]
3580#[non_exhaustive]
3581pub struct SecretKeySelector {
3582    /// Required. The name of the secret in Cloud Secret Manager.
3583    /// Format: {secret_name} if the secret is in the same project.
3584    /// projects/{project}/secrets/{secret_name} if the secret is
3585    /// in a different project.
3586    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3587    pub secret: std::string::String,
3588
3589    /// The Cloud Secret Manager secret version.
3590    /// Can be 'latest' for the latest version, an integer for a specific version,
3591    /// or a version alias.
3592    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3593    pub version: std::string::String,
3594
3595    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3596    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3597}
3598
3599impl SecretKeySelector {
3600    pub fn new() -> Self {
3601        std::default::Default::default()
3602    }
3603
3604    /// Sets the value of [secret][crate::model::SecretKeySelector::secret].
3605    pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3606        self.secret = v.into();
3607        self
3608    }
3609
3610    /// Sets the value of [version][crate::model::SecretKeySelector::version].
3611    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3612        self.version = v.into();
3613        self
3614    }
3615}
3616
3617impl wkt::message::Message for SecretKeySelector {
3618    fn typename() -> &'static str {
3619        "type.googleapis.com/google.cloud.run.v2.SecretKeySelector"
3620    }
3621}
3622
3623/// ContainerPort represents a network port in a single container.
3624#[serde_with::serde_as]
3625#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3626#[serde(default, rename_all = "camelCase")]
3627#[non_exhaustive]
3628pub struct ContainerPort {
3629    /// If specified, used to specify which protocol to use.
3630    /// Allowed values are "http1" and "h2c".
3631    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3632    pub name: std::string::String,
3633
3634    /// Port number the container listens on.
3635    /// This must be a valid TCP port number, 0 < container_port < 65536.
3636    pub container_port: i32,
3637
3638    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3639    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3640}
3641
3642impl ContainerPort {
3643    pub fn new() -> Self {
3644        std::default::Default::default()
3645    }
3646
3647    /// Sets the value of [name][crate::model::ContainerPort::name].
3648    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3649        self.name = v.into();
3650        self
3651    }
3652
3653    /// Sets the value of [container_port][crate::model::ContainerPort::container_port].
3654    pub fn set_container_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3655        self.container_port = v.into();
3656        self
3657    }
3658}
3659
3660impl wkt::message::Message for ContainerPort {
3661    fn typename() -> &'static str {
3662        "type.googleapis.com/google.cloud.run.v2.ContainerPort"
3663    }
3664}
3665
3666/// VolumeMount describes a mounting of a Volume within a container.
3667#[serde_with::serde_as]
3668#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3669#[serde(default, rename_all = "camelCase")]
3670#[non_exhaustive]
3671pub struct VolumeMount {
3672    /// Required. This must match the Name of a Volume.
3673    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3674    pub name: std::string::String,
3675
3676    /// Required. Path within the container at which the volume should be mounted.
3677    /// Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must
3678    /// otherwise be `/cloudsql`. All instances defined in the Volume will be
3679    /// available as `/cloudsql/[instance]`. For more information on Cloud SQL
3680    /// volumes, visit <https://cloud.google.com/sql/docs/mysql/connect-run>
3681    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3682    pub mount_path: std::string::String,
3683
3684    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3685    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3686}
3687
3688impl VolumeMount {
3689    pub fn new() -> Self {
3690        std::default::Default::default()
3691    }
3692
3693    /// Sets the value of [name][crate::model::VolumeMount::name].
3694    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3695        self.name = v.into();
3696        self
3697    }
3698
3699    /// Sets the value of [mount_path][crate::model::VolumeMount::mount_path].
3700    pub fn set_mount_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3701        self.mount_path = v.into();
3702        self
3703    }
3704}
3705
3706impl wkt::message::Message for VolumeMount {
3707    fn typename() -> &'static str {
3708        "type.googleapis.com/google.cloud.run.v2.VolumeMount"
3709    }
3710}
3711
3712/// Volume represents a named volume in a container.
3713#[serde_with::serde_as]
3714#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3715#[serde(default, rename_all = "camelCase")]
3716#[non_exhaustive]
3717pub struct Volume {
3718    /// Required. Volume's name.
3719    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3720    pub name: std::string::String,
3721
3722    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3723    pub volume_type: std::option::Option<crate::model::volume::VolumeType>,
3724
3725    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3726    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3727}
3728
3729impl Volume {
3730    pub fn new() -> Self {
3731        std::default::Default::default()
3732    }
3733
3734    /// Sets the value of [name][crate::model::Volume::name].
3735    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3736        self.name = v.into();
3737        self
3738    }
3739
3740    /// Sets the value of [volume_type][crate::model::Volume::volume_type].
3741    ///
3742    /// Note that all the setters affecting `volume_type` are mutually
3743    /// exclusive.
3744    pub fn set_volume_type<
3745        T: std::convert::Into<std::option::Option<crate::model::volume::VolumeType>>,
3746    >(
3747        mut self,
3748        v: T,
3749    ) -> Self {
3750        self.volume_type = v.into();
3751        self
3752    }
3753
3754    /// The value of [volume_type][crate::model::Volume::volume_type]
3755    /// if it holds a `Secret`, `None` if the field is not set or
3756    /// holds a different branch.
3757    pub fn secret(
3758        &self,
3759    ) -> std::option::Option<&std::boxed::Box<crate::model::SecretVolumeSource>> {
3760        #[allow(unreachable_patterns)]
3761        self.volume_type.as_ref().and_then(|v| match v {
3762            crate::model::volume::VolumeType::Secret(v) => std::option::Option::Some(v),
3763            _ => std::option::Option::None,
3764        })
3765    }
3766
3767    /// The value of [volume_type][crate::model::Volume::volume_type]
3768    /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
3769    /// holds a different branch.
3770    pub fn cloud_sql_instance(
3771        &self,
3772    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlInstance>> {
3773        #[allow(unreachable_patterns)]
3774        self.volume_type.as_ref().and_then(|v| match v {
3775            crate::model::volume::VolumeType::CloudSqlInstance(v) => std::option::Option::Some(v),
3776            _ => std::option::Option::None,
3777        })
3778    }
3779
3780    /// The value of [volume_type][crate::model::Volume::volume_type]
3781    /// if it holds a `EmptyDir`, `None` if the field is not set or
3782    /// holds a different branch.
3783    pub fn empty_dir(
3784        &self,
3785    ) -> std::option::Option<&std::boxed::Box<crate::model::EmptyDirVolumeSource>> {
3786        #[allow(unreachable_patterns)]
3787        self.volume_type.as_ref().and_then(|v| match v {
3788            crate::model::volume::VolumeType::EmptyDir(v) => std::option::Option::Some(v),
3789            _ => std::option::Option::None,
3790        })
3791    }
3792
3793    /// The value of [volume_type][crate::model::Volume::volume_type]
3794    /// if it holds a `Nfs`, `None` if the field is not set or
3795    /// holds a different branch.
3796    pub fn nfs(&self) -> std::option::Option<&std::boxed::Box<crate::model::NFSVolumeSource>> {
3797        #[allow(unreachable_patterns)]
3798        self.volume_type.as_ref().and_then(|v| match v {
3799            crate::model::volume::VolumeType::Nfs(v) => std::option::Option::Some(v),
3800            _ => std::option::Option::None,
3801        })
3802    }
3803
3804    /// The value of [volume_type][crate::model::Volume::volume_type]
3805    /// if it holds a `Gcs`, `None` if the field is not set or
3806    /// holds a different branch.
3807    pub fn gcs(&self) -> std::option::Option<&std::boxed::Box<crate::model::GCSVolumeSource>> {
3808        #[allow(unreachable_patterns)]
3809        self.volume_type.as_ref().and_then(|v| match v {
3810            crate::model::volume::VolumeType::Gcs(v) => std::option::Option::Some(v),
3811            _ => std::option::Option::None,
3812        })
3813    }
3814
3815    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
3816    /// to hold a `Secret`.
3817    ///
3818    /// Note that all the setters affecting `volume_type` are
3819    /// mutually exclusive.
3820    pub fn set_secret<T: std::convert::Into<std::boxed::Box<crate::model::SecretVolumeSource>>>(
3821        mut self,
3822        v: T,
3823    ) -> Self {
3824        self.volume_type =
3825            std::option::Option::Some(crate::model::volume::VolumeType::Secret(v.into()));
3826        self
3827    }
3828
3829    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
3830    /// to hold a `CloudSqlInstance`.
3831    ///
3832    /// Note that all the setters affecting `volume_type` are
3833    /// mutually exclusive.
3834    pub fn set_cloud_sql_instance<
3835        T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlInstance>>,
3836    >(
3837        mut self,
3838        v: T,
3839    ) -> Self {
3840        self.volume_type =
3841            std::option::Option::Some(crate::model::volume::VolumeType::CloudSqlInstance(v.into()));
3842        self
3843    }
3844
3845    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
3846    /// to hold a `EmptyDir`.
3847    ///
3848    /// Note that all the setters affecting `volume_type` are
3849    /// mutually exclusive.
3850    pub fn set_empty_dir<
3851        T: std::convert::Into<std::boxed::Box<crate::model::EmptyDirVolumeSource>>,
3852    >(
3853        mut self,
3854        v: T,
3855    ) -> Self {
3856        self.volume_type =
3857            std::option::Option::Some(crate::model::volume::VolumeType::EmptyDir(v.into()));
3858        self
3859    }
3860
3861    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
3862    /// to hold a `Nfs`.
3863    ///
3864    /// Note that all the setters affecting `volume_type` are
3865    /// mutually exclusive.
3866    pub fn set_nfs<T: std::convert::Into<std::boxed::Box<crate::model::NFSVolumeSource>>>(
3867        mut self,
3868        v: T,
3869    ) -> Self {
3870        self.volume_type =
3871            std::option::Option::Some(crate::model::volume::VolumeType::Nfs(v.into()));
3872        self
3873    }
3874
3875    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
3876    /// to hold a `Gcs`.
3877    ///
3878    /// Note that all the setters affecting `volume_type` are
3879    /// mutually exclusive.
3880    pub fn set_gcs<T: std::convert::Into<std::boxed::Box<crate::model::GCSVolumeSource>>>(
3881        mut self,
3882        v: T,
3883    ) -> Self {
3884        self.volume_type =
3885            std::option::Option::Some(crate::model::volume::VolumeType::Gcs(v.into()));
3886        self
3887    }
3888}
3889
3890impl wkt::message::Message for Volume {
3891    fn typename() -> &'static str {
3892        "type.googleapis.com/google.cloud.run.v2.Volume"
3893    }
3894}
3895
3896/// Defines additional types related to [Volume].
3897pub mod volume {
3898    #[allow(unused_imports)]
3899    use super::*;
3900
3901    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3902    #[serde(rename_all = "camelCase")]
3903    #[non_exhaustive]
3904    pub enum VolumeType {
3905        /// Secret represents a secret that should populate this volume.
3906        Secret(std::boxed::Box<crate::model::SecretVolumeSource>),
3907        /// For Cloud SQL volumes, contains the specific instances that should be
3908        /// mounted. Visit <https://cloud.google.com/sql/docs/mysql/connect-run> for
3909        /// more information on how to connect Cloud SQL and Cloud Run.
3910        CloudSqlInstance(std::boxed::Box<crate::model::CloudSqlInstance>),
3911        /// Ephemeral storage used as a shared volume.
3912        EmptyDir(std::boxed::Box<crate::model::EmptyDirVolumeSource>),
3913        /// For NFS Voumes, contains the path to the nfs Volume
3914        Nfs(std::boxed::Box<crate::model::NFSVolumeSource>),
3915        /// Persistent storage backed by a Google Cloud Storage bucket.
3916        Gcs(std::boxed::Box<crate::model::GCSVolumeSource>),
3917    }
3918}
3919
3920/// The secret's value will be presented as the content of a file whose
3921/// name is defined in the item path. If no items are defined, the name of
3922/// the file is the secret.
3923#[serde_with::serde_as]
3924#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3925#[serde(default, rename_all = "camelCase")]
3926#[non_exhaustive]
3927pub struct SecretVolumeSource {
3928    /// Required. The name of the secret in Cloud Secret Manager.
3929    /// Format: {secret} if the secret is in the same project.
3930    /// projects/{project}/secrets/{secret} if the secret is
3931    /// in a different project.
3932    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3933    pub secret: std::string::String,
3934
3935    /// If unspecified, the volume will expose a file whose name is the
3936    /// secret, relative to VolumeMount.mount_path.
3937    /// If specified, the key will be used as the version to fetch from Cloud
3938    /// Secret Manager and the path will be the name of the file exposed in the
3939    /// volume. When items are defined, they must specify a path and a version.
3940    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3941    pub items: std::vec::Vec<crate::model::VersionToPath>,
3942
3943    /// Integer representation of mode bits to use on created files by default.
3944    /// Must be a value between 0000 and 0777 (octal), defaulting to 0444.
3945    /// Directories within the path are not affected by  this setting.
3946    ///
3947    /// Notes
3948    ///
3949    /// * Internally, a umask of 0222 will be applied to any non-zero value.
3950    /// * This is an integer representation of the mode bits. So, the octal
3951    ///   integer value should look exactly as the chmod numeric notation with a
3952    ///   leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal)
3953    ///   or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or
3954    ///   493 (base-10).
3955    /// * This might be in conflict with other options that affect the
3956    ///   file mode, like fsGroup, and the result can be other mode bits set.
3957    ///
3958    /// This might be in conflict with other options that affect the
3959    /// file mode, like fsGroup, and as a result, other mode bits could be set.
3960    pub default_mode: i32,
3961
3962    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3963    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3964}
3965
3966impl SecretVolumeSource {
3967    pub fn new() -> Self {
3968        std::default::Default::default()
3969    }
3970
3971    /// Sets the value of [secret][crate::model::SecretVolumeSource::secret].
3972    pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3973        self.secret = v.into();
3974        self
3975    }
3976
3977    /// Sets the value of [default_mode][crate::model::SecretVolumeSource::default_mode].
3978    pub fn set_default_mode<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3979        self.default_mode = v.into();
3980        self
3981    }
3982
3983    /// Sets the value of [items][crate::model::SecretVolumeSource::items].
3984    pub fn set_items<T, V>(mut self, v: T) -> Self
3985    where
3986        T: std::iter::IntoIterator<Item = V>,
3987        V: std::convert::Into<crate::model::VersionToPath>,
3988    {
3989        use std::iter::Iterator;
3990        self.items = v.into_iter().map(|i| i.into()).collect();
3991        self
3992    }
3993}
3994
3995impl wkt::message::Message for SecretVolumeSource {
3996    fn typename() -> &'static str {
3997        "type.googleapis.com/google.cloud.run.v2.SecretVolumeSource"
3998    }
3999}
4000
4001/// VersionToPath maps a specific version of a secret to a relative file to mount
4002/// to, relative to VolumeMount's mount_path.
4003#[serde_with::serde_as]
4004#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4005#[serde(default, rename_all = "camelCase")]
4006#[non_exhaustive]
4007pub struct VersionToPath {
4008    /// Required. The relative path of the secret in the container.
4009    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4010    pub path: std::string::String,
4011
4012    /// The Cloud Secret Manager secret version.
4013    /// Can be 'latest' for the latest value, or an integer or a secret alias for a
4014    /// specific version.
4015    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4016    pub version: std::string::String,
4017
4018    /// Integer octal mode bits to use on this file, must be a value between
4019    /// 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be
4020    /// used.
4021    ///
4022    /// Notes
4023    ///
4024    /// * Internally, a umask of 0222 will be applied to any non-zero value.
4025    /// * This is an integer representation of the mode bits. So, the octal
4026    ///   integer value should look exactly as the chmod numeric notation with a
4027    ///   leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal)
4028    ///   or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or
4029    ///   493 (base-10).
4030    /// * This might be in conflict with other options that affect the
4031    ///   file mode, like fsGroup, and the result can be other mode bits set.
4032    pub mode: i32,
4033
4034    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4035    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4036}
4037
4038impl VersionToPath {
4039    pub fn new() -> Self {
4040        std::default::Default::default()
4041    }
4042
4043    /// Sets the value of [path][crate::model::VersionToPath::path].
4044    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4045        self.path = v.into();
4046        self
4047    }
4048
4049    /// Sets the value of [version][crate::model::VersionToPath::version].
4050    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4051        self.version = v.into();
4052        self
4053    }
4054
4055    /// Sets the value of [mode][crate::model::VersionToPath::mode].
4056    pub fn set_mode<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4057        self.mode = v.into();
4058        self
4059    }
4060}
4061
4062impl wkt::message::Message for VersionToPath {
4063    fn typename() -> &'static str {
4064        "type.googleapis.com/google.cloud.run.v2.VersionToPath"
4065    }
4066}
4067
4068/// Represents a set of Cloud SQL instances. Each one will be available under
4069/// /cloudsql/[instance]. Visit
4070/// <https://cloud.google.com/sql/docs/mysql/connect-run> for more information on
4071/// how to connect Cloud SQL and Cloud Run.
4072#[serde_with::serde_as]
4073#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4074#[serde(default, rename_all = "camelCase")]
4075#[non_exhaustive]
4076pub struct CloudSqlInstance {
4077    /// The Cloud SQL instance connection names, as can be found in
4078    /// <https://console.cloud.google.com/sql/instances>. Visit
4079    /// <https://cloud.google.com/sql/docs/mysql/connect-run> for more information on
4080    /// how to connect Cloud SQL and Cloud Run. Format:
4081    /// {project}:{location}:{instance}
4082    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4083    pub instances: std::vec::Vec<std::string::String>,
4084
4085    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4086    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4087}
4088
4089impl CloudSqlInstance {
4090    pub fn new() -> Self {
4091        std::default::Default::default()
4092    }
4093
4094    /// Sets the value of [instances][crate::model::CloudSqlInstance::instances].
4095    pub fn set_instances<T, V>(mut self, v: T) -> Self
4096    where
4097        T: std::iter::IntoIterator<Item = V>,
4098        V: std::convert::Into<std::string::String>,
4099    {
4100        use std::iter::Iterator;
4101        self.instances = v.into_iter().map(|i| i.into()).collect();
4102        self
4103    }
4104}
4105
4106impl wkt::message::Message for CloudSqlInstance {
4107    fn typename() -> &'static str {
4108        "type.googleapis.com/google.cloud.run.v2.CloudSqlInstance"
4109    }
4110}
4111
4112/// In memory (tmpfs) ephemeral storage.
4113/// It is ephemeral in the sense that when the sandbox is taken down, the data is
4114/// destroyed with it (it does not persist across sandbox runs).
4115#[serde_with::serde_as]
4116#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4117#[serde(default, rename_all = "camelCase")]
4118#[non_exhaustive]
4119pub struct EmptyDirVolumeSource {
4120    /// The medium on which the data is stored. Acceptable values today is only
4121    /// MEMORY or none. When none, the default will currently be backed by memory
4122    /// but could change over time. +optional
4123    pub medium: crate::model::empty_dir_volume_source::Medium,
4124
4125    /// Limit on the storage usable by this EmptyDir volume.
4126    /// The size limit is also applicable for memory medium.
4127    /// The maximum usage on memory medium EmptyDir would be the minimum value
4128    /// between the SizeLimit specified here and the sum of memory limits of all
4129    /// containers. The default is nil which means that the limit is undefined.
4130    /// More info:
4131    /// <https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume>.
4132    /// Info in Kubernetes:
4133    /// <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir>
4134    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4135    pub size_limit: std::string::String,
4136
4137    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4138    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4139}
4140
4141impl EmptyDirVolumeSource {
4142    pub fn new() -> Self {
4143        std::default::Default::default()
4144    }
4145
4146    /// Sets the value of [medium][crate::model::EmptyDirVolumeSource::medium].
4147    pub fn set_medium<T: std::convert::Into<crate::model::empty_dir_volume_source::Medium>>(
4148        mut self,
4149        v: T,
4150    ) -> Self {
4151        self.medium = v.into();
4152        self
4153    }
4154
4155    /// Sets the value of [size_limit][crate::model::EmptyDirVolumeSource::size_limit].
4156    pub fn set_size_limit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4157        self.size_limit = v.into();
4158        self
4159    }
4160}
4161
4162impl wkt::message::Message for EmptyDirVolumeSource {
4163    fn typename() -> &'static str {
4164        "type.googleapis.com/google.cloud.run.v2.EmptyDirVolumeSource"
4165    }
4166}
4167
4168/// Defines additional types related to [EmptyDirVolumeSource].
4169pub mod empty_dir_volume_source {
4170    #[allow(unused_imports)]
4171    use super::*;
4172
4173    /// The different types of medium supported for EmptyDir.
4174    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4175    pub struct Medium(i32);
4176
4177    impl Medium {
4178        /// When not specified, falls back to the default implementation which
4179        /// is currently in memory (this may change over time).
4180        pub const MEDIUM_UNSPECIFIED: Medium = Medium::new(0);
4181
4182        /// Explicitly set the EmptyDir to be in memory. Uses tmpfs.
4183        pub const MEMORY: Medium = Medium::new(1);
4184
4185        /// Creates a new Medium instance.
4186        pub(crate) const fn new(value: i32) -> Self {
4187            Self(value)
4188        }
4189
4190        /// Gets the enum value.
4191        pub fn value(&self) -> i32 {
4192            self.0
4193        }
4194
4195        /// Gets the enum value as a string.
4196        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4197            match self.0 {
4198                0 => std::borrow::Cow::Borrowed("MEDIUM_UNSPECIFIED"),
4199                1 => std::borrow::Cow::Borrowed("MEMORY"),
4200                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4201            }
4202        }
4203
4204        /// Creates an enum value from the value name.
4205        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4206            match name {
4207                "MEDIUM_UNSPECIFIED" => std::option::Option::Some(Self::MEDIUM_UNSPECIFIED),
4208                "MEMORY" => std::option::Option::Some(Self::MEMORY),
4209                _ => std::option::Option::None,
4210            }
4211        }
4212    }
4213
4214    impl std::convert::From<i32> for Medium {
4215        fn from(value: i32) -> Self {
4216            Self::new(value)
4217        }
4218    }
4219
4220    impl std::default::Default for Medium {
4221        fn default() -> Self {
4222            Self::new(0)
4223        }
4224    }
4225}
4226
4227/// Represents an NFS mount.
4228#[serde_with::serde_as]
4229#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4230#[serde(default, rename_all = "camelCase")]
4231#[non_exhaustive]
4232pub struct NFSVolumeSource {
4233    /// Hostname or IP address of the NFS server
4234    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4235    pub server: std::string::String,
4236
4237    /// Path that is exported by the NFS server.
4238    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4239    pub path: std::string::String,
4240
4241    /// If true, the volume will be mounted as read only for all mounts.
4242    pub read_only: bool,
4243
4244    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4245    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4246}
4247
4248impl NFSVolumeSource {
4249    pub fn new() -> Self {
4250        std::default::Default::default()
4251    }
4252
4253    /// Sets the value of [server][crate::model::NFSVolumeSource::server].
4254    pub fn set_server<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4255        self.server = v.into();
4256        self
4257    }
4258
4259    /// Sets the value of [path][crate::model::NFSVolumeSource::path].
4260    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4261        self.path = v.into();
4262        self
4263    }
4264
4265    /// Sets the value of [read_only][crate::model::NFSVolumeSource::read_only].
4266    pub fn set_read_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4267        self.read_only = v.into();
4268        self
4269    }
4270}
4271
4272impl wkt::message::Message for NFSVolumeSource {
4273    fn typename() -> &'static str {
4274        "type.googleapis.com/google.cloud.run.v2.NFSVolumeSource"
4275    }
4276}
4277
4278/// Represents a volume backed by a Cloud Storage bucket using Cloud Storage
4279/// FUSE.
4280#[serde_with::serde_as]
4281#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4282#[serde(default, rename_all = "camelCase")]
4283#[non_exhaustive]
4284pub struct GCSVolumeSource {
4285    /// Cloud Storage Bucket name.
4286    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4287    pub bucket: std::string::String,
4288
4289    /// If true, the volume will be mounted as read only for all mounts.
4290    pub read_only: bool,
4291
4292    /// A list of additional flags to pass to the gcsfuse CLI.
4293    /// Options should be specified without the leading "--".
4294    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4295    pub mount_options: std::vec::Vec<std::string::String>,
4296
4297    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4298    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4299}
4300
4301impl GCSVolumeSource {
4302    pub fn new() -> Self {
4303        std::default::Default::default()
4304    }
4305
4306    /// Sets the value of [bucket][crate::model::GCSVolumeSource::bucket].
4307    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4308        self.bucket = v.into();
4309        self
4310    }
4311
4312    /// Sets the value of [read_only][crate::model::GCSVolumeSource::read_only].
4313    pub fn set_read_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4314        self.read_only = v.into();
4315        self
4316    }
4317
4318    /// Sets the value of [mount_options][crate::model::GCSVolumeSource::mount_options].
4319    pub fn set_mount_options<T, V>(mut self, v: T) -> Self
4320    where
4321        T: std::iter::IntoIterator<Item = V>,
4322        V: std::convert::Into<std::string::String>,
4323    {
4324        use std::iter::Iterator;
4325        self.mount_options = v.into_iter().map(|i| i.into()).collect();
4326        self
4327    }
4328}
4329
4330impl wkt::message::Message for GCSVolumeSource {
4331    fn typename() -> &'static str {
4332        "type.googleapis.com/google.cloud.run.v2.GCSVolumeSource"
4333    }
4334}
4335
4336/// Probe describes a health check to be performed against a container to
4337/// determine whether it is alive or ready to receive traffic.
4338#[serde_with::serde_as]
4339#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4340#[serde(default, rename_all = "camelCase")]
4341#[non_exhaustive]
4342pub struct Probe {
4343    /// Optional. Number of seconds after the container has started before the
4344    /// probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum
4345    /// value for liveness probe is 3600. Maximum value for startup probe is 240.
4346    pub initial_delay_seconds: i32,
4347
4348    /// Optional. Number of seconds after which the probe times out.
4349    /// Defaults to 1 second. Minimum value is 1. Maximum value is 3600.
4350    /// Must be smaller than period_seconds.
4351    pub timeout_seconds: i32,
4352
4353    /// Optional. How often (in seconds) to perform the probe.
4354    /// Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe
4355    /// is 3600. Maximum value for startup probe is 240.
4356    /// Must be greater or equal than timeout_seconds.
4357    pub period_seconds: i32,
4358
4359    /// Optional. Minimum consecutive failures for the probe to be considered
4360    /// failed after having succeeded. Defaults to 3. Minimum value is 1.
4361    pub failure_threshold: i32,
4362
4363    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
4364    pub probe_type: std::option::Option<crate::model::probe::ProbeType>,
4365
4366    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4367    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4368}
4369
4370impl Probe {
4371    pub fn new() -> Self {
4372        std::default::Default::default()
4373    }
4374
4375    /// Sets the value of [initial_delay_seconds][crate::model::Probe::initial_delay_seconds].
4376    pub fn set_initial_delay_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4377        self.initial_delay_seconds = v.into();
4378        self
4379    }
4380
4381    /// Sets the value of [timeout_seconds][crate::model::Probe::timeout_seconds].
4382    pub fn set_timeout_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4383        self.timeout_seconds = v.into();
4384        self
4385    }
4386
4387    /// Sets the value of [period_seconds][crate::model::Probe::period_seconds].
4388    pub fn set_period_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4389        self.period_seconds = v.into();
4390        self
4391    }
4392
4393    /// Sets the value of [failure_threshold][crate::model::Probe::failure_threshold].
4394    pub fn set_failure_threshold<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4395        self.failure_threshold = v.into();
4396        self
4397    }
4398
4399    /// Sets the value of [probe_type][crate::model::Probe::probe_type].
4400    ///
4401    /// Note that all the setters affecting `probe_type` are mutually
4402    /// exclusive.
4403    pub fn set_probe_type<
4404        T: std::convert::Into<std::option::Option<crate::model::probe::ProbeType>>,
4405    >(
4406        mut self,
4407        v: T,
4408    ) -> Self {
4409        self.probe_type = v.into();
4410        self
4411    }
4412
4413    /// The value of [probe_type][crate::model::Probe::probe_type]
4414    /// if it holds a `HttpGet`, `None` if the field is not set or
4415    /// holds a different branch.
4416    pub fn http_get(&self) -> std::option::Option<&std::boxed::Box<crate::model::HTTPGetAction>> {
4417        #[allow(unreachable_patterns)]
4418        self.probe_type.as_ref().and_then(|v| match v {
4419            crate::model::probe::ProbeType::HttpGet(v) => std::option::Option::Some(v),
4420            _ => std::option::Option::None,
4421        })
4422    }
4423
4424    /// The value of [probe_type][crate::model::Probe::probe_type]
4425    /// if it holds a `TcpSocket`, `None` if the field is not set or
4426    /// holds a different branch.
4427    pub fn tcp_socket(
4428        &self,
4429    ) -> std::option::Option<&std::boxed::Box<crate::model::TCPSocketAction>> {
4430        #[allow(unreachable_patterns)]
4431        self.probe_type.as_ref().and_then(|v| match v {
4432            crate::model::probe::ProbeType::TcpSocket(v) => std::option::Option::Some(v),
4433            _ => std::option::Option::None,
4434        })
4435    }
4436
4437    /// The value of [probe_type][crate::model::Probe::probe_type]
4438    /// if it holds a `Grpc`, `None` if the field is not set or
4439    /// holds a different branch.
4440    pub fn grpc(&self) -> std::option::Option<&std::boxed::Box<crate::model::GRPCAction>> {
4441        #[allow(unreachable_patterns)]
4442        self.probe_type.as_ref().and_then(|v| match v {
4443            crate::model::probe::ProbeType::Grpc(v) => std::option::Option::Some(v),
4444            _ => std::option::Option::None,
4445        })
4446    }
4447
4448    /// Sets the value of [probe_type][crate::model::Probe::probe_type]
4449    /// to hold a `HttpGet`.
4450    ///
4451    /// Note that all the setters affecting `probe_type` are
4452    /// mutually exclusive.
4453    pub fn set_http_get<T: std::convert::Into<std::boxed::Box<crate::model::HTTPGetAction>>>(
4454        mut self,
4455        v: T,
4456    ) -> Self {
4457        self.probe_type =
4458            std::option::Option::Some(crate::model::probe::ProbeType::HttpGet(v.into()));
4459        self
4460    }
4461
4462    /// Sets the value of [probe_type][crate::model::Probe::probe_type]
4463    /// to hold a `TcpSocket`.
4464    ///
4465    /// Note that all the setters affecting `probe_type` are
4466    /// mutually exclusive.
4467    pub fn set_tcp_socket<T: std::convert::Into<std::boxed::Box<crate::model::TCPSocketAction>>>(
4468        mut self,
4469        v: T,
4470    ) -> Self {
4471        self.probe_type =
4472            std::option::Option::Some(crate::model::probe::ProbeType::TcpSocket(v.into()));
4473        self
4474    }
4475
4476    /// Sets the value of [probe_type][crate::model::Probe::probe_type]
4477    /// to hold a `Grpc`.
4478    ///
4479    /// Note that all the setters affecting `probe_type` are
4480    /// mutually exclusive.
4481    pub fn set_grpc<T: std::convert::Into<std::boxed::Box<crate::model::GRPCAction>>>(
4482        mut self,
4483        v: T,
4484    ) -> Self {
4485        self.probe_type = std::option::Option::Some(crate::model::probe::ProbeType::Grpc(v.into()));
4486        self
4487    }
4488}
4489
4490impl wkt::message::Message for Probe {
4491    fn typename() -> &'static str {
4492        "type.googleapis.com/google.cloud.run.v2.Probe"
4493    }
4494}
4495
4496/// Defines additional types related to [Probe].
4497pub mod probe {
4498    #[allow(unused_imports)]
4499    use super::*;
4500
4501    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4502    #[serde(rename_all = "camelCase")]
4503    #[non_exhaustive]
4504    pub enum ProbeType {
4505        /// Optional. HTTPGet specifies the http request to perform.
4506        /// Exactly one of httpGet, tcpSocket, or grpc must be specified.
4507        HttpGet(std::boxed::Box<crate::model::HTTPGetAction>),
4508        /// Optional. TCPSocket specifies an action involving a TCP port.
4509        /// Exactly one of httpGet, tcpSocket, or grpc must be specified.
4510        TcpSocket(std::boxed::Box<crate::model::TCPSocketAction>),
4511        /// Optional. GRPC specifies an action involving a gRPC port.
4512        /// Exactly one of httpGet, tcpSocket, or grpc must be specified.
4513        Grpc(std::boxed::Box<crate::model::GRPCAction>),
4514    }
4515}
4516
4517/// HTTPGetAction describes an action based on HTTP Get requests.
4518#[serde_with::serde_as]
4519#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4520#[serde(default, rename_all = "camelCase")]
4521#[non_exhaustive]
4522pub struct HTTPGetAction {
4523    /// Optional. Path to access on the HTTP server. Defaults to '/'.
4524    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4525    pub path: std::string::String,
4526
4527    /// Optional. Custom headers to set in the request. HTTP allows repeated
4528    /// headers.
4529    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4530    pub http_headers: std::vec::Vec<crate::model::HTTPHeader>,
4531
4532    /// Optional. Port number to access on the container. Must be in the range 1 to
4533    /// 65535. If not specified, defaults to the exposed port of the container,
4534    /// which is the value of container.ports[0].containerPort.
4535    pub port: i32,
4536
4537    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4538    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4539}
4540
4541impl HTTPGetAction {
4542    pub fn new() -> Self {
4543        std::default::Default::default()
4544    }
4545
4546    /// Sets the value of [path][crate::model::HTTPGetAction::path].
4547    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4548        self.path = v.into();
4549        self
4550    }
4551
4552    /// Sets the value of [port][crate::model::HTTPGetAction::port].
4553    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4554        self.port = v.into();
4555        self
4556    }
4557
4558    /// Sets the value of [http_headers][crate::model::HTTPGetAction::http_headers].
4559    pub fn set_http_headers<T, V>(mut self, v: T) -> Self
4560    where
4561        T: std::iter::IntoIterator<Item = V>,
4562        V: std::convert::Into<crate::model::HTTPHeader>,
4563    {
4564        use std::iter::Iterator;
4565        self.http_headers = v.into_iter().map(|i| i.into()).collect();
4566        self
4567    }
4568}
4569
4570impl wkt::message::Message for HTTPGetAction {
4571    fn typename() -> &'static str {
4572        "type.googleapis.com/google.cloud.run.v2.HTTPGetAction"
4573    }
4574}
4575
4576/// HTTPHeader describes a custom header to be used in HTTP probes
4577#[serde_with::serde_as]
4578#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4579#[serde(default, rename_all = "camelCase")]
4580#[non_exhaustive]
4581pub struct HTTPHeader {
4582    /// Required. The header field name
4583    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4584    pub name: std::string::String,
4585
4586    /// Optional. The header field value
4587    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4588    pub value: std::string::String,
4589
4590    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4591    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4592}
4593
4594impl HTTPHeader {
4595    pub fn new() -> Self {
4596        std::default::Default::default()
4597    }
4598
4599    /// Sets the value of [name][crate::model::HTTPHeader::name].
4600    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4601        self.name = v.into();
4602        self
4603    }
4604
4605    /// Sets the value of [value][crate::model::HTTPHeader::value].
4606    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4607        self.value = v.into();
4608        self
4609    }
4610}
4611
4612impl wkt::message::Message for HTTPHeader {
4613    fn typename() -> &'static str {
4614        "type.googleapis.com/google.cloud.run.v2.HTTPHeader"
4615    }
4616}
4617
4618/// TCPSocketAction describes an action based on opening a socket
4619#[serde_with::serde_as]
4620#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4621#[serde(default, rename_all = "camelCase")]
4622#[non_exhaustive]
4623pub struct TCPSocketAction {
4624    /// Optional. Port number to access on the container. Must be in the range 1 to
4625    /// 65535. If not specified, defaults to the exposed port of the container,
4626    /// which is the value of container.ports[0].containerPort.
4627    pub port: i32,
4628
4629    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4630    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4631}
4632
4633impl TCPSocketAction {
4634    pub fn new() -> Self {
4635        std::default::Default::default()
4636    }
4637
4638    /// Sets the value of [port][crate::model::TCPSocketAction::port].
4639    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4640        self.port = v.into();
4641        self
4642    }
4643}
4644
4645impl wkt::message::Message for TCPSocketAction {
4646    fn typename() -> &'static str {
4647        "type.googleapis.com/google.cloud.run.v2.TCPSocketAction"
4648    }
4649}
4650
4651/// GRPCAction describes an action involving a GRPC port.
4652#[serde_with::serde_as]
4653#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4654#[serde(default, rename_all = "camelCase")]
4655#[non_exhaustive]
4656pub struct GRPCAction {
4657    /// Optional. Port number of the gRPC service. Number must be in the range 1 to
4658    /// 65535. If not specified, defaults to the exposed port of the container,
4659    /// which is the value of container.ports[0].containerPort.
4660    pub port: i32,
4661
4662    /// Optional. Service is the name of the service to place in the gRPC
4663    /// HealthCheckRequest (see
4664    /// <https://github.com/grpc/grpc/blob/master/doc/health-checking.md> ). If this
4665    /// is not specified, the default behavior is defined by gRPC.
4666    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4667    pub service: std::string::String,
4668
4669    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4670    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4671}
4672
4673impl GRPCAction {
4674    pub fn new() -> Self {
4675        std::default::Default::default()
4676    }
4677
4678    /// Sets the value of [port][crate::model::GRPCAction::port].
4679    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4680        self.port = v.into();
4681        self
4682    }
4683
4684    /// Sets the value of [service][crate::model::GRPCAction::service].
4685    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4686        self.service = v.into();
4687        self
4688    }
4689}
4690
4691impl wkt::message::Message for GRPCAction {
4692    fn typename() -> &'static str {
4693        "type.googleapis.com/google.cloud.run.v2.GRPCAction"
4694    }
4695}
4696
4697/// Build information of the image.
4698#[serde_with::serde_as]
4699#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4700#[serde(default, rename_all = "camelCase")]
4701#[non_exhaustive]
4702pub struct BuildInfo {
4703    /// Output only. Entry point of the function when the image is a Cloud Run
4704    /// function.
4705    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4706    pub function_target: std::string::String,
4707
4708    /// Output only. Source code location of the image.
4709    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4710    pub source_location: std::string::String,
4711
4712    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4713    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4714}
4715
4716impl BuildInfo {
4717    pub fn new() -> Self {
4718        std::default::Default::default()
4719    }
4720
4721    /// Sets the value of [function_target][crate::model::BuildInfo::function_target].
4722    pub fn set_function_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4723        self.function_target = v.into();
4724        self
4725    }
4726
4727    /// Sets the value of [source_location][crate::model::BuildInfo::source_location].
4728    pub fn set_source_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4729        self.source_location = v.into();
4730        self
4731    }
4732}
4733
4734impl wkt::message::Message for BuildInfo {
4735    fn typename() -> &'static str {
4736        "type.googleapis.com/google.cloud.run.v2.BuildInfo"
4737    }
4738}
4739
4740/// Request message for obtaining a Revision by its full name.
4741#[serde_with::serde_as]
4742#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4743#[serde(default, rename_all = "camelCase")]
4744#[non_exhaustive]
4745pub struct GetRevisionRequest {
4746    /// Required. The full name of the Revision.
4747    /// Format:
4748    /// projects/{project}/locations/{location}/services/{service}/revisions/{revision}
4749    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4750    pub name: std::string::String,
4751
4752    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4753    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4754}
4755
4756impl GetRevisionRequest {
4757    pub fn new() -> Self {
4758        std::default::Default::default()
4759    }
4760
4761    /// Sets the value of [name][crate::model::GetRevisionRequest::name].
4762    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4763        self.name = v.into();
4764        self
4765    }
4766}
4767
4768impl wkt::message::Message for GetRevisionRequest {
4769    fn typename() -> &'static str {
4770        "type.googleapis.com/google.cloud.run.v2.GetRevisionRequest"
4771    }
4772}
4773
4774/// Request message for retrieving a list of Revisions.
4775#[serde_with::serde_as]
4776#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4777#[serde(default, rename_all = "camelCase")]
4778#[non_exhaustive]
4779pub struct ListRevisionsRequest {
4780    /// Required. The Service from which the Revisions should be listed.
4781    /// To list all Revisions across Services, use "-" instead of Service name.
4782    /// Format:
4783    /// projects/{project}/locations/{location}/services/{service}
4784    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4785    pub parent: std::string::String,
4786
4787    /// Maximum number of revisions to return in this call.
4788    pub page_size: i32,
4789
4790    /// A page token received from a previous call to ListRevisions.
4791    /// All other parameters must match.
4792    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4793    pub page_token: std::string::String,
4794
4795    /// If true, returns deleted (but unexpired) resources along with active ones.
4796    pub show_deleted: bool,
4797
4798    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4799    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4800}
4801
4802impl ListRevisionsRequest {
4803    pub fn new() -> Self {
4804        std::default::Default::default()
4805    }
4806
4807    /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
4808    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4809        self.parent = v.into();
4810        self
4811    }
4812
4813    /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
4814    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4815        self.page_size = v.into();
4816        self
4817    }
4818
4819    /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
4820    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4821        self.page_token = v.into();
4822        self
4823    }
4824
4825    /// Sets the value of [show_deleted][crate::model::ListRevisionsRequest::show_deleted].
4826    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4827        self.show_deleted = v.into();
4828        self
4829    }
4830}
4831
4832impl wkt::message::Message for ListRevisionsRequest {
4833    fn typename() -> &'static str {
4834        "type.googleapis.com/google.cloud.run.v2.ListRevisionsRequest"
4835    }
4836}
4837
4838/// Response message containing a list of Revisions.
4839#[serde_with::serde_as]
4840#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4841#[serde(default, rename_all = "camelCase")]
4842#[non_exhaustive]
4843pub struct ListRevisionsResponse {
4844    /// The resulting list of Revisions.
4845    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4846    pub revisions: std::vec::Vec<crate::model::Revision>,
4847
4848    /// A token indicating there are more items than page_size. Use it in the next
4849    /// ListRevisions request to continue.
4850    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4851    pub next_page_token: std::string::String,
4852
4853    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4854    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4855}
4856
4857impl ListRevisionsResponse {
4858    pub fn new() -> Self {
4859        std::default::Default::default()
4860    }
4861
4862    /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
4863    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4864        self.next_page_token = v.into();
4865        self
4866    }
4867
4868    /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
4869    pub fn set_revisions<T, V>(mut self, v: T) -> Self
4870    where
4871        T: std::iter::IntoIterator<Item = V>,
4872        V: std::convert::Into<crate::model::Revision>,
4873    {
4874        use std::iter::Iterator;
4875        self.revisions = v.into_iter().map(|i| i.into()).collect();
4876        self
4877    }
4878}
4879
4880impl wkt::message::Message for ListRevisionsResponse {
4881    fn typename() -> &'static str {
4882        "type.googleapis.com/google.cloud.run.v2.ListRevisionsResponse"
4883    }
4884}
4885
4886#[doc(hidden)]
4887impl gax::paginator::internal::PageableResponse for ListRevisionsResponse {
4888    type PageItem = crate::model::Revision;
4889
4890    fn items(self) -> std::vec::Vec<Self::PageItem> {
4891        self.revisions
4892    }
4893
4894    fn next_page_token(&self) -> std::string::String {
4895        use std::clone::Clone;
4896        self.next_page_token.clone()
4897    }
4898}
4899
4900/// Request message for deleting a retired Revision.
4901/// Revision lifecycle is usually managed by making changes to the parent
4902/// Service. Only retired revisions can be deleted with this API.
4903#[serde_with::serde_as]
4904#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4905#[serde(default, rename_all = "camelCase")]
4906#[non_exhaustive]
4907pub struct DeleteRevisionRequest {
4908    /// Required. The name of the Revision to delete.
4909    /// Format:
4910    /// projects/{project}/locations/{location}/services/{service}/revisions/{revision}
4911    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4912    pub name: std::string::String,
4913
4914    /// Indicates that the request should be validated without actually
4915    /// deleting any resources.
4916    pub validate_only: bool,
4917
4918    /// A system-generated fingerprint for this version of the
4919    /// resource. This may be used to detect modification conflict during updates.
4920    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4921    pub etag: std::string::String,
4922
4923    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4924    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4925}
4926
4927impl DeleteRevisionRequest {
4928    pub fn new() -> Self {
4929        std::default::Default::default()
4930    }
4931
4932    /// Sets the value of [name][crate::model::DeleteRevisionRequest::name].
4933    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4934        self.name = v.into();
4935        self
4936    }
4937
4938    /// Sets the value of [validate_only][crate::model::DeleteRevisionRequest::validate_only].
4939    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4940        self.validate_only = v.into();
4941        self
4942    }
4943
4944    /// Sets the value of [etag][crate::model::DeleteRevisionRequest::etag].
4945    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4946        self.etag = v.into();
4947        self
4948    }
4949}
4950
4951impl wkt::message::Message for DeleteRevisionRequest {
4952    fn typename() -> &'static str {
4953        "type.googleapis.com/google.cloud.run.v2.DeleteRevisionRequest"
4954    }
4955}
4956
4957/// A Revision is an immutable snapshot of code and configuration.  A Revision
4958/// references a container image. Revisions are only created by updates to its
4959/// parent Service.
4960#[serde_with::serde_as]
4961#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4962#[serde(default, rename_all = "camelCase")]
4963#[non_exhaustive]
4964pub struct Revision {
4965    /// Output only. The unique name of this Revision.
4966    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4967    pub name: std::string::String,
4968
4969    /// Output only. Server assigned unique identifier for the Revision. The value
4970    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
4971    /// deleted.
4972    #[serde(skip_serializing_if = "std::string::String::is_empty")]
4973    pub uid: std::string::String,
4974
4975    /// Output only. A number that monotonically increases every time the user
4976    /// modifies the desired state.
4977    #[serde_as(as = "serde_with::DisplayFromStr")]
4978    pub generation: i64,
4979
4980    /// Output only. Unstructured key value map that can be used to organize and
4981    /// categorize objects. User-provided labels are shared with Google's billing
4982    /// system, so they can be used to filter, or break down billing charges by
4983    /// team, component, environment, state, etc. For more information, visit
4984    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
4985    /// <https://cloud.google.com/run/docs/configuring/labels>.
4986    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4987    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4988
4989    /// Output only. Unstructured key value map that may
4990    /// be set by external tools to store and arbitrary metadata.
4991    /// They are not queryable and should be preserved
4992    /// when modifying objects.
4993    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4994    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
4995
4996    /// Output only. The creation time.
4997    #[serde(skip_serializing_if = "std::option::Option::is_none")]
4998    pub create_time: std::option::Option<wkt::Timestamp>,
4999
5000    /// Output only. The last-modified time.
5001    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5002    pub update_time: std::option::Option<wkt::Timestamp>,
5003
5004    /// Output only. For a deleted resource, the deletion time. It is only
5005    /// populated as a response to a Delete request.
5006    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5007    pub delete_time: std::option::Option<wkt::Timestamp>,
5008
5009    /// Output only. For a deleted resource, the time after which it will be
5010    /// permamently deleted. It is only populated as a response to a Delete
5011    /// request.
5012    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5013    pub expire_time: std::option::Option<wkt::Timestamp>,
5014
5015    /// The least stable launch stage needed to create this resource, as defined by
5016    /// [Google Cloud Platform Launch
5017    /// Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports
5018    /// `ALPHA`, `BETA`, and `GA`.
5019    ///
5020    /// Note that this value might not be what was used
5021    /// as input. For example, if ALPHA was provided as input in the parent
5022    /// resource, but only BETA and GA-level features are were, this field will be
5023    /// BETA.
5024    pub launch_stage: api::model::LaunchStage,
5025
5026    /// Output only. The name of the parent service.
5027    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5028    pub service: std::string::String,
5029
5030    /// Scaling settings for this revision.
5031    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5032    pub scaling: std::option::Option<crate::model::RevisionScaling>,
5033
5034    /// VPC Access configuration for this Revision. For more information, visit
5035    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
5036    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5037    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
5038
5039    /// Sets the maximum number of requests that each serving instance can receive.
5040    pub max_instance_request_concurrency: i32,
5041
5042    /// Max allowed time for an instance to respond to a request.
5043    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5044    pub timeout: std::option::Option<wkt::Duration>,
5045
5046    /// Email address of the IAM service account associated with the revision of
5047    /// the service. The service account represents the identity of the running
5048    /// revision, and determines what permissions the revision has.
5049    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5050    pub service_account: std::string::String,
5051
5052    /// Holds the single container that defines the unit of execution for this
5053    /// Revision.
5054    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5055    pub containers: std::vec::Vec<crate::model::Container>,
5056
5057    /// A list of Volumes to make available to containers.
5058    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5059    pub volumes: std::vec::Vec<crate::model::Volume>,
5060
5061    /// The execution environment being used to host this Revision.
5062    pub execution_environment: crate::model::ExecutionEnvironment,
5063
5064    /// A reference to a customer managed encryption key (CMEK) to use to encrypt
5065    /// this container image. For more information, go to
5066    /// <https://cloud.google.com/run/docs/securing/using-cmek>
5067    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5068    pub encryption_key: std::string::String,
5069
5070    /// Enables service mesh connectivity.
5071    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5072    pub service_mesh: std::option::Option<crate::model::ServiceMesh>,
5073
5074    /// The action to take if the encryption key is revoked.
5075    pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
5076
5077    /// If encryption_key_revocation_action is SHUTDOWN, the duration before
5078    /// shutting down all instances. The minimum increment is 1 hour.
5079    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5080    pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
5081
5082    /// Output only. Indicates whether the resource's reconciliation is still in
5083    /// progress. See comments in `Service.reconciling` for additional information
5084    /// on reconciliation process in Cloud Run.
5085    pub reconciling: bool,
5086
5087    /// Output only. The Condition of this Revision, containing its readiness
5088    /// status, and detailed error information in case it did not reach a serving
5089    /// state.
5090    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5091    pub conditions: std::vec::Vec<crate::model::Condition>,
5092
5093    /// Output only. The generation of this Revision currently serving traffic. See
5094    /// comments in `reconciling` for additional information on reconciliation
5095    /// process in Cloud Run.
5096    #[serde_as(as = "serde_with::DisplayFromStr")]
5097    pub observed_generation: i64,
5098
5099    /// Output only. The Google Console URI to obtain logs for the Revision.
5100    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5101    pub log_uri: std::string::String,
5102
5103    /// Output only. Reserved for future use.
5104    pub satisfies_pzs: bool,
5105
5106    /// Enable session affinity.
5107    pub session_affinity: bool,
5108
5109    /// Output only. The current effective scaling settings for the revision.
5110    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5111    pub scaling_status: std::option::Option<crate::model::RevisionScalingStatus>,
5112
5113    /// The node selector for the revision.
5114    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5115    pub node_selector: std::option::Option<crate::model::NodeSelector>,
5116
5117    /// Output only. A system-generated fingerprint for this version of the
5118    /// resource. May be used to detect modification conflict during updates.
5119    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5120    pub etag: std::string::String,
5121
5122    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5123    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5124}
5125
5126impl Revision {
5127    pub fn new() -> Self {
5128        std::default::Default::default()
5129    }
5130
5131    /// Sets the value of [name][crate::model::Revision::name].
5132    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5133        self.name = v.into();
5134        self
5135    }
5136
5137    /// Sets the value of [uid][crate::model::Revision::uid].
5138    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5139        self.uid = v.into();
5140        self
5141    }
5142
5143    /// Sets the value of [generation][crate::model::Revision::generation].
5144    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5145        self.generation = v.into();
5146        self
5147    }
5148
5149    /// Sets the value of [create_time][crate::model::Revision::create_time].
5150    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
5151        mut self,
5152        v: T,
5153    ) -> Self {
5154        self.create_time = v.into();
5155        self
5156    }
5157
5158    /// Sets the value of [update_time][crate::model::Revision::update_time].
5159    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
5160        mut self,
5161        v: T,
5162    ) -> Self {
5163        self.update_time = v.into();
5164        self
5165    }
5166
5167    /// Sets the value of [delete_time][crate::model::Revision::delete_time].
5168    pub fn set_delete_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
5169        mut self,
5170        v: T,
5171    ) -> Self {
5172        self.delete_time = v.into();
5173        self
5174    }
5175
5176    /// Sets the value of [expire_time][crate::model::Revision::expire_time].
5177    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
5178        mut self,
5179        v: T,
5180    ) -> Self {
5181        self.expire_time = v.into();
5182        self
5183    }
5184
5185    /// Sets the value of [launch_stage][crate::model::Revision::launch_stage].
5186    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
5187        mut self,
5188        v: T,
5189    ) -> Self {
5190        self.launch_stage = v.into();
5191        self
5192    }
5193
5194    /// Sets the value of [service][crate::model::Revision::service].
5195    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5196        self.service = v.into();
5197        self
5198    }
5199
5200    /// Sets the value of [scaling][crate::model::Revision::scaling].
5201    pub fn set_scaling<
5202        T: std::convert::Into<std::option::Option<crate::model::RevisionScaling>>,
5203    >(
5204        mut self,
5205        v: T,
5206    ) -> Self {
5207        self.scaling = v.into();
5208        self
5209    }
5210
5211    /// Sets the value of [vpc_access][crate::model::Revision::vpc_access].
5212    pub fn set_vpc_access<T: std::convert::Into<std::option::Option<crate::model::VpcAccess>>>(
5213        mut self,
5214        v: T,
5215    ) -> Self {
5216        self.vpc_access = v.into();
5217        self
5218    }
5219
5220    /// Sets the value of [max_instance_request_concurrency][crate::model::Revision::max_instance_request_concurrency].
5221    pub fn set_max_instance_request_concurrency<T: std::convert::Into<i32>>(
5222        mut self,
5223        v: T,
5224    ) -> Self {
5225        self.max_instance_request_concurrency = v.into();
5226        self
5227    }
5228
5229    /// Sets the value of [timeout][crate::model::Revision::timeout].
5230    pub fn set_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
5231        mut self,
5232        v: T,
5233    ) -> Self {
5234        self.timeout = v.into();
5235        self
5236    }
5237
5238    /// Sets the value of [service_account][crate::model::Revision::service_account].
5239    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5240        self.service_account = v.into();
5241        self
5242    }
5243
5244    /// Sets the value of [execution_environment][crate::model::Revision::execution_environment].
5245    pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
5246        mut self,
5247        v: T,
5248    ) -> Self {
5249        self.execution_environment = v.into();
5250        self
5251    }
5252
5253    /// Sets the value of [encryption_key][crate::model::Revision::encryption_key].
5254    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5255        self.encryption_key = v.into();
5256        self
5257    }
5258
5259    /// Sets the value of [service_mesh][crate::model::Revision::service_mesh].
5260    pub fn set_service_mesh<
5261        T: std::convert::Into<std::option::Option<crate::model::ServiceMesh>>,
5262    >(
5263        mut self,
5264        v: T,
5265    ) -> Self {
5266        self.service_mesh = v.into();
5267        self
5268    }
5269
5270    /// Sets the value of [encryption_key_revocation_action][crate::model::Revision::encryption_key_revocation_action].
5271    pub fn set_encryption_key_revocation_action<
5272        T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
5273    >(
5274        mut self,
5275        v: T,
5276    ) -> Self {
5277        self.encryption_key_revocation_action = v.into();
5278        self
5279    }
5280
5281    /// Sets the value of [encryption_key_shutdown_duration][crate::model::Revision::encryption_key_shutdown_duration].
5282    pub fn set_encryption_key_shutdown_duration<
5283        T: std::convert::Into<std::option::Option<wkt::Duration>>,
5284    >(
5285        mut self,
5286        v: T,
5287    ) -> Self {
5288        self.encryption_key_shutdown_duration = v.into();
5289        self
5290    }
5291
5292    /// Sets the value of [reconciling][crate::model::Revision::reconciling].
5293    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5294        self.reconciling = v.into();
5295        self
5296    }
5297
5298    /// Sets the value of [observed_generation][crate::model::Revision::observed_generation].
5299    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5300        self.observed_generation = v.into();
5301        self
5302    }
5303
5304    /// Sets the value of [log_uri][crate::model::Revision::log_uri].
5305    pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5306        self.log_uri = v.into();
5307        self
5308    }
5309
5310    /// Sets the value of [satisfies_pzs][crate::model::Revision::satisfies_pzs].
5311    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5312        self.satisfies_pzs = v.into();
5313        self
5314    }
5315
5316    /// Sets the value of [session_affinity][crate::model::Revision::session_affinity].
5317    pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5318        self.session_affinity = v.into();
5319        self
5320    }
5321
5322    /// Sets the value of [scaling_status][crate::model::Revision::scaling_status].
5323    pub fn set_scaling_status<
5324        T: std::convert::Into<std::option::Option<crate::model::RevisionScalingStatus>>,
5325    >(
5326        mut self,
5327        v: T,
5328    ) -> Self {
5329        self.scaling_status = v.into();
5330        self
5331    }
5332
5333    /// Sets the value of [node_selector][crate::model::Revision::node_selector].
5334    pub fn set_node_selector<
5335        T: std::convert::Into<std::option::Option<crate::model::NodeSelector>>,
5336    >(
5337        mut self,
5338        v: T,
5339    ) -> Self {
5340        self.node_selector = v.into();
5341        self
5342    }
5343
5344    /// Sets the value of [etag][crate::model::Revision::etag].
5345    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5346        self.etag = v.into();
5347        self
5348    }
5349
5350    /// Sets the value of [containers][crate::model::Revision::containers].
5351    pub fn set_containers<T, V>(mut self, v: T) -> Self
5352    where
5353        T: std::iter::IntoIterator<Item = V>,
5354        V: std::convert::Into<crate::model::Container>,
5355    {
5356        use std::iter::Iterator;
5357        self.containers = v.into_iter().map(|i| i.into()).collect();
5358        self
5359    }
5360
5361    /// Sets the value of [volumes][crate::model::Revision::volumes].
5362    pub fn set_volumes<T, V>(mut self, v: T) -> Self
5363    where
5364        T: std::iter::IntoIterator<Item = V>,
5365        V: std::convert::Into<crate::model::Volume>,
5366    {
5367        use std::iter::Iterator;
5368        self.volumes = v.into_iter().map(|i| i.into()).collect();
5369        self
5370    }
5371
5372    /// Sets the value of [conditions][crate::model::Revision::conditions].
5373    pub fn set_conditions<T, V>(mut self, v: T) -> Self
5374    where
5375        T: std::iter::IntoIterator<Item = V>,
5376        V: std::convert::Into<crate::model::Condition>,
5377    {
5378        use std::iter::Iterator;
5379        self.conditions = v.into_iter().map(|i| i.into()).collect();
5380        self
5381    }
5382
5383    /// Sets the value of [labels][crate::model::Revision::labels].
5384    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5385    where
5386        T: std::iter::IntoIterator<Item = (K, V)>,
5387        K: std::convert::Into<std::string::String>,
5388        V: std::convert::Into<std::string::String>,
5389    {
5390        use std::iter::Iterator;
5391        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5392        self
5393    }
5394
5395    /// Sets the value of [annotations][crate::model::Revision::annotations].
5396    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5397    where
5398        T: std::iter::IntoIterator<Item = (K, V)>,
5399        K: std::convert::Into<std::string::String>,
5400        V: std::convert::Into<std::string::String>,
5401    {
5402        use std::iter::Iterator;
5403        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5404        self
5405    }
5406}
5407
5408impl wkt::message::Message for Revision {
5409    fn typename() -> &'static str {
5410        "type.googleapis.com/google.cloud.run.v2.Revision"
5411    }
5412}
5413
5414/// RevisionTemplate describes the data a revision should have when created from
5415/// a template.
5416#[serde_with::serde_as]
5417#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5418#[serde(default, rename_all = "camelCase")]
5419#[non_exhaustive]
5420pub struct RevisionTemplate {
5421    /// Optional. The unique name for the revision. If this field is omitted, it
5422    /// will be automatically generated based on the Service name.
5423    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5424    pub revision: std::string::String,
5425
5426    /// Optional. Unstructured key value map that can be used to organize and
5427    /// categorize objects. User-provided labels are shared with Google's billing
5428    /// system, so they can be used to filter, or break down billing charges by
5429    /// team, component, environment, state, etc. For more information, visit
5430    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
5431    /// <https://cloud.google.com/run/docs/configuring/labels>.
5432    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5433    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5434
5435    /// Optional. Unstructured key value map that may be set by external tools to
5436    /// store and arbitrary metadata. They are not queryable and should be
5437    /// preserved when modifying objects.
5438    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5439    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5440
5441    /// Optional. Scaling settings for this Revision.
5442    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5443    pub scaling: std::option::Option<crate::model::RevisionScaling>,
5444
5445    /// Optional. VPC Access configuration to use for this Revision. For more
5446    /// information, visit
5447    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
5448    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5449    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
5450
5451    /// Optional. Max allowed time for an instance to respond to a request.
5452    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5453    pub timeout: std::option::Option<wkt::Duration>,
5454
5455    /// Optional. Email address of the IAM service account associated with the
5456    /// revision of the service. The service account represents the identity of the
5457    /// running revision, and determines what permissions the revision has. If not
5458    /// provided, the revision will use the project's default service account.
5459    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5460    pub service_account: std::string::String,
5461
5462    /// Holds the single container that defines the unit of execution for this
5463    /// Revision.
5464    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5465    pub containers: std::vec::Vec<crate::model::Container>,
5466
5467    /// Optional. A list of Volumes to make available to containers.
5468    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5469    pub volumes: std::vec::Vec<crate::model::Volume>,
5470
5471    /// Optional. The sandbox environment to host this Revision.
5472    pub execution_environment: crate::model::ExecutionEnvironment,
5473
5474    /// A reference to a customer managed encryption key (CMEK) to use to encrypt
5475    /// this container image. For more information, go to
5476    /// <https://cloud.google.com/run/docs/securing/using-cmek>
5477    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5478    pub encryption_key: std::string::String,
5479
5480    /// Optional. Sets the maximum number of requests that each serving instance
5481    /// can receive. If not specified or 0, concurrency defaults to 80 when
5482    /// requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`.
5483    pub max_instance_request_concurrency: i32,
5484
5485    /// Optional. Enables service mesh connectivity.
5486    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5487    pub service_mesh: std::option::Option<crate::model::ServiceMesh>,
5488
5489    /// Optional. The action to take if the encryption key is revoked.
5490    pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
5491
5492    /// Optional. If encryption_key_revocation_action is SHUTDOWN, the duration
5493    /// before shutting down all instances. The minimum increment is 1 hour.
5494    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5495    pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
5496
5497    /// Optional. Enable session affinity.
5498    pub session_affinity: bool,
5499
5500    /// Optional. Disables health checking containers during deployment.
5501    pub health_check_disabled: bool,
5502
5503    /// Optional. The node selector for the revision template.
5504    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5505    pub node_selector: std::option::Option<crate::model::NodeSelector>,
5506
5507    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5508    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5509}
5510
5511impl RevisionTemplate {
5512    pub fn new() -> Self {
5513        std::default::Default::default()
5514    }
5515
5516    /// Sets the value of [revision][crate::model::RevisionTemplate::revision].
5517    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5518        self.revision = v.into();
5519        self
5520    }
5521
5522    /// Sets the value of [scaling][crate::model::RevisionTemplate::scaling].
5523    pub fn set_scaling<
5524        T: std::convert::Into<std::option::Option<crate::model::RevisionScaling>>,
5525    >(
5526        mut self,
5527        v: T,
5528    ) -> Self {
5529        self.scaling = v.into();
5530        self
5531    }
5532
5533    /// Sets the value of [vpc_access][crate::model::RevisionTemplate::vpc_access].
5534    pub fn set_vpc_access<T: std::convert::Into<std::option::Option<crate::model::VpcAccess>>>(
5535        mut self,
5536        v: T,
5537    ) -> Self {
5538        self.vpc_access = v.into();
5539        self
5540    }
5541
5542    /// Sets the value of [timeout][crate::model::RevisionTemplate::timeout].
5543    pub fn set_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
5544        mut self,
5545        v: T,
5546    ) -> Self {
5547        self.timeout = v.into();
5548        self
5549    }
5550
5551    /// Sets the value of [service_account][crate::model::RevisionTemplate::service_account].
5552    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5553        self.service_account = v.into();
5554        self
5555    }
5556
5557    /// Sets the value of [execution_environment][crate::model::RevisionTemplate::execution_environment].
5558    pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
5559        mut self,
5560        v: T,
5561    ) -> Self {
5562        self.execution_environment = v.into();
5563        self
5564    }
5565
5566    /// Sets the value of [encryption_key][crate::model::RevisionTemplate::encryption_key].
5567    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5568        self.encryption_key = v.into();
5569        self
5570    }
5571
5572    /// Sets the value of [max_instance_request_concurrency][crate::model::RevisionTemplate::max_instance_request_concurrency].
5573    pub fn set_max_instance_request_concurrency<T: std::convert::Into<i32>>(
5574        mut self,
5575        v: T,
5576    ) -> Self {
5577        self.max_instance_request_concurrency = v.into();
5578        self
5579    }
5580
5581    /// Sets the value of [service_mesh][crate::model::RevisionTemplate::service_mesh].
5582    pub fn set_service_mesh<
5583        T: std::convert::Into<std::option::Option<crate::model::ServiceMesh>>,
5584    >(
5585        mut self,
5586        v: T,
5587    ) -> Self {
5588        self.service_mesh = v.into();
5589        self
5590    }
5591
5592    /// Sets the value of [encryption_key_revocation_action][crate::model::RevisionTemplate::encryption_key_revocation_action].
5593    pub fn set_encryption_key_revocation_action<
5594        T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
5595    >(
5596        mut self,
5597        v: T,
5598    ) -> Self {
5599        self.encryption_key_revocation_action = v.into();
5600        self
5601    }
5602
5603    /// Sets the value of [encryption_key_shutdown_duration][crate::model::RevisionTemplate::encryption_key_shutdown_duration].
5604    pub fn set_encryption_key_shutdown_duration<
5605        T: std::convert::Into<std::option::Option<wkt::Duration>>,
5606    >(
5607        mut self,
5608        v: T,
5609    ) -> Self {
5610        self.encryption_key_shutdown_duration = v.into();
5611        self
5612    }
5613
5614    /// Sets the value of [session_affinity][crate::model::RevisionTemplate::session_affinity].
5615    pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5616        self.session_affinity = v.into();
5617        self
5618    }
5619
5620    /// Sets the value of [health_check_disabled][crate::model::RevisionTemplate::health_check_disabled].
5621    pub fn set_health_check_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5622        self.health_check_disabled = v.into();
5623        self
5624    }
5625
5626    /// Sets the value of [node_selector][crate::model::RevisionTemplate::node_selector].
5627    pub fn set_node_selector<
5628        T: std::convert::Into<std::option::Option<crate::model::NodeSelector>>,
5629    >(
5630        mut self,
5631        v: T,
5632    ) -> Self {
5633        self.node_selector = v.into();
5634        self
5635    }
5636
5637    /// Sets the value of [containers][crate::model::RevisionTemplate::containers].
5638    pub fn set_containers<T, V>(mut self, v: T) -> Self
5639    where
5640        T: std::iter::IntoIterator<Item = V>,
5641        V: std::convert::Into<crate::model::Container>,
5642    {
5643        use std::iter::Iterator;
5644        self.containers = v.into_iter().map(|i| i.into()).collect();
5645        self
5646    }
5647
5648    /// Sets the value of [volumes][crate::model::RevisionTemplate::volumes].
5649    pub fn set_volumes<T, V>(mut self, v: T) -> Self
5650    where
5651        T: std::iter::IntoIterator<Item = V>,
5652        V: std::convert::Into<crate::model::Volume>,
5653    {
5654        use std::iter::Iterator;
5655        self.volumes = v.into_iter().map(|i| i.into()).collect();
5656        self
5657    }
5658
5659    /// Sets the value of [labels][crate::model::RevisionTemplate::labels].
5660    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5661    where
5662        T: std::iter::IntoIterator<Item = (K, V)>,
5663        K: std::convert::Into<std::string::String>,
5664        V: std::convert::Into<std::string::String>,
5665    {
5666        use std::iter::Iterator;
5667        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5668        self
5669    }
5670
5671    /// Sets the value of [annotations][crate::model::RevisionTemplate::annotations].
5672    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5673    where
5674        T: std::iter::IntoIterator<Item = (K, V)>,
5675        K: std::convert::Into<std::string::String>,
5676        V: std::convert::Into<std::string::String>,
5677    {
5678        use std::iter::Iterator;
5679        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5680        self
5681    }
5682}
5683
5684impl wkt::message::Message for RevisionTemplate {
5685    fn typename() -> &'static str {
5686        "type.googleapis.com/google.cloud.run.v2.RevisionTemplate"
5687    }
5688}
5689
5690/// Request message for creating a Service.
5691#[serde_with::serde_as]
5692#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5693#[serde(default, rename_all = "camelCase")]
5694#[non_exhaustive]
5695pub struct CreateServiceRequest {
5696    /// Required. The location and project in which this service should be created.
5697    /// Format: projects/{project}/locations/{location}, where {project} can be
5698    /// project id or number. Only lowercase characters, digits, and hyphens.
5699    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5700    pub parent: std::string::String,
5701
5702    /// Required. The Service instance to create.
5703    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5704    pub service: std::option::Option<crate::model::Service>,
5705
5706    /// Required. The unique identifier for the Service. It must begin with letter,
5707    /// and cannot end with hyphen; must contain fewer than 50 characters.
5708    /// The name of the service becomes {parent}/services/{service_id}.
5709    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5710    pub service_id: std::string::String,
5711
5712    /// Indicates that the request should be validated and default values
5713    /// populated, without persisting the request or creating any resources.
5714    pub validate_only: bool,
5715
5716    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5717    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5718}
5719
5720impl CreateServiceRequest {
5721    pub fn new() -> Self {
5722        std::default::Default::default()
5723    }
5724
5725    /// Sets the value of [parent][crate::model::CreateServiceRequest::parent].
5726    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5727        self.parent = v.into();
5728        self
5729    }
5730
5731    /// Sets the value of [service][crate::model::CreateServiceRequest::service].
5732    pub fn set_service<T: std::convert::Into<std::option::Option<crate::model::Service>>>(
5733        mut self,
5734        v: T,
5735    ) -> Self {
5736        self.service = v.into();
5737        self
5738    }
5739
5740    /// Sets the value of [service_id][crate::model::CreateServiceRequest::service_id].
5741    pub fn set_service_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5742        self.service_id = v.into();
5743        self
5744    }
5745
5746    /// Sets the value of [validate_only][crate::model::CreateServiceRequest::validate_only].
5747    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5748        self.validate_only = v.into();
5749        self
5750    }
5751}
5752
5753impl wkt::message::Message for CreateServiceRequest {
5754    fn typename() -> &'static str {
5755        "type.googleapis.com/google.cloud.run.v2.CreateServiceRequest"
5756    }
5757}
5758
5759/// Request message for updating a service.
5760#[serde_with::serde_as]
5761#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5762#[serde(default, rename_all = "camelCase")]
5763#[non_exhaustive]
5764pub struct UpdateServiceRequest {
5765    /// Optional. The list of fields to be updated.
5766    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5767    pub update_mask: std::option::Option<wkt::FieldMask>,
5768
5769    /// Required. The Service to be updated.
5770    #[serde(skip_serializing_if = "std::option::Option::is_none")]
5771    pub service: std::option::Option<crate::model::Service>,
5772
5773    /// Indicates that the request should be validated and default values
5774    /// populated, without persisting the request or updating any resources.
5775    pub validate_only: bool,
5776
5777    /// Optional. If set to true, and if the Service does not exist, it will create
5778    /// a new one. The caller must have 'run.services.create' permissions if this
5779    /// is set to true and the Service does not exist.
5780    pub allow_missing: bool,
5781
5782    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5783    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5784}
5785
5786impl UpdateServiceRequest {
5787    pub fn new() -> Self {
5788        std::default::Default::default()
5789    }
5790
5791    /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
5792    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
5793        mut self,
5794        v: T,
5795    ) -> Self {
5796        self.update_mask = v.into();
5797        self
5798    }
5799
5800    /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
5801    pub fn set_service<T: std::convert::Into<std::option::Option<crate::model::Service>>>(
5802        mut self,
5803        v: T,
5804    ) -> Self {
5805        self.service = v.into();
5806        self
5807    }
5808
5809    /// Sets the value of [validate_only][crate::model::UpdateServiceRequest::validate_only].
5810    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5811        self.validate_only = v.into();
5812        self
5813    }
5814
5815    /// Sets the value of [allow_missing][crate::model::UpdateServiceRequest::allow_missing].
5816    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5817        self.allow_missing = v.into();
5818        self
5819    }
5820}
5821
5822impl wkt::message::Message for UpdateServiceRequest {
5823    fn typename() -> &'static str {
5824        "type.googleapis.com/google.cloud.run.v2.UpdateServiceRequest"
5825    }
5826}
5827
5828/// Request message for retrieving a list of Services.
5829#[serde_with::serde_as]
5830#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5831#[serde(default, rename_all = "camelCase")]
5832#[non_exhaustive]
5833pub struct ListServicesRequest {
5834    /// Required. The location and project to list resources on.
5835    /// Location must be a valid Google Cloud region, and cannot be the "-"
5836    /// wildcard. Format: projects/{project}/locations/{location}, where {project}
5837    /// can be project id or number.
5838    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5839    pub parent: std::string::String,
5840
5841    /// Maximum number of Services to return in this call.
5842    pub page_size: i32,
5843
5844    /// A page token received from a previous call to ListServices.
5845    /// All other parameters must match.
5846    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5847    pub page_token: std::string::String,
5848
5849    /// If true, returns deleted (but unexpired) resources along with active ones.
5850    pub show_deleted: bool,
5851
5852    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5853    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5854}
5855
5856impl ListServicesRequest {
5857    pub fn new() -> Self {
5858        std::default::Default::default()
5859    }
5860
5861    /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
5862    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5863        self.parent = v.into();
5864        self
5865    }
5866
5867    /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
5868    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5869        self.page_size = v.into();
5870        self
5871    }
5872
5873    /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
5874    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5875        self.page_token = v.into();
5876        self
5877    }
5878
5879    /// Sets the value of [show_deleted][crate::model::ListServicesRequest::show_deleted].
5880    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5881        self.show_deleted = v.into();
5882        self
5883    }
5884}
5885
5886impl wkt::message::Message for ListServicesRequest {
5887    fn typename() -> &'static str {
5888        "type.googleapis.com/google.cloud.run.v2.ListServicesRequest"
5889    }
5890}
5891
5892/// Response message containing a list of Services.
5893#[serde_with::serde_as]
5894#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5895#[serde(default, rename_all = "camelCase")]
5896#[non_exhaustive]
5897pub struct ListServicesResponse {
5898    /// The resulting list of Services.
5899    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5900    pub services: std::vec::Vec<crate::model::Service>,
5901
5902    /// A token indicating there are more items than page_size. Use it in the next
5903    /// ListServices request to continue.
5904    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5905    pub next_page_token: std::string::String,
5906
5907    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5908    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5909}
5910
5911impl ListServicesResponse {
5912    pub fn new() -> Self {
5913        std::default::Default::default()
5914    }
5915
5916    /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
5917    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5918        self.next_page_token = v.into();
5919        self
5920    }
5921
5922    /// Sets the value of [services][crate::model::ListServicesResponse::services].
5923    pub fn set_services<T, V>(mut self, v: T) -> Self
5924    where
5925        T: std::iter::IntoIterator<Item = V>,
5926        V: std::convert::Into<crate::model::Service>,
5927    {
5928        use std::iter::Iterator;
5929        self.services = v.into_iter().map(|i| i.into()).collect();
5930        self
5931    }
5932}
5933
5934impl wkt::message::Message for ListServicesResponse {
5935    fn typename() -> &'static str {
5936        "type.googleapis.com/google.cloud.run.v2.ListServicesResponse"
5937    }
5938}
5939
5940#[doc(hidden)]
5941impl gax::paginator::internal::PageableResponse for ListServicesResponse {
5942    type PageItem = crate::model::Service;
5943
5944    fn items(self) -> std::vec::Vec<Self::PageItem> {
5945        self.services
5946    }
5947
5948    fn next_page_token(&self) -> std::string::String {
5949        use std::clone::Clone;
5950        self.next_page_token.clone()
5951    }
5952}
5953
5954/// Request message for obtaining a Service by its full name.
5955#[serde_with::serde_as]
5956#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5957#[serde(default, rename_all = "camelCase")]
5958#[non_exhaustive]
5959pub struct GetServiceRequest {
5960    /// Required. The full name of the Service.
5961    /// Format: projects/{project}/locations/{location}/services/{service}, where
5962    /// {project} can be project id or number.
5963    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5964    pub name: std::string::String,
5965
5966    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5967    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5968}
5969
5970impl GetServiceRequest {
5971    pub fn new() -> Self {
5972        std::default::Default::default()
5973    }
5974
5975    /// Sets the value of [name][crate::model::GetServiceRequest::name].
5976    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5977        self.name = v.into();
5978        self
5979    }
5980}
5981
5982impl wkt::message::Message for GetServiceRequest {
5983    fn typename() -> &'static str {
5984        "type.googleapis.com/google.cloud.run.v2.GetServiceRequest"
5985    }
5986}
5987
5988/// Request message to delete a Service by its full name.
5989#[serde_with::serde_as]
5990#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5991#[serde(default, rename_all = "camelCase")]
5992#[non_exhaustive]
5993pub struct DeleteServiceRequest {
5994    /// Required. The full name of the Service.
5995    /// Format: projects/{project}/locations/{location}/services/{service}, where
5996    /// {project} can be project id or number.
5997    #[serde(skip_serializing_if = "std::string::String::is_empty")]
5998    pub name: std::string::String,
5999
6000    /// Indicates that the request should be validated without actually
6001    /// deleting any resources.
6002    pub validate_only: bool,
6003
6004    /// A system-generated fingerprint for this version of the
6005    /// resource. May be used to detect modification conflict during updates.
6006    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6007    pub etag: std::string::String,
6008
6009    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6010    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6011}
6012
6013impl DeleteServiceRequest {
6014    pub fn new() -> Self {
6015        std::default::Default::default()
6016    }
6017
6018    /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
6019    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6020        self.name = v.into();
6021        self
6022    }
6023
6024    /// Sets the value of [validate_only][crate::model::DeleteServiceRequest::validate_only].
6025    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6026        self.validate_only = v.into();
6027        self
6028    }
6029
6030    /// Sets the value of [etag][crate::model::DeleteServiceRequest::etag].
6031    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6032        self.etag = v.into();
6033        self
6034    }
6035}
6036
6037impl wkt::message::Message for DeleteServiceRequest {
6038    fn typename() -> &'static str {
6039        "type.googleapis.com/google.cloud.run.v2.DeleteServiceRequest"
6040    }
6041}
6042
6043/// Service acts as a top-level container that manages a set of
6044/// configurations and revision templates which implement a network service.
6045/// Service exists to provide a singular abstraction which can be access
6046/// controlled, reasoned about, and which encapsulates software lifecycle
6047/// decisions such as rollout policy and team resource ownership.
6048#[serde_with::serde_as]
6049#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6050#[serde(default, rename_all = "camelCase")]
6051#[non_exhaustive]
6052pub struct Service {
6053    /// The fully qualified name of this Service. In CreateServiceRequest, this
6054    /// field is ignored, and instead composed from CreateServiceRequest.parent and
6055    /// CreateServiceRequest.service_id.
6056    ///
6057    /// Format:
6058    /// projects/{project}/locations/{location}/services/{service_id}
6059    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6060    pub name: std::string::String,
6061
6062    /// User-provided description of the Service. This field currently has a
6063    /// 512-character limit.
6064    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6065    pub description: std::string::String,
6066
6067    /// Output only. Server assigned unique identifier for the trigger. The value
6068    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
6069    /// deleted.
6070    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6071    pub uid: std::string::String,
6072
6073    /// Output only. A number that monotonically increases every time the user
6074    /// modifies the desired state.
6075    /// Please note that unlike v1, this is an int64 value. As with most Google
6076    /// APIs, its JSON representation will be a `string` instead of an `integer`.
6077    #[serde_as(as = "serde_with::DisplayFromStr")]
6078    pub generation: i64,
6079
6080    /// Optional. Unstructured key value map that can be used to organize and
6081    /// categorize objects. User-provided labels are shared with Google's billing
6082    /// system, so they can be used to filter, or break down billing charges by
6083    /// team, component, environment, state, etc. For more information, visit
6084    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
6085    /// <https://cloud.google.com/run/docs/configuring/labels>.
6086    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
6087    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6088
6089    /// Optional. Unstructured key value map that may be set by external tools to
6090    /// store and arbitrary metadata. They are not queryable and should be
6091    /// preserved when modifying objects.
6092    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
6093    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6094
6095    /// Output only. The creation time.
6096    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6097    pub create_time: std::option::Option<wkt::Timestamp>,
6098
6099    /// Output only. The last-modified time.
6100    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6101    pub update_time: std::option::Option<wkt::Timestamp>,
6102
6103    /// Output only. The deletion time. It is only populated as a response to a
6104    /// Delete request.
6105    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6106    pub delete_time: std::option::Option<wkt::Timestamp>,
6107
6108    /// Output only. For a deleted resource, the time after which it will be
6109    /// permanently deleted.
6110    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6111    pub expire_time: std::option::Option<wkt::Timestamp>,
6112
6113    /// Output only. Email address of the authenticated creator.
6114    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6115    pub creator: std::string::String,
6116
6117    /// Output only. Email address of the last authenticated modifier.
6118    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6119    pub last_modifier: std::string::String,
6120
6121    /// Arbitrary identifier for the API client.
6122    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6123    pub client: std::string::String,
6124
6125    /// Arbitrary version identifier for the API client.
6126    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6127    pub client_version: std::string::String,
6128
6129    /// Optional. Provides the ingress settings for this Service. On output,
6130    /// returns the currently observed ingress settings, or
6131    /// INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.
6132    pub ingress: crate::model::IngressTraffic,
6133
6134    /// Optional. The launch stage as defined by [Google Cloud Platform
6135    /// Launch Stages](https://cloud.google.com/terms/launch-stages).
6136    /// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
6137    /// is assumed.
6138    /// Set the launch stage to a preview stage on input to allow use of preview
6139    /// features in that stage. On read (or output), describes whether the resource
6140    /// uses preview features.
6141    ///
6142    /// For example, if ALPHA is provided as input, but only BETA and GA-level
6143    /// features are used, this field will be BETA on output.
6144    pub launch_stage: api::model::LaunchStage,
6145
6146    /// Optional. Settings for the Binary Authorization feature.
6147    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6148    pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
6149
6150    /// Required. The template used to create revisions for this Service.
6151    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6152    pub template: std::option::Option<crate::model::RevisionTemplate>,
6153
6154    /// Optional. Specifies how to distribute traffic over a collection of
6155    /// Revisions belonging to the Service. If traffic is empty or not provided,
6156    /// defaults to 100% traffic to the latest `Ready` Revision.
6157    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6158    pub traffic: std::vec::Vec<crate::model::TrafficTarget>,
6159
6160    /// Optional. Specifies service-level scaling settings
6161    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6162    pub scaling: std::option::Option<crate::model::ServiceScaling>,
6163
6164    /// Optional. Disables IAM permission check for run.routes.invoke for callers
6165    /// of this service. This feature is available by invitation only. For more
6166    /// information, visit
6167    /// <https://cloud.google.com/run/docs/securing/managing-access#invoker_check>.
6168    pub invoker_iam_disabled: bool,
6169
6170    /// Optional. Disables public resolution of the default URI of this service.
6171    pub default_uri_disabled: bool,
6172
6173    /// Output only. All URLs serving traffic for this Service.
6174    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6175    pub urls: std::vec::Vec<std::string::String>,
6176
6177    /// One or more custom audiences that you want this service to support. Specify
6178    /// each custom audience as the full URL in a string. The custom audiences are
6179    /// encoded in the token and used to authenticate requests. For more
6180    /// information, see
6181    /// <https://cloud.google.com/run/docs/configuring/custom-audiences>.
6182    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6183    pub custom_audiences: std::vec::Vec<std::string::String>,
6184
6185    /// Output only. The generation of this Service currently serving traffic. See
6186    /// comments in `reconciling` for additional information on reconciliation
6187    /// process in Cloud Run. Please note that unlike v1, this is an int64 value.
6188    /// As with most Google APIs, its JSON representation will be a `string`
6189    /// instead of an `integer`.
6190    #[serde_as(as = "serde_with::DisplayFromStr")]
6191    pub observed_generation: i64,
6192
6193    /// Output only. The Condition of this Service, containing its readiness
6194    /// status, and detailed error information in case it did not reach a serving
6195    /// state. See comments in `reconciling` for additional information on
6196    /// reconciliation process in Cloud Run.
6197    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6198    pub terminal_condition: std::option::Option<crate::model::Condition>,
6199
6200    /// Output only. The Conditions of all other associated sub-resources. They
6201    /// contain additional diagnostics information in case the Service does not
6202    /// reach its Serving state. See comments in `reconciling` for additional
6203    /// information on reconciliation process in Cloud Run.
6204    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6205    pub conditions: std::vec::Vec<crate::model::Condition>,
6206
6207    /// Output only. Name of the latest revision that is serving traffic. See
6208    /// comments in `reconciling` for additional information on reconciliation
6209    /// process in Cloud Run.
6210    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6211    pub latest_ready_revision: std::string::String,
6212
6213    /// Output only. Name of the last created revision. See comments in
6214    /// `reconciling` for additional information on reconciliation process in Cloud
6215    /// Run.
6216    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6217    pub latest_created_revision: std::string::String,
6218
6219    /// Output only. Detailed status information for corresponding traffic targets.
6220    /// See comments in `reconciling` for additional information on reconciliation
6221    /// process in Cloud Run.
6222    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6223    pub traffic_statuses: std::vec::Vec<crate::model::TrafficTargetStatus>,
6224
6225    /// Output only. The main URI in which this Service is serving traffic.
6226    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6227    pub uri: std::string::String,
6228
6229    /// Output only. Reserved for future use.
6230    pub satisfies_pzs: bool,
6231
6232    /// Optional. Configuration for building a Cloud Run function.
6233    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6234    pub build_config: std::option::Option<crate::model::BuildConfig>,
6235
6236    /// Output only. Returns true if the Service is currently being acted upon by
6237    /// the system to bring it into the desired state.
6238    ///
6239    /// When a new Service is created, or an existing one is updated, Cloud Run
6240    /// will asynchronously perform all necessary steps to bring the Service to the
6241    /// desired serving state. This process is called reconciliation.
6242    /// While reconciliation is in process, `observed_generation`,
6243    /// `latest_ready_revision`, `traffic_statuses`, and `uri` will have transient
6244    /// values that might mismatch the intended state: Once reconciliation is over
6245    /// (and this field is false), there are two possible outcomes: reconciliation
6246    /// succeeded and the serving state matches the Service, or there was an error,
6247    /// and reconciliation failed. This state can be found in
6248    /// `terminal_condition.state`.
6249    ///
6250    /// If reconciliation succeeded, the following fields will match: `traffic` and
6251    /// `traffic_statuses`, `observed_generation` and `generation`,
6252    /// `latest_ready_revision` and `latest_created_revision`.
6253    ///
6254    /// If reconciliation failed, `traffic_statuses`, `observed_generation`, and
6255    /// `latest_ready_revision` will have the state of the last serving revision,
6256    /// or empty for newly created Services. Additional information on the failure
6257    /// can be found in `terminal_condition` and `conditions`.
6258    pub reconciling: bool,
6259
6260    /// Output only. A system-generated fingerprint for this version of the
6261    /// resource. May be used to detect modification conflict during updates.
6262    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6263    pub etag: std::string::String,
6264
6265    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6266    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6267}
6268
6269impl Service {
6270    pub fn new() -> Self {
6271        std::default::Default::default()
6272    }
6273
6274    /// Sets the value of [name][crate::model::Service::name].
6275    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6276        self.name = v.into();
6277        self
6278    }
6279
6280    /// Sets the value of [description][crate::model::Service::description].
6281    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6282        self.description = v.into();
6283        self
6284    }
6285
6286    /// Sets the value of [uid][crate::model::Service::uid].
6287    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6288        self.uid = v.into();
6289        self
6290    }
6291
6292    /// Sets the value of [generation][crate::model::Service::generation].
6293    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6294        self.generation = v.into();
6295        self
6296    }
6297
6298    /// Sets the value of [create_time][crate::model::Service::create_time].
6299    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6300        mut self,
6301        v: T,
6302    ) -> Self {
6303        self.create_time = v.into();
6304        self
6305    }
6306
6307    /// Sets the value of [update_time][crate::model::Service::update_time].
6308    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6309        mut self,
6310        v: T,
6311    ) -> Self {
6312        self.update_time = v.into();
6313        self
6314    }
6315
6316    /// Sets the value of [delete_time][crate::model::Service::delete_time].
6317    pub fn set_delete_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6318        mut self,
6319        v: T,
6320    ) -> Self {
6321        self.delete_time = v.into();
6322        self
6323    }
6324
6325    /// Sets the value of [expire_time][crate::model::Service::expire_time].
6326    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6327        mut self,
6328        v: T,
6329    ) -> Self {
6330        self.expire_time = v.into();
6331        self
6332    }
6333
6334    /// Sets the value of [creator][crate::model::Service::creator].
6335    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6336        self.creator = v.into();
6337        self
6338    }
6339
6340    /// Sets the value of [last_modifier][crate::model::Service::last_modifier].
6341    pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6342        self.last_modifier = v.into();
6343        self
6344    }
6345
6346    /// Sets the value of [client][crate::model::Service::client].
6347    pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6348        self.client = v.into();
6349        self
6350    }
6351
6352    /// Sets the value of [client_version][crate::model::Service::client_version].
6353    pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6354        self.client_version = v.into();
6355        self
6356    }
6357
6358    /// Sets the value of [ingress][crate::model::Service::ingress].
6359    pub fn set_ingress<T: std::convert::Into<crate::model::IngressTraffic>>(
6360        mut self,
6361        v: T,
6362    ) -> Self {
6363        self.ingress = v.into();
6364        self
6365    }
6366
6367    /// Sets the value of [launch_stage][crate::model::Service::launch_stage].
6368    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
6369        mut self,
6370        v: T,
6371    ) -> Self {
6372        self.launch_stage = v.into();
6373        self
6374    }
6375
6376    /// Sets the value of [binary_authorization][crate::model::Service::binary_authorization].
6377    pub fn set_binary_authorization<
6378        T: std::convert::Into<std::option::Option<crate::model::BinaryAuthorization>>,
6379    >(
6380        mut self,
6381        v: T,
6382    ) -> Self {
6383        self.binary_authorization = v.into();
6384        self
6385    }
6386
6387    /// Sets the value of [template][crate::model::Service::template].
6388    pub fn set_template<
6389        T: std::convert::Into<std::option::Option<crate::model::RevisionTemplate>>,
6390    >(
6391        mut self,
6392        v: T,
6393    ) -> Self {
6394        self.template = v.into();
6395        self
6396    }
6397
6398    /// Sets the value of [scaling][crate::model::Service::scaling].
6399    pub fn set_scaling<T: std::convert::Into<std::option::Option<crate::model::ServiceScaling>>>(
6400        mut self,
6401        v: T,
6402    ) -> Self {
6403        self.scaling = v.into();
6404        self
6405    }
6406
6407    /// Sets the value of [invoker_iam_disabled][crate::model::Service::invoker_iam_disabled].
6408    pub fn set_invoker_iam_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6409        self.invoker_iam_disabled = v.into();
6410        self
6411    }
6412
6413    /// Sets the value of [default_uri_disabled][crate::model::Service::default_uri_disabled].
6414    pub fn set_default_uri_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6415        self.default_uri_disabled = v.into();
6416        self
6417    }
6418
6419    /// Sets the value of [observed_generation][crate::model::Service::observed_generation].
6420    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6421        self.observed_generation = v.into();
6422        self
6423    }
6424
6425    /// Sets the value of [terminal_condition][crate::model::Service::terminal_condition].
6426    pub fn set_terminal_condition<
6427        T: std::convert::Into<std::option::Option<crate::model::Condition>>,
6428    >(
6429        mut self,
6430        v: T,
6431    ) -> Self {
6432        self.terminal_condition = v.into();
6433        self
6434    }
6435
6436    /// Sets the value of [latest_ready_revision][crate::model::Service::latest_ready_revision].
6437    pub fn set_latest_ready_revision<T: std::convert::Into<std::string::String>>(
6438        mut self,
6439        v: T,
6440    ) -> Self {
6441        self.latest_ready_revision = v.into();
6442        self
6443    }
6444
6445    /// Sets the value of [latest_created_revision][crate::model::Service::latest_created_revision].
6446    pub fn set_latest_created_revision<T: std::convert::Into<std::string::String>>(
6447        mut self,
6448        v: T,
6449    ) -> Self {
6450        self.latest_created_revision = v.into();
6451        self
6452    }
6453
6454    /// Sets the value of [uri][crate::model::Service::uri].
6455    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6456        self.uri = v.into();
6457        self
6458    }
6459
6460    /// Sets the value of [satisfies_pzs][crate::model::Service::satisfies_pzs].
6461    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6462        self.satisfies_pzs = v.into();
6463        self
6464    }
6465
6466    /// Sets the value of [build_config][crate::model::Service::build_config].
6467    pub fn set_build_config<
6468        T: std::convert::Into<std::option::Option<crate::model::BuildConfig>>,
6469    >(
6470        mut self,
6471        v: T,
6472    ) -> Self {
6473        self.build_config = v.into();
6474        self
6475    }
6476
6477    /// Sets the value of [reconciling][crate::model::Service::reconciling].
6478    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6479        self.reconciling = v.into();
6480        self
6481    }
6482
6483    /// Sets the value of [etag][crate::model::Service::etag].
6484    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6485        self.etag = v.into();
6486        self
6487    }
6488
6489    /// Sets the value of [traffic][crate::model::Service::traffic].
6490    pub fn set_traffic<T, V>(mut self, v: T) -> Self
6491    where
6492        T: std::iter::IntoIterator<Item = V>,
6493        V: std::convert::Into<crate::model::TrafficTarget>,
6494    {
6495        use std::iter::Iterator;
6496        self.traffic = v.into_iter().map(|i| i.into()).collect();
6497        self
6498    }
6499
6500    /// Sets the value of [urls][crate::model::Service::urls].
6501    pub fn set_urls<T, V>(mut self, v: T) -> Self
6502    where
6503        T: std::iter::IntoIterator<Item = V>,
6504        V: std::convert::Into<std::string::String>,
6505    {
6506        use std::iter::Iterator;
6507        self.urls = v.into_iter().map(|i| i.into()).collect();
6508        self
6509    }
6510
6511    /// Sets the value of [custom_audiences][crate::model::Service::custom_audiences].
6512    pub fn set_custom_audiences<T, V>(mut self, v: T) -> Self
6513    where
6514        T: std::iter::IntoIterator<Item = V>,
6515        V: std::convert::Into<std::string::String>,
6516    {
6517        use std::iter::Iterator;
6518        self.custom_audiences = v.into_iter().map(|i| i.into()).collect();
6519        self
6520    }
6521
6522    /// Sets the value of [conditions][crate::model::Service::conditions].
6523    pub fn set_conditions<T, V>(mut self, v: T) -> Self
6524    where
6525        T: std::iter::IntoIterator<Item = V>,
6526        V: std::convert::Into<crate::model::Condition>,
6527    {
6528        use std::iter::Iterator;
6529        self.conditions = v.into_iter().map(|i| i.into()).collect();
6530        self
6531    }
6532
6533    /// Sets the value of [traffic_statuses][crate::model::Service::traffic_statuses].
6534    pub fn set_traffic_statuses<T, V>(mut self, v: T) -> Self
6535    where
6536        T: std::iter::IntoIterator<Item = V>,
6537        V: std::convert::Into<crate::model::TrafficTargetStatus>,
6538    {
6539        use std::iter::Iterator;
6540        self.traffic_statuses = v.into_iter().map(|i| i.into()).collect();
6541        self
6542    }
6543
6544    /// Sets the value of [labels][crate::model::Service::labels].
6545    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6546    where
6547        T: std::iter::IntoIterator<Item = (K, V)>,
6548        K: std::convert::Into<std::string::String>,
6549        V: std::convert::Into<std::string::String>,
6550    {
6551        use std::iter::Iterator;
6552        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6553        self
6554    }
6555
6556    /// Sets the value of [annotations][crate::model::Service::annotations].
6557    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6558    where
6559        T: std::iter::IntoIterator<Item = (K, V)>,
6560        K: std::convert::Into<std::string::String>,
6561        V: std::convert::Into<std::string::String>,
6562    {
6563        use std::iter::Iterator;
6564        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6565        self
6566    }
6567}
6568
6569impl wkt::message::Message for Service {
6570    fn typename() -> &'static str {
6571        "type.googleapis.com/google.cloud.run.v2.Service"
6572    }
6573}
6574
6575/// Effective settings for the current revision
6576#[serde_with::serde_as]
6577#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6578#[serde(default, rename_all = "camelCase")]
6579#[non_exhaustive]
6580pub struct RevisionScalingStatus {
6581    /// The current number of min instances provisioned for this revision.
6582    pub desired_min_instance_count: i32,
6583
6584    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6585    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6586}
6587
6588impl RevisionScalingStatus {
6589    pub fn new() -> Self {
6590        std::default::Default::default()
6591    }
6592
6593    /// Sets the value of [desired_min_instance_count][crate::model::RevisionScalingStatus::desired_min_instance_count].
6594    pub fn set_desired_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6595        self.desired_min_instance_count = v.into();
6596        self
6597    }
6598}
6599
6600impl wkt::message::Message for RevisionScalingStatus {
6601    fn typename() -> &'static str {
6602        "type.googleapis.com/google.cloud.run.v2.RevisionScalingStatus"
6603    }
6604}
6605
6606/// Request message for obtaining a Task by its full name.
6607#[serde_with::serde_as]
6608#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6609#[serde(default, rename_all = "camelCase")]
6610#[non_exhaustive]
6611pub struct GetTaskRequest {
6612    /// Required. The full name of the Task.
6613    /// Format:
6614    /// projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}
6615    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6616    pub name: std::string::String,
6617
6618    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6619    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6620}
6621
6622impl GetTaskRequest {
6623    pub fn new() -> Self {
6624        std::default::Default::default()
6625    }
6626
6627    /// Sets the value of [name][crate::model::GetTaskRequest::name].
6628    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6629        self.name = v.into();
6630        self
6631    }
6632}
6633
6634impl wkt::message::Message for GetTaskRequest {
6635    fn typename() -> &'static str {
6636        "type.googleapis.com/google.cloud.run.v2.GetTaskRequest"
6637    }
6638}
6639
6640/// Request message for retrieving a list of Tasks.
6641#[serde_with::serde_as]
6642#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6643#[serde(default, rename_all = "camelCase")]
6644#[non_exhaustive]
6645pub struct ListTasksRequest {
6646    /// Required. The Execution from which the Tasks should be listed.
6647    /// To list all Tasks across Executions of a Job, use "-" instead of Execution
6648    /// name. To list all Tasks across Jobs, use "-" instead of Job name. Format:
6649    /// projects/{project}/locations/{location}/jobs/{job}/executions/{execution}
6650    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6651    pub parent: std::string::String,
6652
6653    /// Maximum number of Tasks to return in this call.
6654    pub page_size: i32,
6655
6656    /// A page token received from a previous call to ListTasks.
6657    /// All other parameters must match.
6658    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6659    pub page_token: std::string::String,
6660
6661    /// If true, returns deleted (but unexpired) resources along with active ones.
6662    pub show_deleted: bool,
6663
6664    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6665    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6666}
6667
6668impl ListTasksRequest {
6669    pub fn new() -> Self {
6670        std::default::Default::default()
6671    }
6672
6673    /// Sets the value of [parent][crate::model::ListTasksRequest::parent].
6674    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6675        self.parent = v.into();
6676        self
6677    }
6678
6679    /// Sets the value of [page_size][crate::model::ListTasksRequest::page_size].
6680    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6681        self.page_size = v.into();
6682        self
6683    }
6684
6685    /// Sets the value of [page_token][crate::model::ListTasksRequest::page_token].
6686    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6687        self.page_token = v.into();
6688        self
6689    }
6690
6691    /// Sets the value of [show_deleted][crate::model::ListTasksRequest::show_deleted].
6692    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6693        self.show_deleted = v.into();
6694        self
6695    }
6696}
6697
6698impl wkt::message::Message for ListTasksRequest {
6699    fn typename() -> &'static str {
6700        "type.googleapis.com/google.cloud.run.v2.ListTasksRequest"
6701    }
6702}
6703
6704/// Response message containing a list of Tasks.
6705#[serde_with::serde_as]
6706#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6707#[serde(default, rename_all = "camelCase")]
6708#[non_exhaustive]
6709pub struct ListTasksResponse {
6710    /// The resulting list of Tasks.
6711    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6712    pub tasks: std::vec::Vec<crate::model::Task>,
6713
6714    /// A token indicating there are more items than page_size. Use it in the next
6715    /// ListTasks request to continue.
6716    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6717    pub next_page_token: std::string::String,
6718
6719    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6720    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6721}
6722
6723impl ListTasksResponse {
6724    pub fn new() -> Self {
6725        std::default::Default::default()
6726    }
6727
6728    /// Sets the value of [next_page_token][crate::model::ListTasksResponse::next_page_token].
6729    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6730        self.next_page_token = v.into();
6731        self
6732    }
6733
6734    /// Sets the value of [tasks][crate::model::ListTasksResponse::tasks].
6735    pub fn set_tasks<T, V>(mut self, v: T) -> Self
6736    where
6737        T: std::iter::IntoIterator<Item = V>,
6738        V: std::convert::Into<crate::model::Task>,
6739    {
6740        use std::iter::Iterator;
6741        self.tasks = v.into_iter().map(|i| i.into()).collect();
6742        self
6743    }
6744}
6745
6746impl wkt::message::Message for ListTasksResponse {
6747    fn typename() -> &'static str {
6748        "type.googleapis.com/google.cloud.run.v2.ListTasksResponse"
6749    }
6750}
6751
6752#[doc(hidden)]
6753impl gax::paginator::internal::PageableResponse for ListTasksResponse {
6754    type PageItem = crate::model::Task;
6755
6756    fn items(self) -> std::vec::Vec<Self::PageItem> {
6757        self.tasks
6758    }
6759
6760    fn next_page_token(&self) -> std::string::String {
6761        use std::clone::Clone;
6762        self.next_page_token.clone()
6763    }
6764}
6765
6766/// Task represents a single run of a container to completion.
6767#[serde_with::serde_as]
6768#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6769#[serde(default, rename_all = "camelCase")]
6770#[non_exhaustive]
6771pub struct Task {
6772    /// Output only. The unique name of this Task.
6773    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6774    pub name: std::string::String,
6775
6776    /// Output only. Server assigned unique identifier for the Task. The value is a
6777    /// UUID4 string and guaranteed to remain unchanged until the resource is
6778    /// deleted.
6779    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6780    pub uid: std::string::String,
6781
6782    /// Output only. A number that monotonically increases every time the user
6783    /// modifies the desired state.
6784    #[serde_as(as = "serde_with::DisplayFromStr")]
6785    pub generation: i64,
6786
6787    /// Output only. Unstructured key value map that can be used to organize and
6788    /// categorize objects. User-provided labels are shared with Google's billing
6789    /// system, so they can be used to filter, or break down billing charges by
6790    /// team, component, environment, state, etc. For more information, visit
6791    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
6792    /// <https://cloud.google.com/run/docs/configuring/labels>
6793    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
6794    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6795
6796    /// Output only. Unstructured key value map that may
6797    /// be set by external tools to store and arbitrary metadata.
6798    /// They are not queryable and should be preserved
6799    /// when modifying objects.
6800    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
6801    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6802
6803    /// Output only. Represents time when the task was created by the system.
6804    /// It is not guaranteed to be set in happens-before order across separate
6805    /// operations.
6806    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6807    pub create_time: std::option::Option<wkt::Timestamp>,
6808
6809    /// Output only. Represents time when the task was scheduled to run by the
6810    /// system. It is not guaranteed to be set in happens-before order across
6811    /// separate operations.
6812    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6813    pub scheduled_time: std::option::Option<wkt::Timestamp>,
6814
6815    /// Output only. Represents time when the task started to run.
6816    /// It is not guaranteed to be set in happens-before order across separate
6817    /// operations.
6818    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6819    pub start_time: std::option::Option<wkt::Timestamp>,
6820
6821    /// Output only. Represents time when the Task was completed. It is not
6822    /// guaranteed to be set in happens-before order across separate operations.
6823    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6824    pub completion_time: std::option::Option<wkt::Timestamp>,
6825
6826    /// Output only. The last-modified time.
6827    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6828    pub update_time: std::option::Option<wkt::Timestamp>,
6829
6830    /// Output only. For a deleted resource, the deletion time. It is only
6831    /// populated as a response to a Delete request.
6832    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6833    pub delete_time: std::option::Option<wkt::Timestamp>,
6834
6835    /// Output only. For a deleted resource, the time after which it will be
6836    /// permamently deleted. It is only populated as a response to a Delete
6837    /// request.
6838    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6839    pub expire_time: std::option::Option<wkt::Timestamp>,
6840
6841    /// Output only. The name of the parent Job.
6842    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6843    pub job: std::string::String,
6844
6845    /// Output only. The name of the parent Execution.
6846    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6847    pub execution: std::string::String,
6848
6849    /// Holds the single container that defines the unit of execution for this
6850    /// task.
6851    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6852    pub containers: std::vec::Vec<crate::model::Container>,
6853
6854    /// A list of Volumes to make available to containers.
6855    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6856    pub volumes: std::vec::Vec<crate::model::Volume>,
6857
6858    /// Number of retries allowed per Task, before marking this Task failed.
6859    pub max_retries: i32,
6860
6861    /// Max allowed time duration the Task may be active before the system will
6862    /// actively try to mark it failed and kill associated containers. This applies
6863    /// per attempt of a task, meaning each retry can run for the full timeout.
6864    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6865    pub timeout: std::option::Option<wkt::Duration>,
6866
6867    /// Email address of the IAM service account associated with the Task of a
6868    /// Job. The service account represents the identity of the
6869    /// running task, and determines what permissions the task has. If
6870    /// not provided, the task will use the project's default service account.
6871    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6872    pub service_account: std::string::String,
6873
6874    /// The execution environment being used to host this Task.
6875    pub execution_environment: crate::model::ExecutionEnvironment,
6876
6877    /// Output only. Indicates whether the resource's reconciliation is still in
6878    /// progress. See comments in `Job.reconciling` for additional information on
6879    /// reconciliation process in Cloud Run.
6880    pub reconciling: bool,
6881
6882    /// Output only. The Condition of this Task, containing its readiness status,
6883    /// and detailed error information in case it did not reach the desired state.
6884    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6885    pub conditions: std::vec::Vec<crate::model::Condition>,
6886
6887    /// Output only. The generation of this Task. See comments in `Job.reconciling`
6888    /// for additional information on reconciliation process in Cloud Run.
6889    #[serde_as(as = "serde_with::DisplayFromStr")]
6890    pub observed_generation: i64,
6891
6892    /// Output only. Index of the Task, unique per execution, and beginning at 0.
6893    pub index: i32,
6894
6895    /// Output only. The number of times this Task was retried.
6896    /// Tasks are retried when they fail up to the maxRetries limit.
6897    pub retried: i32,
6898
6899    /// Output only. Result of the last attempt of this Task.
6900    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6901    pub last_attempt_result: std::option::Option<crate::model::TaskAttemptResult>,
6902
6903    /// Output only. A reference to a customer managed encryption key (CMEK) to use
6904    /// to encrypt this container image. For more information, go to
6905    /// <https://cloud.google.com/run/docs/securing/using-cmek>
6906    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6907    pub encryption_key: std::string::String,
6908
6909    /// Output only. VPC Access configuration to use for this Task. For more
6910    /// information, visit
6911    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
6912    #[serde(skip_serializing_if = "std::option::Option::is_none")]
6913    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
6914
6915    /// Output only. URI where logs for this execution can be found in Cloud
6916    /// Console.
6917    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6918    pub log_uri: std::string::String,
6919
6920    /// Output only. Reserved for future use.
6921    pub satisfies_pzs: bool,
6922
6923    /// Output only. A system-generated fingerprint for this version of the
6924    /// resource. May be used to detect modification conflict during updates.
6925    #[serde(skip_serializing_if = "std::string::String::is_empty")]
6926    pub etag: std::string::String,
6927
6928    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6929    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6930}
6931
6932impl Task {
6933    pub fn new() -> Self {
6934        std::default::Default::default()
6935    }
6936
6937    /// Sets the value of [name][crate::model::Task::name].
6938    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6939        self.name = v.into();
6940        self
6941    }
6942
6943    /// Sets the value of [uid][crate::model::Task::uid].
6944    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6945        self.uid = v.into();
6946        self
6947    }
6948
6949    /// Sets the value of [generation][crate::model::Task::generation].
6950    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6951        self.generation = v.into();
6952        self
6953    }
6954
6955    /// Sets the value of [create_time][crate::model::Task::create_time].
6956    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6957        mut self,
6958        v: T,
6959    ) -> Self {
6960        self.create_time = v.into();
6961        self
6962    }
6963
6964    /// Sets the value of [scheduled_time][crate::model::Task::scheduled_time].
6965    pub fn set_scheduled_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6966        mut self,
6967        v: T,
6968    ) -> Self {
6969        self.scheduled_time = v.into();
6970        self
6971    }
6972
6973    /// Sets the value of [start_time][crate::model::Task::start_time].
6974    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6975        mut self,
6976        v: T,
6977    ) -> Self {
6978        self.start_time = v.into();
6979        self
6980    }
6981
6982    /// Sets the value of [completion_time][crate::model::Task::completion_time].
6983    pub fn set_completion_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6984        mut self,
6985        v: T,
6986    ) -> Self {
6987        self.completion_time = v.into();
6988        self
6989    }
6990
6991    /// Sets the value of [update_time][crate::model::Task::update_time].
6992    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
6993        mut self,
6994        v: T,
6995    ) -> Self {
6996        self.update_time = v.into();
6997        self
6998    }
6999
7000    /// Sets the value of [delete_time][crate::model::Task::delete_time].
7001    pub fn set_delete_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
7002        mut self,
7003        v: T,
7004    ) -> Self {
7005        self.delete_time = v.into();
7006        self
7007    }
7008
7009    /// Sets the value of [expire_time][crate::model::Task::expire_time].
7010    pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
7011        mut self,
7012        v: T,
7013    ) -> Self {
7014        self.expire_time = v.into();
7015        self
7016    }
7017
7018    /// Sets the value of [job][crate::model::Task::job].
7019    pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7020        self.job = v.into();
7021        self
7022    }
7023
7024    /// Sets the value of [execution][crate::model::Task::execution].
7025    pub fn set_execution<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7026        self.execution = v.into();
7027        self
7028    }
7029
7030    /// Sets the value of [max_retries][crate::model::Task::max_retries].
7031    pub fn set_max_retries<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7032        self.max_retries = v.into();
7033        self
7034    }
7035
7036    /// Sets the value of [timeout][crate::model::Task::timeout].
7037    pub fn set_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
7038        mut self,
7039        v: T,
7040    ) -> Self {
7041        self.timeout = v.into();
7042        self
7043    }
7044
7045    /// Sets the value of [service_account][crate::model::Task::service_account].
7046    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7047        self.service_account = v.into();
7048        self
7049    }
7050
7051    /// Sets the value of [execution_environment][crate::model::Task::execution_environment].
7052    pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
7053        mut self,
7054        v: T,
7055    ) -> Self {
7056        self.execution_environment = v.into();
7057        self
7058    }
7059
7060    /// Sets the value of [reconciling][crate::model::Task::reconciling].
7061    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7062        self.reconciling = v.into();
7063        self
7064    }
7065
7066    /// Sets the value of [observed_generation][crate::model::Task::observed_generation].
7067    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7068        self.observed_generation = v.into();
7069        self
7070    }
7071
7072    /// Sets the value of [index][crate::model::Task::index].
7073    pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7074        self.index = v.into();
7075        self
7076    }
7077
7078    /// Sets the value of [retried][crate::model::Task::retried].
7079    pub fn set_retried<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7080        self.retried = v.into();
7081        self
7082    }
7083
7084    /// Sets the value of [last_attempt_result][crate::model::Task::last_attempt_result].
7085    pub fn set_last_attempt_result<
7086        T: std::convert::Into<std::option::Option<crate::model::TaskAttemptResult>>,
7087    >(
7088        mut self,
7089        v: T,
7090    ) -> Self {
7091        self.last_attempt_result = v.into();
7092        self
7093    }
7094
7095    /// Sets the value of [encryption_key][crate::model::Task::encryption_key].
7096    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7097        self.encryption_key = v.into();
7098        self
7099    }
7100
7101    /// Sets the value of [vpc_access][crate::model::Task::vpc_access].
7102    pub fn set_vpc_access<T: std::convert::Into<std::option::Option<crate::model::VpcAccess>>>(
7103        mut self,
7104        v: T,
7105    ) -> Self {
7106        self.vpc_access = v.into();
7107        self
7108    }
7109
7110    /// Sets the value of [log_uri][crate::model::Task::log_uri].
7111    pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7112        self.log_uri = v.into();
7113        self
7114    }
7115
7116    /// Sets the value of [satisfies_pzs][crate::model::Task::satisfies_pzs].
7117    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7118        self.satisfies_pzs = v.into();
7119        self
7120    }
7121
7122    /// Sets the value of [etag][crate::model::Task::etag].
7123    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7124        self.etag = v.into();
7125        self
7126    }
7127
7128    /// Sets the value of [containers][crate::model::Task::containers].
7129    pub fn set_containers<T, V>(mut self, v: T) -> Self
7130    where
7131        T: std::iter::IntoIterator<Item = V>,
7132        V: std::convert::Into<crate::model::Container>,
7133    {
7134        use std::iter::Iterator;
7135        self.containers = v.into_iter().map(|i| i.into()).collect();
7136        self
7137    }
7138
7139    /// Sets the value of [volumes][crate::model::Task::volumes].
7140    pub fn set_volumes<T, V>(mut self, v: T) -> Self
7141    where
7142        T: std::iter::IntoIterator<Item = V>,
7143        V: std::convert::Into<crate::model::Volume>,
7144    {
7145        use std::iter::Iterator;
7146        self.volumes = v.into_iter().map(|i| i.into()).collect();
7147        self
7148    }
7149
7150    /// Sets the value of [conditions][crate::model::Task::conditions].
7151    pub fn set_conditions<T, V>(mut self, v: T) -> Self
7152    where
7153        T: std::iter::IntoIterator<Item = V>,
7154        V: std::convert::Into<crate::model::Condition>,
7155    {
7156        use std::iter::Iterator;
7157        self.conditions = v.into_iter().map(|i| i.into()).collect();
7158        self
7159    }
7160
7161    /// Sets the value of [labels][crate::model::Task::labels].
7162    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7163    where
7164        T: std::iter::IntoIterator<Item = (K, V)>,
7165        K: std::convert::Into<std::string::String>,
7166        V: std::convert::Into<std::string::String>,
7167    {
7168        use std::iter::Iterator;
7169        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7170        self
7171    }
7172
7173    /// Sets the value of [annotations][crate::model::Task::annotations].
7174    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7175    where
7176        T: std::iter::IntoIterator<Item = (K, V)>,
7177        K: std::convert::Into<std::string::String>,
7178        V: std::convert::Into<std::string::String>,
7179    {
7180        use std::iter::Iterator;
7181        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7182        self
7183    }
7184}
7185
7186impl wkt::message::Message for Task {
7187    fn typename() -> &'static str {
7188        "type.googleapis.com/google.cloud.run.v2.Task"
7189    }
7190}
7191
7192/// Result of a task attempt.
7193#[serde_with::serde_as]
7194#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7195#[serde(default, rename_all = "camelCase")]
7196#[non_exhaustive]
7197pub struct TaskAttemptResult {
7198    /// Output only. The status of this attempt.
7199    /// If the status code is OK, then the attempt succeeded.
7200    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7201    pub status: std::option::Option<rpc::model::Status>,
7202
7203    /// Output only. The exit code of this attempt.
7204    /// This may be unset if the container was unable to exit cleanly with a code
7205    /// due to some other failure.
7206    /// See status field for possible failure details.
7207    pub exit_code: i32,
7208
7209    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7210    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7211}
7212
7213impl TaskAttemptResult {
7214    pub fn new() -> Self {
7215        std::default::Default::default()
7216    }
7217
7218    /// Sets the value of [status][crate::model::TaskAttemptResult::status].
7219    pub fn set_status<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
7220        mut self,
7221        v: T,
7222    ) -> Self {
7223        self.status = v.into();
7224        self
7225    }
7226
7227    /// Sets the value of [exit_code][crate::model::TaskAttemptResult::exit_code].
7228    pub fn set_exit_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7229        self.exit_code = v.into();
7230        self
7231    }
7232}
7233
7234impl wkt::message::Message for TaskAttemptResult {
7235    fn typename() -> &'static str {
7236        "type.googleapis.com/google.cloud.run.v2.TaskAttemptResult"
7237    }
7238}
7239
7240/// TaskTemplate describes the data a task should have when created
7241/// from a template.
7242#[serde_with::serde_as]
7243#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7244#[serde(default, rename_all = "camelCase")]
7245#[non_exhaustive]
7246pub struct TaskTemplate {
7247    /// Holds the single container that defines the unit of execution for this
7248    /// task.
7249    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7250    pub containers: std::vec::Vec<crate::model::Container>,
7251
7252    /// Optional. A list of Volumes to make available to containers.
7253    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7254    pub volumes: std::vec::Vec<crate::model::Volume>,
7255
7256    /// Optional. Max allowed time duration the Task may be active before the
7257    /// system will actively try to mark it failed and kill associated containers.
7258    /// This applies per attempt of a task, meaning each retry can run for the full
7259    /// timeout. Defaults to 600 seconds.
7260    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7261    pub timeout: std::option::Option<wkt::Duration>,
7262
7263    /// Optional. Email address of the IAM service account associated with the Task
7264    /// of a Job. The service account represents the identity of the running task,
7265    /// and determines what permissions the task has. If not provided, the task
7266    /// will use the project's default service account.
7267    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7268    pub service_account: std::string::String,
7269
7270    /// Optional. The execution environment being used to host this Task.
7271    pub execution_environment: crate::model::ExecutionEnvironment,
7272
7273    /// A reference to a customer managed encryption key (CMEK) to use to encrypt
7274    /// this container image. For more information, go to
7275    /// <https://cloud.google.com/run/docs/securing/using-cmek>
7276    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7277    pub encryption_key: std::string::String,
7278
7279    /// Optional. VPC Access configuration to use for this Task. For more
7280    /// information, visit
7281    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
7282    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7283    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
7284
7285    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7286    pub retries: std::option::Option<crate::model::task_template::Retries>,
7287
7288    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7289    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7290}
7291
7292impl TaskTemplate {
7293    pub fn new() -> Self {
7294        std::default::Default::default()
7295    }
7296
7297    /// Sets the value of [timeout][crate::model::TaskTemplate::timeout].
7298    pub fn set_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
7299        mut self,
7300        v: T,
7301    ) -> Self {
7302        self.timeout = v.into();
7303        self
7304    }
7305
7306    /// Sets the value of [service_account][crate::model::TaskTemplate::service_account].
7307    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7308        self.service_account = v.into();
7309        self
7310    }
7311
7312    /// Sets the value of [execution_environment][crate::model::TaskTemplate::execution_environment].
7313    pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
7314        mut self,
7315        v: T,
7316    ) -> Self {
7317        self.execution_environment = v.into();
7318        self
7319    }
7320
7321    /// Sets the value of [encryption_key][crate::model::TaskTemplate::encryption_key].
7322    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7323        self.encryption_key = v.into();
7324        self
7325    }
7326
7327    /// Sets the value of [vpc_access][crate::model::TaskTemplate::vpc_access].
7328    pub fn set_vpc_access<T: std::convert::Into<std::option::Option<crate::model::VpcAccess>>>(
7329        mut self,
7330        v: T,
7331    ) -> Self {
7332        self.vpc_access = v.into();
7333        self
7334    }
7335
7336    /// Sets the value of [containers][crate::model::TaskTemplate::containers].
7337    pub fn set_containers<T, V>(mut self, v: T) -> Self
7338    where
7339        T: std::iter::IntoIterator<Item = V>,
7340        V: std::convert::Into<crate::model::Container>,
7341    {
7342        use std::iter::Iterator;
7343        self.containers = v.into_iter().map(|i| i.into()).collect();
7344        self
7345    }
7346
7347    /// Sets the value of [volumes][crate::model::TaskTemplate::volumes].
7348    pub fn set_volumes<T, V>(mut self, v: T) -> Self
7349    where
7350        T: std::iter::IntoIterator<Item = V>,
7351        V: std::convert::Into<crate::model::Volume>,
7352    {
7353        use std::iter::Iterator;
7354        self.volumes = v.into_iter().map(|i| i.into()).collect();
7355        self
7356    }
7357
7358    /// Sets the value of [retries][crate::model::TaskTemplate::retries].
7359    ///
7360    /// Note that all the setters affecting `retries` are mutually
7361    /// exclusive.
7362    pub fn set_retries<
7363        T: std::convert::Into<std::option::Option<crate::model::task_template::Retries>>,
7364    >(
7365        mut self,
7366        v: T,
7367    ) -> Self {
7368        self.retries = v.into();
7369        self
7370    }
7371
7372    /// The value of [retries][crate::model::TaskTemplate::retries]
7373    /// if it holds a `MaxRetries`, `None` if the field is not set or
7374    /// holds a different branch.
7375    pub fn max_retries(&self) -> std::option::Option<&i32> {
7376        #[allow(unreachable_patterns)]
7377        self.retries.as_ref().and_then(|v| match v {
7378            crate::model::task_template::Retries::MaxRetries(v) => std::option::Option::Some(v),
7379            _ => std::option::Option::None,
7380        })
7381    }
7382
7383    /// Sets the value of [retries][crate::model::TaskTemplate::retries]
7384    /// to hold a `MaxRetries`.
7385    ///
7386    /// Note that all the setters affecting `retries` are
7387    /// mutually exclusive.
7388    pub fn set_max_retries<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7389        self.retries =
7390            std::option::Option::Some(crate::model::task_template::Retries::MaxRetries(v.into()));
7391        self
7392    }
7393}
7394
7395impl wkt::message::Message for TaskTemplate {
7396    fn typename() -> &'static str {
7397        "type.googleapis.com/google.cloud.run.v2.TaskTemplate"
7398    }
7399}
7400
7401/// Defines additional types related to [TaskTemplate].
7402pub mod task_template {
7403    #[allow(unused_imports)]
7404    use super::*;
7405
7406    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7407    #[serde(rename_all = "camelCase")]
7408    #[non_exhaustive]
7409    pub enum Retries {
7410        /// Number of retries allowed per Task, before marking this Task failed.
7411        /// Defaults to 3.
7412        MaxRetries(i32),
7413    }
7414}
7415
7416/// Holds a single traffic routing entry for the Service. Allocations can be done
7417/// to a specific Revision name, or pointing to the latest Ready Revision.
7418#[serde_with::serde_as]
7419#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7420#[serde(default, rename_all = "camelCase")]
7421#[non_exhaustive]
7422pub struct TrafficTarget {
7423    /// The allocation type for this traffic target.
7424    #[serde(rename = "type")]
7425    pub r#type: crate::model::TrafficTargetAllocationType,
7426
7427    /// Revision to which to send this portion of traffic, if traffic allocation is
7428    /// by revision.
7429    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7430    pub revision: std::string::String,
7431
7432    /// Specifies percent of the traffic to this Revision.
7433    /// This defaults to zero if unspecified.
7434    pub percent: i32,
7435
7436    /// Indicates a string to be part of the URI to exclusively reference this
7437    /// target.
7438    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7439    pub tag: std::string::String,
7440
7441    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7442    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7443}
7444
7445impl TrafficTarget {
7446    pub fn new() -> Self {
7447        std::default::Default::default()
7448    }
7449
7450    /// Sets the value of [r#type][crate::model::TrafficTarget::type].
7451    pub fn set_type<T: std::convert::Into<crate::model::TrafficTargetAllocationType>>(
7452        mut self,
7453        v: T,
7454    ) -> Self {
7455        self.r#type = v.into();
7456        self
7457    }
7458
7459    /// Sets the value of [revision][crate::model::TrafficTarget::revision].
7460    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7461        self.revision = v.into();
7462        self
7463    }
7464
7465    /// Sets the value of [percent][crate::model::TrafficTarget::percent].
7466    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7467        self.percent = v.into();
7468        self
7469    }
7470
7471    /// Sets the value of [tag][crate::model::TrafficTarget::tag].
7472    pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7473        self.tag = v.into();
7474        self
7475    }
7476}
7477
7478impl wkt::message::Message for TrafficTarget {
7479    fn typename() -> &'static str {
7480        "type.googleapis.com/google.cloud.run.v2.TrafficTarget"
7481    }
7482}
7483
7484/// Represents the observed state of a single `TrafficTarget` entry.
7485#[serde_with::serde_as]
7486#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7487#[serde(default, rename_all = "camelCase")]
7488#[non_exhaustive]
7489pub struct TrafficTargetStatus {
7490    /// The allocation type for this traffic target.
7491    #[serde(rename = "type")]
7492    pub r#type: crate::model::TrafficTargetAllocationType,
7493
7494    /// Revision to which this traffic is sent.
7495    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7496    pub revision: std::string::String,
7497
7498    /// Specifies percent of the traffic to this Revision.
7499    pub percent: i32,
7500
7501    /// Indicates the string used in the URI to exclusively reference this target.
7502    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7503    pub tag: std::string::String,
7504
7505    /// Displays the target URI.
7506    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7507    pub uri: std::string::String,
7508
7509    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7510    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7511}
7512
7513impl TrafficTargetStatus {
7514    pub fn new() -> Self {
7515        std::default::Default::default()
7516    }
7517
7518    /// Sets the value of [r#type][crate::model::TrafficTargetStatus::type].
7519    pub fn set_type<T: std::convert::Into<crate::model::TrafficTargetAllocationType>>(
7520        mut self,
7521        v: T,
7522    ) -> Self {
7523        self.r#type = v.into();
7524        self
7525    }
7526
7527    /// Sets the value of [revision][crate::model::TrafficTargetStatus::revision].
7528    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7529        self.revision = v.into();
7530        self
7531    }
7532
7533    /// Sets the value of [percent][crate::model::TrafficTargetStatus::percent].
7534    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7535        self.percent = v.into();
7536        self
7537    }
7538
7539    /// Sets the value of [tag][crate::model::TrafficTargetStatus::tag].
7540    pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7541        self.tag = v.into();
7542        self
7543    }
7544
7545    /// Sets the value of [uri][crate::model::TrafficTargetStatus::uri].
7546    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7547        self.uri = v.into();
7548        self
7549    }
7550}
7551
7552impl wkt::message::Message for TrafficTargetStatus {
7553    fn typename() -> &'static str {
7554        "type.googleapis.com/google.cloud.run.v2.TrafficTargetStatus"
7555    }
7556}
7557
7558/// VPC Access settings. For more information on sending traffic to a VPC
7559/// network, visit <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
7560#[serde_with::serde_as]
7561#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7562#[serde(default, rename_all = "camelCase")]
7563#[non_exhaustive]
7564pub struct VpcAccess {
7565    /// VPC Access connector name.
7566    /// Format: `projects/{project}/locations/{location}/connectors/{connector}`,
7567    /// where `{project}` can be project id or number.
7568    /// For more information on sending traffic to a VPC network via a connector,
7569    /// visit <https://cloud.google.com/run/docs/configuring/vpc-connectors>.
7570    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7571    pub connector: std::string::String,
7572
7573    /// Optional. Traffic VPC egress settings. If not provided, it defaults to
7574    /// PRIVATE_RANGES_ONLY.
7575    pub egress: crate::model::vpc_access::VpcEgress,
7576
7577    /// Optional. Direct VPC egress settings. Currently only single network
7578    /// interface is supported.
7579    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7580    pub network_interfaces: std::vec::Vec<crate::model::vpc_access::NetworkInterface>,
7581
7582    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7583    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7584}
7585
7586impl VpcAccess {
7587    pub fn new() -> Self {
7588        std::default::Default::default()
7589    }
7590
7591    /// Sets the value of [connector][crate::model::VpcAccess::connector].
7592    pub fn set_connector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7593        self.connector = v.into();
7594        self
7595    }
7596
7597    /// Sets the value of [egress][crate::model::VpcAccess::egress].
7598    pub fn set_egress<T: std::convert::Into<crate::model::vpc_access::VpcEgress>>(
7599        mut self,
7600        v: T,
7601    ) -> Self {
7602        self.egress = v.into();
7603        self
7604    }
7605
7606    /// Sets the value of [network_interfaces][crate::model::VpcAccess::network_interfaces].
7607    pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
7608    where
7609        T: std::iter::IntoIterator<Item = V>,
7610        V: std::convert::Into<crate::model::vpc_access::NetworkInterface>,
7611    {
7612        use std::iter::Iterator;
7613        self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
7614        self
7615    }
7616}
7617
7618impl wkt::message::Message for VpcAccess {
7619    fn typename() -> &'static str {
7620        "type.googleapis.com/google.cloud.run.v2.VpcAccess"
7621    }
7622}
7623
7624/// Defines additional types related to [VpcAccess].
7625pub mod vpc_access {
7626    #[allow(unused_imports)]
7627    use super::*;
7628
7629    /// Direct VPC egress settings.
7630    #[serde_with::serde_as]
7631    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7632    #[serde(default, rename_all = "camelCase")]
7633    #[non_exhaustive]
7634    pub struct NetworkInterface {
7635        /// Optional. The VPC network that the Cloud Run resource will be able to
7636        /// send traffic to. At least one of network or subnetwork must be specified.
7637        /// If both network and subnetwork are specified, the given VPC subnetwork
7638        /// must belong to the given VPC network. If network is not specified, it
7639        /// will be looked up from the subnetwork.
7640        #[serde(skip_serializing_if = "std::string::String::is_empty")]
7641        pub network: std::string::String,
7642
7643        /// Optional. The VPC subnetwork that the Cloud Run resource will get IPs
7644        /// from. At least one of network or subnetwork must be specified. If both
7645        /// network and subnetwork are specified, the given VPC subnetwork must
7646        /// belong to the given VPC network. If subnetwork is not specified, the
7647        /// subnetwork with the same name with the network will be used.
7648        #[serde(skip_serializing_if = "std::string::String::is_empty")]
7649        pub subnetwork: std::string::String,
7650
7651        /// Optional. Network tags applied to this Cloud Run resource.
7652        #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7653        pub tags: std::vec::Vec<std::string::String>,
7654
7655        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7656        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7657    }
7658
7659    impl NetworkInterface {
7660        pub fn new() -> Self {
7661            std::default::Default::default()
7662        }
7663
7664        /// Sets the value of [network][crate::model::vpc_access::NetworkInterface::network].
7665        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7666            self.network = v.into();
7667            self
7668        }
7669
7670        /// Sets the value of [subnetwork][crate::model::vpc_access::NetworkInterface::subnetwork].
7671        pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7672            self.subnetwork = v.into();
7673            self
7674        }
7675
7676        /// Sets the value of [tags][crate::model::vpc_access::NetworkInterface::tags].
7677        pub fn set_tags<T, V>(mut self, v: T) -> Self
7678        where
7679            T: std::iter::IntoIterator<Item = V>,
7680            V: std::convert::Into<std::string::String>,
7681        {
7682            use std::iter::Iterator;
7683            self.tags = v.into_iter().map(|i| i.into()).collect();
7684            self
7685        }
7686    }
7687
7688    impl wkt::message::Message for NetworkInterface {
7689        fn typename() -> &'static str {
7690            "type.googleapis.com/google.cloud.run.v2.VpcAccess.NetworkInterface"
7691        }
7692    }
7693
7694    /// Egress options for VPC access.
7695    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7696    pub struct VpcEgress(i32);
7697
7698    impl VpcEgress {
7699        /// Unspecified
7700        pub const VPC_EGRESS_UNSPECIFIED: VpcEgress = VpcEgress::new(0);
7701
7702        /// All outbound traffic is routed through the VPC connector.
7703        pub const ALL_TRAFFIC: VpcEgress = VpcEgress::new(1);
7704
7705        /// Only private IP ranges are routed through the VPC connector.
7706        pub const PRIVATE_RANGES_ONLY: VpcEgress = VpcEgress::new(2);
7707
7708        /// Creates a new VpcEgress instance.
7709        pub(crate) const fn new(value: i32) -> Self {
7710            Self(value)
7711        }
7712
7713        /// Gets the enum value.
7714        pub fn value(&self) -> i32 {
7715            self.0
7716        }
7717
7718        /// Gets the enum value as a string.
7719        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
7720            match self.0 {
7721                0 => std::borrow::Cow::Borrowed("VPC_EGRESS_UNSPECIFIED"),
7722                1 => std::borrow::Cow::Borrowed("ALL_TRAFFIC"),
7723                2 => std::borrow::Cow::Borrowed("PRIVATE_RANGES_ONLY"),
7724                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
7725            }
7726        }
7727
7728        /// Creates an enum value from the value name.
7729        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
7730            match name {
7731                "VPC_EGRESS_UNSPECIFIED" => std::option::Option::Some(Self::VPC_EGRESS_UNSPECIFIED),
7732                "ALL_TRAFFIC" => std::option::Option::Some(Self::ALL_TRAFFIC),
7733                "PRIVATE_RANGES_ONLY" => std::option::Option::Some(Self::PRIVATE_RANGES_ONLY),
7734                _ => std::option::Option::None,
7735            }
7736        }
7737    }
7738
7739    impl std::convert::From<i32> for VpcEgress {
7740        fn from(value: i32) -> Self {
7741            Self::new(value)
7742        }
7743    }
7744
7745    impl std::default::Default for VpcEgress {
7746        fn default() -> Self {
7747            Self::new(0)
7748        }
7749    }
7750}
7751
7752/// Settings for Binary Authorization feature.
7753#[serde_with::serde_as]
7754#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7755#[serde(default, rename_all = "camelCase")]
7756#[non_exhaustive]
7757pub struct BinaryAuthorization {
7758    /// Optional. If present, indicates to use Breakglass using this justification.
7759    /// If use_default is False, then it must be empty.
7760    /// For more information on breakglass, see
7761    /// <https://cloud.google.com/binary-authorization/docs/using-breakglass>
7762    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7763    pub breakglass_justification: std::string::String,
7764
7765    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7766    pub binauthz_method: std::option::Option<crate::model::binary_authorization::BinauthzMethod>,
7767
7768    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7769    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7770}
7771
7772impl BinaryAuthorization {
7773    pub fn new() -> Self {
7774        std::default::Default::default()
7775    }
7776
7777    /// Sets the value of [breakglass_justification][crate::model::BinaryAuthorization::breakglass_justification].
7778    pub fn set_breakglass_justification<T: std::convert::Into<std::string::String>>(
7779        mut self,
7780        v: T,
7781    ) -> Self {
7782        self.breakglass_justification = v.into();
7783        self
7784    }
7785
7786    /// Sets the value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method].
7787    ///
7788    /// Note that all the setters affecting `binauthz_method` are mutually
7789    /// exclusive.
7790    pub fn set_binauthz_method<
7791        T: std::convert::Into<std::option::Option<crate::model::binary_authorization::BinauthzMethod>>,
7792    >(
7793        mut self,
7794        v: T,
7795    ) -> Self {
7796        self.binauthz_method = v.into();
7797        self
7798    }
7799
7800    /// The value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method]
7801    /// if it holds a `UseDefault`, `None` if the field is not set or
7802    /// holds a different branch.
7803    pub fn use_default(&self) -> std::option::Option<&bool> {
7804        #[allow(unreachable_patterns)]
7805        self.binauthz_method.as_ref().and_then(|v| match v {
7806            crate::model::binary_authorization::BinauthzMethod::UseDefault(v) => {
7807                std::option::Option::Some(v)
7808            }
7809            _ => std::option::Option::None,
7810        })
7811    }
7812
7813    /// The value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method]
7814    /// if it holds a `Policy`, `None` if the field is not set or
7815    /// holds a different branch.
7816    pub fn policy(&self) -> std::option::Option<&std::string::String> {
7817        #[allow(unreachable_patterns)]
7818        self.binauthz_method.as_ref().and_then(|v| match v {
7819            crate::model::binary_authorization::BinauthzMethod::Policy(v) => {
7820                std::option::Option::Some(v)
7821            }
7822            _ => std::option::Option::None,
7823        })
7824    }
7825
7826    /// Sets the value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method]
7827    /// to hold a `UseDefault`.
7828    ///
7829    /// Note that all the setters affecting `binauthz_method` are
7830    /// mutually exclusive.
7831    pub fn set_use_default<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7832        self.binauthz_method = std::option::Option::Some(
7833            crate::model::binary_authorization::BinauthzMethod::UseDefault(v.into()),
7834        );
7835        self
7836    }
7837
7838    /// Sets the value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method]
7839    /// to hold a `Policy`.
7840    ///
7841    /// Note that all the setters affecting `binauthz_method` are
7842    /// mutually exclusive.
7843    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7844        self.binauthz_method = std::option::Option::Some(
7845            crate::model::binary_authorization::BinauthzMethod::Policy(v.into()),
7846        );
7847        self
7848    }
7849}
7850
7851impl wkt::message::Message for BinaryAuthorization {
7852    fn typename() -> &'static str {
7853        "type.googleapis.com/google.cloud.run.v2.BinaryAuthorization"
7854    }
7855}
7856
7857/// Defines additional types related to [BinaryAuthorization].
7858pub mod binary_authorization {
7859    #[allow(unused_imports)]
7860    use super::*;
7861
7862    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7863    #[serde(rename_all = "camelCase")]
7864    #[non_exhaustive]
7865    pub enum BinauthzMethod {
7866        /// Optional. If True, indicates to use the default project's binary
7867        /// authorization policy. If False, binary authorization will be disabled.
7868        UseDefault(bool),
7869        /// Optional. The path to a binary authorization policy.
7870        /// Format: `projects/{project}/platforms/cloudRun/{policy-name}`
7871        Policy(std::string::String),
7872    }
7873}
7874
7875/// Settings for revision-level scaling settings.
7876#[serde_with::serde_as]
7877#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7878#[serde(default, rename_all = "camelCase")]
7879#[non_exhaustive]
7880pub struct RevisionScaling {
7881    /// Optional. Minimum number of serving instances that this resource should
7882    /// have.
7883    pub min_instance_count: i32,
7884
7885    /// Optional. Maximum number of serving instances that this resource should
7886    /// have. When unspecified, the field is set to the server default value of
7887    /// 100. For more information see
7888    /// <https://cloud.google.com/run/docs/configuring/max-instances>
7889    pub max_instance_count: i32,
7890
7891    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7892    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7893}
7894
7895impl RevisionScaling {
7896    pub fn new() -> Self {
7897        std::default::Default::default()
7898    }
7899
7900    /// Sets the value of [min_instance_count][crate::model::RevisionScaling::min_instance_count].
7901    pub fn set_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7902        self.min_instance_count = v.into();
7903        self
7904    }
7905
7906    /// Sets the value of [max_instance_count][crate::model::RevisionScaling::max_instance_count].
7907    pub fn set_max_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7908        self.max_instance_count = v.into();
7909        self
7910    }
7911}
7912
7913impl wkt::message::Message for RevisionScaling {
7914    fn typename() -> &'static str {
7915        "type.googleapis.com/google.cloud.run.v2.RevisionScaling"
7916    }
7917}
7918
7919/// Settings for Cloud Service Mesh. For more information see
7920/// <https://cloud.google.com/service-mesh/docs/overview>.
7921#[serde_with::serde_as]
7922#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7923#[serde(default, rename_all = "camelCase")]
7924#[non_exhaustive]
7925pub struct ServiceMesh {
7926    /// The Mesh resource name. Format:
7927    /// `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can
7928    /// be project id or number.
7929    #[serde(skip_serializing_if = "std::string::String::is_empty")]
7930    pub mesh: std::string::String,
7931
7932    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7933    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7934}
7935
7936impl ServiceMesh {
7937    pub fn new() -> Self {
7938        std::default::Default::default()
7939    }
7940
7941    /// Sets the value of [mesh][crate::model::ServiceMesh::mesh].
7942    pub fn set_mesh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7943        self.mesh = v.into();
7944        self
7945    }
7946}
7947
7948impl wkt::message::Message for ServiceMesh {
7949    fn typename() -> &'static str {
7950        "type.googleapis.com/google.cloud.run.v2.ServiceMesh"
7951    }
7952}
7953
7954/// Scaling settings applied at the service level rather than
7955/// at the revision level.
7956#[serde_with::serde_as]
7957#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7958#[serde(default, rename_all = "camelCase")]
7959#[non_exhaustive]
7960pub struct ServiceScaling {
7961    /// Optional. total min instances for the service. This number of instances is
7962    /// divided among all revisions with specified traffic based on the percent
7963    /// of traffic they are receiving.
7964    pub min_instance_count: i32,
7965
7966    /// Optional. The scaling mode for the service.
7967    pub scaling_mode: crate::model::service_scaling::ScalingMode,
7968
7969    /// Optional. total instance count for the service in manual scaling mode. This
7970    /// number of instances is divided among all revisions with specified traffic
7971    /// based on the percent of traffic they are receiving.
7972    #[serde(skip_serializing_if = "std::option::Option::is_none")]
7973    pub manual_instance_count: std::option::Option<i32>,
7974
7975    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7976    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7977}
7978
7979impl ServiceScaling {
7980    pub fn new() -> Self {
7981        std::default::Default::default()
7982    }
7983
7984    /// Sets the value of [min_instance_count][crate::model::ServiceScaling::min_instance_count].
7985    pub fn set_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7986        self.min_instance_count = v.into();
7987        self
7988    }
7989
7990    /// Sets the value of [scaling_mode][crate::model::ServiceScaling::scaling_mode].
7991    pub fn set_scaling_mode<T: std::convert::Into<crate::model::service_scaling::ScalingMode>>(
7992        mut self,
7993        v: T,
7994    ) -> Self {
7995        self.scaling_mode = v.into();
7996        self
7997    }
7998
7999    /// Sets the value of [manual_instance_count][crate::model::ServiceScaling::manual_instance_count].
8000    pub fn set_manual_instance_count<T: std::convert::Into<std::option::Option<i32>>>(
8001        mut self,
8002        v: T,
8003    ) -> Self {
8004        self.manual_instance_count = v.into();
8005        self
8006    }
8007}
8008
8009impl wkt::message::Message for ServiceScaling {
8010    fn typename() -> &'static str {
8011        "type.googleapis.com/google.cloud.run.v2.ServiceScaling"
8012    }
8013}
8014
8015/// Defines additional types related to [ServiceScaling].
8016pub mod service_scaling {
8017    #[allow(unused_imports)]
8018    use super::*;
8019
8020    /// The scaling mode for the service. If not provided, it defaults to
8021    /// AUTOMATIC.
8022    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8023    pub struct ScalingMode(i32);
8024
8025    impl ScalingMode {
8026        /// Unspecified.
8027        pub const SCALING_MODE_UNSPECIFIED: ScalingMode = ScalingMode::new(0);
8028
8029        /// Scale based on traffic between min and max instances.
8030        pub const AUTOMATIC: ScalingMode = ScalingMode::new(1);
8031
8032        /// Scale to exactly min instances and ignore max instances.
8033        pub const MANUAL: ScalingMode = ScalingMode::new(2);
8034
8035        /// Creates a new ScalingMode instance.
8036        pub(crate) const fn new(value: i32) -> Self {
8037            Self(value)
8038        }
8039
8040        /// Gets the enum value.
8041        pub fn value(&self) -> i32 {
8042            self.0
8043        }
8044
8045        /// Gets the enum value as a string.
8046        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8047            match self.0 {
8048                0 => std::borrow::Cow::Borrowed("SCALING_MODE_UNSPECIFIED"),
8049                1 => std::borrow::Cow::Borrowed("AUTOMATIC"),
8050                2 => std::borrow::Cow::Borrowed("MANUAL"),
8051                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8052            }
8053        }
8054
8055        /// Creates an enum value from the value name.
8056        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8057            match name {
8058                "SCALING_MODE_UNSPECIFIED" => {
8059                    std::option::Option::Some(Self::SCALING_MODE_UNSPECIFIED)
8060                }
8061                "AUTOMATIC" => std::option::Option::Some(Self::AUTOMATIC),
8062                "MANUAL" => std::option::Option::Some(Self::MANUAL),
8063                _ => std::option::Option::None,
8064            }
8065        }
8066    }
8067
8068    impl std::convert::From<i32> for ScalingMode {
8069        fn from(value: i32) -> Self {
8070            Self::new(value)
8071        }
8072    }
8073
8074    impl std::default::Default for ScalingMode {
8075        fn default() -> Self {
8076            Self::new(0)
8077        }
8078    }
8079}
8080
8081/// Hardware constraints configuration.
8082#[serde_with::serde_as]
8083#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8084#[serde(default, rename_all = "camelCase")]
8085#[non_exhaustive]
8086pub struct NodeSelector {
8087    /// Required. GPU accelerator type to attach to an instance.
8088    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8089    pub accelerator: std::string::String,
8090
8091    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8092    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8093}
8094
8095impl NodeSelector {
8096    pub fn new() -> Self {
8097        std::default::Default::default()
8098    }
8099
8100    /// Sets the value of [accelerator][crate::model::NodeSelector::accelerator].
8101    pub fn set_accelerator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8102        self.accelerator = v.into();
8103        self
8104    }
8105}
8106
8107impl wkt::message::Message for NodeSelector {
8108    fn typename() -> &'static str {
8109        "type.googleapis.com/google.cloud.run.v2.NodeSelector"
8110    }
8111}
8112
8113/// Describes the Build step of the function that builds a container from the
8114/// given source.
8115#[serde_with::serde_as]
8116#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8117#[serde(default, rename_all = "camelCase")]
8118#[non_exhaustive]
8119pub struct BuildConfig {
8120    /// Output only. The Cloud Build name of the latest successful deployment of
8121    /// the function.
8122    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8123    pub name: std::string::String,
8124
8125    /// The Cloud Storage bucket URI where the function source code is located.
8126    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8127    pub source_location: std::string::String,
8128
8129    /// Optional. The name of the function (as defined in source code) that will be
8130    /// executed. Defaults to the resource name suffix, if not specified. For
8131    /// backward compatibility, if function with given name is not found, then the
8132    /// system will try to use function named "function".
8133    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8134    pub function_target: std::string::String,
8135
8136    /// Optional. Artifact Registry URI to store the built image.
8137    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8138    pub image_uri: std::string::String,
8139
8140    /// Optional. The base image used to build the function.
8141    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8142    pub base_image: std::string::String,
8143
8144    /// Optional. Sets whether the function will receive automatic base image
8145    /// updates.
8146    pub enable_automatic_updates: bool,
8147
8148    /// Optional. Name of the Cloud Build Custom Worker Pool that should be used to
8149    /// build the Cloud Run function. The format of this field is
8150    /// `projects/{project}/locations/{region}/workerPools/{workerPool}` where
8151    /// `{project}` and `{region}` are the project id and region respectively where
8152    /// the worker pool is defined and `{workerPool}` is the short name of the
8153    /// worker pool.
8154    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8155    pub worker_pool: std::string::String,
8156
8157    /// Optional. User-provided build-time environment variables for the function
8158    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8159    pub environment_variables: std::collections::HashMap<std::string::String, std::string::String>,
8160
8161    /// Optional. Service account to be used for building the container. The format
8162    /// of this field is
8163    /// `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`.
8164    #[serde(skip_serializing_if = "std::string::String::is_empty")]
8165    pub service_account: std::string::String,
8166
8167    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8168    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8169}
8170
8171impl BuildConfig {
8172    pub fn new() -> Self {
8173        std::default::Default::default()
8174    }
8175
8176    /// Sets the value of [name][crate::model::BuildConfig::name].
8177    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8178        self.name = v.into();
8179        self
8180    }
8181
8182    /// Sets the value of [source_location][crate::model::BuildConfig::source_location].
8183    pub fn set_source_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8184        self.source_location = v.into();
8185        self
8186    }
8187
8188    /// Sets the value of [function_target][crate::model::BuildConfig::function_target].
8189    pub fn set_function_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8190        self.function_target = v.into();
8191        self
8192    }
8193
8194    /// Sets the value of [image_uri][crate::model::BuildConfig::image_uri].
8195    pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8196        self.image_uri = v.into();
8197        self
8198    }
8199
8200    /// Sets the value of [base_image][crate::model::BuildConfig::base_image].
8201    pub fn set_base_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8202        self.base_image = v.into();
8203        self
8204    }
8205
8206    /// Sets the value of [enable_automatic_updates][crate::model::BuildConfig::enable_automatic_updates].
8207    pub fn set_enable_automatic_updates<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8208        self.enable_automatic_updates = v.into();
8209        self
8210    }
8211
8212    /// Sets the value of [worker_pool][crate::model::BuildConfig::worker_pool].
8213    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8214        self.worker_pool = v.into();
8215        self
8216    }
8217
8218    /// Sets the value of [service_account][crate::model::BuildConfig::service_account].
8219    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8220        self.service_account = v.into();
8221        self
8222    }
8223
8224    /// Sets the value of [environment_variables][crate::model::BuildConfig::environment_variables].
8225    pub fn set_environment_variables<T, K, V>(mut self, v: T) -> Self
8226    where
8227        T: std::iter::IntoIterator<Item = (K, V)>,
8228        K: std::convert::Into<std::string::String>,
8229        V: std::convert::Into<std::string::String>,
8230    {
8231        use std::iter::Iterator;
8232        self.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8233        self
8234    }
8235}
8236
8237impl wkt::message::Message for BuildConfig {
8238    fn typename() -> &'static str {
8239        "type.googleapis.com/google.cloud.run.v2.BuildConfig"
8240    }
8241}
8242
8243/// The type of instance allocation.
8244#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8245pub struct TrafficTargetAllocationType(i32);
8246
8247impl TrafficTargetAllocationType {
8248    /// Unspecified instance allocation type.
8249    pub const TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED: TrafficTargetAllocationType =
8250        TrafficTargetAllocationType::new(0);
8251
8252    /// Allocates instances to the Service's latest ready Revision.
8253    pub const TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST: TrafficTargetAllocationType =
8254        TrafficTargetAllocationType::new(1);
8255
8256    /// Allocates instances to a Revision by name.
8257    pub const TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION: TrafficTargetAllocationType =
8258        TrafficTargetAllocationType::new(2);
8259
8260    /// Creates a new TrafficTargetAllocationType instance.
8261    pub(crate) const fn new(value: i32) -> Self {
8262        Self(value)
8263    }
8264
8265    /// Gets the enum value.
8266    pub fn value(&self) -> i32 {
8267        self.0
8268    }
8269
8270    /// Gets the enum value as a string.
8271    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8272        match self.0 {
8273            0 => std::borrow::Cow::Borrowed("TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED"),
8274            1 => std::borrow::Cow::Borrowed("TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"),
8275            2 => std::borrow::Cow::Borrowed("TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"),
8276            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8277        }
8278    }
8279
8280    /// Creates an enum value from the value name.
8281    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8282        match name {
8283            "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" => {
8284                std::option::Option::Some(Self::TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED)
8285            }
8286            "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST" => {
8287                std::option::Option::Some(Self::TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST)
8288            }
8289            "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION" => {
8290                std::option::Option::Some(Self::TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION)
8291            }
8292            _ => std::option::Option::None,
8293        }
8294    }
8295}
8296
8297impl std::convert::From<i32> for TrafficTargetAllocationType {
8298    fn from(value: i32) -> Self {
8299        Self::new(value)
8300    }
8301}
8302
8303impl std::default::Default for TrafficTargetAllocationType {
8304    fn default() -> Self {
8305        Self::new(0)
8306    }
8307}
8308
8309/// Allowed ingress traffic for the Container.
8310#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8311pub struct IngressTraffic(i32);
8312
8313impl IngressTraffic {
8314    /// Unspecified
8315    pub const INGRESS_TRAFFIC_UNSPECIFIED: IngressTraffic = IngressTraffic::new(0);
8316
8317    /// All inbound traffic is allowed.
8318    pub const INGRESS_TRAFFIC_ALL: IngressTraffic = IngressTraffic::new(1);
8319
8320    /// Only internal traffic is allowed.
8321    pub const INGRESS_TRAFFIC_INTERNAL_ONLY: IngressTraffic = IngressTraffic::new(2);
8322
8323    /// Both internal and Google Cloud Load Balancer traffic is allowed.
8324    pub const INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER: IngressTraffic = IngressTraffic::new(3);
8325
8326    /// No ingress traffic is allowed.
8327    pub const INGRESS_TRAFFIC_NONE: IngressTraffic = IngressTraffic::new(4);
8328
8329    /// Creates a new IngressTraffic instance.
8330    pub(crate) const fn new(value: i32) -> Self {
8331        Self(value)
8332    }
8333
8334    /// Gets the enum value.
8335    pub fn value(&self) -> i32 {
8336        self.0
8337    }
8338
8339    /// Gets the enum value as a string.
8340    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8341        match self.0 {
8342            0 => std::borrow::Cow::Borrowed("INGRESS_TRAFFIC_UNSPECIFIED"),
8343            1 => std::borrow::Cow::Borrowed("INGRESS_TRAFFIC_ALL"),
8344            2 => std::borrow::Cow::Borrowed("INGRESS_TRAFFIC_INTERNAL_ONLY"),
8345            3 => std::borrow::Cow::Borrowed("INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"),
8346            4 => std::borrow::Cow::Borrowed("INGRESS_TRAFFIC_NONE"),
8347            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8348        }
8349    }
8350
8351    /// Creates an enum value from the value name.
8352    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8353        match name {
8354            "INGRESS_TRAFFIC_UNSPECIFIED" => {
8355                std::option::Option::Some(Self::INGRESS_TRAFFIC_UNSPECIFIED)
8356            }
8357            "INGRESS_TRAFFIC_ALL" => std::option::Option::Some(Self::INGRESS_TRAFFIC_ALL),
8358            "INGRESS_TRAFFIC_INTERNAL_ONLY" => {
8359                std::option::Option::Some(Self::INGRESS_TRAFFIC_INTERNAL_ONLY)
8360            }
8361            "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER" => {
8362                std::option::Option::Some(Self::INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER)
8363            }
8364            "INGRESS_TRAFFIC_NONE" => std::option::Option::Some(Self::INGRESS_TRAFFIC_NONE),
8365            _ => std::option::Option::None,
8366        }
8367    }
8368}
8369
8370impl std::convert::From<i32> for IngressTraffic {
8371    fn from(value: i32) -> Self {
8372        Self::new(value)
8373    }
8374}
8375
8376impl std::default::Default for IngressTraffic {
8377    fn default() -> Self {
8378        Self::new(0)
8379    }
8380}
8381
8382/// Alternatives for execution environments.
8383#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8384pub struct ExecutionEnvironment(i32);
8385
8386impl ExecutionEnvironment {
8387    /// Unspecified
8388    pub const EXECUTION_ENVIRONMENT_UNSPECIFIED: ExecutionEnvironment =
8389        ExecutionEnvironment::new(0);
8390
8391    /// Uses the First Generation environment.
8392    pub const EXECUTION_ENVIRONMENT_GEN1: ExecutionEnvironment = ExecutionEnvironment::new(1);
8393
8394    /// Uses Second Generation environment.
8395    pub const EXECUTION_ENVIRONMENT_GEN2: ExecutionEnvironment = ExecutionEnvironment::new(2);
8396
8397    /// Creates a new ExecutionEnvironment instance.
8398    pub(crate) const fn new(value: i32) -> Self {
8399        Self(value)
8400    }
8401
8402    /// Gets the enum value.
8403    pub fn value(&self) -> i32 {
8404        self.0
8405    }
8406
8407    /// Gets the enum value as a string.
8408    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8409        match self.0 {
8410            0 => std::borrow::Cow::Borrowed("EXECUTION_ENVIRONMENT_UNSPECIFIED"),
8411            1 => std::borrow::Cow::Borrowed("EXECUTION_ENVIRONMENT_GEN1"),
8412            2 => std::borrow::Cow::Borrowed("EXECUTION_ENVIRONMENT_GEN2"),
8413            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8414        }
8415    }
8416
8417    /// Creates an enum value from the value name.
8418    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8419        match name {
8420            "EXECUTION_ENVIRONMENT_UNSPECIFIED" => {
8421                std::option::Option::Some(Self::EXECUTION_ENVIRONMENT_UNSPECIFIED)
8422            }
8423            "EXECUTION_ENVIRONMENT_GEN1" => {
8424                std::option::Option::Some(Self::EXECUTION_ENVIRONMENT_GEN1)
8425            }
8426            "EXECUTION_ENVIRONMENT_GEN2" => {
8427                std::option::Option::Some(Self::EXECUTION_ENVIRONMENT_GEN2)
8428            }
8429            _ => std::option::Option::None,
8430        }
8431    }
8432}
8433
8434impl std::convert::From<i32> for ExecutionEnvironment {
8435    fn from(value: i32) -> Self {
8436        Self::new(value)
8437    }
8438}
8439
8440impl std::default::Default for ExecutionEnvironment {
8441    fn default() -> Self {
8442        Self::new(0)
8443    }
8444}
8445
8446/// Specifies behavior if an encryption key used by a resource is revoked.
8447#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8448pub struct EncryptionKeyRevocationAction(i32);
8449
8450impl EncryptionKeyRevocationAction {
8451    /// Unspecified
8452    pub const ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED: EncryptionKeyRevocationAction =
8453        EncryptionKeyRevocationAction::new(0);
8454
8455    /// Prevents the creation of new instances.
8456    pub const PREVENT_NEW: EncryptionKeyRevocationAction = EncryptionKeyRevocationAction::new(1);
8457
8458    /// Shuts down existing instances, and prevents creation of new ones.
8459    pub const SHUTDOWN: EncryptionKeyRevocationAction = EncryptionKeyRevocationAction::new(2);
8460
8461    /// Creates a new EncryptionKeyRevocationAction instance.
8462    pub(crate) const fn new(value: i32) -> Self {
8463        Self(value)
8464    }
8465
8466    /// Gets the enum value.
8467    pub fn value(&self) -> i32 {
8468        self.0
8469    }
8470
8471    /// Gets the enum value as a string.
8472    pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8473        match self.0 {
8474            0 => std::borrow::Cow::Borrowed("ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED"),
8475            1 => std::borrow::Cow::Borrowed("PREVENT_NEW"),
8476            2 => std::borrow::Cow::Borrowed("SHUTDOWN"),
8477            _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8478        }
8479    }
8480
8481    /// Creates an enum value from the value name.
8482    pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8483        match name {
8484            "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" => {
8485                std::option::Option::Some(Self::ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED)
8486            }
8487            "PREVENT_NEW" => std::option::Option::Some(Self::PREVENT_NEW),
8488            "SHUTDOWN" => std::option::Option::Some(Self::SHUTDOWN),
8489            _ => std::option::Option::None,
8490        }
8491    }
8492}
8493
8494impl std::convert::From<i32> for EncryptionKeyRevocationAction {
8495    fn from(value: i32) -> Self {
8496        Self::new(value)
8497    }
8498}
8499
8500impl std::default::Default for EncryptionKeyRevocationAction {
8501    fn default() -> Self {
8502        Self::new(0)
8503    }
8504}