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#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct SubmitBuildRequest {
42    /// Required. The project and location to build in. Location must be a region,
43    /// e.g., 'us-central1' or 'global' if the global builder is to be used.
44    /// Format:
45    /// `projects/{project}/locations/{location}`
46    pub parent: std::string::String,
47
48    /// Required. Artifact Registry URI to store the built image.
49    pub image_uri: std::string::String,
50
51    /// Optional. The service account to use for the build. If not set, the default
52    /// Cloud Build service account for the project will be used.
53    pub service_account: std::string::String,
54
55    /// Optional. Name of the Cloud Build Custom Worker Pool that should be used to
56    /// build the function. The format of this field is
57    /// `projects/{project}/locations/{region}/workerPools/{workerPool}` where
58    /// `{project}` and `{region}` are the project id and region respectively where
59    /// the worker pool is defined and `{workerPool}` is the short name of the
60    /// worker pool.
61    pub worker_pool: std::string::String,
62
63    /// Optional. Additional tags to annotate the build.
64    pub tags: std::vec::Vec<std::string::String>,
65
66    /// Location of source.
67    pub source: std::option::Option<crate::model::submit_build_request::Source>,
68
69    /// Build type must be one of the following.
70    pub build_type: std::option::Option<crate::model::submit_build_request::BuildType>,
71
72    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
73}
74
75impl SubmitBuildRequest {
76    pub fn new() -> Self {
77        std::default::Default::default()
78    }
79
80    /// Sets the value of [parent][crate::model::SubmitBuildRequest::parent].
81    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
82        self.parent = v.into();
83        self
84    }
85
86    /// Sets the value of [image_uri][crate::model::SubmitBuildRequest::image_uri].
87    pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88        self.image_uri = v.into();
89        self
90    }
91
92    /// Sets the value of [service_account][crate::model::SubmitBuildRequest::service_account].
93    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
94        self.service_account = v.into();
95        self
96    }
97
98    /// Sets the value of [worker_pool][crate::model::SubmitBuildRequest::worker_pool].
99    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100        self.worker_pool = v.into();
101        self
102    }
103
104    /// Sets the value of [tags][crate::model::SubmitBuildRequest::tags].
105    pub fn set_tags<T, V>(mut self, v: T) -> Self
106    where
107        T: std::iter::IntoIterator<Item = V>,
108        V: std::convert::Into<std::string::String>,
109    {
110        use std::iter::Iterator;
111        self.tags = v.into_iter().map(|i| i.into()).collect();
112        self
113    }
114
115    /// Sets the value of [source][crate::model::SubmitBuildRequest::source].
116    ///
117    /// Note that all the setters affecting `source` are mutually
118    /// exclusive.
119    pub fn set_source<
120        T: std::convert::Into<std::option::Option<crate::model::submit_build_request::Source>>,
121    >(
122        mut self,
123        v: T,
124    ) -> Self {
125        self.source = v.into();
126        self
127    }
128
129    /// The value of [source][crate::model::SubmitBuildRequest::source]
130    /// if it holds a `StorageSource`, `None` if the field is not set or
131    /// holds a different branch.
132    pub fn storage_source(
133        &self,
134    ) -> std::option::Option<&std::boxed::Box<crate::model::StorageSource>> {
135        #[allow(unreachable_patterns)]
136        self.source.as_ref().and_then(|v| match v {
137            crate::model::submit_build_request::Source::StorageSource(v) => {
138                std::option::Option::Some(v)
139            }
140            _ => std::option::Option::None,
141        })
142    }
143
144    /// Sets the value of [source][crate::model::SubmitBuildRequest::source]
145    /// to hold a `StorageSource`.
146    ///
147    /// Note that all the setters affecting `source` are
148    /// mutually exclusive.
149    pub fn set_storage_source<
150        T: std::convert::Into<std::boxed::Box<crate::model::StorageSource>>,
151    >(
152        mut self,
153        v: T,
154    ) -> Self {
155        self.source = std::option::Option::Some(
156            crate::model::submit_build_request::Source::StorageSource(v.into()),
157        );
158        self
159    }
160
161    /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type].
162    ///
163    /// Note that all the setters affecting `build_type` are mutually
164    /// exclusive.
165    pub fn set_build_type<
166        T: std::convert::Into<std::option::Option<crate::model::submit_build_request::BuildType>>,
167    >(
168        mut self,
169        v: T,
170    ) -> Self {
171        self.build_type = v.into();
172        self
173    }
174
175    /// The value of [build_type][crate::model::SubmitBuildRequest::build_type]
176    /// if it holds a `BuildpackBuild`, `None` if the field is not set or
177    /// holds a different branch.
178    pub fn buildpack_build(
179        &self,
180    ) -> std::option::Option<&std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>>
181    {
182        #[allow(unreachable_patterns)]
183        self.build_type.as_ref().and_then(|v| match v {
184            crate::model::submit_build_request::BuildType::BuildpackBuild(v) => {
185                std::option::Option::Some(v)
186            }
187            _ => std::option::Option::None,
188        })
189    }
190
191    /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type]
192    /// to hold a `BuildpackBuild`.
193    ///
194    /// Note that all the setters affecting `build_type` are
195    /// mutually exclusive.
196    pub fn set_buildpack_build<
197        T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>>,
198    >(
199        mut self,
200        v: T,
201    ) -> Self {
202        self.build_type = std::option::Option::Some(
203            crate::model::submit_build_request::BuildType::BuildpackBuild(v.into()),
204        );
205        self
206    }
207
208    /// The value of [build_type][crate::model::SubmitBuildRequest::build_type]
209    /// if it holds a `DockerBuild`, `None` if the field is not set or
210    /// holds a different branch.
211    pub fn docker_build(
212        &self,
213    ) -> std::option::Option<&std::boxed::Box<crate::model::submit_build_request::DockerBuild>>
214    {
215        #[allow(unreachable_patterns)]
216        self.build_type.as_ref().and_then(|v| match v {
217            crate::model::submit_build_request::BuildType::DockerBuild(v) => {
218                std::option::Option::Some(v)
219            }
220            _ => std::option::Option::None,
221        })
222    }
223
224    /// Sets the value of [build_type][crate::model::SubmitBuildRequest::build_type]
225    /// to hold a `DockerBuild`.
226    ///
227    /// Note that all the setters affecting `build_type` are
228    /// mutually exclusive.
229    pub fn set_docker_build<
230        T: std::convert::Into<std::boxed::Box<crate::model::submit_build_request::DockerBuild>>,
231    >(
232        mut self,
233        v: T,
234    ) -> Self {
235        self.build_type = std::option::Option::Some(
236            crate::model::submit_build_request::BuildType::DockerBuild(v.into()),
237        );
238        self
239    }
240}
241
242impl wkt::message::Message for SubmitBuildRequest {
243    fn typename() -> &'static str {
244        "type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest"
245    }
246}
247
248#[doc(hidden)]
249impl<'de> serde::de::Deserialize<'de> for SubmitBuildRequest {
250    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
251    where
252        D: serde::Deserializer<'de>,
253    {
254        #[allow(non_camel_case_types)]
255        #[doc(hidden)]
256        #[derive(PartialEq, Eq, Hash)]
257        enum __FieldTag {
258            __parent,
259            __storage_source,
260            __image_uri,
261            __buildpack_build,
262            __docker_build,
263            __service_account,
264            __worker_pool,
265            __tags,
266            Unknown(std::string::String),
267        }
268        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
269            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
270            where
271                D: serde::Deserializer<'de>,
272            {
273                struct Visitor;
274                impl<'de> serde::de::Visitor<'de> for Visitor {
275                    type Value = __FieldTag;
276                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
277                        formatter.write_str("a field name for SubmitBuildRequest")
278                    }
279                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
280                    where
281                        E: serde::de::Error,
282                    {
283                        use std::result::Result::Ok;
284                        use std::string::ToString;
285                        match value {
286                            "parent" => Ok(__FieldTag::__parent),
287                            "storageSource" => Ok(__FieldTag::__storage_source),
288                            "storage_source" => Ok(__FieldTag::__storage_source),
289                            "imageUri" => Ok(__FieldTag::__image_uri),
290                            "image_uri" => Ok(__FieldTag::__image_uri),
291                            "buildpackBuild" => Ok(__FieldTag::__buildpack_build),
292                            "buildpack_build" => Ok(__FieldTag::__buildpack_build),
293                            "dockerBuild" => Ok(__FieldTag::__docker_build),
294                            "docker_build" => Ok(__FieldTag::__docker_build),
295                            "serviceAccount" => Ok(__FieldTag::__service_account),
296                            "service_account" => Ok(__FieldTag::__service_account),
297                            "workerPool" => Ok(__FieldTag::__worker_pool),
298                            "worker_pool" => Ok(__FieldTag::__worker_pool),
299                            "tags" => Ok(__FieldTag::__tags),
300                            _ => Ok(__FieldTag::Unknown(value.to_string())),
301                        }
302                    }
303                }
304                deserializer.deserialize_identifier(Visitor)
305            }
306        }
307        struct Visitor;
308        impl<'de> serde::de::Visitor<'de> for Visitor {
309            type Value = SubmitBuildRequest;
310            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
311                formatter.write_str("struct SubmitBuildRequest")
312            }
313            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
314            where
315                A: serde::de::MapAccess<'de>,
316            {
317                #[allow(unused_imports)]
318                use serde::de::Error;
319                use std::option::Option::Some;
320                let mut fields = std::collections::HashSet::new();
321                let mut result = Self::Value::new();
322                while let Some(tag) = map.next_key::<__FieldTag>()? {
323                    #[allow(clippy::match_single_binding)]
324                    match tag {
325                        __FieldTag::__parent => {
326                            if !fields.insert(__FieldTag::__parent) {
327                                return std::result::Result::Err(A::Error::duplicate_field(
328                                    "multiple values for parent",
329                                ));
330                            }
331                            result.parent = map
332                                .next_value::<std::option::Option<std::string::String>>()?
333                                .unwrap_or_default();
334                        }
335                        __FieldTag::__storage_source => {
336                            if !fields.insert(__FieldTag::__storage_source) {
337                                return std::result::Result::Err(A::Error::duplicate_field(
338                                    "multiple values for storage_source",
339                                ));
340                            }
341                            if result.source.is_some() {
342                                return std::result::Result::Err(A::Error::duplicate_field(
343                                    "multiple values for `source`, a oneof with full ID .google.cloud.run.v2.SubmitBuildRequest.storage_source, latest field was storageSource",
344                                ));
345                            }
346                            result.source = std::option::Option::Some(
347                                crate::model::submit_build_request::Source::StorageSource(
348                                    map.next_value::<std::option::Option<
349                                        std::boxed::Box<crate::model::StorageSource>,
350                                    >>()?
351                                    .unwrap_or_default(),
352                                ),
353                            );
354                        }
355                        __FieldTag::__image_uri => {
356                            if !fields.insert(__FieldTag::__image_uri) {
357                                return std::result::Result::Err(A::Error::duplicate_field(
358                                    "multiple values for image_uri",
359                                ));
360                            }
361                            result.image_uri = map
362                                .next_value::<std::option::Option<std::string::String>>()?
363                                .unwrap_or_default();
364                        }
365                        __FieldTag::__buildpack_build => {
366                            if !fields.insert(__FieldTag::__buildpack_build) {
367                                return std::result::Result::Err(A::Error::duplicate_field(
368                                    "multiple values for buildpack_build",
369                                ));
370                            }
371                            if result.build_type.is_some() {
372                                return std::result::Result::Err(A::Error::duplicate_field(
373                                    "multiple values for `build_type`, a oneof with full ID .google.cloud.run.v2.SubmitBuildRequest.buildpack_build, latest field was buildpackBuild",
374                                ));
375                            }
376                            result.build_type = std::option::Option::Some(
377                                crate::model::submit_build_request::BuildType::BuildpackBuild(
378                                    map.next_value::<std::option::Option<
379                                        std::boxed::Box<
380                                            crate::model::submit_build_request::BuildpacksBuild,
381                                        >,
382                                    >>()?
383                                    .unwrap_or_default(),
384                                ),
385                            );
386                        }
387                        __FieldTag::__docker_build => {
388                            if !fields.insert(__FieldTag::__docker_build) {
389                                return std::result::Result::Err(A::Error::duplicate_field(
390                                    "multiple values for docker_build",
391                                ));
392                            }
393                            if result.build_type.is_some() {
394                                return std::result::Result::Err(A::Error::duplicate_field(
395                                    "multiple values for `build_type`, a oneof with full ID .google.cloud.run.v2.SubmitBuildRequest.docker_build, latest field was dockerBuild",
396                                ));
397                            }
398                            result.build_type = std::option::Option::Some(
399                                crate::model::submit_build_request::BuildType::DockerBuild(
400                                    map.next_value::<std::option::Option<
401                                        std::boxed::Box<
402                                            crate::model::submit_build_request::DockerBuild,
403                                        >,
404                                    >>()?
405                                    .unwrap_or_default(),
406                                ),
407                            );
408                        }
409                        __FieldTag::__service_account => {
410                            if !fields.insert(__FieldTag::__service_account) {
411                                return std::result::Result::Err(A::Error::duplicate_field(
412                                    "multiple values for service_account",
413                                ));
414                            }
415                            result.service_account = map
416                                .next_value::<std::option::Option<std::string::String>>()?
417                                .unwrap_or_default();
418                        }
419                        __FieldTag::__worker_pool => {
420                            if !fields.insert(__FieldTag::__worker_pool) {
421                                return std::result::Result::Err(A::Error::duplicate_field(
422                                    "multiple values for worker_pool",
423                                ));
424                            }
425                            result.worker_pool = map
426                                .next_value::<std::option::Option<std::string::String>>()?
427                                .unwrap_or_default();
428                        }
429                        __FieldTag::__tags => {
430                            if !fields.insert(__FieldTag::__tags) {
431                                return std::result::Result::Err(A::Error::duplicate_field(
432                                    "multiple values for tags",
433                                ));
434                            }
435                            result.tags = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
436                        }
437                        __FieldTag::Unknown(key) => {
438                            let value = map.next_value::<serde_json::Value>()?;
439                            result._unknown_fields.insert(key, value);
440                        }
441                    }
442                }
443                std::result::Result::Ok(result)
444            }
445        }
446        deserializer.deserialize_any(Visitor)
447    }
448}
449
450#[doc(hidden)]
451impl serde::ser::Serialize for SubmitBuildRequest {
452    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
453    where
454        S: serde::ser::Serializer,
455    {
456        use serde::ser::SerializeMap;
457        #[allow(unused_imports)]
458        use std::option::Option::Some;
459        let mut state = serializer.serialize_map(std::option::Option::None)?;
460        if !self.parent.is_empty() {
461            state.serialize_entry("parent", &self.parent)?;
462        }
463        if let Some(value) = self.storage_source() {
464            state.serialize_entry("storageSource", value)?;
465        }
466        if !self.image_uri.is_empty() {
467            state.serialize_entry("imageUri", &self.image_uri)?;
468        }
469        if let Some(value) = self.buildpack_build() {
470            state.serialize_entry("buildpackBuild", value)?;
471        }
472        if let Some(value) = self.docker_build() {
473            state.serialize_entry("dockerBuild", value)?;
474        }
475        if !self.service_account.is_empty() {
476            state.serialize_entry("serviceAccount", &self.service_account)?;
477        }
478        if !self.worker_pool.is_empty() {
479            state.serialize_entry("workerPool", &self.worker_pool)?;
480        }
481        if !self.tags.is_empty() {
482            state.serialize_entry("tags", &self.tags)?;
483        }
484        if !self._unknown_fields.is_empty() {
485            for (key, value) in self._unknown_fields.iter() {
486                state.serialize_entry(key, &value)?;
487            }
488        }
489        state.end()
490    }
491}
492
493impl std::fmt::Debug for SubmitBuildRequest {
494    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
495        let mut debug_struct = f.debug_struct("SubmitBuildRequest");
496        debug_struct.field("parent", &self.parent);
497        debug_struct.field("image_uri", &self.image_uri);
498        debug_struct.field("service_account", &self.service_account);
499        debug_struct.field("worker_pool", &self.worker_pool);
500        debug_struct.field("tags", &self.tags);
501        debug_struct.field("source", &self.source);
502        debug_struct.field("build_type", &self.build_type);
503        if !self._unknown_fields.is_empty() {
504            debug_struct.field("_unknown_fields", &self._unknown_fields);
505        }
506        debug_struct.finish()
507    }
508}
509
510/// Defines additional types related to [SubmitBuildRequest].
511pub mod submit_build_request {
512    #[allow(unused_imports)]
513    use super::*;
514
515    /// Build the source using Docker. This means the source has a Dockerfile.
516    #[derive(Clone, Default, PartialEq)]
517    #[non_exhaustive]
518    pub struct DockerBuild {
519        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
520    }
521
522    impl DockerBuild {
523        pub fn new() -> Self {
524            std::default::Default::default()
525        }
526    }
527
528    impl wkt::message::Message for DockerBuild {
529        fn typename() -> &'static str {
530            "type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest.DockerBuild"
531        }
532    }
533
534    #[doc(hidden)]
535    impl<'de> serde::de::Deserialize<'de> for DockerBuild {
536        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
537        where
538            D: serde::Deserializer<'de>,
539        {
540            #[allow(non_camel_case_types)]
541            #[doc(hidden)]
542            #[derive(PartialEq, Eq, Hash)]
543            enum __FieldTag {
544                Unknown(std::string::String),
545            }
546            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
547                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
548                where
549                    D: serde::Deserializer<'de>,
550                {
551                    struct Visitor;
552                    impl<'de> serde::de::Visitor<'de> for Visitor {
553                        type Value = __FieldTag;
554                        fn expecting(
555                            &self,
556                            formatter: &mut std::fmt::Formatter,
557                        ) -> std::fmt::Result {
558                            formatter.write_str("a field name for DockerBuild")
559                        }
560                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
561                        where
562                            E: serde::de::Error,
563                        {
564                            use std::result::Result::Ok;
565                            use std::string::ToString;
566                            Ok(__FieldTag::Unknown(value.to_string()))
567                        }
568                    }
569                    deserializer.deserialize_identifier(Visitor)
570                }
571            }
572            struct Visitor;
573            impl<'de> serde::de::Visitor<'de> for Visitor {
574                type Value = DockerBuild;
575                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
576                    formatter.write_str("struct DockerBuild")
577                }
578                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
579                where
580                    A: serde::de::MapAccess<'de>,
581                {
582                    #[allow(unused_imports)]
583                    use serde::de::Error;
584                    use std::option::Option::Some;
585                    let mut result = Self::Value::new();
586                    while let Some(tag) = map.next_key::<__FieldTag>()? {
587                        #[allow(clippy::match_single_binding)]
588                        match tag {
589                            __FieldTag::Unknown(key) => {
590                                let value = map.next_value::<serde_json::Value>()?;
591                                result._unknown_fields.insert(key, value);
592                            }
593                        }
594                    }
595                    std::result::Result::Ok(result)
596                }
597            }
598            deserializer.deserialize_any(Visitor)
599        }
600    }
601
602    #[doc(hidden)]
603    impl serde::ser::Serialize for DockerBuild {
604        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
605        where
606            S: serde::ser::Serializer,
607        {
608            use serde::ser::SerializeMap;
609            #[allow(unused_imports)]
610            use std::option::Option::Some;
611            let mut state = serializer.serialize_map(std::option::Option::None)?;
612            if !self._unknown_fields.is_empty() {
613                for (key, value) in self._unknown_fields.iter() {
614                    state.serialize_entry(key, &value)?;
615                }
616            }
617            state.end()
618        }
619    }
620
621    impl std::fmt::Debug for DockerBuild {
622        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
623            let mut debug_struct = f.debug_struct("DockerBuild");
624            if !self._unknown_fields.is_empty() {
625                debug_struct.field("_unknown_fields", &self._unknown_fields);
626            }
627            debug_struct.finish()
628        }
629    }
630
631    /// Build the source using Buildpacks.
632    #[derive(Clone, Default, PartialEq)]
633    #[non_exhaustive]
634    pub struct BuildpacksBuild {
635        /// The runtime name, e.g. 'go113'. Leave blank for generic builds.
636        #[deprecated]
637        pub runtime: std::string::String,
638
639        /// Optional. Name of the function target if the source is a function source.
640        /// Required for function builds.
641        pub function_target: std::string::String,
642
643        /// Optional. cache_image_uri is the GCR/AR URL where the cache image will be
644        /// stored. cache_image_uri is optional and omitting it will disable caching.
645        /// This URL must be stable across builds. It is used to derive a
646        /// build-specific temporary URL by substituting the tag with the build ID.
647        /// The build will clean up the temporary image on a best-effort basis.
648        pub cache_image_uri: std::string::String,
649
650        /// Optional. The base image to use for the build.
651        pub base_image: std::string::String,
652
653        /// Optional. User-provided build-time environment variables.
654        pub environment_variables:
655            std::collections::HashMap<std::string::String, std::string::String>,
656
657        /// Optional. Whether or not the application container will be enrolled in
658        /// automatic base image updates. When true, the application will be built on
659        /// a scratch base image, so the base layers can be appended at run time.
660        pub enable_automatic_updates: bool,
661
662        /// Optional. project_descriptor stores the path to the project descriptor
663        /// file. When empty, it means that there is no project descriptor file in
664        /// the source.
665        pub project_descriptor: std::string::String,
666
667        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
668    }
669
670    impl BuildpacksBuild {
671        pub fn new() -> Self {
672            std::default::Default::default()
673        }
674
675        /// Sets the value of [runtime][crate::model::submit_build_request::BuildpacksBuild::runtime].
676        #[deprecated]
677        pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
678            self.runtime = v.into();
679            self
680        }
681
682        /// Sets the value of [function_target][crate::model::submit_build_request::BuildpacksBuild::function_target].
683        pub fn set_function_target<T: std::convert::Into<std::string::String>>(
684            mut self,
685            v: T,
686        ) -> Self {
687            self.function_target = v.into();
688            self
689        }
690
691        /// Sets the value of [cache_image_uri][crate::model::submit_build_request::BuildpacksBuild::cache_image_uri].
692        pub fn set_cache_image_uri<T: std::convert::Into<std::string::String>>(
693            mut self,
694            v: T,
695        ) -> Self {
696            self.cache_image_uri = v.into();
697            self
698        }
699
700        /// Sets the value of [base_image][crate::model::submit_build_request::BuildpacksBuild::base_image].
701        pub fn set_base_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
702            self.base_image = v.into();
703            self
704        }
705
706        /// Sets the value of [environment_variables][crate::model::submit_build_request::BuildpacksBuild::environment_variables].
707        pub fn set_environment_variables<T, K, V>(mut self, v: T) -> Self
708        where
709            T: std::iter::IntoIterator<Item = (K, V)>,
710            K: std::convert::Into<std::string::String>,
711            V: std::convert::Into<std::string::String>,
712        {
713            use std::iter::Iterator;
714            self.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
715            self
716        }
717
718        /// Sets the value of [enable_automatic_updates][crate::model::submit_build_request::BuildpacksBuild::enable_automatic_updates].
719        pub fn set_enable_automatic_updates<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
720            self.enable_automatic_updates = v.into();
721            self
722        }
723
724        /// Sets the value of [project_descriptor][crate::model::submit_build_request::BuildpacksBuild::project_descriptor].
725        pub fn set_project_descriptor<T: std::convert::Into<std::string::String>>(
726            mut self,
727            v: T,
728        ) -> Self {
729            self.project_descriptor = v.into();
730            self
731        }
732    }
733
734    impl wkt::message::Message for BuildpacksBuild {
735        fn typename() -> &'static str {
736            "type.googleapis.com/google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild"
737        }
738    }
739
740    #[doc(hidden)]
741    impl<'de> serde::de::Deserialize<'de> for BuildpacksBuild {
742        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
743        where
744            D: serde::Deserializer<'de>,
745        {
746            #[allow(non_camel_case_types)]
747            #[doc(hidden)]
748            #[derive(PartialEq, Eq, Hash)]
749            enum __FieldTag {
750                __runtime,
751                __function_target,
752                __cache_image_uri,
753                __base_image,
754                __environment_variables,
755                __enable_automatic_updates,
756                __project_descriptor,
757                Unknown(std::string::String),
758            }
759            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
760                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
761                where
762                    D: serde::Deserializer<'de>,
763                {
764                    struct Visitor;
765                    impl<'de> serde::de::Visitor<'de> for Visitor {
766                        type Value = __FieldTag;
767                        fn expecting(
768                            &self,
769                            formatter: &mut std::fmt::Formatter,
770                        ) -> std::fmt::Result {
771                            formatter.write_str("a field name for BuildpacksBuild")
772                        }
773                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
774                        where
775                            E: serde::de::Error,
776                        {
777                            use std::result::Result::Ok;
778                            use std::string::ToString;
779                            match value {
780                                "runtime" => Ok(__FieldTag::__runtime),
781                                "functionTarget" => Ok(__FieldTag::__function_target),
782                                "function_target" => Ok(__FieldTag::__function_target),
783                                "cacheImageUri" => Ok(__FieldTag::__cache_image_uri),
784                                "cache_image_uri" => Ok(__FieldTag::__cache_image_uri),
785                                "baseImage" => Ok(__FieldTag::__base_image),
786                                "base_image" => Ok(__FieldTag::__base_image),
787                                "environmentVariables" => Ok(__FieldTag::__environment_variables),
788                                "environment_variables" => Ok(__FieldTag::__environment_variables),
789                                "enableAutomaticUpdates" => {
790                                    Ok(__FieldTag::__enable_automatic_updates)
791                                }
792                                "enable_automatic_updates" => {
793                                    Ok(__FieldTag::__enable_automatic_updates)
794                                }
795                                "projectDescriptor" => Ok(__FieldTag::__project_descriptor),
796                                "project_descriptor" => Ok(__FieldTag::__project_descriptor),
797                                _ => Ok(__FieldTag::Unknown(value.to_string())),
798                            }
799                        }
800                    }
801                    deserializer.deserialize_identifier(Visitor)
802                }
803            }
804            struct Visitor;
805            impl<'de> serde::de::Visitor<'de> for Visitor {
806                type Value = BuildpacksBuild;
807                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
808                    formatter.write_str("struct BuildpacksBuild")
809                }
810                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
811                where
812                    A: serde::de::MapAccess<'de>,
813                {
814                    #[allow(unused_imports)]
815                    use serde::de::Error;
816                    use std::option::Option::Some;
817                    let mut fields = std::collections::HashSet::new();
818                    let mut result = Self::Value::new();
819                    while let Some(tag) = map.next_key::<__FieldTag>()? {
820                        #[allow(clippy::match_single_binding)]
821                        match tag {
822                            __FieldTag::__runtime => {
823                                if !fields.insert(__FieldTag::__runtime) {
824                                    return std::result::Result::Err(A::Error::duplicate_field(
825                                        "multiple values for runtime",
826                                    ));
827                                }
828                                result.runtime = map
829                                    .next_value::<std::option::Option<std::string::String>>()?
830                                    .unwrap_or_default();
831                            }
832                            __FieldTag::__function_target => {
833                                if !fields.insert(__FieldTag::__function_target) {
834                                    return std::result::Result::Err(A::Error::duplicate_field(
835                                        "multiple values for function_target",
836                                    ));
837                                }
838                                result.function_target = map
839                                    .next_value::<std::option::Option<std::string::String>>()?
840                                    .unwrap_or_default();
841                            }
842                            __FieldTag::__cache_image_uri => {
843                                if !fields.insert(__FieldTag::__cache_image_uri) {
844                                    return std::result::Result::Err(A::Error::duplicate_field(
845                                        "multiple values for cache_image_uri",
846                                    ));
847                                }
848                                result.cache_image_uri = map
849                                    .next_value::<std::option::Option<std::string::String>>()?
850                                    .unwrap_or_default();
851                            }
852                            __FieldTag::__base_image => {
853                                if !fields.insert(__FieldTag::__base_image) {
854                                    return std::result::Result::Err(A::Error::duplicate_field(
855                                        "multiple values for base_image",
856                                    ));
857                                }
858                                result.base_image = map
859                                    .next_value::<std::option::Option<std::string::String>>()?
860                                    .unwrap_or_default();
861                            }
862                            __FieldTag::__environment_variables => {
863                                if !fields.insert(__FieldTag::__environment_variables) {
864                                    return std::result::Result::Err(A::Error::duplicate_field(
865                                        "multiple values for environment_variables",
866                                    ));
867                                }
868                                result.environment_variables = map
869                                    .next_value::<std::option::Option<
870                                        std::collections::HashMap<
871                                            std::string::String,
872                                            std::string::String,
873                                        >,
874                                    >>()?
875                                    .unwrap_or_default();
876                            }
877                            __FieldTag::__enable_automatic_updates => {
878                                if !fields.insert(__FieldTag::__enable_automatic_updates) {
879                                    return std::result::Result::Err(A::Error::duplicate_field(
880                                        "multiple values for enable_automatic_updates",
881                                    ));
882                                }
883                                result.enable_automatic_updates = map
884                                    .next_value::<std::option::Option<bool>>()?
885                                    .unwrap_or_default();
886                            }
887                            __FieldTag::__project_descriptor => {
888                                if !fields.insert(__FieldTag::__project_descriptor) {
889                                    return std::result::Result::Err(A::Error::duplicate_field(
890                                        "multiple values for project_descriptor",
891                                    ));
892                                }
893                                result.project_descriptor = map
894                                    .next_value::<std::option::Option<std::string::String>>()?
895                                    .unwrap_or_default();
896                            }
897                            __FieldTag::Unknown(key) => {
898                                let value = map.next_value::<serde_json::Value>()?;
899                                result._unknown_fields.insert(key, value);
900                            }
901                        }
902                    }
903                    std::result::Result::Ok(result)
904                }
905            }
906            deserializer.deserialize_any(Visitor)
907        }
908    }
909
910    #[doc(hidden)]
911    impl serde::ser::Serialize for BuildpacksBuild {
912        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
913        where
914            S: serde::ser::Serializer,
915        {
916            use serde::ser::SerializeMap;
917            #[allow(unused_imports)]
918            use std::option::Option::Some;
919            let mut state = serializer.serialize_map(std::option::Option::None)?;
920            if !self.runtime.is_empty() {
921                state.serialize_entry("runtime", &self.runtime)?;
922            }
923            if !self.function_target.is_empty() {
924                state.serialize_entry("functionTarget", &self.function_target)?;
925            }
926            if !self.cache_image_uri.is_empty() {
927                state.serialize_entry("cacheImageUri", &self.cache_image_uri)?;
928            }
929            if !self.base_image.is_empty() {
930                state.serialize_entry("baseImage", &self.base_image)?;
931            }
932            if !self.environment_variables.is_empty() {
933                state.serialize_entry("environmentVariables", &self.environment_variables)?;
934            }
935            if !wkt::internal::is_default(&self.enable_automatic_updates) {
936                state.serialize_entry("enableAutomaticUpdates", &self.enable_automatic_updates)?;
937            }
938            if !self.project_descriptor.is_empty() {
939                state.serialize_entry("projectDescriptor", &self.project_descriptor)?;
940            }
941            if !self._unknown_fields.is_empty() {
942                for (key, value) in self._unknown_fields.iter() {
943                    state.serialize_entry(key, &value)?;
944                }
945            }
946            state.end()
947        }
948    }
949
950    impl std::fmt::Debug for BuildpacksBuild {
951        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
952            let mut debug_struct = f.debug_struct("BuildpacksBuild");
953            debug_struct.field("runtime", &self.runtime);
954            debug_struct.field("function_target", &self.function_target);
955            debug_struct.field("cache_image_uri", &self.cache_image_uri);
956            debug_struct.field("base_image", &self.base_image);
957            debug_struct.field("environment_variables", &self.environment_variables);
958            debug_struct.field("enable_automatic_updates", &self.enable_automatic_updates);
959            debug_struct.field("project_descriptor", &self.project_descriptor);
960            if !self._unknown_fields.is_empty() {
961                debug_struct.field("_unknown_fields", &self._unknown_fields);
962            }
963            debug_struct.finish()
964        }
965    }
966
967    /// Location of source.
968    #[derive(Clone, Debug, PartialEq)]
969    #[non_exhaustive]
970    pub enum Source {
971        /// Required. Source for the build.
972        StorageSource(std::boxed::Box<crate::model::StorageSource>),
973    }
974
975    /// Build type must be one of the following.
976    #[derive(Clone, Debug, PartialEq)]
977    #[non_exhaustive]
978    pub enum BuildType {
979        /// Build the source using Buildpacks.
980        BuildpackBuild(std::boxed::Box<crate::model::submit_build_request::BuildpacksBuild>),
981        /// Build the source using Docker. This means the source has a Dockerfile.
982        DockerBuild(std::boxed::Box<crate::model::submit_build_request::DockerBuild>),
983    }
984}
985
986/// Response message for submitting a Build.
987#[derive(Clone, Default, PartialEq)]
988#[non_exhaustive]
989pub struct SubmitBuildResponse {
990    /// Cloud Build operation to be polled via CloudBuild API.
991    pub build_operation: std::option::Option<longrunning::model::Operation>,
992
993    /// URI of the base builder image in Artifact Registry being used in the build.
994    /// Used to opt into automatic base image updates.
995    pub base_image_uri: std::string::String,
996
997    /// Warning message for the base image.
998    pub base_image_warning: std::string::String,
999
1000    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1001}
1002
1003impl SubmitBuildResponse {
1004    pub fn new() -> Self {
1005        std::default::Default::default()
1006    }
1007
1008    /// Sets the value of [build_operation][crate::model::SubmitBuildResponse::build_operation].
1009    pub fn set_build_operation<T>(mut self, v: T) -> Self
1010    where
1011        T: std::convert::Into<longrunning::model::Operation>,
1012    {
1013        self.build_operation = std::option::Option::Some(v.into());
1014        self
1015    }
1016
1017    /// Sets or clears the value of [build_operation][crate::model::SubmitBuildResponse::build_operation].
1018    pub fn set_or_clear_build_operation<T>(mut self, v: std::option::Option<T>) -> Self
1019    where
1020        T: std::convert::Into<longrunning::model::Operation>,
1021    {
1022        self.build_operation = v.map(|x| x.into());
1023        self
1024    }
1025
1026    /// Sets the value of [base_image_uri][crate::model::SubmitBuildResponse::base_image_uri].
1027    pub fn set_base_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1028        self.base_image_uri = v.into();
1029        self
1030    }
1031
1032    /// Sets the value of [base_image_warning][crate::model::SubmitBuildResponse::base_image_warning].
1033    pub fn set_base_image_warning<T: std::convert::Into<std::string::String>>(
1034        mut self,
1035        v: T,
1036    ) -> Self {
1037        self.base_image_warning = v.into();
1038        self
1039    }
1040}
1041
1042impl wkt::message::Message for SubmitBuildResponse {
1043    fn typename() -> &'static str {
1044        "type.googleapis.com/google.cloud.run.v2.SubmitBuildResponse"
1045    }
1046}
1047
1048#[doc(hidden)]
1049impl<'de> serde::de::Deserialize<'de> for SubmitBuildResponse {
1050    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1051    where
1052        D: serde::Deserializer<'de>,
1053    {
1054        #[allow(non_camel_case_types)]
1055        #[doc(hidden)]
1056        #[derive(PartialEq, Eq, Hash)]
1057        enum __FieldTag {
1058            __build_operation,
1059            __base_image_uri,
1060            __base_image_warning,
1061            Unknown(std::string::String),
1062        }
1063        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1064            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1065            where
1066                D: serde::Deserializer<'de>,
1067            {
1068                struct Visitor;
1069                impl<'de> serde::de::Visitor<'de> for Visitor {
1070                    type Value = __FieldTag;
1071                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1072                        formatter.write_str("a field name for SubmitBuildResponse")
1073                    }
1074                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1075                    where
1076                        E: serde::de::Error,
1077                    {
1078                        use std::result::Result::Ok;
1079                        use std::string::ToString;
1080                        match value {
1081                            "buildOperation" => Ok(__FieldTag::__build_operation),
1082                            "build_operation" => Ok(__FieldTag::__build_operation),
1083                            "baseImageUri" => Ok(__FieldTag::__base_image_uri),
1084                            "base_image_uri" => Ok(__FieldTag::__base_image_uri),
1085                            "baseImageWarning" => Ok(__FieldTag::__base_image_warning),
1086                            "base_image_warning" => Ok(__FieldTag::__base_image_warning),
1087                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1088                        }
1089                    }
1090                }
1091                deserializer.deserialize_identifier(Visitor)
1092            }
1093        }
1094        struct Visitor;
1095        impl<'de> serde::de::Visitor<'de> for Visitor {
1096            type Value = SubmitBuildResponse;
1097            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1098                formatter.write_str("struct SubmitBuildResponse")
1099            }
1100            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1101            where
1102                A: serde::de::MapAccess<'de>,
1103            {
1104                #[allow(unused_imports)]
1105                use serde::de::Error;
1106                use std::option::Option::Some;
1107                let mut fields = std::collections::HashSet::new();
1108                let mut result = Self::Value::new();
1109                while let Some(tag) = map.next_key::<__FieldTag>()? {
1110                    #[allow(clippy::match_single_binding)]
1111                    match tag {
1112                        __FieldTag::__build_operation => {
1113                            if !fields.insert(__FieldTag::__build_operation) {
1114                                return std::result::Result::Err(A::Error::duplicate_field(
1115                                    "multiple values for build_operation",
1116                                ));
1117                            }
1118                            result.build_operation = map
1119                                .next_value::<std::option::Option<longrunning::model::Operation>>(
1120                                )?;
1121                        }
1122                        __FieldTag::__base_image_uri => {
1123                            if !fields.insert(__FieldTag::__base_image_uri) {
1124                                return std::result::Result::Err(A::Error::duplicate_field(
1125                                    "multiple values for base_image_uri",
1126                                ));
1127                            }
1128                            result.base_image_uri = map
1129                                .next_value::<std::option::Option<std::string::String>>()?
1130                                .unwrap_or_default();
1131                        }
1132                        __FieldTag::__base_image_warning => {
1133                            if !fields.insert(__FieldTag::__base_image_warning) {
1134                                return std::result::Result::Err(A::Error::duplicate_field(
1135                                    "multiple values for base_image_warning",
1136                                ));
1137                            }
1138                            result.base_image_warning = map
1139                                .next_value::<std::option::Option<std::string::String>>()?
1140                                .unwrap_or_default();
1141                        }
1142                        __FieldTag::Unknown(key) => {
1143                            let value = map.next_value::<serde_json::Value>()?;
1144                            result._unknown_fields.insert(key, value);
1145                        }
1146                    }
1147                }
1148                std::result::Result::Ok(result)
1149            }
1150        }
1151        deserializer.deserialize_any(Visitor)
1152    }
1153}
1154
1155#[doc(hidden)]
1156impl serde::ser::Serialize for SubmitBuildResponse {
1157    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1158    where
1159        S: serde::ser::Serializer,
1160    {
1161        use serde::ser::SerializeMap;
1162        #[allow(unused_imports)]
1163        use std::option::Option::Some;
1164        let mut state = serializer.serialize_map(std::option::Option::None)?;
1165        if self.build_operation.is_some() {
1166            state.serialize_entry("buildOperation", &self.build_operation)?;
1167        }
1168        if !self.base_image_uri.is_empty() {
1169            state.serialize_entry("baseImageUri", &self.base_image_uri)?;
1170        }
1171        if !self.base_image_warning.is_empty() {
1172            state.serialize_entry("baseImageWarning", &self.base_image_warning)?;
1173        }
1174        if !self._unknown_fields.is_empty() {
1175            for (key, value) in self._unknown_fields.iter() {
1176                state.serialize_entry(key, &value)?;
1177            }
1178        }
1179        state.end()
1180    }
1181}
1182
1183impl std::fmt::Debug for SubmitBuildResponse {
1184    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1185        let mut debug_struct = f.debug_struct("SubmitBuildResponse");
1186        debug_struct.field("build_operation", &self.build_operation);
1187        debug_struct.field("base_image_uri", &self.base_image_uri);
1188        debug_struct.field("base_image_warning", &self.base_image_warning);
1189        if !self._unknown_fields.is_empty() {
1190            debug_struct.field("_unknown_fields", &self._unknown_fields);
1191        }
1192        debug_struct.finish()
1193    }
1194}
1195
1196/// Location of the source in an archive file in Google Cloud Storage.
1197#[derive(Clone, Default, PartialEq)]
1198#[non_exhaustive]
1199pub struct StorageSource {
1200    /// Required. Google Cloud Storage bucket containing the source (see
1201    /// [Bucket Name
1202    /// Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
1203    pub bucket: std::string::String,
1204
1205    /// Required. Google Cloud Storage object containing the source.
1206    ///
1207    /// This object must be a gzipped archive file (`.tar.gz`) containing source to
1208    /// build.
1209    pub object: std::string::String,
1210
1211    /// Optional. Google Cloud Storage generation for the object. If the generation
1212    /// is omitted, the latest generation will be used.
1213    pub generation: i64,
1214
1215    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1216}
1217
1218impl StorageSource {
1219    pub fn new() -> Self {
1220        std::default::Default::default()
1221    }
1222
1223    /// Sets the value of [bucket][crate::model::StorageSource::bucket].
1224    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1225        self.bucket = v.into();
1226        self
1227    }
1228
1229    /// Sets the value of [object][crate::model::StorageSource::object].
1230    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1231        self.object = v.into();
1232        self
1233    }
1234
1235    /// Sets the value of [generation][crate::model::StorageSource::generation].
1236    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1237        self.generation = v.into();
1238        self
1239    }
1240}
1241
1242impl wkt::message::Message for StorageSource {
1243    fn typename() -> &'static str {
1244        "type.googleapis.com/google.cloud.run.v2.StorageSource"
1245    }
1246}
1247
1248#[doc(hidden)]
1249impl<'de> serde::de::Deserialize<'de> for StorageSource {
1250    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1251    where
1252        D: serde::Deserializer<'de>,
1253    {
1254        #[allow(non_camel_case_types)]
1255        #[doc(hidden)]
1256        #[derive(PartialEq, Eq, Hash)]
1257        enum __FieldTag {
1258            __bucket,
1259            __object,
1260            __generation,
1261            Unknown(std::string::String),
1262        }
1263        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1264            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1265            where
1266                D: serde::Deserializer<'de>,
1267            {
1268                struct Visitor;
1269                impl<'de> serde::de::Visitor<'de> for Visitor {
1270                    type Value = __FieldTag;
1271                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1272                        formatter.write_str("a field name for StorageSource")
1273                    }
1274                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1275                    where
1276                        E: serde::de::Error,
1277                    {
1278                        use std::result::Result::Ok;
1279                        use std::string::ToString;
1280                        match value {
1281                            "bucket" => Ok(__FieldTag::__bucket),
1282                            "object" => Ok(__FieldTag::__object),
1283                            "generation" => Ok(__FieldTag::__generation),
1284                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1285                        }
1286                    }
1287                }
1288                deserializer.deserialize_identifier(Visitor)
1289            }
1290        }
1291        struct Visitor;
1292        impl<'de> serde::de::Visitor<'de> for Visitor {
1293            type Value = StorageSource;
1294            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1295                formatter.write_str("struct StorageSource")
1296            }
1297            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1298            where
1299                A: serde::de::MapAccess<'de>,
1300            {
1301                #[allow(unused_imports)]
1302                use serde::de::Error;
1303                use std::option::Option::Some;
1304                let mut fields = std::collections::HashSet::new();
1305                let mut result = Self::Value::new();
1306                while let Some(tag) = map.next_key::<__FieldTag>()? {
1307                    #[allow(clippy::match_single_binding)]
1308                    match tag {
1309                        __FieldTag::__bucket => {
1310                            if !fields.insert(__FieldTag::__bucket) {
1311                                return std::result::Result::Err(A::Error::duplicate_field(
1312                                    "multiple values for bucket",
1313                                ));
1314                            }
1315                            result.bucket = map
1316                                .next_value::<std::option::Option<std::string::String>>()?
1317                                .unwrap_or_default();
1318                        }
1319                        __FieldTag::__object => {
1320                            if !fields.insert(__FieldTag::__object) {
1321                                return std::result::Result::Err(A::Error::duplicate_field(
1322                                    "multiple values for object",
1323                                ));
1324                            }
1325                            result.object = map
1326                                .next_value::<std::option::Option<std::string::String>>()?
1327                                .unwrap_or_default();
1328                        }
1329                        __FieldTag::__generation => {
1330                            if !fields.insert(__FieldTag::__generation) {
1331                                return std::result::Result::Err(A::Error::duplicate_field(
1332                                    "multiple values for generation",
1333                                ));
1334                            }
1335                            struct __With(std::option::Option<i64>);
1336                            impl<'de> serde::de::Deserialize<'de> for __With {
1337                                fn deserialize<D>(
1338                                    deserializer: D,
1339                                ) -> std::result::Result<Self, D::Error>
1340                                where
1341                                    D: serde::de::Deserializer<'de>,
1342                                {
1343                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
1344                                }
1345                            }
1346                            result.generation = map.next_value::<__With>()?.0.unwrap_or_default();
1347                        }
1348                        __FieldTag::Unknown(key) => {
1349                            let value = map.next_value::<serde_json::Value>()?;
1350                            result._unknown_fields.insert(key, value);
1351                        }
1352                    }
1353                }
1354                std::result::Result::Ok(result)
1355            }
1356        }
1357        deserializer.deserialize_any(Visitor)
1358    }
1359}
1360
1361#[doc(hidden)]
1362impl serde::ser::Serialize for StorageSource {
1363    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1364    where
1365        S: serde::ser::Serializer,
1366    {
1367        use serde::ser::SerializeMap;
1368        #[allow(unused_imports)]
1369        use std::option::Option::Some;
1370        let mut state = serializer.serialize_map(std::option::Option::None)?;
1371        if !self.bucket.is_empty() {
1372            state.serialize_entry("bucket", &self.bucket)?;
1373        }
1374        if !self.object.is_empty() {
1375            state.serialize_entry("object", &self.object)?;
1376        }
1377        if !wkt::internal::is_default(&self.generation) {
1378            struct __With<'a>(&'a i64);
1379            impl<'a> serde::ser::Serialize for __With<'a> {
1380                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1381                where
1382                    S: serde::ser::Serializer,
1383                {
1384                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
1385                }
1386            }
1387            state.serialize_entry("generation", &__With(&self.generation))?;
1388        }
1389        if !self._unknown_fields.is_empty() {
1390            for (key, value) in self._unknown_fields.iter() {
1391                state.serialize_entry(key, &value)?;
1392            }
1393        }
1394        state.end()
1395    }
1396}
1397
1398impl std::fmt::Debug for StorageSource {
1399    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1400        let mut debug_struct = f.debug_struct("StorageSource");
1401        debug_struct.field("bucket", &self.bucket);
1402        debug_struct.field("object", &self.object);
1403        debug_struct.field("generation", &self.generation);
1404        if !self._unknown_fields.is_empty() {
1405            debug_struct.field("_unknown_fields", &self._unknown_fields);
1406        }
1407        debug_struct.finish()
1408    }
1409}
1410
1411/// Defines a status condition for a resource.
1412#[derive(Clone, Default, PartialEq)]
1413#[non_exhaustive]
1414pub struct Condition {
1415    /// type is used to communicate the status of the reconciliation process.
1416    /// See also:
1417    /// <https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting>
1418    /// Types common to all resources include:
1419    ///
1420    /// * "Ready": True when the Resource is ready.
1421    pub r#type: std::string::String,
1422
1423    /// State of the condition.
1424    pub state: crate::model::condition::State,
1425
1426    /// Human readable message indicating details about the current status.
1427    pub message: std::string::String,
1428
1429    /// Last time the condition transitioned from one status to another.
1430    pub last_transition_time: std::option::Option<wkt::Timestamp>,
1431
1432    /// How to interpret failures of this condition, one of Error, Warning, Info
1433    pub severity: crate::model::condition::Severity,
1434
1435    /// The reason for this condition. Depending on the condition type,
1436    /// it will populate one of these fields.
1437    /// Successful conditions cannot have a reason.
1438    pub reasons: std::option::Option<crate::model::condition::Reasons>,
1439
1440    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1441}
1442
1443impl Condition {
1444    pub fn new() -> Self {
1445        std::default::Default::default()
1446    }
1447
1448    /// Sets the value of [r#type][crate::model::Condition::type].
1449    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1450        self.r#type = v.into();
1451        self
1452    }
1453
1454    /// Sets the value of [state][crate::model::Condition::state].
1455    pub fn set_state<T: std::convert::Into<crate::model::condition::State>>(
1456        mut self,
1457        v: T,
1458    ) -> Self {
1459        self.state = v.into();
1460        self
1461    }
1462
1463    /// Sets the value of [message][crate::model::Condition::message].
1464    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1465        self.message = v.into();
1466        self
1467    }
1468
1469    /// Sets the value of [last_transition_time][crate::model::Condition::last_transition_time].
1470    pub fn set_last_transition_time<T>(mut self, v: T) -> Self
1471    where
1472        T: std::convert::Into<wkt::Timestamp>,
1473    {
1474        self.last_transition_time = std::option::Option::Some(v.into());
1475        self
1476    }
1477
1478    /// Sets or clears the value of [last_transition_time][crate::model::Condition::last_transition_time].
1479    pub fn set_or_clear_last_transition_time<T>(mut self, v: std::option::Option<T>) -> Self
1480    where
1481        T: std::convert::Into<wkt::Timestamp>,
1482    {
1483        self.last_transition_time = v.map(|x| x.into());
1484        self
1485    }
1486
1487    /// Sets the value of [severity][crate::model::Condition::severity].
1488    pub fn set_severity<T: std::convert::Into<crate::model::condition::Severity>>(
1489        mut self,
1490        v: T,
1491    ) -> Self {
1492        self.severity = v.into();
1493        self
1494    }
1495
1496    /// Sets the value of [reasons][crate::model::Condition::reasons].
1497    ///
1498    /// Note that all the setters affecting `reasons` are mutually
1499    /// exclusive.
1500    pub fn set_reasons<
1501        T: std::convert::Into<std::option::Option<crate::model::condition::Reasons>>,
1502    >(
1503        mut self,
1504        v: T,
1505    ) -> Self {
1506        self.reasons = v.into();
1507        self
1508    }
1509
1510    /// The value of [reasons][crate::model::Condition::reasons]
1511    /// if it holds a `Reason`, `None` if the field is not set or
1512    /// holds a different branch.
1513    pub fn reason(&self) -> std::option::Option<&crate::model::condition::CommonReason> {
1514        #[allow(unreachable_patterns)]
1515        self.reasons.as_ref().and_then(|v| match v {
1516            crate::model::condition::Reasons::Reason(v) => std::option::Option::Some(v),
1517            _ => std::option::Option::None,
1518        })
1519    }
1520
1521    /// Sets the value of [reasons][crate::model::Condition::reasons]
1522    /// to hold a `Reason`.
1523    ///
1524    /// Note that all the setters affecting `reasons` are
1525    /// mutually exclusive.
1526    pub fn set_reason<T: std::convert::Into<crate::model::condition::CommonReason>>(
1527        mut self,
1528        v: T,
1529    ) -> Self {
1530        self.reasons =
1531            std::option::Option::Some(crate::model::condition::Reasons::Reason(v.into()));
1532        self
1533    }
1534
1535    /// The value of [reasons][crate::model::Condition::reasons]
1536    /// if it holds a `RevisionReason`, `None` if the field is not set or
1537    /// holds a different branch.
1538    pub fn revision_reason(&self) -> std::option::Option<&crate::model::condition::RevisionReason> {
1539        #[allow(unreachable_patterns)]
1540        self.reasons.as_ref().and_then(|v| match v {
1541            crate::model::condition::Reasons::RevisionReason(v) => std::option::Option::Some(v),
1542            _ => std::option::Option::None,
1543        })
1544    }
1545
1546    /// Sets the value of [reasons][crate::model::Condition::reasons]
1547    /// to hold a `RevisionReason`.
1548    ///
1549    /// Note that all the setters affecting `reasons` are
1550    /// mutually exclusive.
1551    pub fn set_revision_reason<T: std::convert::Into<crate::model::condition::RevisionReason>>(
1552        mut self,
1553        v: T,
1554    ) -> Self {
1555        self.reasons =
1556            std::option::Option::Some(crate::model::condition::Reasons::RevisionReason(v.into()));
1557        self
1558    }
1559
1560    /// The value of [reasons][crate::model::Condition::reasons]
1561    /// if it holds a `ExecutionReason`, `None` if the field is not set or
1562    /// holds a different branch.
1563    pub fn execution_reason(
1564        &self,
1565    ) -> std::option::Option<&crate::model::condition::ExecutionReason> {
1566        #[allow(unreachable_patterns)]
1567        self.reasons.as_ref().and_then(|v| match v {
1568            crate::model::condition::Reasons::ExecutionReason(v) => std::option::Option::Some(v),
1569            _ => std::option::Option::None,
1570        })
1571    }
1572
1573    /// Sets the value of [reasons][crate::model::Condition::reasons]
1574    /// to hold a `ExecutionReason`.
1575    ///
1576    /// Note that all the setters affecting `reasons` are
1577    /// mutually exclusive.
1578    pub fn set_execution_reason<T: std::convert::Into<crate::model::condition::ExecutionReason>>(
1579        mut self,
1580        v: T,
1581    ) -> Self {
1582        self.reasons =
1583            std::option::Option::Some(crate::model::condition::Reasons::ExecutionReason(v.into()));
1584        self
1585    }
1586}
1587
1588impl wkt::message::Message for Condition {
1589    fn typename() -> &'static str {
1590        "type.googleapis.com/google.cloud.run.v2.Condition"
1591    }
1592}
1593
1594#[doc(hidden)]
1595impl<'de> serde::de::Deserialize<'de> for Condition {
1596    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1597    where
1598        D: serde::Deserializer<'de>,
1599    {
1600        #[allow(non_camel_case_types)]
1601        #[doc(hidden)]
1602        #[derive(PartialEq, Eq, Hash)]
1603        enum __FieldTag {
1604            __type,
1605            __state,
1606            __message,
1607            __last_transition_time,
1608            __severity,
1609            __reason,
1610            __revision_reason,
1611            __execution_reason,
1612            Unknown(std::string::String),
1613        }
1614        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1615            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1616            where
1617                D: serde::Deserializer<'de>,
1618            {
1619                struct Visitor;
1620                impl<'de> serde::de::Visitor<'de> for Visitor {
1621                    type Value = __FieldTag;
1622                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1623                        formatter.write_str("a field name for Condition")
1624                    }
1625                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1626                    where
1627                        E: serde::de::Error,
1628                    {
1629                        use std::result::Result::Ok;
1630                        use std::string::ToString;
1631                        match value {
1632                            "type" => Ok(__FieldTag::__type),
1633                            "state" => Ok(__FieldTag::__state),
1634                            "message" => Ok(__FieldTag::__message),
1635                            "lastTransitionTime" => Ok(__FieldTag::__last_transition_time),
1636                            "last_transition_time" => Ok(__FieldTag::__last_transition_time),
1637                            "severity" => Ok(__FieldTag::__severity),
1638                            "reason" => Ok(__FieldTag::__reason),
1639                            "revisionReason" => Ok(__FieldTag::__revision_reason),
1640                            "revision_reason" => Ok(__FieldTag::__revision_reason),
1641                            "executionReason" => Ok(__FieldTag::__execution_reason),
1642                            "execution_reason" => Ok(__FieldTag::__execution_reason),
1643                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1644                        }
1645                    }
1646                }
1647                deserializer.deserialize_identifier(Visitor)
1648            }
1649        }
1650        struct Visitor;
1651        impl<'de> serde::de::Visitor<'de> for Visitor {
1652            type Value = Condition;
1653            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1654                formatter.write_str("struct Condition")
1655            }
1656            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1657            where
1658                A: serde::de::MapAccess<'de>,
1659            {
1660                #[allow(unused_imports)]
1661                use serde::de::Error;
1662                use std::option::Option::Some;
1663                let mut fields = std::collections::HashSet::new();
1664                let mut result = Self::Value::new();
1665                while let Some(tag) = map.next_key::<__FieldTag>()? {
1666                    #[allow(clippy::match_single_binding)]
1667                    match tag {
1668                        __FieldTag::__type => {
1669                            if !fields.insert(__FieldTag::__type) {
1670                                return std::result::Result::Err(A::Error::duplicate_field(
1671                                    "multiple values for type",
1672                                ));
1673                            }
1674                            result.r#type = map
1675                                .next_value::<std::option::Option<std::string::String>>()?
1676                                .unwrap_or_default();
1677                        }
1678                        __FieldTag::__state => {
1679                            if !fields.insert(__FieldTag::__state) {
1680                                return std::result::Result::Err(A::Error::duplicate_field(
1681                                    "multiple values for state",
1682                                ));
1683                            }
1684                            result.state = map
1685                                .next_value::<std::option::Option<crate::model::condition::State>>(
1686                                )?
1687                                .unwrap_or_default();
1688                        }
1689                        __FieldTag::__message => {
1690                            if !fields.insert(__FieldTag::__message) {
1691                                return std::result::Result::Err(A::Error::duplicate_field(
1692                                    "multiple values for message",
1693                                ));
1694                            }
1695                            result.message = map
1696                                .next_value::<std::option::Option<std::string::String>>()?
1697                                .unwrap_or_default();
1698                        }
1699                        __FieldTag::__last_transition_time => {
1700                            if !fields.insert(__FieldTag::__last_transition_time) {
1701                                return std::result::Result::Err(A::Error::duplicate_field(
1702                                    "multiple values for last_transition_time",
1703                                ));
1704                            }
1705                            result.last_transition_time =
1706                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1707                        }
1708                        __FieldTag::__severity => {
1709                            if !fields.insert(__FieldTag::__severity) {
1710                                return std::result::Result::Err(A::Error::duplicate_field(
1711                                    "multiple values for severity",
1712                                ));
1713                            }
1714                            result.severity = map.next_value::<std::option::Option<crate::model::condition::Severity>>()?.unwrap_or_default();
1715                        }
1716                        __FieldTag::__reason => {
1717                            if !fields.insert(__FieldTag::__reason) {
1718                                return std::result::Result::Err(A::Error::duplicate_field(
1719                                    "multiple values for reason",
1720                                ));
1721                            }
1722                            if result.reasons.is_some() {
1723                                return std::result::Result::Err(A::Error::duplicate_field(
1724                                    "multiple values for `reasons`, a oneof with full ID .google.cloud.run.v2.Condition.reason, latest field was reason",
1725                                ));
1726                            }
1727                            result.reasons =
1728                                std::option::Option::Some(
1729                                    crate::model::condition::Reasons::Reason(
1730                                        map.next_value::<std::option::Option<
1731                                            crate::model::condition::CommonReason,
1732                                        >>()?
1733                                        .unwrap_or_default(),
1734                                    ),
1735                                );
1736                        }
1737                        __FieldTag::__revision_reason => {
1738                            if !fields.insert(__FieldTag::__revision_reason) {
1739                                return std::result::Result::Err(A::Error::duplicate_field(
1740                                    "multiple values for revision_reason",
1741                                ));
1742                            }
1743                            if result.reasons.is_some() {
1744                                return std::result::Result::Err(A::Error::duplicate_field(
1745                                    "multiple values for `reasons`, a oneof with full ID .google.cloud.run.v2.Condition.revision_reason, latest field was revisionReason",
1746                                ));
1747                            }
1748                            result.reasons = std::option::Option::Some(
1749                                crate::model::condition::Reasons::RevisionReason(
1750                                    map.next_value::<std::option::Option<
1751                                        crate::model::condition::RevisionReason,
1752                                    >>()?
1753                                    .unwrap_or_default(),
1754                                ),
1755                            );
1756                        }
1757                        __FieldTag::__execution_reason => {
1758                            if !fields.insert(__FieldTag::__execution_reason) {
1759                                return std::result::Result::Err(A::Error::duplicate_field(
1760                                    "multiple values for execution_reason",
1761                                ));
1762                            }
1763                            if result.reasons.is_some() {
1764                                return std::result::Result::Err(A::Error::duplicate_field(
1765                                    "multiple values for `reasons`, a oneof with full ID .google.cloud.run.v2.Condition.execution_reason, latest field was executionReason",
1766                                ));
1767                            }
1768                            result.reasons = std::option::Option::Some(
1769                                crate::model::condition::Reasons::ExecutionReason(
1770                                    map.next_value::<std::option::Option<
1771                                        crate::model::condition::ExecutionReason,
1772                                    >>()?
1773                                    .unwrap_or_default(),
1774                                ),
1775                            );
1776                        }
1777                        __FieldTag::Unknown(key) => {
1778                            let value = map.next_value::<serde_json::Value>()?;
1779                            result._unknown_fields.insert(key, value);
1780                        }
1781                    }
1782                }
1783                std::result::Result::Ok(result)
1784            }
1785        }
1786        deserializer.deserialize_any(Visitor)
1787    }
1788}
1789
1790#[doc(hidden)]
1791impl serde::ser::Serialize for Condition {
1792    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1793    where
1794        S: serde::ser::Serializer,
1795    {
1796        use serde::ser::SerializeMap;
1797        #[allow(unused_imports)]
1798        use std::option::Option::Some;
1799        let mut state = serializer.serialize_map(std::option::Option::None)?;
1800        if !self.r#type.is_empty() {
1801            state.serialize_entry("type", &self.r#type)?;
1802        }
1803        if !wkt::internal::is_default(&self.state) {
1804            state.serialize_entry("state", &self.state)?;
1805        }
1806        if !self.message.is_empty() {
1807            state.serialize_entry("message", &self.message)?;
1808        }
1809        if self.last_transition_time.is_some() {
1810            state.serialize_entry("lastTransitionTime", &self.last_transition_time)?;
1811        }
1812        if !wkt::internal::is_default(&self.severity) {
1813            state.serialize_entry("severity", &self.severity)?;
1814        }
1815        if let Some(value) = self.reason() {
1816            state.serialize_entry("reason", value)?;
1817        }
1818        if let Some(value) = self.revision_reason() {
1819            state.serialize_entry("revisionReason", value)?;
1820        }
1821        if let Some(value) = self.execution_reason() {
1822            state.serialize_entry("executionReason", value)?;
1823        }
1824        if !self._unknown_fields.is_empty() {
1825            for (key, value) in self._unknown_fields.iter() {
1826                state.serialize_entry(key, &value)?;
1827            }
1828        }
1829        state.end()
1830    }
1831}
1832
1833impl std::fmt::Debug for Condition {
1834    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1835        let mut debug_struct = f.debug_struct("Condition");
1836        debug_struct.field("r#type", &self.r#type);
1837        debug_struct.field("state", &self.state);
1838        debug_struct.field("message", &self.message);
1839        debug_struct.field("last_transition_time", &self.last_transition_time);
1840        debug_struct.field("severity", &self.severity);
1841        debug_struct.field("reasons", &self.reasons);
1842        if !self._unknown_fields.is_empty() {
1843            debug_struct.field("_unknown_fields", &self._unknown_fields);
1844        }
1845        debug_struct.finish()
1846    }
1847}
1848
1849/// Defines additional types related to [Condition].
1850pub mod condition {
1851    #[allow(unused_imports)]
1852    use super::*;
1853
1854    /// Represents the possible Condition states.
1855    ///
1856    /// # Working with unknown values
1857    ///
1858    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1859    /// additional enum variants at any time. Adding new variants is not considered
1860    /// a breaking change. Applications should write their code in anticipation of:
1861    ///
1862    /// - New values appearing in future releases of the client library, **and**
1863    /// - New values received dynamically, without application changes.
1864    ///
1865    /// Please consult the [Working with enums] section in the user guide for some
1866    /// guidelines.
1867    ///
1868    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1869    #[derive(Clone, Debug, PartialEq)]
1870    #[non_exhaustive]
1871    pub enum State {
1872        /// The default value. This value is used if the state is omitted.
1873        Unspecified,
1874        /// Transient state: Reconciliation has not started yet.
1875        ConditionPending,
1876        /// Transient state: reconciliation is still in progress.
1877        ConditionReconciling,
1878        /// Terminal state: Reconciliation did not succeed.
1879        ConditionFailed,
1880        /// Terminal state: Reconciliation completed successfully.
1881        ConditionSucceeded,
1882        /// If set, the enum was initialized with an unknown value.
1883        ///
1884        /// Applications can examine the value using [State::value] or
1885        /// [State::name].
1886        UnknownValue(state::UnknownValue),
1887    }
1888
1889    #[doc(hidden)]
1890    pub mod state {
1891        #[allow(unused_imports)]
1892        use super::*;
1893        #[derive(Clone, Debug, PartialEq)]
1894        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1895    }
1896
1897    impl State {
1898        /// Gets the enum value.
1899        ///
1900        /// Returns `None` if the enum contains an unknown value deserialized from
1901        /// the string representation of enums.
1902        pub fn value(&self) -> std::option::Option<i32> {
1903            match self {
1904                Self::Unspecified => std::option::Option::Some(0),
1905                Self::ConditionPending => std::option::Option::Some(1),
1906                Self::ConditionReconciling => std::option::Option::Some(2),
1907                Self::ConditionFailed => std::option::Option::Some(3),
1908                Self::ConditionSucceeded => std::option::Option::Some(4),
1909                Self::UnknownValue(u) => u.0.value(),
1910            }
1911        }
1912
1913        /// Gets the enum value as a string.
1914        ///
1915        /// Returns `None` if the enum contains an unknown value deserialized from
1916        /// the integer representation of enums.
1917        pub fn name(&self) -> std::option::Option<&str> {
1918            match self {
1919                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1920                Self::ConditionPending => std::option::Option::Some("CONDITION_PENDING"),
1921                Self::ConditionReconciling => std::option::Option::Some("CONDITION_RECONCILING"),
1922                Self::ConditionFailed => std::option::Option::Some("CONDITION_FAILED"),
1923                Self::ConditionSucceeded => std::option::Option::Some("CONDITION_SUCCEEDED"),
1924                Self::UnknownValue(u) => u.0.name(),
1925            }
1926        }
1927    }
1928
1929    impl std::default::Default for State {
1930        fn default() -> Self {
1931            use std::convert::From;
1932            Self::from(0)
1933        }
1934    }
1935
1936    impl std::fmt::Display for State {
1937        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1938            wkt::internal::display_enum(f, self.name(), self.value())
1939        }
1940    }
1941
1942    impl std::convert::From<i32> for State {
1943        fn from(value: i32) -> Self {
1944            match value {
1945                0 => Self::Unspecified,
1946                1 => Self::ConditionPending,
1947                2 => Self::ConditionReconciling,
1948                3 => Self::ConditionFailed,
1949                4 => Self::ConditionSucceeded,
1950                _ => Self::UnknownValue(state::UnknownValue(
1951                    wkt::internal::UnknownEnumValue::Integer(value),
1952                )),
1953            }
1954        }
1955    }
1956
1957    impl std::convert::From<&str> for State {
1958        fn from(value: &str) -> Self {
1959            use std::string::ToString;
1960            match value {
1961                "STATE_UNSPECIFIED" => Self::Unspecified,
1962                "CONDITION_PENDING" => Self::ConditionPending,
1963                "CONDITION_RECONCILING" => Self::ConditionReconciling,
1964                "CONDITION_FAILED" => Self::ConditionFailed,
1965                "CONDITION_SUCCEEDED" => Self::ConditionSucceeded,
1966                _ => Self::UnknownValue(state::UnknownValue(
1967                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1968                )),
1969            }
1970        }
1971    }
1972
1973    impl serde::ser::Serialize for State {
1974        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1975        where
1976            S: serde::Serializer,
1977        {
1978            match self {
1979                Self::Unspecified => serializer.serialize_i32(0),
1980                Self::ConditionPending => serializer.serialize_i32(1),
1981                Self::ConditionReconciling => serializer.serialize_i32(2),
1982                Self::ConditionFailed => serializer.serialize_i32(3),
1983                Self::ConditionSucceeded => serializer.serialize_i32(4),
1984                Self::UnknownValue(u) => u.0.serialize(serializer),
1985            }
1986        }
1987    }
1988
1989    impl<'de> serde::de::Deserialize<'de> for State {
1990        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1991        where
1992            D: serde::Deserializer<'de>,
1993        {
1994            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1995                ".google.cloud.run.v2.Condition.State",
1996            ))
1997        }
1998    }
1999
2000    /// Represents the severity of the condition failures.
2001    ///
2002    /// # Working with unknown values
2003    ///
2004    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2005    /// additional enum variants at any time. Adding new variants is not considered
2006    /// a breaking change. Applications should write their code in anticipation of:
2007    ///
2008    /// - New values appearing in future releases of the client library, **and**
2009    /// - New values received dynamically, without application changes.
2010    ///
2011    /// Please consult the [Working with enums] section in the user guide for some
2012    /// guidelines.
2013    ///
2014    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2015    #[derive(Clone, Debug, PartialEq)]
2016    #[non_exhaustive]
2017    pub enum Severity {
2018        /// Unspecified severity
2019        Unspecified,
2020        /// Error severity.
2021        Error,
2022        /// Warning severity.
2023        Warning,
2024        /// Info severity.
2025        Info,
2026        /// If set, the enum was initialized with an unknown value.
2027        ///
2028        /// Applications can examine the value using [Severity::value] or
2029        /// [Severity::name].
2030        UnknownValue(severity::UnknownValue),
2031    }
2032
2033    #[doc(hidden)]
2034    pub mod severity {
2035        #[allow(unused_imports)]
2036        use super::*;
2037        #[derive(Clone, Debug, PartialEq)]
2038        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2039    }
2040
2041    impl Severity {
2042        /// Gets the enum value.
2043        ///
2044        /// Returns `None` if the enum contains an unknown value deserialized from
2045        /// the string representation of enums.
2046        pub fn value(&self) -> std::option::Option<i32> {
2047            match self {
2048                Self::Unspecified => std::option::Option::Some(0),
2049                Self::Error => std::option::Option::Some(1),
2050                Self::Warning => std::option::Option::Some(2),
2051                Self::Info => std::option::Option::Some(3),
2052                Self::UnknownValue(u) => u.0.value(),
2053            }
2054        }
2055
2056        /// Gets the enum value as a string.
2057        ///
2058        /// Returns `None` if the enum contains an unknown value deserialized from
2059        /// the integer representation of enums.
2060        pub fn name(&self) -> std::option::Option<&str> {
2061            match self {
2062                Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
2063                Self::Error => std::option::Option::Some("ERROR"),
2064                Self::Warning => std::option::Option::Some("WARNING"),
2065                Self::Info => std::option::Option::Some("INFO"),
2066                Self::UnknownValue(u) => u.0.name(),
2067            }
2068        }
2069    }
2070
2071    impl std::default::Default for Severity {
2072        fn default() -> Self {
2073            use std::convert::From;
2074            Self::from(0)
2075        }
2076    }
2077
2078    impl std::fmt::Display for Severity {
2079        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2080            wkt::internal::display_enum(f, self.name(), self.value())
2081        }
2082    }
2083
2084    impl std::convert::From<i32> for Severity {
2085        fn from(value: i32) -> Self {
2086            match value {
2087                0 => Self::Unspecified,
2088                1 => Self::Error,
2089                2 => Self::Warning,
2090                3 => Self::Info,
2091                _ => Self::UnknownValue(severity::UnknownValue(
2092                    wkt::internal::UnknownEnumValue::Integer(value),
2093                )),
2094            }
2095        }
2096    }
2097
2098    impl std::convert::From<&str> for Severity {
2099        fn from(value: &str) -> Self {
2100            use std::string::ToString;
2101            match value {
2102                "SEVERITY_UNSPECIFIED" => Self::Unspecified,
2103                "ERROR" => Self::Error,
2104                "WARNING" => Self::Warning,
2105                "INFO" => Self::Info,
2106                _ => Self::UnknownValue(severity::UnknownValue(
2107                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2108                )),
2109            }
2110        }
2111    }
2112
2113    impl serde::ser::Serialize for Severity {
2114        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2115        where
2116            S: serde::Serializer,
2117        {
2118            match self {
2119                Self::Unspecified => serializer.serialize_i32(0),
2120                Self::Error => serializer.serialize_i32(1),
2121                Self::Warning => serializer.serialize_i32(2),
2122                Self::Info => serializer.serialize_i32(3),
2123                Self::UnknownValue(u) => u.0.serialize(serializer),
2124            }
2125        }
2126    }
2127
2128    impl<'de> serde::de::Deserialize<'de> for Severity {
2129        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2130        where
2131            D: serde::Deserializer<'de>,
2132        {
2133            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
2134                ".google.cloud.run.v2.Condition.Severity",
2135            ))
2136        }
2137    }
2138
2139    /// Reasons common to all types of conditions.
2140    ///
2141    /// # Working with unknown values
2142    ///
2143    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2144    /// additional enum variants at any time. Adding new variants is not considered
2145    /// a breaking change. Applications should write their code in anticipation of:
2146    ///
2147    /// - New values appearing in future releases of the client library, **and**
2148    /// - New values received dynamically, without application changes.
2149    ///
2150    /// Please consult the [Working with enums] section in the user guide for some
2151    /// guidelines.
2152    ///
2153    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2154    #[derive(Clone, Debug, PartialEq)]
2155    #[non_exhaustive]
2156    pub enum CommonReason {
2157        /// Default value.
2158        Undefined,
2159        /// Reason unknown. Further details will be in message.
2160        Unknown,
2161        /// Revision creation process failed.
2162        RevisionFailed,
2163        /// Timed out waiting for completion.
2164        ProgressDeadlineExceeded,
2165        /// The container image path is incorrect.
2166        ContainerMissing,
2167        /// Insufficient permissions on the container image.
2168        ContainerPermissionDenied,
2169        /// Container image is not authorized by policy.
2170        ContainerImageUnauthorized,
2171        /// Container image policy authorization check failed.
2172        ContainerImageAuthorizationCheckFailed,
2173        /// Insufficient permissions on encryption key.
2174        EncryptionKeyPermissionDenied,
2175        /// Permission check on encryption key failed.
2176        EncryptionKeyCheckFailed,
2177        /// At least one Access check on secrets failed.
2178        SecretsAccessCheckFailed,
2179        /// Waiting for operation to complete.
2180        WaitingForOperation,
2181        /// System will retry immediately.
2182        ImmediateRetry,
2183        /// System will retry later; current attempt failed.
2184        PostponedRetry,
2185        /// An internal error occurred. Further information may be in the message.
2186        Internal,
2187        /// User-provided VPC network was not found.
2188        VpcNetworkNotFound,
2189        /// If set, the enum was initialized with an unknown value.
2190        ///
2191        /// Applications can examine the value using [CommonReason::value] or
2192        /// [CommonReason::name].
2193        UnknownValue(common_reason::UnknownValue),
2194    }
2195
2196    #[doc(hidden)]
2197    pub mod common_reason {
2198        #[allow(unused_imports)]
2199        use super::*;
2200        #[derive(Clone, Debug, PartialEq)]
2201        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2202    }
2203
2204    impl CommonReason {
2205        /// Gets the enum value.
2206        ///
2207        /// Returns `None` if the enum contains an unknown value deserialized from
2208        /// the string representation of enums.
2209        pub fn value(&self) -> std::option::Option<i32> {
2210            match self {
2211                Self::Undefined => std::option::Option::Some(0),
2212                Self::Unknown => std::option::Option::Some(1),
2213                Self::RevisionFailed => std::option::Option::Some(3),
2214                Self::ProgressDeadlineExceeded => std::option::Option::Some(4),
2215                Self::ContainerMissing => std::option::Option::Some(6),
2216                Self::ContainerPermissionDenied => std::option::Option::Some(7),
2217                Self::ContainerImageUnauthorized => std::option::Option::Some(8),
2218                Self::ContainerImageAuthorizationCheckFailed => std::option::Option::Some(9),
2219                Self::EncryptionKeyPermissionDenied => std::option::Option::Some(10),
2220                Self::EncryptionKeyCheckFailed => std::option::Option::Some(11),
2221                Self::SecretsAccessCheckFailed => std::option::Option::Some(12),
2222                Self::WaitingForOperation => std::option::Option::Some(13),
2223                Self::ImmediateRetry => std::option::Option::Some(14),
2224                Self::PostponedRetry => std::option::Option::Some(15),
2225                Self::Internal => std::option::Option::Some(16),
2226                Self::VpcNetworkNotFound => std::option::Option::Some(17),
2227                Self::UnknownValue(u) => u.0.value(),
2228            }
2229        }
2230
2231        /// Gets the enum value as a string.
2232        ///
2233        /// Returns `None` if the enum contains an unknown value deserialized from
2234        /// the integer representation of enums.
2235        pub fn name(&self) -> std::option::Option<&str> {
2236            match self {
2237                Self::Undefined => std::option::Option::Some("COMMON_REASON_UNDEFINED"),
2238                Self::Unknown => std::option::Option::Some("UNKNOWN"),
2239                Self::RevisionFailed => std::option::Option::Some("REVISION_FAILED"),
2240                Self::ProgressDeadlineExceeded => {
2241                    std::option::Option::Some("PROGRESS_DEADLINE_EXCEEDED")
2242                }
2243                Self::ContainerMissing => std::option::Option::Some("CONTAINER_MISSING"),
2244                Self::ContainerPermissionDenied => {
2245                    std::option::Option::Some("CONTAINER_PERMISSION_DENIED")
2246                }
2247                Self::ContainerImageUnauthorized => {
2248                    std::option::Option::Some("CONTAINER_IMAGE_UNAUTHORIZED")
2249                }
2250                Self::ContainerImageAuthorizationCheckFailed => {
2251                    std::option::Option::Some("CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED")
2252                }
2253                Self::EncryptionKeyPermissionDenied => {
2254                    std::option::Option::Some("ENCRYPTION_KEY_PERMISSION_DENIED")
2255                }
2256                Self::EncryptionKeyCheckFailed => {
2257                    std::option::Option::Some("ENCRYPTION_KEY_CHECK_FAILED")
2258                }
2259                Self::SecretsAccessCheckFailed => {
2260                    std::option::Option::Some("SECRETS_ACCESS_CHECK_FAILED")
2261                }
2262                Self::WaitingForOperation => std::option::Option::Some("WAITING_FOR_OPERATION"),
2263                Self::ImmediateRetry => std::option::Option::Some("IMMEDIATE_RETRY"),
2264                Self::PostponedRetry => std::option::Option::Some("POSTPONED_RETRY"),
2265                Self::Internal => std::option::Option::Some("INTERNAL"),
2266                Self::VpcNetworkNotFound => std::option::Option::Some("VPC_NETWORK_NOT_FOUND"),
2267                Self::UnknownValue(u) => u.0.name(),
2268            }
2269        }
2270    }
2271
2272    impl std::default::Default for CommonReason {
2273        fn default() -> Self {
2274            use std::convert::From;
2275            Self::from(0)
2276        }
2277    }
2278
2279    impl std::fmt::Display for CommonReason {
2280        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2281            wkt::internal::display_enum(f, self.name(), self.value())
2282        }
2283    }
2284
2285    impl std::convert::From<i32> for CommonReason {
2286        fn from(value: i32) -> Self {
2287            match value {
2288                0 => Self::Undefined,
2289                1 => Self::Unknown,
2290                3 => Self::RevisionFailed,
2291                4 => Self::ProgressDeadlineExceeded,
2292                6 => Self::ContainerMissing,
2293                7 => Self::ContainerPermissionDenied,
2294                8 => Self::ContainerImageUnauthorized,
2295                9 => Self::ContainerImageAuthorizationCheckFailed,
2296                10 => Self::EncryptionKeyPermissionDenied,
2297                11 => Self::EncryptionKeyCheckFailed,
2298                12 => Self::SecretsAccessCheckFailed,
2299                13 => Self::WaitingForOperation,
2300                14 => Self::ImmediateRetry,
2301                15 => Self::PostponedRetry,
2302                16 => Self::Internal,
2303                17 => Self::VpcNetworkNotFound,
2304                _ => Self::UnknownValue(common_reason::UnknownValue(
2305                    wkt::internal::UnknownEnumValue::Integer(value),
2306                )),
2307            }
2308        }
2309    }
2310
2311    impl std::convert::From<&str> for CommonReason {
2312        fn from(value: &str) -> Self {
2313            use std::string::ToString;
2314            match value {
2315                "COMMON_REASON_UNDEFINED" => Self::Undefined,
2316                "UNKNOWN" => Self::Unknown,
2317                "REVISION_FAILED" => Self::RevisionFailed,
2318                "PROGRESS_DEADLINE_EXCEEDED" => Self::ProgressDeadlineExceeded,
2319                "CONTAINER_MISSING" => Self::ContainerMissing,
2320                "CONTAINER_PERMISSION_DENIED" => Self::ContainerPermissionDenied,
2321                "CONTAINER_IMAGE_UNAUTHORIZED" => Self::ContainerImageUnauthorized,
2322                "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED" => {
2323                    Self::ContainerImageAuthorizationCheckFailed
2324                }
2325                "ENCRYPTION_KEY_PERMISSION_DENIED" => Self::EncryptionKeyPermissionDenied,
2326                "ENCRYPTION_KEY_CHECK_FAILED" => Self::EncryptionKeyCheckFailed,
2327                "SECRETS_ACCESS_CHECK_FAILED" => Self::SecretsAccessCheckFailed,
2328                "WAITING_FOR_OPERATION" => Self::WaitingForOperation,
2329                "IMMEDIATE_RETRY" => Self::ImmediateRetry,
2330                "POSTPONED_RETRY" => Self::PostponedRetry,
2331                "INTERNAL" => Self::Internal,
2332                "VPC_NETWORK_NOT_FOUND" => Self::VpcNetworkNotFound,
2333                _ => Self::UnknownValue(common_reason::UnknownValue(
2334                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2335                )),
2336            }
2337        }
2338    }
2339
2340    impl serde::ser::Serialize for CommonReason {
2341        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2342        where
2343            S: serde::Serializer,
2344        {
2345            match self {
2346                Self::Undefined => serializer.serialize_i32(0),
2347                Self::Unknown => serializer.serialize_i32(1),
2348                Self::RevisionFailed => serializer.serialize_i32(3),
2349                Self::ProgressDeadlineExceeded => serializer.serialize_i32(4),
2350                Self::ContainerMissing => serializer.serialize_i32(6),
2351                Self::ContainerPermissionDenied => serializer.serialize_i32(7),
2352                Self::ContainerImageUnauthorized => serializer.serialize_i32(8),
2353                Self::ContainerImageAuthorizationCheckFailed => serializer.serialize_i32(9),
2354                Self::EncryptionKeyPermissionDenied => serializer.serialize_i32(10),
2355                Self::EncryptionKeyCheckFailed => serializer.serialize_i32(11),
2356                Self::SecretsAccessCheckFailed => serializer.serialize_i32(12),
2357                Self::WaitingForOperation => serializer.serialize_i32(13),
2358                Self::ImmediateRetry => serializer.serialize_i32(14),
2359                Self::PostponedRetry => serializer.serialize_i32(15),
2360                Self::Internal => serializer.serialize_i32(16),
2361                Self::VpcNetworkNotFound => serializer.serialize_i32(17),
2362                Self::UnknownValue(u) => u.0.serialize(serializer),
2363            }
2364        }
2365    }
2366
2367    impl<'de> serde::de::Deserialize<'de> for CommonReason {
2368        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2369        where
2370            D: serde::Deserializer<'de>,
2371        {
2372            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommonReason>::new(
2373                ".google.cloud.run.v2.Condition.CommonReason",
2374            ))
2375        }
2376    }
2377
2378    /// Reasons specific to Revision resource.
2379    ///
2380    /// # Working with unknown values
2381    ///
2382    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2383    /// additional enum variants at any time. Adding new variants is not considered
2384    /// a breaking change. Applications should write their code in anticipation of:
2385    ///
2386    /// - New values appearing in future releases of the client library, **and**
2387    /// - New values received dynamically, without application changes.
2388    ///
2389    /// Please consult the [Working with enums] section in the user guide for some
2390    /// guidelines.
2391    ///
2392    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2393    #[derive(Clone, Debug, PartialEq)]
2394    #[non_exhaustive]
2395    pub enum RevisionReason {
2396        /// Default value.
2397        Undefined,
2398        /// Revision in Pending state.
2399        Pending,
2400        /// Revision is in Reserve state.
2401        Reserve,
2402        /// Revision is Retired.
2403        Retired,
2404        /// Revision is being retired.
2405        Retiring,
2406        /// Revision is being recreated.
2407        Recreating,
2408        /// There was a health check error.
2409        HealthCheckContainerError,
2410        /// Health check failed due to user error from customized path of the
2411        /// container. System will retry.
2412        CustomizedPathResponsePending,
2413        /// A revision with min_instance_count > 0 was created and is reserved, but
2414        /// it was not configured to serve traffic, so it's not live. This can also
2415        /// happen momentarily during traffic migration.
2416        MinInstancesNotProvisioned,
2417        /// The maximum allowed number of active revisions has been reached.
2418        ActiveRevisionLimitReached,
2419        /// There was no deployment defined.
2420        /// This value is no longer used, but Services created in older versions of
2421        /// the API might contain this value.
2422        NoDeployment,
2423        /// A revision's container has no port specified since the revision is of a
2424        /// manually scaled service with 0 instance count
2425        HealthCheckSkipped,
2426        /// A revision with min_instance_count > 0 was created and is waiting for
2427        /// enough instances to begin a traffic migration.
2428        MinInstancesWarming,
2429        /// If set, the enum was initialized with an unknown value.
2430        ///
2431        /// Applications can examine the value using [RevisionReason::value] or
2432        /// [RevisionReason::name].
2433        UnknownValue(revision_reason::UnknownValue),
2434    }
2435
2436    #[doc(hidden)]
2437    pub mod revision_reason {
2438        #[allow(unused_imports)]
2439        use super::*;
2440        #[derive(Clone, Debug, PartialEq)]
2441        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2442    }
2443
2444    impl RevisionReason {
2445        /// Gets the enum value.
2446        ///
2447        /// Returns `None` if the enum contains an unknown value deserialized from
2448        /// the string representation of enums.
2449        pub fn value(&self) -> std::option::Option<i32> {
2450            match self {
2451                Self::Undefined => std::option::Option::Some(0),
2452                Self::Pending => std::option::Option::Some(1),
2453                Self::Reserve => std::option::Option::Some(2),
2454                Self::Retired => std::option::Option::Some(3),
2455                Self::Retiring => std::option::Option::Some(4),
2456                Self::Recreating => std::option::Option::Some(5),
2457                Self::HealthCheckContainerError => std::option::Option::Some(6),
2458                Self::CustomizedPathResponsePending => std::option::Option::Some(7),
2459                Self::MinInstancesNotProvisioned => std::option::Option::Some(8),
2460                Self::ActiveRevisionLimitReached => std::option::Option::Some(9),
2461                Self::NoDeployment => std::option::Option::Some(10),
2462                Self::HealthCheckSkipped => std::option::Option::Some(11),
2463                Self::MinInstancesWarming => std::option::Option::Some(12),
2464                Self::UnknownValue(u) => u.0.value(),
2465            }
2466        }
2467
2468        /// Gets the enum value as a string.
2469        ///
2470        /// Returns `None` if the enum contains an unknown value deserialized from
2471        /// the integer representation of enums.
2472        pub fn name(&self) -> std::option::Option<&str> {
2473            match self {
2474                Self::Undefined => std::option::Option::Some("REVISION_REASON_UNDEFINED"),
2475                Self::Pending => std::option::Option::Some("PENDING"),
2476                Self::Reserve => std::option::Option::Some("RESERVE"),
2477                Self::Retired => std::option::Option::Some("RETIRED"),
2478                Self::Retiring => std::option::Option::Some("RETIRING"),
2479                Self::Recreating => std::option::Option::Some("RECREATING"),
2480                Self::HealthCheckContainerError => {
2481                    std::option::Option::Some("HEALTH_CHECK_CONTAINER_ERROR")
2482                }
2483                Self::CustomizedPathResponsePending => {
2484                    std::option::Option::Some("CUSTOMIZED_PATH_RESPONSE_PENDING")
2485                }
2486                Self::MinInstancesNotProvisioned => {
2487                    std::option::Option::Some("MIN_INSTANCES_NOT_PROVISIONED")
2488                }
2489                Self::ActiveRevisionLimitReached => {
2490                    std::option::Option::Some("ACTIVE_REVISION_LIMIT_REACHED")
2491                }
2492                Self::NoDeployment => std::option::Option::Some("NO_DEPLOYMENT"),
2493                Self::HealthCheckSkipped => std::option::Option::Some("HEALTH_CHECK_SKIPPED"),
2494                Self::MinInstancesWarming => std::option::Option::Some("MIN_INSTANCES_WARMING"),
2495                Self::UnknownValue(u) => u.0.name(),
2496            }
2497        }
2498    }
2499
2500    impl std::default::Default for RevisionReason {
2501        fn default() -> Self {
2502            use std::convert::From;
2503            Self::from(0)
2504        }
2505    }
2506
2507    impl std::fmt::Display for RevisionReason {
2508        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2509            wkt::internal::display_enum(f, self.name(), self.value())
2510        }
2511    }
2512
2513    impl std::convert::From<i32> for RevisionReason {
2514        fn from(value: i32) -> Self {
2515            match value {
2516                0 => Self::Undefined,
2517                1 => Self::Pending,
2518                2 => Self::Reserve,
2519                3 => Self::Retired,
2520                4 => Self::Retiring,
2521                5 => Self::Recreating,
2522                6 => Self::HealthCheckContainerError,
2523                7 => Self::CustomizedPathResponsePending,
2524                8 => Self::MinInstancesNotProvisioned,
2525                9 => Self::ActiveRevisionLimitReached,
2526                10 => Self::NoDeployment,
2527                11 => Self::HealthCheckSkipped,
2528                12 => Self::MinInstancesWarming,
2529                _ => Self::UnknownValue(revision_reason::UnknownValue(
2530                    wkt::internal::UnknownEnumValue::Integer(value),
2531                )),
2532            }
2533        }
2534    }
2535
2536    impl std::convert::From<&str> for RevisionReason {
2537        fn from(value: &str) -> Self {
2538            use std::string::ToString;
2539            match value {
2540                "REVISION_REASON_UNDEFINED" => Self::Undefined,
2541                "PENDING" => Self::Pending,
2542                "RESERVE" => Self::Reserve,
2543                "RETIRED" => Self::Retired,
2544                "RETIRING" => Self::Retiring,
2545                "RECREATING" => Self::Recreating,
2546                "HEALTH_CHECK_CONTAINER_ERROR" => Self::HealthCheckContainerError,
2547                "CUSTOMIZED_PATH_RESPONSE_PENDING" => Self::CustomizedPathResponsePending,
2548                "MIN_INSTANCES_NOT_PROVISIONED" => Self::MinInstancesNotProvisioned,
2549                "ACTIVE_REVISION_LIMIT_REACHED" => Self::ActiveRevisionLimitReached,
2550                "NO_DEPLOYMENT" => Self::NoDeployment,
2551                "HEALTH_CHECK_SKIPPED" => Self::HealthCheckSkipped,
2552                "MIN_INSTANCES_WARMING" => Self::MinInstancesWarming,
2553                _ => Self::UnknownValue(revision_reason::UnknownValue(
2554                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2555                )),
2556            }
2557        }
2558    }
2559
2560    impl serde::ser::Serialize for RevisionReason {
2561        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2562        where
2563            S: serde::Serializer,
2564        {
2565            match self {
2566                Self::Undefined => serializer.serialize_i32(0),
2567                Self::Pending => serializer.serialize_i32(1),
2568                Self::Reserve => serializer.serialize_i32(2),
2569                Self::Retired => serializer.serialize_i32(3),
2570                Self::Retiring => serializer.serialize_i32(4),
2571                Self::Recreating => serializer.serialize_i32(5),
2572                Self::HealthCheckContainerError => serializer.serialize_i32(6),
2573                Self::CustomizedPathResponsePending => serializer.serialize_i32(7),
2574                Self::MinInstancesNotProvisioned => serializer.serialize_i32(8),
2575                Self::ActiveRevisionLimitReached => serializer.serialize_i32(9),
2576                Self::NoDeployment => serializer.serialize_i32(10),
2577                Self::HealthCheckSkipped => serializer.serialize_i32(11),
2578                Self::MinInstancesWarming => serializer.serialize_i32(12),
2579                Self::UnknownValue(u) => u.0.serialize(serializer),
2580            }
2581        }
2582    }
2583
2584    impl<'de> serde::de::Deserialize<'de> for RevisionReason {
2585        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2586        where
2587            D: serde::Deserializer<'de>,
2588        {
2589            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RevisionReason>::new(
2590                ".google.cloud.run.v2.Condition.RevisionReason",
2591            ))
2592        }
2593    }
2594
2595    /// Reasons specific to Execution resource.
2596    ///
2597    /// # Working with unknown values
2598    ///
2599    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2600    /// additional enum variants at any time. Adding new variants is not considered
2601    /// a breaking change. Applications should write their code in anticipation of:
2602    ///
2603    /// - New values appearing in future releases of the client library, **and**
2604    /// - New values received dynamically, without application changes.
2605    ///
2606    /// Please consult the [Working with enums] section in the user guide for some
2607    /// guidelines.
2608    ///
2609    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2610    #[derive(Clone, Debug, PartialEq)]
2611    #[non_exhaustive]
2612    pub enum ExecutionReason {
2613        /// Default value.
2614        Undefined,
2615        /// Internal system error getting execution status. System will retry.
2616        JobStatusServicePollingError,
2617        /// A task reached its retry limit and the last attempt failed due to the
2618        /// user container exiting with a non-zero exit code.
2619        NonZeroExitCode,
2620        /// The execution was cancelled by users.
2621        Cancelled,
2622        /// The execution is in the process of being cancelled.
2623        Cancelling,
2624        /// The execution was deleted.
2625        Deleted,
2626        /// If set, the enum was initialized with an unknown value.
2627        ///
2628        /// Applications can examine the value using [ExecutionReason::value] or
2629        /// [ExecutionReason::name].
2630        UnknownValue(execution_reason::UnknownValue),
2631    }
2632
2633    #[doc(hidden)]
2634    pub mod execution_reason {
2635        #[allow(unused_imports)]
2636        use super::*;
2637        #[derive(Clone, Debug, PartialEq)]
2638        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2639    }
2640
2641    impl ExecutionReason {
2642        /// Gets the enum value.
2643        ///
2644        /// Returns `None` if the enum contains an unknown value deserialized from
2645        /// the string representation of enums.
2646        pub fn value(&self) -> std::option::Option<i32> {
2647            match self {
2648                Self::Undefined => std::option::Option::Some(0),
2649                Self::JobStatusServicePollingError => std::option::Option::Some(1),
2650                Self::NonZeroExitCode => std::option::Option::Some(2),
2651                Self::Cancelled => std::option::Option::Some(3),
2652                Self::Cancelling => std::option::Option::Some(4),
2653                Self::Deleted => std::option::Option::Some(5),
2654                Self::UnknownValue(u) => u.0.value(),
2655            }
2656        }
2657
2658        /// Gets the enum value as a string.
2659        ///
2660        /// Returns `None` if the enum contains an unknown value deserialized from
2661        /// the integer representation of enums.
2662        pub fn name(&self) -> std::option::Option<&str> {
2663            match self {
2664                Self::Undefined => std::option::Option::Some("EXECUTION_REASON_UNDEFINED"),
2665                Self::JobStatusServicePollingError => {
2666                    std::option::Option::Some("JOB_STATUS_SERVICE_POLLING_ERROR")
2667                }
2668                Self::NonZeroExitCode => std::option::Option::Some("NON_ZERO_EXIT_CODE"),
2669                Self::Cancelled => std::option::Option::Some("CANCELLED"),
2670                Self::Cancelling => std::option::Option::Some("CANCELLING"),
2671                Self::Deleted => std::option::Option::Some("DELETED"),
2672                Self::UnknownValue(u) => u.0.name(),
2673            }
2674        }
2675    }
2676
2677    impl std::default::Default for ExecutionReason {
2678        fn default() -> Self {
2679            use std::convert::From;
2680            Self::from(0)
2681        }
2682    }
2683
2684    impl std::fmt::Display for ExecutionReason {
2685        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2686            wkt::internal::display_enum(f, self.name(), self.value())
2687        }
2688    }
2689
2690    impl std::convert::From<i32> for ExecutionReason {
2691        fn from(value: i32) -> Self {
2692            match value {
2693                0 => Self::Undefined,
2694                1 => Self::JobStatusServicePollingError,
2695                2 => Self::NonZeroExitCode,
2696                3 => Self::Cancelled,
2697                4 => Self::Cancelling,
2698                5 => Self::Deleted,
2699                _ => Self::UnknownValue(execution_reason::UnknownValue(
2700                    wkt::internal::UnknownEnumValue::Integer(value),
2701                )),
2702            }
2703        }
2704    }
2705
2706    impl std::convert::From<&str> for ExecutionReason {
2707        fn from(value: &str) -> Self {
2708            use std::string::ToString;
2709            match value {
2710                "EXECUTION_REASON_UNDEFINED" => Self::Undefined,
2711                "JOB_STATUS_SERVICE_POLLING_ERROR" => Self::JobStatusServicePollingError,
2712                "NON_ZERO_EXIT_CODE" => Self::NonZeroExitCode,
2713                "CANCELLED" => Self::Cancelled,
2714                "CANCELLING" => Self::Cancelling,
2715                "DELETED" => Self::Deleted,
2716                _ => Self::UnknownValue(execution_reason::UnknownValue(
2717                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2718                )),
2719            }
2720        }
2721    }
2722
2723    impl serde::ser::Serialize for ExecutionReason {
2724        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2725        where
2726            S: serde::Serializer,
2727        {
2728            match self {
2729                Self::Undefined => serializer.serialize_i32(0),
2730                Self::JobStatusServicePollingError => serializer.serialize_i32(1),
2731                Self::NonZeroExitCode => serializer.serialize_i32(2),
2732                Self::Cancelled => serializer.serialize_i32(3),
2733                Self::Cancelling => serializer.serialize_i32(4),
2734                Self::Deleted => serializer.serialize_i32(5),
2735                Self::UnknownValue(u) => u.0.serialize(serializer),
2736            }
2737        }
2738    }
2739
2740    impl<'de> serde::de::Deserialize<'de> for ExecutionReason {
2741        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2742        where
2743            D: serde::Deserializer<'de>,
2744        {
2745            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionReason>::new(
2746                ".google.cloud.run.v2.Condition.ExecutionReason",
2747            ))
2748        }
2749    }
2750
2751    /// The reason for this condition. Depending on the condition type,
2752    /// it will populate one of these fields.
2753    /// Successful conditions cannot have a reason.
2754    #[derive(Clone, Debug, PartialEq)]
2755    #[non_exhaustive]
2756    pub enum Reasons {
2757        /// Output only. A common (service-level) reason for this condition.
2758        Reason(crate::model::condition::CommonReason),
2759        /// Output only. A reason for the revision condition.
2760        RevisionReason(crate::model::condition::RevisionReason),
2761        /// Output only. A reason for the execution condition.
2762        ExecutionReason(crate::model::condition::ExecutionReason),
2763    }
2764}
2765
2766/// Request message for obtaining a Execution by its full name.
2767#[derive(Clone, Default, PartialEq)]
2768#[non_exhaustive]
2769pub struct GetExecutionRequest {
2770    /// Required. The full name of the Execution.
2771    /// Format:
2772    /// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
2773    /// where `{project}` can be project id or number.
2774    pub name: std::string::String,
2775
2776    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2777}
2778
2779impl GetExecutionRequest {
2780    pub fn new() -> Self {
2781        std::default::Default::default()
2782    }
2783
2784    /// Sets the value of [name][crate::model::GetExecutionRequest::name].
2785    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2786        self.name = v.into();
2787        self
2788    }
2789}
2790
2791impl wkt::message::Message for GetExecutionRequest {
2792    fn typename() -> &'static str {
2793        "type.googleapis.com/google.cloud.run.v2.GetExecutionRequest"
2794    }
2795}
2796
2797#[doc(hidden)]
2798impl<'de> serde::de::Deserialize<'de> for GetExecutionRequest {
2799    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2800    where
2801        D: serde::Deserializer<'de>,
2802    {
2803        #[allow(non_camel_case_types)]
2804        #[doc(hidden)]
2805        #[derive(PartialEq, Eq, Hash)]
2806        enum __FieldTag {
2807            __name,
2808            Unknown(std::string::String),
2809        }
2810        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2811            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2812            where
2813                D: serde::Deserializer<'de>,
2814            {
2815                struct Visitor;
2816                impl<'de> serde::de::Visitor<'de> for Visitor {
2817                    type Value = __FieldTag;
2818                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2819                        formatter.write_str("a field name for GetExecutionRequest")
2820                    }
2821                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2822                    where
2823                        E: serde::de::Error,
2824                    {
2825                        use std::result::Result::Ok;
2826                        use std::string::ToString;
2827                        match value {
2828                            "name" => Ok(__FieldTag::__name),
2829                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2830                        }
2831                    }
2832                }
2833                deserializer.deserialize_identifier(Visitor)
2834            }
2835        }
2836        struct Visitor;
2837        impl<'de> serde::de::Visitor<'de> for Visitor {
2838            type Value = GetExecutionRequest;
2839            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2840                formatter.write_str("struct GetExecutionRequest")
2841            }
2842            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2843            where
2844                A: serde::de::MapAccess<'de>,
2845            {
2846                #[allow(unused_imports)]
2847                use serde::de::Error;
2848                use std::option::Option::Some;
2849                let mut fields = std::collections::HashSet::new();
2850                let mut result = Self::Value::new();
2851                while let Some(tag) = map.next_key::<__FieldTag>()? {
2852                    #[allow(clippy::match_single_binding)]
2853                    match tag {
2854                        __FieldTag::__name => {
2855                            if !fields.insert(__FieldTag::__name) {
2856                                return std::result::Result::Err(A::Error::duplicate_field(
2857                                    "multiple values for name",
2858                                ));
2859                            }
2860                            result.name = map
2861                                .next_value::<std::option::Option<std::string::String>>()?
2862                                .unwrap_or_default();
2863                        }
2864                        __FieldTag::Unknown(key) => {
2865                            let value = map.next_value::<serde_json::Value>()?;
2866                            result._unknown_fields.insert(key, value);
2867                        }
2868                    }
2869                }
2870                std::result::Result::Ok(result)
2871            }
2872        }
2873        deserializer.deserialize_any(Visitor)
2874    }
2875}
2876
2877#[doc(hidden)]
2878impl serde::ser::Serialize for GetExecutionRequest {
2879    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2880    where
2881        S: serde::ser::Serializer,
2882    {
2883        use serde::ser::SerializeMap;
2884        #[allow(unused_imports)]
2885        use std::option::Option::Some;
2886        let mut state = serializer.serialize_map(std::option::Option::None)?;
2887        if !self.name.is_empty() {
2888            state.serialize_entry("name", &self.name)?;
2889        }
2890        if !self._unknown_fields.is_empty() {
2891            for (key, value) in self._unknown_fields.iter() {
2892                state.serialize_entry(key, &value)?;
2893            }
2894        }
2895        state.end()
2896    }
2897}
2898
2899impl std::fmt::Debug for GetExecutionRequest {
2900    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2901        let mut debug_struct = f.debug_struct("GetExecutionRequest");
2902        debug_struct.field("name", &self.name);
2903        if !self._unknown_fields.is_empty() {
2904            debug_struct.field("_unknown_fields", &self._unknown_fields);
2905        }
2906        debug_struct.finish()
2907    }
2908}
2909
2910/// Request message for retrieving a list of Executions.
2911#[derive(Clone, Default, PartialEq)]
2912#[non_exhaustive]
2913pub struct ListExecutionsRequest {
2914    /// Required. The Execution from which the Executions should be listed.
2915    /// To list all Executions across Jobs, use "-" instead of Job name.
2916    /// Format: `projects/{project}/locations/{location}/jobs/{job}`, where
2917    /// `{project}` can be project id or number.
2918    pub parent: std::string::String,
2919
2920    /// Maximum number of Executions to return in this call.
2921    pub page_size: i32,
2922
2923    /// A page token received from a previous call to ListExecutions.
2924    /// All other parameters must match.
2925    pub page_token: std::string::String,
2926
2927    /// If true, returns deleted (but unexpired) resources along with active ones.
2928    pub show_deleted: bool,
2929
2930    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2931}
2932
2933impl ListExecutionsRequest {
2934    pub fn new() -> Self {
2935        std::default::Default::default()
2936    }
2937
2938    /// Sets the value of [parent][crate::model::ListExecutionsRequest::parent].
2939    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2940        self.parent = v.into();
2941        self
2942    }
2943
2944    /// Sets the value of [page_size][crate::model::ListExecutionsRequest::page_size].
2945    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2946        self.page_size = v.into();
2947        self
2948    }
2949
2950    /// Sets the value of [page_token][crate::model::ListExecutionsRequest::page_token].
2951    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2952        self.page_token = v.into();
2953        self
2954    }
2955
2956    /// Sets the value of [show_deleted][crate::model::ListExecutionsRequest::show_deleted].
2957    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2958        self.show_deleted = v.into();
2959        self
2960    }
2961}
2962
2963impl wkt::message::Message for ListExecutionsRequest {
2964    fn typename() -> &'static str {
2965        "type.googleapis.com/google.cloud.run.v2.ListExecutionsRequest"
2966    }
2967}
2968
2969#[doc(hidden)]
2970impl<'de> serde::de::Deserialize<'de> for ListExecutionsRequest {
2971    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2972    where
2973        D: serde::Deserializer<'de>,
2974    {
2975        #[allow(non_camel_case_types)]
2976        #[doc(hidden)]
2977        #[derive(PartialEq, Eq, Hash)]
2978        enum __FieldTag {
2979            __parent,
2980            __page_size,
2981            __page_token,
2982            __show_deleted,
2983            Unknown(std::string::String),
2984        }
2985        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2986            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2987            where
2988                D: serde::Deserializer<'de>,
2989            {
2990                struct Visitor;
2991                impl<'de> serde::de::Visitor<'de> for Visitor {
2992                    type Value = __FieldTag;
2993                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2994                        formatter.write_str("a field name for ListExecutionsRequest")
2995                    }
2996                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2997                    where
2998                        E: serde::de::Error,
2999                    {
3000                        use std::result::Result::Ok;
3001                        use std::string::ToString;
3002                        match value {
3003                            "parent" => Ok(__FieldTag::__parent),
3004                            "pageSize" => Ok(__FieldTag::__page_size),
3005                            "page_size" => Ok(__FieldTag::__page_size),
3006                            "pageToken" => Ok(__FieldTag::__page_token),
3007                            "page_token" => Ok(__FieldTag::__page_token),
3008                            "showDeleted" => Ok(__FieldTag::__show_deleted),
3009                            "show_deleted" => Ok(__FieldTag::__show_deleted),
3010                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3011                        }
3012                    }
3013                }
3014                deserializer.deserialize_identifier(Visitor)
3015            }
3016        }
3017        struct Visitor;
3018        impl<'de> serde::de::Visitor<'de> for Visitor {
3019            type Value = ListExecutionsRequest;
3020            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3021                formatter.write_str("struct ListExecutionsRequest")
3022            }
3023            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3024            where
3025                A: serde::de::MapAccess<'de>,
3026            {
3027                #[allow(unused_imports)]
3028                use serde::de::Error;
3029                use std::option::Option::Some;
3030                let mut fields = std::collections::HashSet::new();
3031                let mut result = Self::Value::new();
3032                while let Some(tag) = map.next_key::<__FieldTag>()? {
3033                    #[allow(clippy::match_single_binding)]
3034                    match tag {
3035                        __FieldTag::__parent => {
3036                            if !fields.insert(__FieldTag::__parent) {
3037                                return std::result::Result::Err(A::Error::duplicate_field(
3038                                    "multiple values for parent",
3039                                ));
3040                            }
3041                            result.parent = map
3042                                .next_value::<std::option::Option<std::string::String>>()?
3043                                .unwrap_or_default();
3044                        }
3045                        __FieldTag::__page_size => {
3046                            if !fields.insert(__FieldTag::__page_size) {
3047                                return std::result::Result::Err(A::Error::duplicate_field(
3048                                    "multiple values for page_size",
3049                                ));
3050                            }
3051                            struct __With(std::option::Option<i32>);
3052                            impl<'de> serde::de::Deserialize<'de> for __With {
3053                                fn deserialize<D>(
3054                                    deserializer: D,
3055                                ) -> std::result::Result<Self, D::Error>
3056                                where
3057                                    D: serde::de::Deserializer<'de>,
3058                                {
3059                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3060                                }
3061                            }
3062                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
3063                        }
3064                        __FieldTag::__page_token => {
3065                            if !fields.insert(__FieldTag::__page_token) {
3066                                return std::result::Result::Err(A::Error::duplicate_field(
3067                                    "multiple values for page_token",
3068                                ));
3069                            }
3070                            result.page_token = map
3071                                .next_value::<std::option::Option<std::string::String>>()?
3072                                .unwrap_or_default();
3073                        }
3074                        __FieldTag::__show_deleted => {
3075                            if !fields.insert(__FieldTag::__show_deleted) {
3076                                return std::result::Result::Err(A::Error::duplicate_field(
3077                                    "multiple values for show_deleted",
3078                                ));
3079                            }
3080                            result.show_deleted = map
3081                                .next_value::<std::option::Option<bool>>()?
3082                                .unwrap_or_default();
3083                        }
3084                        __FieldTag::Unknown(key) => {
3085                            let value = map.next_value::<serde_json::Value>()?;
3086                            result._unknown_fields.insert(key, value);
3087                        }
3088                    }
3089                }
3090                std::result::Result::Ok(result)
3091            }
3092        }
3093        deserializer.deserialize_any(Visitor)
3094    }
3095}
3096
3097#[doc(hidden)]
3098impl serde::ser::Serialize for ListExecutionsRequest {
3099    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3100    where
3101        S: serde::ser::Serializer,
3102    {
3103        use serde::ser::SerializeMap;
3104        #[allow(unused_imports)]
3105        use std::option::Option::Some;
3106        let mut state = serializer.serialize_map(std::option::Option::None)?;
3107        if !self.parent.is_empty() {
3108            state.serialize_entry("parent", &self.parent)?;
3109        }
3110        if !wkt::internal::is_default(&self.page_size) {
3111            struct __With<'a>(&'a i32);
3112            impl<'a> serde::ser::Serialize for __With<'a> {
3113                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3114                where
3115                    S: serde::ser::Serializer,
3116                {
3117                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3118                }
3119            }
3120            state.serialize_entry("pageSize", &__With(&self.page_size))?;
3121        }
3122        if !self.page_token.is_empty() {
3123            state.serialize_entry("pageToken", &self.page_token)?;
3124        }
3125        if !wkt::internal::is_default(&self.show_deleted) {
3126            state.serialize_entry("showDeleted", &self.show_deleted)?;
3127        }
3128        if !self._unknown_fields.is_empty() {
3129            for (key, value) in self._unknown_fields.iter() {
3130                state.serialize_entry(key, &value)?;
3131            }
3132        }
3133        state.end()
3134    }
3135}
3136
3137impl std::fmt::Debug for ListExecutionsRequest {
3138    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3139        let mut debug_struct = f.debug_struct("ListExecutionsRequest");
3140        debug_struct.field("parent", &self.parent);
3141        debug_struct.field("page_size", &self.page_size);
3142        debug_struct.field("page_token", &self.page_token);
3143        debug_struct.field("show_deleted", &self.show_deleted);
3144        if !self._unknown_fields.is_empty() {
3145            debug_struct.field("_unknown_fields", &self._unknown_fields);
3146        }
3147        debug_struct.finish()
3148    }
3149}
3150
3151/// Response message containing a list of Executions.
3152#[derive(Clone, Default, PartialEq)]
3153#[non_exhaustive]
3154pub struct ListExecutionsResponse {
3155    /// The resulting list of Executions.
3156    pub executions: std::vec::Vec<crate::model::Execution>,
3157
3158    /// A token indicating there are more items than page_size. Use it in the next
3159    /// ListExecutions request to continue.
3160    pub next_page_token: std::string::String,
3161
3162    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3163}
3164
3165impl ListExecutionsResponse {
3166    pub fn new() -> Self {
3167        std::default::Default::default()
3168    }
3169
3170    /// Sets the value of [executions][crate::model::ListExecutionsResponse::executions].
3171    pub fn set_executions<T, V>(mut self, v: T) -> Self
3172    where
3173        T: std::iter::IntoIterator<Item = V>,
3174        V: std::convert::Into<crate::model::Execution>,
3175    {
3176        use std::iter::Iterator;
3177        self.executions = v.into_iter().map(|i| i.into()).collect();
3178        self
3179    }
3180
3181    /// Sets the value of [next_page_token][crate::model::ListExecutionsResponse::next_page_token].
3182    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3183        self.next_page_token = v.into();
3184        self
3185    }
3186}
3187
3188impl wkt::message::Message for ListExecutionsResponse {
3189    fn typename() -> &'static str {
3190        "type.googleapis.com/google.cloud.run.v2.ListExecutionsResponse"
3191    }
3192}
3193
3194#[doc(hidden)]
3195impl gax::paginator::internal::PageableResponse for ListExecutionsResponse {
3196    type PageItem = crate::model::Execution;
3197
3198    fn items(self) -> std::vec::Vec<Self::PageItem> {
3199        self.executions
3200    }
3201
3202    fn next_page_token(&self) -> std::string::String {
3203        use std::clone::Clone;
3204        self.next_page_token.clone()
3205    }
3206}
3207
3208#[doc(hidden)]
3209impl<'de> serde::de::Deserialize<'de> for ListExecutionsResponse {
3210    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3211    where
3212        D: serde::Deserializer<'de>,
3213    {
3214        #[allow(non_camel_case_types)]
3215        #[doc(hidden)]
3216        #[derive(PartialEq, Eq, Hash)]
3217        enum __FieldTag {
3218            __executions,
3219            __next_page_token,
3220            Unknown(std::string::String),
3221        }
3222        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3223            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3224            where
3225                D: serde::Deserializer<'de>,
3226            {
3227                struct Visitor;
3228                impl<'de> serde::de::Visitor<'de> for Visitor {
3229                    type Value = __FieldTag;
3230                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3231                        formatter.write_str("a field name for ListExecutionsResponse")
3232                    }
3233                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3234                    where
3235                        E: serde::de::Error,
3236                    {
3237                        use std::result::Result::Ok;
3238                        use std::string::ToString;
3239                        match value {
3240                            "executions" => Ok(__FieldTag::__executions),
3241                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
3242                            "next_page_token" => Ok(__FieldTag::__next_page_token),
3243                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3244                        }
3245                    }
3246                }
3247                deserializer.deserialize_identifier(Visitor)
3248            }
3249        }
3250        struct Visitor;
3251        impl<'de> serde::de::Visitor<'de> for Visitor {
3252            type Value = ListExecutionsResponse;
3253            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3254                formatter.write_str("struct ListExecutionsResponse")
3255            }
3256            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3257            where
3258                A: serde::de::MapAccess<'de>,
3259            {
3260                #[allow(unused_imports)]
3261                use serde::de::Error;
3262                use std::option::Option::Some;
3263                let mut fields = std::collections::HashSet::new();
3264                let mut result = Self::Value::new();
3265                while let Some(tag) = map.next_key::<__FieldTag>()? {
3266                    #[allow(clippy::match_single_binding)]
3267                    match tag {
3268                        __FieldTag::__executions => {
3269                            if !fields.insert(__FieldTag::__executions) {
3270                                return std::result::Result::Err(A::Error::duplicate_field(
3271                                    "multiple values for executions",
3272                                ));
3273                            }
3274                            result.executions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Execution>>>()?.unwrap_or_default();
3275                        }
3276                        __FieldTag::__next_page_token => {
3277                            if !fields.insert(__FieldTag::__next_page_token) {
3278                                return std::result::Result::Err(A::Error::duplicate_field(
3279                                    "multiple values for next_page_token",
3280                                ));
3281                            }
3282                            result.next_page_token = map
3283                                .next_value::<std::option::Option<std::string::String>>()?
3284                                .unwrap_or_default();
3285                        }
3286                        __FieldTag::Unknown(key) => {
3287                            let value = map.next_value::<serde_json::Value>()?;
3288                            result._unknown_fields.insert(key, value);
3289                        }
3290                    }
3291                }
3292                std::result::Result::Ok(result)
3293            }
3294        }
3295        deserializer.deserialize_any(Visitor)
3296    }
3297}
3298
3299#[doc(hidden)]
3300impl serde::ser::Serialize for ListExecutionsResponse {
3301    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3302    where
3303        S: serde::ser::Serializer,
3304    {
3305        use serde::ser::SerializeMap;
3306        #[allow(unused_imports)]
3307        use std::option::Option::Some;
3308        let mut state = serializer.serialize_map(std::option::Option::None)?;
3309        if !self.executions.is_empty() {
3310            state.serialize_entry("executions", &self.executions)?;
3311        }
3312        if !self.next_page_token.is_empty() {
3313            state.serialize_entry("nextPageToken", &self.next_page_token)?;
3314        }
3315        if !self._unknown_fields.is_empty() {
3316            for (key, value) in self._unknown_fields.iter() {
3317                state.serialize_entry(key, &value)?;
3318            }
3319        }
3320        state.end()
3321    }
3322}
3323
3324impl std::fmt::Debug for ListExecutionsResponse {
3325    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3326        let mut debug_struct = f.debug_struct("ListExecutionsResponse");
3327        debug_struct.field("executions", &self.executions);
3328        debug_struct.field("next_page_token", &self.next_page_token);
3329        if !self._unknown_fields.is_empty() {
3330            debug_struct.field("_unknown_fields", &self._unknown_fields);
3331        }
3332        debug_struct.finish()
3333    }
3334}
3335
3336/// Request message for deleting an Execution.
3337#[derive(Clone, Default, PartialEq)]
3338#[non_exhaustive]
3339pub struct DeleteExecutionRequest {
3340    /// Required. The name of the Execution to delete.
3341    /// Format:
3342    /// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
3343    /// where `{project}` can be project id or number.
3344    pub name: std::string::String,
3345
3346    /// Indicates that the request should be validated without actually
3347    /// deleting any resources.
3348    pub validate_only: bool,
3349
3350    /// A system-generated fingerprint for this version of the resource.
3351    /// This may be used to detect modification conflict during updates.
3352    pub etag: std::string::String,
3353
3354    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3355}
3356
3357impl DeleteExecutionRequest {
3358    pub fn new() -> Self {
3359        std::default::Default::default()
3360    }
3361
3362    /// Sets the value of [name][crate::model::DeleteExecutionRequest::name].
3363    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3364        self.name = v.into();
3365        self
3366    }
3367
3368    /// Sets the value of [validate_only][crate::model::DeleteExecutionRequest::validate_only].
3369    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3370        self.validate_only = v.into();
3371        self
3372    }
3373
3374    /// Sets the value of [etag][crate::model::DeleteExecutionRequest::etag].
3375    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3376        self.etag = v.into();
3377        self
3378    }
3379}
3380
3381impl wkt::message::Message for DeleteExecutionRequest {
3382    fn typename() -> &'static str {
3383        "type.googleapis.com/google.cloud.run.v2.DeleteExecutionRequest"
3384    }
3385}
3386
3387#[doc(hidden)]
3388impl<'de> serde::de::Deserialize<'de> for DeleteExecutionRequest {
3389    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3390    where
3391        D: serde::Deserializer<'de>,
3392    {
3393        #[allow(non_camel_case_types)]
3394        #[doc(hidden)]
3395        #[derive(PartialEq, Eq, Hash)]
3396        enum __FieldTag {
3397            __name,
3398            __validate_only,
3399            __etag,
3400            Unknown(std::string::String),
3401        }
3402        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3403            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3404            where
3405                D: serde::Deserializer<'de>,
3406            {
3407                struct Visitor;
3408                impl<'de> serde::de::Visitor<'de> for Visitor {
3409                    type Value = __FieldTag;
3410                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3411                        formatter.write_str("a field name for DeleteExecutionRequest")
3412                    }
3413                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3414                    where
3415                        E: serde::de::Error,
3416                    {
3417                        use std::result::Result::Ok;
3418                        use std::string::ToString;
3419                        match value {
3420                            "name" => Ok(__FieldTag::__name),
3421                            "validateOnly" => Ok(__FieldTag::__validate_only),
3422                            "validate_only" => Ok(__FieldTag::__validate_only),
3423                            "etag" => Ok(__FieldTag::__etag),
3424                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3425                        }
3426                    }
3427                }
3428                deserializer.deserialize_identifier(Visitor)
3429            }
3430        }
3431        struct Visitor;
3432        impl<'de> serde::de::Visitor<'de> for Visitor {
3433            type Value = DeleteExecutionRequest;
3434            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3435                formatter.write_str("struct DeleteExecutionRequest")
3436            }
3437            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3438            where
3439                A: serde::de::MapAccess<'de>,
3440            {
3441                #[allow(unused_imports)]
3442                use serde::de::Error;
3443                use std::option::Option::Some;
3444                let mut fields = std::collections::HashSet::new();
3445                let mut result = Self::Value::new();
3446                while let Some(tag) = map.next_key::<__FieldTag>()? {
3447                    #[allow(clippy::match_single_binding)]
3448                    match tag {
3449                        __FieldTag::__name => {
3450                            if !fields.insert(__FieldTag::__name) {
3451                                return std::result::Result::Err(A::Error::duplicate_field(
3452                                    "multiple values for name",
3453                                ));
3454                            }
3455                            result.name = map
3456                                .next_value::<std::option::Option<std::string::String>>()?
3457                                .unwrap_or_default();
3458                        }
3459                        __FieldTag::__validate_only => {
3460                            if !fields.insert(__FieldTag::__validate_only) {
3461                                return std::result::Result::Err(A::Error::duplicate_field(
3462                                    "multiple values for validate_only",
3463                                ));
3464                            }
3465                            result.validate_only = map
3466                                .next_value::<std::option::Option<bool>>()?
3467                                .unwrap_or_default();
3468                        }
3469                        __FieldTag::__etag => {
3470                            if !fields.insert(__FieldTag::__etag) {
3471                                return std::result::Result::Err(A::Error::duplicate_field(
3472                                    "multiple values for etag",
3473                                ));
3474                            }
3475                            result.etag = map
3476                                .next_value::<std::option::Option<std::string::String>>()?
3477                                .unwrap_or_default();
3478                        }
3479                        __FieldTag::Unknown(key) => {
3480                            let value = map.next_value::<serde_json::Value>()?;
3481                            result._unknown_fields.insert(key, value);
3482                        }
3483                    }
3484                }
3485                std::result::Result::Ok(result)
3486            }
3487        }
3488        deserializer.deserialize_any(Visitor)
3489    }
3490}
3491
3492#[doc(hidden)]
3493impl serde::ser::Serialize for DeleteExecutionRequest {
3494    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3495    where
3496        S: serde::ser::Serializer,
3497    {
3498        use serde::ser::SerializeMap;
3499        #[allow(unused_imports)]
3500        use std::option::Option::Some;
3501        let mut state = serializer.serialize_map(std::option::Option::None)?;
3502        if !self.name.is_empty() {
3503            state.serialize_entry("name", &self.name)?;
3504        }
3505        if !wkt::internal::is_default(&self.validate_only) {
3506            state.serialize_entry("validateOnly", &self.validate_only)?;
3507        }
3508        if !self.etag.is_empty() {
3509            state.serialize_entry("etag", &self.etag)?;
3510        }
3511        if !self._unknown_fields.is_empty() {
3512            for (key, value) in self._unknown_fields.iter() {
3513                state.serialize_entry(key, &value)?;
3514            }
3515        }
3516        state.end()
3517    }
3518}
3519
3520impl std::fmt::Debug for DeleteExecutionRequest {
3521    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3522        let mut debug_struct = f.debug_struct("DeleteExecutionRequest");
3523        debug_struct.field("name", &self.name);
3524        debug_struct.field("validate_only", &self.validate_only);
3525        debug_struct.field("etag", &self.etag);
3526        if !self._unknown_fields.is_empty() {
3527            debug_struct.field("_unknown_fields", &self._unknown_fields);
3528        }
3529        debug_struct.finish()
3530    }
3531}
3532
3533/// Request message for deleting an Execution.
3534#[derive(Clone, Default, PartialEq)]
3535#[non_exhaustive]
3536pub struct CancelExecutionRequest {
3537    /// Required. The name of the Execution to cancel.
3538    /// Format:
3539    /// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
3540    /// where `{project}` can be project id or number.
3541    pub name: std::string::String,
3542
3543    /// Indicates that the request should be validated without actually
3544    /// cancelling any resources.
3545    pub validate_only: bool,
3546
3547    /// A system-generated fingerprint for this version of the resource.
3548    /// This may be used to detect modification conflict during updates.
3549    pub etag: std::string::String,
3550
3551    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3552}
3553
3554impl CancelExecutionRequest {
3555    pub fn new() -> Self {
3556        std::default::Default::default()
3557    }
3558
3559    /// Sets the value of [name][crate::model::CancelExecutionRequest::name].
3560    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3561        self.name = v.into();
3562        self
3563    }
3564
3565    /// Sets the value of [validate_only][crate::model::CancelExecutionRequest::validate_only].
3566    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3567        self.validate_only = v.into();
3568        self
3569    }
3570
3571    /// Sets the value of [etag][crate::model::CancelExecutionRequest::etag].
3572    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3573        self.etag = v.into();
3574        self
3575    }
3576}
3577
3578impl wkt::message::Message for CancelExecutionRequest {
3579    fn typename() -> &'static str {
3580        "type.googleapis.com/google.cloud.run.v2.CancelExecutionRequest"
3581    }
3582}
3583
3584#[doc(hidden)]
3585impl<'de> serde::de::Deserialize<'de> for CancelExecutionRequest {
3586    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3587    where
3588        D: serde::Deserializer<'de>,
3589    {
3590        #[allow(non_camel_case_types)]
3591        #[doc(hidden)]
3592        #[derive(PartialEq, Eq, Hash)]
3593        enum __FieldTag {
3594            __name,
3595            __validate_only,
3596            __etag,
3597            Unknown(std::string::String),
3598        }
3599        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3600            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3601            where
3602                D: serde::Deserializer<'de>,
3603            {
3604                struct Visitor;
3605                impl<'de> serde::de::Visitor<'de> for Visitor {
3606                    type Value = __FieldTag;
3607                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3608                        formatter.write_str("a field name for CancelExecutionRequest")
3609                    }
3610                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3611                    where
3612                        E: serde::de::Error,
3613                    {
3614                        use std::result::Result::Ok;
3615                        use std::string::ToString;
3616                        match value {
3617                            "name" => Ok(__FieldTag::__name),
3618                            "validateOnly" => Ok(__FieldTag::__validate_only),
3619                            "validate_only" => Ok(__FieldTag::__validate_only),
3620                            "etag" => Ok(__FieldTag::__etag),
3621                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3622                        }
3623                    }
3624                }
3625                deserializer.deserialize_identifier(Visitor)
3626            }
3627        }
3628        struct Visitor;
3629        impl<'de> serde::de::Visitor<'de> for Visitor {
3630            type Value = CancelExecutionRequest;
3631            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3632                formatter.write_str("struct CancelExecutionRequest")
3633            }
3634            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3635            where
3636                A: serde::de::MapAccess<'de>,
3637            {
3638                #[allow(unused_imports)]
3639                use serde::de::Error;
3640                use std::option::Option::Some;
3641                let mut fields = std::collections::HashSet::new();
3642                let mut result = Self::Value::new();
3643                while let Some(tag) = map.next_key::<__FieldTag>()? {
3644                    #[allow(clippy::match_single_binding)]
3645                    match tag {
3646                        __FieldTag::__name => {
3647                            if !fields.insert(__FieldTag::__name) {
3648                                return std::result::Result::Err(A::Error::duplicate_field(
3649                                    "multiple values for name",
3650                                ));
3651                            }
3652                            result.name = map
3653                                .next_value::<std::option::Option<std::string::String>>()?
3654                                .unwrap_or_default();
3655                        }
3656                        __FieldTag::__validate_only => {
3657                            if !fields.insert(__FieldTag::__validate_only) {
3658                                return std::result::Result::Err(A::Error::duplicate_field(
3659                                    "multiple values for validate_only",
3660                                ));
3661                            }
3662                            result.validate_only = map
3663                                .next_value::<std::option::Option<bool>>()?
3664                                .unwrap_or_default();
3665                        }
3666                        __FieldTag::__etag => {
3667                            if !fields.insert(__FieldTag::__etag) {
3668                                return std::result::Result::Err(A::Error::duplicate_field(
3669                                    "multiple values for etag",
3670                                ));
3671                            }
3672                            result.etag = map
3673                                .next_value::<std::option::Option<std::string::String>>()?
3674                                .unwrap_or_default();
3675                        }
3676                        __FieldTag::Unknown(key) => {
3677                            let value = map.next_value::<serde_json::Value>()?;
3678                            result._unknown_fields.insert(key, value);
3679                        }
3680                    }
3681                }
3682                std::result::Result::Ok(result)
3683            }
3684        }
3685        deserializer.deserialize_any(Visitor)
3686    }
3687}
3688
3689#[doc(hidden)]
3690impl serde::ser::Serialize for CancelExecutionRequest {
3691    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3692    where
3693        S: serde::ser::Serializer,
3694    {
3695        use serde::ser::SerializeMap;
3696        #[allow(unused_imports)]
3697        use std::option::Option::Some;
3698        let mut state = serializer.serialize_map(std::option::Option::None)?;
3699        if !self.name.is_empty() {
3700            state.serialize_entry("name", &self.name)?;
3701        }
3702        if !wkt::internal::is_default(&self.validate_only) {
3703            state.serialize_entry("validateOnly", &self.validate_only)?;
3704        }
3705        if !self.etag.is_empty() {
3706            state.serialize_entry("etag", &self.etag)?;
3707        }
3708        if !self._unknown_fields.is_empty() {
3709            for (key, value) in self._unknown_fields.iter() {
3710                state.serialize_entry(key, &value)?;
3711            }
3712        }
3713        state.end()
3714    }
3715}
3716
3717impl std::fmt::Debug for CancelExecutionRequest {
3718    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3719        let mut debug_struct = f.debug_struct("CancelExecutionRequest");
3720        debug_struct.field("name", &self.name);
3721        debug_struct.field("validate_only", &self.validate_only);
3722        debug_struct.field("etag", &self.etag);
3723        if !self._unknown_fields.is_empty() {
3724            debug_struct.field("_unknown_fields", &self._unknown_fields);
3725        }
3726        debug_struct.finish()
3727    }
3728}
3729
3730/// Execution represents the configuration of a single execution. A execution an
3731/// immutable resource that references a container image which is run to
3732/// completion.
3733#[derive(Clone, Default, PartialEq)]
3734#[non_exhaustive]
3735pub struct Execution {
3736    /// Output only. The unique name of this Execution.
3737    pub name: std::string::String,
3738
3739    /// Output only. Server assigned unique identifier for the Execution. The value
3740    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
3741    /// deleted.
3742    pub uid: std::string::String,
3743
3744    /// Output only. Email address of the authenticated creator.
3745    pub creator: std::string::String,
3746
3747    /// Output only. A number that monotonically increases every time the user
3748    /// modifies the desired state.
3749    pub generation: i64,
3750
3751    /// Output only. Unstructured key value map that can be used to organize and
3752    /// categorize objects. User-provided labels are shared with Google's billing
3753    /// system, so they can be used to filter, or break down billing charges by
3754    /// team, component, environment, state, etc. For more information, visit
3755    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
3756    /// <https://cloud.google.com/run/docs/configuring/labels>
3757    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3758
3759    /// Output only. Unstructured key value map that may
3760    /// be set by external tools to store and arbitrary metadata.
3761    /// They are not queryable and should be preserved
3762    /// when modifying objects.
3763    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3764
3765    /// Output only. Represents time when the execution was acknowledged by the
3766    /// execution controller. It is not guaranteed to be set in happens-before
3767    /// order across separate operations.
3768    pub create_time: std::option::Option<wkt::Timestamp>,
3769
3770    /// Output only. Represents time when the execution started to run.
3771    /// It is not guaranteed to be set in happens-before order across separate
3772    /// operations.
3773    pub start_time: std::option::Option<wkt::Timestamp>,
3774
3775    /// Output only. Represents time when the execution was completed. It is not
3776    /// guaranteed to be set in happens-before order across separate operations.
3777    pub completion_time: std::option::Option<wkt::Timestamp>,
3778
3779    /// Output only. The last-modified time.
3780    pub update_time: std::option::Option<wkt::Timestamp>,
3781
3782    /// Output only. For a deleted resource, the deletion time. It is only
3783    /// populated as a response to a Delete request.
3784    pub delete_time: std::option::Option<wkt::Timestamp>,
3785
3786    /// Output only. For a deleted resource, the time after which it will be
3787    /// permamently deleted. It is only populated as a response to a Delete
3788    /// request.
3789    pub expire_time: std::option::Option<wkt::Timestamp>,
3790
3791    /// The least stable launch stage needed to create this resource, as defined by
3792    /// [Google Cloud Platform Launch
3793    /// Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports
3794    /// `ALPHA`, `BETA`, and `GA`.
3795    ///
3796    /// Note that this value might not be what was used
3797    /// as input. For example, if ALPHA was provided as input in the parent
3798    /// resource, but only BETA and GA-level features are were, this field will be
3799    /// BETA.
3800    pub launch_stage: api::model::LaunchStage,
3801
3802    /// Output only. The name of the parent Job.
3803    pub job: std::string::String,
3804
3805    /// Output only. Specifies the maximum desired number of tasks the execution
3806    /// should run at any given time. Must be <= task_count. The actual number of
3807    /// tasks running in steady state will be less than this number when
3808    /// ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when
3809    /// the work left to do is less than max parallelism.
3810    pub parallelism: i32,
3811
3812    /// Output only. Specifies the desired number of tasks the execution should
3813    /// run. Setting to 1 means that parallelism is limited to 1 and the success of
3814    /// that task signals the success of the execution.
3815    pub task_count: i32,
3816
3817    /// Output only. The template used to create tasks for this execution.
3818    pub template: std::option::Option<crate::model::TaskTemplate>,
3819
3820    /// Output only. Indicates whether the resource's reconciliation is still in
3821    /// progress. See comments in `Job.reconciling` for additional information on
3822    /// reconciliation process in Cloud Run.
3823    pub reconciling: bool,
3824
3825    /// Output only. The Condition of this Execution, containing its readiness
3826    /// status, and detailed error information in case it did not reach the desired
3827    /// state.
3828    pub conditions: std::vec::Vec<crate::model::Condition>,
3829
3830    /// Output only. The generation of this Execution. See comments in
3831    /// `reconciling` for additional information on reconciliation process in Cloud
3832    /// Run.
3833    pub observed_generation: i64,
3834
3835    /// Output only. The number of actively running tasks.
3836    pub running_count: i32,
3837
3838    /// Output only. The number of tasks which reached phase Succeeded.
3839    pub succeeded_count: i32,
3840
3841    /// Output only. The number of tasks which reached phase Failed.
3842    pub failed_count: i32,
3843
3844    /// Output only. The number of tasks which reached phase Cancelled.
3845    pub cancelled_count: i32,
3846
3847    /// Output only. The number of tasks which have retried at least once.
3848    pub retried_count: i32,
3849
3850    /// Output only. URI where logs for this execution can be found in Cloud
3851    /// Console.
3852    pub log_uri: std::string::String,
3853
3854    /// Output only. Reserved for future use.
3855    pub satisfies_pzs: bool,
3856
3857    /// Output only. A system-generated fingerprint for this version of the
3858    /// resource. May be used to detect modification conflict during updates.
3859    pub etag: std::string::String,
3860
3861    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3862}
3863
3864impl Execution {
3865    pub fn new() -> Self {
3866        std::default::Default::default()
3867    }
3868
3869    /// Sets the value of [name][crate::model::Execution::name].
3870    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3871        self.name = v.into();
3872        self
3873    }
3874
3875    /// Sets the value of [uid][crate::model::Execution::uid].
3876    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3877        self.uid = v.into();
3878        self
3879    }
3880
3881    /// Sets the value of [creator][crate::model::Execution::creator].
3882    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3883        self.creator = v.into();
3884        self
3885    }
3886
3887    /// Sets the value of [generation][crate::model::Execution::generation].
3888    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3889        self.generation = v.into();
3890        self
3891    }
3892
3893    /// Sets the value of [labels][crate::model::Execution::labels].
3894    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3895    where
3896        T: std::iter::IntoIterator<Item = (K, V)>,
3897        K: std::convert::Into<std::string::String>,
3898        V: std::convert::Into<std::string::String>,
3899    {
3900        use std::iter::Iterator;
3901        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3902        self
3903    }
3904
3905    /// Sets the value of [annotations][crate::model::Execution::annotations].
3906    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3907    where
3908        T: std::iter::IntoIterator<Item = (K, V)>,
3909        K: std::convert::Into<std::string::String>,
3910        V: std::convert::Into<std::string::String>,
3911    {
3912        use std::iter::Iterator;
3913        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3914        self
3915    }
3916
3917    /// Sets the value of [create_time][crate::model::Execution::create_time].
3918    pub fn set_create_time<T>(mut self, v: T) -> Self
3919    where
3920        T: std::convert::Into<wkt::Timestamp>,
3921    {
3922        self.create_time = std::option::Option::Some(v.into());
3923        self
3924    }
3925
3926    /// Sets or clears the value of [create_time][crate::model::Execution::create_time].
3927    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3928    where
3929        T: std::convert::Into<wkt::Timestamp>,
3930    {
3931        self.create_time = v.map(|x| x.into());
3932        self
3933    }
3934
3935    /// Sets the value of [start_time][crate::model::Execution::start_time].
3936    pub fn set_start_time<T>(mut self, v: T) -> Self
3937    where
3938        T: std::convert::Into<wkt::Timestamp>,
3939    {
3940        self.start_time = std::option::Option::Some(v.into());
3941        self
3942    }
3943
3944    /// Sets or clears the value of [start_time][crate::model::Execution::start_time].
3945    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3946    where
3947        T: std::convert::Into<wkt::Timestamp>,
3948    {
3949        self.start_time = v.map(|x| x.into());
3950        self
3951    }
3952
3953    /// Sets the value of [completion_time][crate::model::Execution::completion_time].
3954    pub fn set_completion_time<T>(mut self, v: T) -> Self
3955    where
3956        T: std::convert::Into<wkt::Timestamp>,
3957    {
3958        self.completion_time = std::option::Option::Some(v.into());
3959        self
3960    }
3961
3962    /// Sets or clears the value of [completion_time][crate::model::Execution::completion_time].
3963    pub fn set_or_clear_completion_time<T>(mut self, v: std::option::Option<T>) -> Self
3964    where
3965        T: std::convert::Into<wkt::Timestamp>,
3966    {
3967        self.completion_time = v.map(|x| x.into());
3968        self
3969    }
3970
3971    /// Sets the value of [update_time][crate::model::Execution::update_time].
3972    pub fn set_update_time<T>(mut self, v: T) -> Self
3973    where
3974        T: std::convert::Into<wkt::Timestamp>,
3975    {
3976        self.update_time = std::option::Option::Some(v.into());
3977        self
3978    }
3979
3980    /// Sets or clears the value of [update_time][crate::model::Execution::update_time].
3981    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3982    where
3983        T: std::convert::Into<wkt::Timestamp>,
3984    {
3985        self.update_time = v.map(|x| x.into());
3986        self
3987    }
3988
3989    /// Sets the value of [delete_time][crate::model::Execution::delete_time].
3990    pub fn set_delete_time<T>(mut self, v: T) -> Self
3991    where
3992        T: std::convert::Into<wkt::Timestamp>,
3993    {
3994        self.delete_time = std::option::Option::Some(v.into());
3995        self
3996    }
3997
3998    /// Sets or clears the value of [delete_time][crate::model::Execution::delete_time].
3999    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
4000    where
4001        T: std::convert::Into<wkt::Timestamp>,
4002    {
4003        self.delete_time = v.map(|x| x.into());
4004        self
4005    }
4006
4007    /// Sets the value of [expire_time][crate::model::Execution::expire_time].
4008    pub fn set_expire_time<T>(mut self, v: T) -> Self
4009    where
4010        T: std::convert::Into<wkt::Timestamp>,
4011    {
4012        self.expire_time = std::option::Option::Some(v.into());
4013        self
4014    }
4015
4016    /// Sets or clears the value of [expire_time][crate::model::Execution::expire_time].
4017    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4018    where
4019        T: std::convert::Into<wkt::Timestamp>,
4020    {
4021        self.expire_time = v.map(|x| x.into());
4022        self
4023    }
4024
4025    /// Sets the value of [launch_stage][crate::model::Execution::launch_stage].
4026    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
4027        mut self,
4028        v: T,
4029    ) -> Self {
4030        self.launch_stage = v.into();
4031        self
4032    }
4033
4034    /// Sets the value of [job][crate::model::Execution::job].
4035    pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4036        self.job = v.into();
4037        self
4038    }
4039
4040    /// Sets the value of [parallelism][crate::model::Execution::parallelism].
4041    pub fn set_parallelism<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4042        self.parallelism = v.into();
4043        self
4044    }
4045
4046    /// Sets the value of [task_count][crate::model::Execution::task_count].
4047    pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4048        self.task_count = v.into();
4049        self
4050    }
4051
4052    /// Sets the value of [template][crate::model::Execution::template].
4053    pub fn set_template<T>(mut self, v: T) -> Self
4054    where
4055        T: std::convert::Into<crate::model::TaskTemplate>,
4056    {
4057        self.template = std::option::Option::Some(v.into());
4058        self
4059    }
4060
4061    /// Sets or clears the value of [template][crate::model::Execution::template].
4062    pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
4063    where
4064        T: std::convert::Into<crate::model::TaskTemplate>,
4065    {
4066        self.template = v.map(|x| x.into());
4067        self
4068    }
4069
4070    /// Sets the value of [reconciling][crate::model::Execution::reconciling].
4071    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4072        self.reconciling = v.into();
4073        self
4074    }
4075
4076    /// Sets the value of [conditions][crate::model::Execution::conditions].
4077    pub fn set_conditions<T, V>(mut self, v: T) -> Self
4078    where
4079        T: std::iter::IntoIterator<Item = V>,
4080        V: std::convert::Into<crate::model::Condition>,
4081    {
4082        use std::iter::Iterator;
4083        self.conditions = v.into_iter().map(|i| i.into()).collect();
4084        self
4085    }
4086
4087    /// Sets the value of [observed_generation][crate::model::Execution::observed_generation].
4088    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4089        self.observed_generation = v.into();
4090        self
4091    }
4092
4093    /// Sets the value of [running_count][crate::model::Execution::running_count].
4094    pub fn set_running_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4095        self.running_count = v.into();
4096        self
4097    }
4098
4099    /// Sets the value of [succeeded_count][crate::model::Execution::succeeded_count].
4100    pub fn set_succeeded_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4101        self.succeeded_count = v.into();
4102        self
4103    }
4104
4105    /// Sets the value of [failed_count][crate::model::Execution::failed_count].
4106    pub fn set_failed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4107        self.failed_count = v.into();
4108        self
4109    }
4110
4111    /// Sets the value of [cancelled_count][crate::model::Execution::cancelled_count].
4112    pub fn set_cancelled_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4113        self.cancelled_count = v.into();
4114        self
4115    }
4116
4117    /// Sets the value of [retried_count][crate::model::Execution::retried_count].
4118    pub fn set_retried_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4119        self.retried_count = v.into();
4120        self
4121    }
4122
4123    /// Sets the value of [log_uri][crate::model::Execution::log_uri].
4124    pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4125        self.log_uri = v.into();
4126        self
4127    }
4128
4129    /// Sets the value of [satisfies_pzs][crate::model::Execution::satisfies_pzs].
4130    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4131        self.satisfies_pzs = v.into();
4132        self
4133    }
4134
4135    /// Sets the value of [etag][crate::model::Execution::etag].
4136    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4137        self.etag = v.into();
4138        self
4139    }
4140}
4141
4142impl wkt::message::Message for Execution {
4143    fn typename() -> &'static str {
4144        "type.googleapis.com/google.cloud.run.v2.Execution"
4145    }
4146}
4147
4148#[doc(hidden)]
4149impl<'de> serde::de::Deserialize<'de> for Execution {
4150    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4151    where
4152        D: serde::Deserializer<'de>,
4153    {
4154        #[allow(non_camel_case_types)]
4155        #[doc(hidden)]
4156        #[derive(PartialEq, Eq, Hash)]
4157        enum __FieldTag {
4158            __name,
4159            __uid,
4160            __creator,
4161            __generation,
4162            __labels,
4163            __annotations,
4164            __create_time,
4165            __start_time,
4166            __completion_time,
4167            __update_time,
4168            __delete_time,
4169            __expire_time,
4170            __launch_stage,
4171            __job,
4172            __parallelism,
4173            __task_count,
4174            __template,
4175            __reconciling,
4176            __conditions,
4177            __observed_generation,
4178            __running_count,
4179            __succeeded_count,
4180            __failed_count,
4181            __cancelled_count,
4182            __retried_count,
4183            __log_uri,
4184            __satisfies_pzs,
4185            __etag,
4186            Unknown(std::string::String),
4187        }
4188        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4189            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4190            where
4191                D: serde::Deserializer<'de>,
4192            {
4193                struct Visitor;
4194                impl<'de> serde::de::Visitor<'de> for Visitor {
4195                    type Value = __FieldTag;
4196                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4197                        formatter.write_str("a field name for Execution")
4198                    }
4199                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4200                    where
4201                        E: serde::de::Error,
4202                    {
4203                        use std::result::Result::Ok;
4204                        use std::string::ToString;
4205                        match value {
4206                            "name" => Ok(__FieldTag::__name),
4207                            "uid" => Ok(__FieldTag::__uid),
4208                            "creator" => Ok(__FieldTag::__creator),
4209                            "generation" => Ok(__FieldTag::__generation),
4210                            "labels" => Ok(__FieldTag::__labels),
4211                            "annotations" => Ok(__FieldTag::__annotations),
4212                            "createTime" => Ok(__FieldTag::__create_time),
4213                            "create_time" => Ok(__FieldTag::__create_time),
4214                            "startTime" => Ok(__FieldTag::__start_time),
4215                            "start_time" => Ok(__FieldTag::__start_time),
4216                            "completionTime" => Ok(__FieldTag::__completion_time),
4217                            "completion_time" => Ok(__FieldTag::__completion_time),
4218                            "updateTime" => Ok(__FieldTag::__update_time),
4219                            "update_time" => Ok(__FieldTag::__update_time),
4220                            "deleteTime" => Ok(__FieldTag::__delete_time),
4221                            "delete_time" => Ok(__FieldTag::__delete_time),
4222                            "expireTime" => Ok(__FieldTag::__expire_time),
4223                            "expire_time" => Ok(__FieldTag::__expire_time),
4224                            "launchStage" => Ok(__FieldTag::__launch_stage),
4225                            "launch_stage" => Ok(__FieldTag::__launch_stage),
4226                            "job" => Ok(__FieldTag::__job),
4227                            "parallelism" => Ok(__FieldTag::__parallelism),
4228                            "taskCount" => Ok(__FieldTag::__task_count),
4229                            "task_count" => Ok(__FieldTag::__task_count),
4230                            "template" => Ok(__FieldTag::__template),
4231                            "reconciling" => Ok(__FieldTag::__reconciling),
4232                            "conditions" => Ok(__FieldTag::__conditions),
4233                            "observedGeneration" => Ok(__FieldTag::__observed_generation),
4234                            "observed_generation" => Ok(__FieldTag::__observed_generation),
4235                            "runningCount" => Ok(__FieldTag::__running_count),
4236                            "running_count" => Ok(__FieldTag::__running_count),
4237                            "succeededCount" => Ok(__FieldTag::__succeeded_count),
4238                            "succeeded_count" => Ok(__FieldTag::__succeeded_count),
4239                            "failedCount" => Ok(__FieldTag::__failed_count),
4240                            "failed_count" => Ok(__FieldTag::__failed_count),
4241                            "cancelledCount" => Ok(__FieldTag::__cancelled_count),
4242                            "cancelled_count" => Ok(__FieldTag::__cancelled_count),
4243                            "retriedCount" => Ok(__FieldTag::__retried_count),
4244                            "retried_count" => Ok(__FieldTag::__retried_count),
4245                            "logUri" => Ok(__FieldTag::__log_uri),
4246                            "log_uri" => Ok(__FieldTag::__log_uri),
4247                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
4248                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
4249                            "etag" => Ok(__FieldTag::__etag),
4250                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4251                        }
4252                    }
4253                }
4254                deserializer.deserialize_identifier(Visitor)
4255            }
4256        }
4257        struct Visitor;
4258        impl<'de> serde::de::Visitor<'de> for Visitor {
4259            type Value = Execution;
4260            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4261                formatter.write_str("struct Execution")
4262            }
4263            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4264            where
4265                A: serde::de::MapAccess<'de>,
4266            {
4267                #[allow(unused_imports)]
4268                use serde::de::Error;
4269                use std::option::Option::Some;
4270                let mut fields = std::collections::HashSet::new();
4271                let mut result = Self::Value::new();
4272                while let Some(tag) = map.next_key::<__FieldTag>()? {
4273                    #[allow(clippy::match_single_binding)]
4274                    match tag {
4275                        __FieldTag::__name => {
4276                            if !fields.insert(__FieldTag::__name) {
4277                                return std::result::Result::Err(A::Error::duplicate_field(
4278                                    "multiple values for name",
4279                                ));
4280                            }
4281                            result.name = map
4282                                .next_value::<std::option::Option<std::string::String>>()?
4283                                .unwrap_or_default();
4284                        }
4285                        __FieldTag::__uid => {
4286                            if !fields.insert(__FieldTag::__uid) {
4287                                return std::result::Result::Err(A::Error::duplicate_field(
4288                                    "multiple values for uid",
4289                                ));
4290                            }
4291                            result.uid = map
4292                                .next_value::<std::option::Option<std::string::String>>()?
4293                                .unwrap_or_default();
4294                        }
4295                        __FieldTag::__creator => {
4296                            if !fields.insert(__FieldTag::__creator) {
4297                                return std::result::Result::Err(A::Error::duplicate_field(
4298                                    "multiple values for creator",
4299                                ));
4300                            }
4301                            result.creator = map
4302                                .next_value::<std::option::Option<std::string::String>>()?
4303                                .unwrap_or_default();
4304                        }
4305                        __FieldTag::__generation => {
4306                            if !fields.insert(__FieldTag::__generation) {
4307                                return std::result::Result::Err(A::Error::duplicate_field(
4308                                    "multiple values for generation",
4309                                ));
4310                            }
4311                            struct __With(std::option::Option<i64>);
4312                            impl<'de> serde::de::Deserialize<'de> for __With {
4313                                fn deserialize<D>(
4314                                    deserializer: D,
4315                                ) -> std::result::Result<Self, D::Error>
4316                                where
4317                                    D: serde::de::Deserializer<'de>,
4318                                {
4319                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
4320                                }
4321                            }
4322                            result.generation = map.next_value::<__With>()?.0.unwrap_or_default();
4323                        }
4324                        __FieldTag::__labels => {
4325                            if !fields.insert(__FieldTag::__labels) {
4326                                return std::result::Result::Err(A::Error::duplicate_field(
4327                                    "multiple values for labels",
4328                                ));
4329                            }
4330                            result.labels = map
4331                                .next_value::<std::option::Option<
4332                                    std::collections::HashMap<
4333                                        std::string::String,
4334                                        std::string::String,
4335                                    >,
4336                                >>()?
4337                                .unwrap_or_default();
4338                        }
4339                        __FieldTag::__annotations => {
4340                            if !fields.insert(__FieldTag::__annotations) {
4341                                return std::result::Result::Err(A::Error::duplicate_field(
4342                                    "multiple values for annotations",
4343                                ));
4344                            }
4345                            result.annotations = map
4346                                .next_value::<std::option::Option<
4347                                    std::collections::HashMap<
4348                                        std::string::String,
4349                                        std::string::String,
4350                                    >,
4351                                >>()?
4352                                .unwrap_or_default();
4353                        }
4354                        __FieldTag::__create_time => {
4355                            if !fields.insert(__FieldTag::__create_time) {
4356                                return std::result::Result::Err(A::Error::duplicate_field(
4357                                    "multiple values for create_time",
4358                                ));
4359                            }
4360                            result.create_time =
4361                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
4362                        }
4363                        __FieldTag::__start_time => {
4364                            if !fields.insert(__FieldTag::__start_time) {
4365                                return std::result::Result::Err(A::Error::duplicate_field(
4366                                    "multiple values for start_time",
4367                                ));
4368                            }
4369                            result.start_time =
4370                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
4371                        }
4372                        __FieldTag::__completion_time => {
4373                            if !fields.insert(__FieldTag::__completion_time) {
4374                                return std::result::Result::Err(A::Error::duplicate_field(
4375                                    "multiple values for completion_time",
4376                                ));
4377                            }
4378                            result.completion_time =
4379                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
4380                        }
4381                        __FieldTag::__update_time => {
4382                            if !fields.insert(__FieldTag::__update_time) {
4383                                return std::result::Result::Err(A::Error::duplicate_field(
4384                                    "multiple values for update_time",
4385                                ));
4386                            }
4387                            result.update_time =
4388                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
4389                        }
4390                        __FieldTag::__delete_time => {
4391                            if !fields.insert(__FieldTag::__delete_time) {
4392                                return std::result::Result::Err(A::Error::duplicate_field(
4393                                    "multiple values for delete_time",
4394                                ));
4395                            }
4396                            result.delete_time =
4397                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
4398                        }
4399                        __FieldTag::__expire_time => {
4400                            if !fields.insert(__FieldTag::__expire_time) {
4401                                return std::result::Result::Err(A::Error::duplicate_field(
4402                                    "multiple values for expire_time",
4403                                ));
4404                            }
4405                            result.expire_time =
4406                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
4407                        }
4408                        __FieldTag::__launch_stage => {
4409                            if !fields.insert(__FieldTag::__launch_stage) {
4410                                return std::result::Result::Err(A::Error::duplicate_field(
4411                                    "multiple values for launch_stage",
4412                                ));
4413                            }
4414                            result.launch_stage = map
4415                                .next_value::<std::option::Option<api::model::LaunchStage>>()?
4416                                .unwrap_or_default();
4417                        }
4418                        __FieldTag::__job => {
4419                            if !fields.insert(__FieldTag::__job) {
4420                                return std::result::Result::Err(A::Error::duplicate_field(
4421                                    "multiple values for job",
4422                                ));
4423                            }
4424                            result.job = map
4425                                .next_value::<std::option::Option<std::string::String>>()?
4426                                .unwrap_or_default();
4427                        }
4428                        __FieldTag::__parallelism => {
4429                            if !fields.insert(__FieldTag::__parallelism) {
4430                                return std::result::Result::Err(A::Error::duplicate_field(
4431                                    "multiple values for parallelism",
4432                                ));
4433                            }
4434                            struct __With(std::option::Option<i32>);
4435                            impl<'de> serde::de::Deserialize<'de> for __With {
4436                                fn deserialize<D>(
4437                                    deserializer: D,
4438                                ) -> std::result::Result<Self, D::Error>
4439                                where
4440                                    D: serde::de::Deserializer<'de>,
4441                                {
4442                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4443                                }
4444                            }
4445                            result.parallelism = map.next_value::<__With>()?.0.unwrap_or_default();
4446                        }
4447                        __FieldTag::__task_count => {
4448                            if !fields.insert(__FieldTag::__task_count) {
4449                                return std::result::Result::Err(A::Error::duplicate_field(
4450                                    "multiple values for task_count",
4451                                ));
4452                            }
4453                            struct __With(std::option::Option<i32>);
4454                            impl<'de> serde::de::Deserialize<'de> for __With {
4455                                fn deserialize<D>(
4456                                    deserializer: D,
4457                                ) -> std::result::Result<Self, D::Error>
4458                                where
4459                                    D: serde::de::Deserializer<'de>,
4460                                {
4461                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4462                                }
4463                            }
4464                            result.task_count = map.next_value::<__With>()?.0.unwrap_or_default();
4465                        }
4466                        __FieldTag::__template => {
4467                            if !fields.insert(__FieldTag::__template) {
4468                                return std::result::Result::Err(A::Error::duplicate_field(
4469                                    "multiple values for template",
4470                                ));
4471                            }
4472                            result.template = map
4473                                .next_value::<std::option::Option<crate::model::TaskTemplate>>()?;
4474                        }
4475                        __FieldTag::__reconciling => {
4476                            if !fields.insert(__FieldTag::__reconciling) {
4477                                return std::result::Result::Err(A::Error::duplicate_field(
4478                                    "multiple values for reconciling",
4479                                ));
4480                            }
4481                            result.reconciling = map
4482                                .next_value::<std::option::Option<bool>>()?
4483                                .unwrap_or_default();
4484                        }
4485                        __FieldTag::__conditions => {
4486                            if !fields.insert(__FieldTag::__conditions) {
4487                                return std::result::Result::Err(A::Error::duplicate_field(
4488                                    "multiple values for conditions",
4489                                ));
4490                            }
4491                            result.conditions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Condition>>>()?.unwrap_or_default();
4492                        }
4493                        __FieldTag::__observed_generation => {
4494                            if !fields.insert(__FieldTag::__observed_generation) {
4495                                return std::result::Result::Err(A::Error::duplicate_field(
4496                                    "multiple values for observed_generation",
4497                                ));
4498                            }
4499                            struct __With(std::option::Option<i64>);
4500                            impl<'de> serde::de::Deserialize<'de> for __With {
4501                                fn deserialize<D>(
4502                                    deserializer: D,
4503                                ) -> std::result::Result<Self, D::Error>
4504                                where
4505                                    D: serde::de::Deserializer<'de>,
4506                                {
4507                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
4508                                }
4509                            }
4510                            result.observed_generation =
4511                                map.next_value::<__With>()?.0.unwrap_or_default();
4512                        }
4513                        __FieldTag::__running_count => {
4514                            if !fields.insert(__FieldTag::__running_count) {
4515                                return std::result::Result::Err(A::Error::duplicate_field(
4516                                    "multiple values for running_count",
4517                                ));
4518                            }
4519                            struct __With(std::option::Option<i32>);
4520                            impl<'de> serde::de::Deserialize<'de> for __With {
4521                                fn deserialize<D>(
4522                                    deserializer: D,
4523                                ) -> std::result::Result<Self, D::Error>
4524                                where
4525                                    D: serde::de::Deserializer<'de>,
4526                                {
4527                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4528                                }
4529                            }
4530                            result.running_count =
4531                                map.next_value::<__With>()?.0.unwrap_or_default();
4532                        }
4533                        __FieldTag::__succeeded_count => {
4534                            if !fields.insert(__FieldTag::__succeeded_count) {
4535                                return std::result::Result::Err(A::Error::duplicate_field(
4536                                    "multiple values for succeeded_count",
4537                                ));
4538                            }
4539                            struct __With(std::option::Option<i32>);
4540                            impl<'de> serde::de::Deserialize<'de> for __With {
4541                                fn deserialize<D>(
4542                                    deserializer: D,
4543                                ) -> std::result::Result<Self, D::Error>
4544                                where
4545                                    D: serde::de::Deserializer<'de>,
4546                                {
4547                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4548                                }
4549                            }
4550                            result.succeeded_count =
4551                                map.next_value::<__With>()?.0.unwrap_or_default();
4552                        }
4553                        __FieldTag::__failed_count => {
4554                            if !fields.insert(__FieldTag::__failed_count) {
4555                                return std::result::Result::Err(A::Error::duplicate_field(
4556                                    "multiple values for failed_count",
4557                                ));
4558                            }
4559                            struct __With(std::option::Option<i32>);
4560                            impl<'de> serde::de::Deserialize<'de> for __With {
4561                                fn deserialize<D>(
4562                                    deserializer: D,
4563                                ) -> std::result::Result<Self, D::Error>
4564                                where
4565                                    D: serde::de::Deserializer<'de>,
4566                                {
4567                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4568                                }
4569                            }
4570                            result.failed_count = map.next_value::<__With>()?.0.unwrap_or_default();
4571                        }
4572                        __FieldTag::__cancelled_count => {
4573                            if !fields.insert(__FieldTag::__cancelled_count) {
4574                                return std::result::Result::Err(A::Error::duplicate_field(
4575                                    "multiple values for cancelled_count",
4576                                ));
4577                            }
4578                            struct __With(std::option::Option<i32>);
4579                            impl<'de> serde::de::Deserialize<'de> for __With {
4580                                fn deserialize<D>(
4581                                    deserializer: D,
4582                                ) -> std::result::Result<Self, D::Error>
4583                                where
4584                                    D: serde::de::Deserializer<'de>,
4585                                {
4586                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4587                                }
4588                            }
4589                            result.cancelled_count =
4590                                map.next_value::<__With>()?.0.unwrap_or_default();
4591                        }
4592                        __FieldTag::__retried_count => {
4593                            if !fields.insert(__FieldTag::__retried_count) {
4594                                return std::result::Result::Err(A::Error::duplicate_field(
4595                                    "multiple values for retried_count",
4596                                ));
4597                            }
4598                            struct __With(std::option::Option<i32>);
4599                            impl<'de> serde::de::Deserialize<'de> for __With {
4600                                fn deserialize<D>(
4601                                    deserializer: D,
4602                                ) -> std::result::Result<Self, D::Error>
4603                                where
4604                                    D: serde::de::Deserializer<'de>,
4605                                {
4606                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4607                                }
4608                            }
4609                            result.retried_count =
4610                                map.next_value::<__With>()?.0.unwrap_or_default();
4611                        }
4612                        __FieldTag::__log_uri => {
4613                            if !fields.insert(__FieldTag::__log_uri) {
4614                                return std::result::Result::Err(A::Error::duplicate_field(
4615                                    "multiple values for log_uri",
4616                                ));
4617                            }
4618                            result.log_uri = map
4619                                .next_value::<std::option::Option<std::string::String>>()?
4620                                .unwrap_or_default();
4621                        }
4622                        __FieldTag::__satisfies_pzs => {
4623                            if !fields.insert(__FieldTag::__satisfies_pzs) {
4624                                return std::result::Result::Err(A::Error::duplicate_field(
4625                                    "multiple values for satisfies_pzs",
4626                                ));
4627                            }
4628                            result.satisfies_pzs = map
4629                                .next_value::<std::option::Option<bool>>()?
4630                                .unwrap_or_default();
4631                        }
4632                        __FieldTag::__etag => {
4633                            if !fields.insert(__FieldTag::__etag) {
4634                                return std::result::Result::Err(A::Error::duplicate_field(
4635                                    "multiple values for etag",
4636                                ));
4637                            }
4638                            result.etag = map
4639                                .next_value::<std::option::Option<std::string::String>>()?
4640                                .unwrap_or_default();
4641                        }
4642                        __FieldTag::Unknown(key) => {
4643                            let value = map.next_value::<serde_json::Value>()?;
4644                            result._unknown_fields.insert(key, value);
4645                        }
4646                    }
4647                }
4648                std::result::Result::Ok(result)
4649            }
4650        }
4651        deserializer.deserialize_any(Visitor)
4652    }
4653}
4654
4655#[doc(hidden)]
4656impl serde::ser::Serialize for Execution {
4657    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4658    where
4659        S: serde::ser::Serializer,
4660    {
4661        use serde::ser::SerializeMap;
4662        #[allow(unused_imports)]
4663        use std::option::Option::Some;
4664        let mut state = serializer.serialize_map(std::option::Option::None)?;
4665        if !self.name.is_empty() {
4666            state.serialize_entry("name", &self.name)?;
4667        }
4668        if !self.uid.is_empty() {
4669            state.serialize_entry("uid", &self.uid)?;
4670        }
4671        if !self.creator.is_empty() {
4672            state.serialize_entry("creator", &self.creator)?;
4673        }
4674        if !wkt::internal::is_default(&self.generation) {
4675            struct __With<'a>(&'a i64);
4676            impl<'a> serde::ser::Serialize for __With<'a> {
4677                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4678                where
4679                    S: serde::ser::Serializer,
4680                {
4681                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
4682                }
4683            }
4684            state.serialize_entry("generation", &__With(&self.generation))?;
4685        }
4686        if !self.labels.is_empty() {
4687            state.serialize_entry("labels", &self.labels)?;
4688        }
4689        if !self.annotations.is_empty() {
4690            state.serialize_entry("annotations", &self.annotations)?;
4691        }
4692        if self.create_time.is_some() {
4693            state.serialize_entry("createTime", &self.create_time)?;
4694        }
4695        if self.start_time.is_some() {
4696            state.serialize_entry("startTime", &self.start_time)?;
4697        }
4698        if self.completion_time.is_some() {
4699            state.serialize_entry("completionTime", &self.completion_time)?;
4700        }
4701        if self.update_time.is_some() {
4702            state.serialize_entry("updateTime", &self.update_time)?;
4703        }
4704        if self.delete_time.is_some() {
4705            state.serialize_entry("deleteTime", &self.delete_time)?;
4706        }
4707        if self.expire_time.is_some() {
4708            state.serialize_entry("expireTime", &self.expire_time)?;
4709        }
4710        if !wkt::internal::is_default(&self.launch_stage) {
4711            state.serialize_entry("launchStage", &self.launch_stage)?;
4712        }
4713        if !self.job.is_empty() {
4714            state.serialize_entry("job", &self.job)?;
4715        }
4716        if !wkt::internal::is_default(&self.parallelism) {
4717            struct __With<'a>(&'a i32);
4718            impl<'a> serde::ser::Serialize for __With<'a> {
4719                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4720                where
4721                    S: serde::ser::Serializer,
4722                {
4723                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4724                }
4725            }
4726            state.serialize_entry("parallelism", &__With(&self.parallelism))?;
4727        }
4728        if !wkt::internal::is_default(&self.task_count) {
4729            struct __With<'a>(&'a i32);
4730            impl<'a> serde::ser::Serialize for __With<'a> {
4731                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4732                where
4733                    S: serde::ser::Serializer,
4734                {
4735                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4736                }
4737            }
4738            state.serialize_entry("taskCount", &__With(&self.task_count))?;
4739        }
4740        if self.template.is_some() {
4741            state.serialize_entry("template", &self.template)?;
4742        }
4743        if !wkt::internal::is_default(&self.reconciling) {
4744            state.serialize_entry("reconciling", &self.reconciling)?;
4745        }
4746        if !self.conditions.is_empty() {
4747            state.serialize_entry("conditions", &self.conditions)?;
4748        }
4749        if !wkt::internal::is_default(&self.observed_generation) {
4750            struct __With<'a>(&'a i64);
4751            impl<'a> serde::ser::Serialize for __With<'a> {
4752                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4753                where
4754                    S: serde::ser::Serializer,
4755                {
4756                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
4757                }
4758            }
4759            state.serialize_entry("observedGeneration", &__With(&self.observed_generation))?;
4760        }
4761        if !wkt::internal::is_default(&self.running_count) {
4762            struct __With<'a>(&'a i32);
4763            impl<'a> serde::ser::Serialize for __With<'a> {
4764                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4765                where
4766                    S: serde::ser::Serializer,
4767                {
4768                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4769                }
4770            }
4771            state.serialize_entry("runningCount", &__With(&self.running_count))?;
4772        }
4773        if !wkt::internal::is_default(&self.succeeded_count) {
4774            struct __With<'a>(&'a i32);
4775            impl<'a> serde::ser::Serialize for __With<'a> {
4776                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4777                where
4778                    S: serde::ser::Serializer,
4779                {
4780                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4781                }
4782            }
4783            state.serialize_entry("succeededCount", &__With(&self.succeeded_count))?;
4784        }
4785        if !wkt::internal::is_default(&self.failed_count) {
4786            struct __With<'a>(&'a i32);
4787            impl<'a> serde::ser::Serialize for __With<'a> {
4788                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4789                where
4790                    S: serde::ser::Serializer,
4791                {
4792                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4793                }
4794            }
4795            state.serialize_entry("failedCount", &__With(&self.failed_count))?;
4796        }
4797        if !wkt::internal::is_default(&self.cancelled_count) {
4798            struct __With<'a>(&'a i32);
4799            impl<'a> serde::ser::Serialize for __With<'a> {
4800                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4801                where
4802                    S: serde::ser::Serializer,
4803                {
4804                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4805                }
4806            }
4807            state.serialize_entry("cancelledCount", &__With(&self.cancelled_count))?;
4808        }
4809        if !wkt::internal::is_default(&self.retried_count) {
4810            struct __With<'a>(&'a i32);
4811            impl<'a> serde::ser::Serialize for __With<'a> {
4812                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4813                where
4814                    S: serde::ser::Serializer,
4815                {
4816                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4817                }
4818            }
4819            state.serialize_entry("retriedCount", &__With(&self.retried_count))?;
4820        }
4821        if !self.log_uri.is_empty() {
4822            state.serialize_entry("logUri", &self.log_uri)?;
4823        }
4824        if !wkt::internal::is_default(&self.satisfies_pzs) {
4825            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
4826        }
4827        if !self.etag.is_empty() {
4828            state.serialize_entry("etag", &self.etag)?;
4829        }
4830        if !self._unknown_fields.is_empty() {
4831            for (key, value) in self._unknown_fields.iter() {
4832                state.serialize_entry(key, &value)?;
4833            }
4834        }
4835        state.end()
4836    }
4837}
4838
4839impl std::fmt::Debug for Execution {
4840    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4841        let mut debug_struct = f.debug_struct("Execution");
4842        debug_struct.field("name", &self.name);
4843        debug_struct.field("uid", &self.uid);
4844        debug_struct.field("creator", &self.creator);
4845        debug_struct.field("generation", &self.generation);
4846        debug_struct.field("labels", &self.labels);
4847        debug_struct.field("annotations", &self.annotations);
4848        debug_struct.field("create_time", &self.create_time);
4849        debug_struct.field("start_time", &self.start_time);
4850        debug_struct.field("completion_time", &self.completion_time);
4851        debug_struct.field("update_time", &self.update_time);
4852        debug_struct.field("delete_time", &self.delete_time);
4853        debug_struct.field("expire_time", &self.expire_time);
4854        debug_struct.field("launch_stage", &self.launch_stage);
4855        debug_struct.field("job", &self.job);
4856        debug_struct.field("parallelism", &self.parallelism);
4857        debug_struct.field("task_count", &self.task_count);
4858        debug_struct.field("template", &self.template);
4859        debug_struct.field("reconciling", &self.reconciling);
4860        debug_struct.field("conditions", &self.conditions);
4861        debug_struct.field("observed_generation", &self.observed_generation);
4862        debug_struct.field("running_count", &self.running_count);
4863        debug_struct.field("succeeded_count", &self.succeeded_count);
4864        debug_struct.field("failed_count", &self.failed_count);
4865        debug_struct.field("cancelled_count", &self.cancelled_count);
4866        debug_struct.field("retried_count", &self.retried_count);
4867        debug_struct.field("log_uri", &self.log_uri);
4868        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
4869        debug_struct.field("etag", &self.etag);
4870        if !self._unknown_fields.is_empty() {
4871            debug_struct.field("_unknown_fields", &self._unknown_fields);
4872        }
4873        debug_struct.finish()
4874    }
4875}
4876
4877/// ExecutionTemplate describes the data an execution should have when created
4878/// from a template.
4879#[derive(Clone, Default, PartialEq)]
4880#[non_exhaustive]
4881pub struct ExecutionTemplate {
4882    /// Unstructured key value map that can be used to organize and categorize
4883    /// objects.
4884    /// User-provided labels are shared with Google's billing system, so they can
4885    /// be used to filter, or break down billing charges by team, component,
4886    /// environment, state, etc. For more information, visit
4887    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
4888    /// <https://cloud.google.com/run/docs/configuring/labels>.
4889    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4890
4891    /// Unstructured key value map that may be set by external tools to store and
4892    /// arbitrary metadata. They are not queryable and should be preserved
4893    /// when modifying objects.
4894    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
4895
4896    /// Optional. Specifies the maximum desired number of tasks the execution
4897    /// should run at given time. When the job is run, if this field is 0 or unset,
4898    /// the maximum possible value will be used for that execution. The actual
4899    /// number of tasks running in steady state will be less than this number when
4900    /// there are fewer tasks waiting to be completed remaining, i.e. when the work
4901    /// left to do is less than max parallelism.
4902    pub parallelism: i32,
4903
4904    /// Specifies the desired number of tasks the execution should run.
4905    /// Setting to 1 means that parallelism is limited to 1 and the success of
4906    /// that task signals the success of the execution. Defaults to 1.
4907    pub task_count: i32,
4908
4909    /// Required. Describes the task(s) that will be created when executing an
4910    /// execution.
4911    pub template: std::option::Option<crate::model::TaskTemplate>,
4912
4913    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4914}
4915
4916impl ExecutionTemplate {
4917    pub fn new() -> Self {
4918        std::default::Default::default()
4919    }
4920
4921    /// Sets the value of [labels][crate::model::ExecutionTemplate::labels].
4922    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4923    where
4924        T: std::iter::IntoIterator<Item = (K, V)>,
4925        K: std::convert::Into<std::string::String>,
4926        V: std::convert::Into<std::string::String>,
4927    {
4928        use std::iter::Iterator;
4929        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4930        self
4931    }
4932
4933    /// Sets the value of [annotations][crate::model::ExecutionTemplate::annotations].
4934    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
4935    where
4936        T: std::iter::IntoIterator<Item = (K, V)>,
4937        K: std::convert::Into<std::string::String>,
4938        V: std::convert::Into<std::string::String>,
4939    {
4940        use std::iter::Iterator;
4941        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4942        self
4943    }
4944
4945    /// Sets the value of [parallelism][crate::model::ExecutionTemplate::parallelism].
4946    pub fn set_parallelism<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4947        self.parallelism = v.into();
4948        self
4949    }
4950
4951    /// Sets the value of [task_count][crate::model::ExecutionTemplate::task_count].
4952    pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4953        self.task_count = v.into();
4954        self
4955    }
4956
4957    /// Sets the value of [template][crate::model::ExecutionTemplate::template].
4958    pub fn set_template<T>(mut self, v: T) -> Self
4959    where
4960        T: std::convert::Into<crate::model::TaskTemplate>,
4961    {
4962        self.template = std::option::Option::Some(v.into());
4963        self
4964    }
4965
4966    /// Sets or clears the value of [template][crate::model::ExecutionTemplate::template].
4967    pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
4968    where
4969        T: std::convert::Into<crate::model::TaskTemplate>,
4970    {
4971        self.template = v.map(|x| x.into());
4972        self
4973    }
4974}
4975
4976impl wkt::message::Message for ExecutionTemplate {
4977    fn typename() -> &'static str {
4978        "type.googleapis.com/google.cloud.run.v2.ExecutionTemplate"
4979    }
4980}
4981
4982#[doc(hidden)]
4983impl<'de> serde::de::Deserialize<'de> for ExecutionTemplate {
4984    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4985    where
4986        D: serde::Deserializer<'de>,
4987    {
4988        #[allow(non_camel_case_types)]
4989        #[doc(hidden)]
4990        #[derive(PartialEq, Eq, Hash)]
4991        enum __FieldTag {
4992            __labels,
4993            __annotations,
4994            __parallelism,
4995            __task_count,
4996            __template,
4997            Unknown(std::string::String),
4998        }
4999        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5000            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5001            where
5002                D: serde::Deserializer<'de>,
5003            {
5004                struct Visitor;
5005                impl<'de> serde::de::Visitor<'de> for Visitor {
5006                    type Value = __FieldTag;
5007                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5008                        formatter.write_str("a field name for ExecutionTemplate")
5009                    }
5010                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5011                    where
5012                        E: serde::de::Error,
5013                    {
5014                        use std::result::Result::Ok;
5015                        use std::string::ToString;
5016                        match value {
5017                            "labels" => Ok(__FieldTag::__labels),
5018                            "annotations" => Ok(__FieldTag::__annotations),
5019                            "parallelism" => Ok(__FieldTag::__parallelism),
5020                            "taskCount" => Ok(__FieldTag::__task_count),
5021                            "task_count" => Ok(__FieldTag::__task_count),
5022                            "template" => Ok(__FieldTag::__template),
5023                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5024                        }
5025                    }
5026                }
5027                deserializer.deserialize_identifier(Visitor)
5028            }
5029        }
5030        struct Visitor;
5031        impl<'de> serde::de::Visitor<'de> for Visitor {
5032            type Value = ExecutionTemplate;
5033            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5034                formatter.write_str("struct ExecutionTemplate")
5035            }
5036            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5037            where
5038                A: serde::de::MapAccess<'de>,
5039            {
5040                #[allow(unused_imports)]
5041                use serde::de::Error;
5042                use std::option::Option::Some;
5043                let mut fields = std::collections::HashSet::new();
5044                let mut result = Self::Value::new();
5045                while let Some(tag) = map.next_key::<__FieldTag>()? {
5046                    #[allow(clippy::match_single_binding)]
5047                    match tag {
5048                        __FieldTag::__labels => {
5049                            if !fields.insert(__FieldTag::__labels) {
5050                                return std::result::Result::Err(A::Error::duplicate_field(
5051                                    "multiple values for labels",
5052                                ));
5053                            }
5054                            result.labels = map
5055                                .next_value::<std::option::Option<
5056                                    std::collections::HashMap<
5057                                        std::string::String,
5058                                        std::string::String,
5059                                    >,
5060                                >>()?
5061                                .unwrap_or_default();
5062                        }
5063                        __FieldTag::__annotations => {
5064                            if !fields.insert(__FieldTag::__annotations) {
5065                                return std::result::Result::Err(A::Error::duplicate_field(
5066                                    "multiple values for annotations",
5067                                ));
5068                            }
5069                            result.annotations = map
5070                                .next_value::<std::option::Option<
5071                                    std::collections::HashMap<
5072                                        std::string::String,
5073                                        std::string::String,
5074                                    >,
5075                                >>()?
5076                                .unwrap_or_default();
5077                        }
5078                        __FieldTag::__parallelism => {
5079                            if !fields.insert(__FieldTag::__parallelism) {
5080                                return std::result::Result::Err(A::Error::duplicate_field(
5081                                    "multiple values for parallelism",
5082                                ));
5083                            }
5084                            struct __With(std::option::Option<i32>);
5085                            impl<'de> serde::de::Deserialize<'de> for __With {
5086                                fn deserialize<D>(
5087                                    deserializer: D,
5088                                ) -> std::result::Result<Self, D::Error>
5089                                where
5090                                    D: serde::de::Deserializer<'de>,
5091                                {
5092                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5093                                }
5094                            }
5095                            result.parallelism = map.next_value::<__With>()?.0.unwrap_or_default();
5096                        }
5097                        __FieldTag::__task_count => {
5098                            if !fields.insert(__FieldTag::__task_count) {
5099                                return std::result::Result::Err(A::Error::duplicate_field(
5100                                    "multiple values for task_count",
5101                                ));
5102                            }
5103                            struct __With(std::option::Option<i32>);
5104                            impl<'de> serde::de::Deserialize<'de> for __With {
5105                                fn deserialize<D>(
5106                                    deserializer: D,
5107                                ) -> std::result::Result<Self, D::Error>
5108                                where
5109                                    D: serde::de::Deserializer<'de>,
5110                                {
5111                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5112                                }
5113                            }
5114                            result.task_count = map.next_value::<__With>()?.0.unwrap_or_default();
5115                        }
5116                        __FieldTag::__template => {
5117                            if !fields.insert(__FieldTag::__template) {
5118                                return std::result::Result::Err(A::Error::duplicate_field(
5119                                    "multiple values for template",
5120                                ));
5121                            }
5122                            result.template = map
5123                                .next_value::<std::option::Option<crate::model::TaskTemplate>>()?;
5124                        }
5125                        __FieldTag::Unknown(key) => {
5126                            let value = map.next_value::<serde_json::Value>()?;
5127                            result._unknown_fields.insert(key, value);
5128                        }
5129                    }
5130                }
5131                std::result::Result::Ok(result)
5132            }
5133        }
5134        deserializer.deserialize_any(Visitor)
5135    }
5136}
5137
5138#[doc(hidden)]
5139impl serde::ser::Serialize for ExecutionTemplate {
5140    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5141    where
5142        S: serde::ser::Serializer,
5143    {
5144        use serde::ser::SerializeMap;
5145        #[allow(unused_imports)]
5146        use std::option::Option::Some;
5147        let mut state = serializer.serialize_map(std::option::Option::None)?;
5148        if !self.labels.is_empty() {
5149            state.serialize_entry("labels", &self.labels)?;
5150        }
5151        if !self.annotations.is_empty() {
5152            state.serialize_entry("annotations", &self.annotations)?;
5153        }
5154        if !wkt::internal::is_default(&self.parallelism) {
5155            struct __With<'a>(&'a i32);
5156            impl<'a> serde::ser::Serialize for __With<'a> {
5157                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5158                where
5159                    S: serde::ser::Serializer,
5160                {
5161                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5162                }
5163            }
5164            state.serialize_entry("parallelism", &__With(&self.parallelism))?;
5165        }
5166        if !wkt::internal::is_default(&self.task_count) {
5167            struct __With<'a>(&'a i32);
5168            impl<'a> serde::ser::Serialize for __With<'a> {
5169                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5170                where
5171                    S: serde::ser::Serializer,
5172                {
5173                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5174                }
5175            }
5176            state.serialize_entry("taskCount", &__With(&self.task_count))?;
5177        }
5178        if self.template.is_some() {
5179            state.serialize_entry("template", &self.template)?;
5180        }
5181        if !self._unknown_fields.is_empty() {
5182            for (key, value) in self._unknown_fields.iter() {
5183                state.serialize_entry(key, &value)?;
5184            }
5185        }
5186        state.end()
5187    }
5188}
5189
5190impl std::fmt::Debug for ExecutionTemplate {
5191    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5192        let mut debug_struct = f.debug_struct("ExecutionTemplate");
5193        debug_struct.field("labels", &self.labels);
5194        debug_struct.field("annotations", &self.annotations);
5195        debug_struct.field("parallelism", &self.parallelism);
5196        debug_struct.field("task_count", &self.task_count);
5197        debug_struct.field("template", &self.template);
5198        if !self._unknown_fields.is_empty() {
5199            debug_struct.field("_unknown_fields", &self._unknown_fields);
5200        }
5201        debug_struct.finish()
5202    }
5203}
5204
5205/// Holds a single instance split entry for the Worker. Allocations can be done
5206/// to a specific Revision name, or pointing to the latest Ready Revision.
5207#[derive(Clone, Default, PartialEq)]
5208#[non_exhaustive]
5209pub struct InstanceSplit {
5210    /// The allocation type for this instance split.
5211    pub r#type: crate::model::InstanceSplitAllocationType,
5212
5213    /// Revision to which to assign this portion of instances, if split allocation
5214    /// is by revision.
5215    pub revision: std::string::String,
5216
5217    /// Specifies percent of the instance split to this Revision.
5218    /// This defaults to zero if unspecified.
5219    pub percent: i32,
5220
5221    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5222}
5223
5224impl InstanceSplit {
5225    pub fn new() -> Self {
5226        std::default::Default::default()
5227    }
5228
5229    /// Sets the value of [r#type][crate::model::InstanceSplit::type].
5230    pub fn set_type<T: std::convert::Into<crate::model::InstanceSplitAllocationType>>(
5231        mut self,
5232        v: T,
5233    ) -> Self {
5234        self.r#type = v.into();
5235        self
5236    }
5237
5238    /// Sets the value of [revision][crate::model::InstanceSplit::revision].
5239    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5240        self.revision = v.into();
5241        self
5242    }
5243
5244    /// Sets the value of [percent][crate::model::InstanceSplit::percent].
5245    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5246        self.percent = v.into();
5247        self
5248    }
5249}
5250
5251impl wkt::message::Message for InstanceSplit {
5252    fn typename() -> &'static str {
5253        "type.googleapis.com/google.cloud.run.v2.InstanceSplit"
5254    }
5255}
5256
5257#[doc(hidden)]
5258impl<'de> serde::de::Deserialize<'de> for InstanceSplit {
5259    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5260    where
5261        D: serde::Deserializer<'de>,
5262    {
5263        #[allow(non_camel_case_types)]
5264        #[doc(hidden)]
5265        #[derive(PartialEq, Eq, Hash)]
5266        enum __FieldTag {
5267            __type,
5268            __revision,
5269            __percent,
5270            Unknown(std::string::String),
5271        }
5272        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5273            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5274            where
5275                D: serde::Deserializer<'de>,
5276            {
5277                struct Visitor;
5278                impl<'de> serde::de::Visitor<'de> for Visitor {
5279                    type Value = __FieldTag;
5280                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5281                        formatter.write_str("a field name for InstanceSplit")
5282                    }
5283                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5284                    where
5285                        E: serde::de::Error,
5286                    {
5287                        use std::result::Result::Ok;
5288                        use std::string::ToString;
5289                        match value {
5290                            "type" => Ok(__FieldTag::__type),
5291                            "revision" => Ok(__FieldTag::__revision),
5292                            "percent" => Ok(__FieldTag::__percent),
5293                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5294                        }
5295                    }
5296                }
5297                deserializer.deserialize_identifier(Visitor)
5298            }
5299        }
5300        struct Visitor;
5301        impl<'de> serde::de::Visitor<'de> for Visitor {
5302            type Value = InstanceSplit;
5303            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5304                formatter.write_str("struct InstanceSplit")
5305            }
5306            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5307            where
5308                A: serde::de::MapAccess<'de>,
5309            {
5310                #[allow(unused_imports)]
5311                use serde::de::Error;
5312                use std::option::Option::Some;
5313                let mut fields = std::collections::HashSet::new();
5314                let mut result = Self::Value::new();
5315                while let Some(tag) = map.next_key::<__FieldTag>()? {
5316                    #[allow(clippy::match_single_binding)]
5317                    match tag {
5318                        __FieldTag::__type => {
5319                            if !fields.insert(__FieldTag::__type) {
5320                                return std::result::Result::Err(A::Error::duplicate_field(
5321                                    "multiple values for type",
5322                                ));
5323                            }
5324                            result.r#type = map.next_value::<std::option::Option<crate::model::InstanceSplitAllocationType>>()?.unwrap_or_default();
5325                        }
5326                        __FieldTag::__revision => {
5327                            if !fields.insert(__FieldTag::__revision) {
5328                                return std::result::Result::Err(A::Error::duplicate_field(
5329                                    "multiple values for revision",
5330                                ));
5331                            }
5332                            result.revision = map
5333                                .next_value::<std::option::Option<std::string::String>>()?
5334                                .unwrap_or_default();
5335                        }
5336                        __FieldTag::__percent => {
5337                            if !fields.insert(__FieldTag::__percent) {
5338                                return std::result::Result::Err(A::Error::duplicate_field(
5339                                    "multiple values for percent",
5340                                ));
5341                            }
5342                            struct __With(std::option::Option<i32>);
5343                            impl<'de> serde::de::Deserialize<'de> for __With {
5344                                fn deserialize<D>(
5345                                    deserializer: D,
5346                                ) -> std::result::Result<Self, D::Error>
5347                                where
5348                                    D: serde::de::Deserializer<'de>,
5349                                {
5350                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5351                                }
5352                            }
5353                            result.percent = map.next_value::<__With>()?.0.unwrap_or_default();
5354                        }
5355                        __FieldTag::Unknown(key) => {
5356                            let value = map.next_value::<serde_json::Value>()?;
5357                            result._unknown_fields.insert(key, value);
5358                        }
5359                    }
5360                }
5361                std::result::Result::Ok(result)
5362            }
5363        }
5364        deserializer.deserialize_any(Visitor)
5365    }
5366}
5367
5368#[doc(hidden)]
5369impl serde::ser::Serialize for InstanceSplit {
5370    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5371    where
5372        S: serde::ser::Serializer,
5373    {
5374        use serde::ser::SerializeMap;
5375        #[allow(unused_imports)]
5376        use std::option::Option::Some;
5377        let mut state = serializer.serialize_map(std::option::Option::None)?;
5378        if !wkt::internal::is_default(&self.r#type) {
5379            state.serialize_entry("type", &self.r#type)?;
5380        }
5381        if !self.revision.is_empty() {
5382            state.serialize_entry("revision", &self.revision)?;
5383        }
5384        if !wkt::internal::is_default(&self.percent) {
5385            struct __With<'a>(&'a i32);
5386            impl<'a> serde::ser::Serialize for __With<'a> {
5387                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5388                where
5389                    S: serde::ser::Serializer,
5390                {
5391                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5392                }
5393            }
5394            state.serialize_entry("percent", &__With(&self.percent))?;
5395        }
5396        if !self._unknown_fields.is_empty() {
5397            for (key, value) in self._unknown_fields.iter() {
5398                state.serialize_entry(key, &value)?;
5399            }
5400        }
5401        state.end()
5402    }
5403}
5404
5405impl std::fmt::Debug for InstanceSplit {
5406    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5407        let mut debug_struct = f.debug_struct("InstanceSplit");
5408        debug_struct.field("r#type", &self.r#type);
5409        debug_struct.field("revision", &self.revision);
5410        debug_struct.field("percent", &self.percent);
5411        if !self._unknown_fields.is_empty() {
5412            debug_struct.field("_unknown_fields", &self._unknown_fields);
5413        }
5414        debug_struct.finish()
5415    }
5416}
5417
5418/// Represents the observed state of a single `InstanceSplit` entry.
5419#[derive(Clone, Default, PartialEq)]
5420#[non_exhaustive]
5421pub struct InstanceSplitStatus {
5422    /// The allocation type for this instance split.
5423    pub r#type: crate::model::InstanceSplitAllocationType,
5424
5425    /// Revision to which this instance split is assigned.
5426    pub revision: std::string::String,
5427
5428    /// Specifies percent of the instance split to this Revision.
5429    pub percent: i32,
5430
5431    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5432}
5433
5434impl InstanceSplitStatus {
5435    pub fn new() -> Self {
5436        std::default::Default::default()
5437    }
5438
5439    /// Sets the value of [r#type][crate::model::InstanceSplitStatus::type].
5440    pub fn set_type<T: std::convert::Into<crate::model::InstanceSplitAllocationType>>(
5441        mut self,
5442        v: T,
5443    ) -> Self {
5444        self.r#type = v.into();
5445        self
5446    }
5447
5448    /// Sets the value of [revision][crate::model::InstanceSplitStatus::revision].
5449    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5450        self.revision = v.into();
5451        self
5452    }
5453
5454    /// Sets the value of [percent][crate::model::InstanceSplitStatus::percent].
5455    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5456        self.percent = v.into();
5457        self
5458    }
5459}
5460
5461impl wkt::message::Message for InstanceSplitStatus {
5462    fn typename() -> &'static str {
5463        "type.googleapis.com/google.cloud.run.v2.InstanceSplitStatus"
5464    }
5465}
5466
5467#[doc(hidden)]
5468impl<'de> serde::de::Deserialize<'de> for InstanceSplitStatus {
5469    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5470    where
5471        D: serde::Deserializer<'de>,
5472    {
5473        #[allow(non_camel_case_types)]
5474        #[doc(hidden)]
5475        #[derive(PartialEq, Eq, Hash)]
5476        enum __FieldTag {
5477            __type,
5478            __revision,
5479            __percent,
5480            Unknown(std::string::String),
5481        }
5482        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5483            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5484            where
5485                D: serde::Deserializer<'de>,
5486            {
5487                struct Visitor;
5488                impl<'de> serde::de::Visitor<'de> for Visitor {
5489                    type Value = __FieldTag;
5490                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5491                        formatter.write_str("a field name for InstanceSplitStatus")
5492                    }
5493                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5494                    where
5495                        E: serde::de::Error,
5496                    {
5497                        use std::result::Result::Ok;
5498                        use std::string::ToString;
5499                        match value {
5500                            "type" => Ok(__FieldTag::__type),
5501                            "revision" => Ok(__FieldTag::__revision),
5502                            "percent" => Ok(__FieldTag::__percent),
5503                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5504                        }
5505                    }
5506                }
5507                deserializer.deserialize_identifier(Visitor)
5508            }
5509        }
5510        struct Visitor;
5511        impl<'de> serde::de::Visitor<'de> for Visitor {
5512            type Value = InstanceSplitStatus;
5513            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5514                formatter.write_str("struct InstanceSplitStatus")
5515            }
5516            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5517            where
5518                A: serde::de::MapAccess<'de>,
5519            {
5520                #[allow(unused_imports)]
5521                use serde::de::Error;
5522                use std::option::Option::Some;
5523                let mut fields = std::collections::HashSet::new();
5524                let mut result = Self::Value::new();
5525                while let Some(tag) = map.next_key::<__FieldTag>()? {
5526                    #[allow(clippy::match_single_binding)]
5527                    match tag {
5528                        __FieldTag::__type => {
5529                            if !fields.insert(__FieldTag::__type) {
5530                                return std::result::Result::Err(A::Error::duplicate_field(
5531                                    "multiple values for type",
5532                                ));
5533                            }
5534                            result.r#type = map.next_value::<std::option::Option<crate::model::InstanceSplitAllocationType>>()?.unwrap_or_default();
5535                        }
5536                        __FieldTag::__revision => {
5537                            if !fields.insert(__FieldTag::__revision) {
5538                                return std::result::Result::Err(A::Error::duplicate_field(
5539                                    "multiple values for revision",
5540                                ));
5541                            }
5542                            result.revision = map
5543                                .next_value::<std::option::Option<std::string::String>>()?
5544                                .unwrap_or_default();
5545                        }
5546                        __FieldTag::__percent => {
5547                            if !fields.insert(__FieldTag::__percent) {
5548                                return std::result::Result::Err(A::Error::duplicate_field(
5549                                    "multiple values for percent",
5550                                ));
5551                            }
5552                            struct __With(std::option::Option<i32>);
5553                            impl<'de> serde::de::Deserialize<'de> for __With {
5554                                fn deserialize<D>(
5555                                    deserializer: D,
5556                                ) -> std::result::Result<Self, D::Error>
5557                                where
5558                                    D: serde::de::Deserializer<'de>,
5559                                {
5560                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5561                                }
5562                            }
5563                            result.percent = map.next_value::<__With>()?.0.unwrap_or_default();
5564                        }
5565                        __FieldTag::Unknown(key) => {
5566                            let value = map.next_value::<serde_json::Value>()?;
5567                            result._unknown_fields.insert(key, value);
5568                        }
5569                    }
5570                }
5571                std::result::Result::Ok(result)
5572            }
5573        }
5574        deserializer.deserialize_any(Visitor)
5575    }
5576}
5577
5578#[doc(hidden)]
5579impl serde::ser::Serialize for InstanceSplitStatus {
5580    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5581    where
5582        S: serde::ser::Serializer,
5583    {
5584        use serde::ser::SerializeMap;
5585        #[allow(unused_imports)]
5586        use std::option::Option::Some;
5587        let mut state = serializer.serialize_map(std::option::Option::None)?;
5588        if !wkt::internal::is_default(&self.r#type) {
5589            state.serialize_entry("type", &self.r#type)?;
5590        }
5591        if !self.revision.is_empty() {
5592            state.serialize_entry("revision", &self.revision)?;
5593        }
5594        if !wkt::internal::is_default(&self.percent) {
5595            struct __With<'a>(&'a i32);
5596            impl<'a> serde::ser::Serialize for __With<'a> {
5597                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5598                where
5599                    S: serde::ser::Serializer,
5600                {
5601                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5602                }
5603            }
5604            state.serialize_entry("percent", &__With(&self.percent))?;
5605        }
5606        if !self._unknown_fields.is_empty() {
5607            for (key, value) in self._unknown_fields.iter() {
5608                state.serialize_entry(key, &value)?;
5609            }
5610        }
5611        state.end()
5612    }
5613}
5614
5615impl std::fmt::Debug for InstanceSplitStatus {
5616    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5617        let mut debug_struct = f.debug_struct("InstanceSplitStatus");
5618        debug_struct.field("r#type", &self.r#type);
5619        debug_struct.field("revision", &self.revision);
5620        debug_struct.field("percent", &self.percent);
5621        if !self._unknown_fields.is_empty() {
5622            debug_struct.field("_unknown_fields", &self._unknown_fields);
5623        }
5624        debug_struct.finish()
5625    }
5626}
5627
5628/// Request message for creating a Job.
5629#[derive(Clone, Default, PartialEq)]
5630#[non_exhaustive]
5631pub struct CreateJobRequest {
5632    /// Required. The location and project in which this Job should be created.
5633    /// Format: projects/{project}/locations/{location}, where {project} can be
5634    /// project id or number.
5635    pub parent: std::string::String,
5636
5637    /// Required. The Job instance to create.
5638    pub job: std::option::Option<crate::model::Job>,
5639
5640    /// Required. The unique identifier for the Job. The name of the job becomes
5641    /// {parent}/jobs/{job_id}.
5642    pub job_id: std::string::String,
5643
5644    /// Indicates that the request should be validated and default values
5645    /// populated, without persisting the request or creating any resources.
5646    pub validate_only: bool,
5647
5648    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5649}
5650
5651impl CreateJobRequest {
5652    pub fn new() -> Self {
5653        std::default::Default::default()
5654    }
5655
5656    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
5657    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5658        self.parent = v.into();
5659        self
5660    }
5661
5662    /// Sets the value of [job][crate::model::CreateJobRequest::job].
5663    pub fn set_job<T>(mut self, v: T) -> Self
5664    where
5665        T: std::convert::Into<crate::model::Job>,
5666    {
5667        self.job = std::option::Option::Some(v.into());
5668        self
5669    }
5670
5671    /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
5672    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
5673    where
5674        T: std::convert::Into<crate::model::Job>,
5675    {
5676        self.job = v.map(|x| x.into());
5677        self
5678    }
5679
5680    /// Sets the value of [job_id][crate::model::CreateJobRequest::job_id].
5681    pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5682        self.job_id = v.into();
5683        self
5684    }
5685
5686    /// Sets the value of [validate_only][crate::model::CreateJobRequest::validate_only].
5687    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5688        self.validate_only = v.into();
5689        self
5690    }
5691}
5692
5693impl wkt::message::Message for CreateJobRequest {
5694    fn typename() -> &'static str {
5695        "type.googleapis.com/google.cloud.run.v2.CreateJobRequest"
5696    }
5697}
5698
5699#[doc(hidden)]
5700impl<'de> serde::de::Deserialize<'de> for CreateJobRequest {
5701    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5702    where
5703        D: serde::Deserializer<'de>,
5704    {
5705        #[allow(non_camel_case_types)]
5706        #[doc(hidden)]
5707        #[derive(PartialEq, Eq, Hash)]
5708        enum __FieldTag {
5709            __parent,
5710            __job,
5711            __job_id,
5712            __validate_only,
5713            Unknown(std::string::String),
5714        }
5715        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5716            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5717            where
5718                D: serde::Deserializer<'de>,
5719            {
5720                struct Visitor;
5721                impl<'de> serde::de::Visitor<'de> for Visitor {
5722                    type Value = __FieldTag;
5723                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5724                        formatter.write_str("a field name for CreateJobRequest")
5725                    }
5726                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5727                    where
5728                        E: serde::de::Error,
5729                    {
5730                        use std::result::Result::Ok;
5731                        use std::string::ToString;
5732                        match value {
5733                            "parent" => Ok(__FieldTag::__parent),
5734                            "job" => Ok(__FieldTag::__job),
5735                            "jobId" => Ok(__FieldTag::__job_id),
5736                            "job_id" => Ok(__FieldTag::__job_id),
5737                            "validateOnly" => Ok(__FieldTag::__validate_only),
5738                            "validate_only" => Ok(__FieldTag::__validate_only),
5739                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5740                        }
5741                    }
5742                }
5743                deserializer.deserialize_identifier(Visitor)
5744            }
5745        }
5746        struct Visitor;
5747        impl<'de> serde::de::Visitor<'de> for Visitor {
5748            type Value = CreateJobRequest;
5749            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5750                formatter.write_str("struct CreateJobRequest")
5751            }
5752            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5753            where
5754                A: serde::de::MapAccess<'de>,
5755            {
5756                #[allow(unused_imports)]
5757                use serde::de::Error;
5758                use std::option::Option::Some;
5759                let mut fields = std::collections::HashSet::new();
5760                let mut result = Self::Value::new();
5761                while let Some(tag) = map.next_key::<__FieldTag>()? {
5762                    #[allow(clippy::match_single_binding)]
5763                    match tag {
5764                        __FieldTag::__parent => {
5765                            if !fields.insert(__FieldTag::__parent) {
5766                                return std::result::Result::Err(A::Error::duplicate_field(
5767                                    "multiple values for parent",
5768                                ));
5769                            }
5770                            result.parent = map
5771                                .next_value::<std::option::Option<std::string::String>>()?
5772                                .unwrap_or_default();
5773                        }
5774                        __FieldTag::__job => {
5775                            if !fields.insert(__FieldTag::__job) {
5776                                return std::result::Result::Err(A::Error::duplicate_field(
5777                                    "multiple values for job",
5778                                ));
5779                            }
5780                            result.job =
5781                                map.next_value::<std::option::Option<crate::model::Job>>()?;
5782                        }
5783                        __FieldTag::__job_id => {
5784                            if !fields.insert(__FieldTag::__job_id) {
5785                                return std::result::Result::Err(A::Error::duplicate_field(
5786                                    "multiple values for job_id",
5787                                ));
5788                            }
5789                            result.job_id = map
5790                                .next_value::<std::option::Option<std::string::String>>()?
5791                                .unwrap_or_default();
5792                        }
5793                        __FieldTag::__validate_only => {
5794                            if !fields.insert(__FieldTag::__validate_only) {
5795                                return std::result::Result::Err(A::Error::duplicate_field(
5796                                    "multiple values for validate_only",
5797                                ));
5798                            }
5799                            result.validate_only = map
5800                                .next_value::<std::option::Option<bool>>()?
5801                                .unwrap_or_default();
5802                        }
5803                        __FieldTag::Unknown(key) => {
5804                            let value = map.next_value::<serde_json::Value>()?;
5805                            result._unknown_fields.insert(key, value);
5806                        }
5807                    }
5808                }
5809                std::result::Result::Ok(result)
5810            }
5811        }
5812        deserializer.deserialize_any(Visitor)
5813    }
5814}
5815
5816#[doc(hidden)]
5817impl serde::ser::Serialize for CreateJobRequest {
5818    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5819    where
5820        S: serde::ser::Serializer,
5821    {
5822        use serde::ser::SerializeMap;
5823        #[allow(unused_imports)]
5824        use std::option::Option::Some;
5825        let mut state = serializer.serialize_map(std::option::Option::None)?;
5826        if !self.parent.is_empty() {
5827            state.serialize_entry("parent", &self.parent)?;
5828        }
5829        if self.job.is_some() {
5830            state.serialize_entry("job", &self.job)?;
5831        }
5832        if !self.job_id.is_empty() {
5833            state.serialize_entry("jobId", &self.job_id)?;
5834        }
5835        if !wkt::internal::is_default(&self.validate_only) {
5836            state.serialize_entry("validateOnly", &self.validate_only)?;
5837        }
5838        if !self._unknown_fields.is_empty() {
5839            for (key, value) in self._unknown_fields.iter() {
5840                state.serialize_entry(key, &value)?;
5841            }
5842        }
5843        state.end()
5844    }
5845}
5846
5847impl std::fmt::Debug for CreateJobRequest {
5848    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5849        let mut debug_struct = f.debug_struct("CreateJobRequest");
5850        debug_struct.field("parent", &self.parent);
5851        debug_struct.field("job", &self.job);
5852        debug_struct.field("job_id", &self.job_id);
5853        debug_struct.field("validate_only", &self.validate_only);
5854        if !self._unknown_fields.is_empty() {
5855            debug_struct.field("_unknown_fields", &self._unknown_fields);
5856        }
5857        debug_struct.finish()
5858    }
5859}
5860
5861/// Request message for obtaining a Job by its full name.
5862#[derive(Clone, Default, PartialEq)]
5863#[non_exhaustive]
5864pub struct GetJobRequest {
5865    /// Required. The full name of the Job.
5866    /// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
5867    /// can be project id or number.
5868    pub name: std::string::String,
5869
5870    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5871}
5872
5873impl GetJobRequest {
5874    pub fn new() -> Self {
5875        std::default::Default::default()
5876    }
5877
5878    /// Sets the value of [name][crate::model::GetJobRequest::name].
5879    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5880        self.name = v.into();
5881        self
5882    }
5883}
5884
5885impl wkt::message::Message for GetJobRequest {
5886    fn typename() -> &'static str {
5887        "type.googleapis.com/google.cloud.run.v2.GetJobRequest"
5888    }
5889}
5890
5891#[doc(hidden)]
5892impl<'de> serde::de::Deserialize<'de> for GetJobRequest {
5893    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5894    where
5895        D: serde::Deserializer<'de>,
5896    {
5897        #[allow(non_camel_case_types)]
5898        #[doc(hidden)]
5899        #[derive(PartialEq, Eq, Hash)]
5900        enum __FieldTag {
5901            __name,
5902            Unknown(std::string::String),
5903        }
5904        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5905            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5906            where
5907                D: serde::Deserializer<'de>,
5908            {
5909                struct Visitor;
5910                impl<'de> serde::de::Visitor<'de> for Visitor {
5911                    type Value = __FieldTag;
5912                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5913                        formatter.write_str("a field name for GetJobRequest")
5914                    }
5915                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5916                    where
5917                        E: serde::de::Error,
5918                    {
5919                        use std::result::Result::Ok;
5920                        use std::string::ToString;
5921                        match value {
5922                            "name" => Ok(__FieldTag::__name),
5923                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5924                        }
5925                    }
5926                }
5927                deserializer.deserialize_identifier(Visitor)
5928            }
5929        }
5930        struct Visitor;
5931        impl<'de> serde::de::Visitor<'de> for Visitor {
5932            type Value = GetJobRequest;
5933            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5934                formatter.write_str("struct GetJobRequest")
5935            }
5936            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5937            where
5938                A: serde::de::MapAccess<'de>,
5939            {
5940                #[allow(unused_imports)]
5941                use serde::de::Error;
5942                use std::option::Option::Some;
5943                let mut fields = std::collections::HashSet::new();
5944                let mut result = Self::Value::new();
5945                while let Some(tag) = map.next_key::<__FieldTag>()? {
5946                    #[allow(clippy::match_single_binding)]
5947                    match tag {
5948                        __FieldTag::__name => {
5949                            if !fields.insert(__FieldTag::__name) {
5950                                return std::result::Result::Err(A::Error::duplicate_field(
5951                                    "multiple values for name",
5952                                ));
5953                            }
5954                            result.name = map
5955                                .next_value::<std::option::Option<std::string::String>>()?
5956                                .unwrap_or_default();
5957                        }
5958                        __FieldTag::Unknown(key) => {
5959                            let value = map.next_value::<serde_json::Value>()?;
5960                            result._unknown_fields.insert(key, value);
5961                        }
5962                    }
5963                }
5964                std::result::Result::Ok(result)
5965            }
5966        }
5967        deserializer.deserialize_any(Visitor)
5968    }
5969}
5970
5971#[doc(hidden)]
5972impl serde::ser::Serialize for GetJobRequest {
5973    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5974    where
5975        S: serde::ser::Serializer,
5976    {
5977        use serde::ser::SerializeMap;
5978        #[allow(unused_imports)]
5979        use std::option::Option::Some;
5980        let mut state = serializer.serialize_map(std::option::Option::None)?;
5981        if !self.name.is_empty() {
5982            state.serialize_entry("name", &self.name)?;
5983        }
5984        if !self._unknown_fields.is_empty() {
5985            for (key, value) in self._unknown_fields.iter() {
5986                state.serialize_entry(key, &value)?;
5987            }
5988        }
5989        state.end()
5990    }
5991}
5992
5993impl std::fmt::Debug for GetJobRequest {
5994    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5995        let mut debug_struct = f.debug_struct("GetJobRequest");
5996        debug_struct.field("name", &self.name);
5997        if !self._unknown_fields.is_empty() {
5998            debug_struct.field("_unknown_fields", &self._unknown_fields);
5999        }
6000        debug_struct.finish()
6001    }
6002}
6003
6004/// Request message for updating a Job.
6005#[derive(Clone, Default, PartialEq)]
6006#[non_exhaustive]
6007pub struct UpdateJobRequest {
6008    /// Required. The Job to be updated.
6009    pub job: std::option::Option<crate::model::Job>,
6010
6011    /// Indicates that the request should be validated and default values
6012    /// populated, without persisting the request or updating any resources.
6013    pub validate_only: bool,
6014
6015    /// Optional. If set to true, and if the Job does not exist, it will create a
6016    /// new one. Caller must have both create and update permissions for this call
6017    /// if this is set to true.
6018    pub allow_missing: bool,
6019
6020    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6021}
6022
6023impl UpdateJobRequest {
6024    pub fn new() -> Self {
6025        std::default::Default::default()
6026    }
6027
6028    /// Sets the value of [job][crate::model::UpdateJobRequest::job].
6029    pub fn set_job<T>(mut self, v: T) -> Self
6030    where
6031        T: std::convert::Into<crate::model::Job>,
6032    {
6033        self.job = std::option::Option::Some(v.into());
6034        self
6035    }
6036
6037    /// Sets or clears the value of [job][crate::model::UpdateJobRequest::job].
6038    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
6039    where
6040        T: std::convert::Into<crate::model::Job>,
6041    {
6042        self.job = v.map(|x| x.into());
6043        self
6044    }
6045
6046    /// Sets the value of [validate_only][crate::model::UpdateJobRequest::validate_only].
6047    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6048        self.validate_only = v.into();
6049        self
6050    }
6051
6052    /// Sets the value of [allow_missing][crate::model::UpdateJobRequest::allow_missing].
6053    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6054        self.allow_missing = v.into();
6055        self
6056    }
6057}
6058
6059impl wkt::message::Message for UpdateJobRequest {
6060    fn typename() -> &'static str {
6061        "type.googleapis.com/google.cloud.run.v2.UpdateJobRequest"
6062    }
6063}
6064
6065#[doc(hidden)]
6066impl<'de> serde::de::Deserialize<'de> for UpdateJobRequest {
6067    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6068    where
6069        D: serde::Deserializer<'de>,
6070    {
6071        #[allow(non_camel_case_types)]
6072        #[doc(hidden)]
6073        #[derive(PartialEq, Eq, Hash)]
6074        enum __FieldTag {
6075            __job,
6076            __validate_only,
6077            __allow_missing,
6078            Unknown(std::string::String),
6079        }
6080        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6081            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6082            where
6083                D: serde::Deserializer<'de>,
6084            {
6085                struct Visitor;
6086                impl<'de> serde::de::Visitor<'de> for Visitor {
6087                    type Value = __FieldTag;
6088                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6089                        formatter.write_str("a field name for UpdateJobRequest")
6090                    }
6091                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6092                    where
6093                        E: serde::de::Error,
6094                    {
6095                        use std::result::Result::Ok;
6096                        use std::string::ToString;
6097                        match value {
6098                            "job" => Ok(__FieldTag::__job),
6099                            "validateOnly" => Ok(__FieldTag::__validate_only),
6100                            "validate_only" => Ok(__FieldTag::__validate_only),
6101                            "allowMissing" => Ok(__FieldTag::__allow_missing),
6102                            "allow_missing" => Ok(__FieldTag::__allow_missing),
6103                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6104                        }
6105                    }
6106                }
6107                deserializer.deserialize_identifier(Visitor)
6108            }
6109        }
6110        struct Visitor;
6111        impl<'de> serde::de::Visitor<'de> for Visitor {
6112            type Value = UpdateJobRequest;
6113            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6114                formatter.write_str("struct UpdateJobRequest")
6115            }
6116            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6117            where
6118                A: serde::de::MapAccess<'de>,
6119            {
6120                #[allow(unused_imports)]
6121                use serde::de::Error;
6122                use std::option::Option::Some;
6123                let mut fields = std::collections::HashSet::new();
6124                let mut result = Self::Value::new();
6125                while let Some(tag) = map.next_key::<__FieldTag>()? {
6126                    #[allow(clippy::match_single_binding)]
6127                    match tag {
6128                        __FieldTag::__job => {
6129                            if !fields.insert(__FieldTag::__job) {
6130                                return std::result::Result::Err(A::Error::duplicate_field(
6131                                    "multiple values for job",
6132                                ));
6133                            }
6134                            result.job =
6135                                map.next_value::<std::option::Option<crate::model::Job>>()?;
6136                        }
6137                        __FieldTag::__validate_only => {
6138                            if !fields.insert(__FieldTag::__validate_only) {
6139                                return std::result::Result::Err(A::Error::duplicate_field(
6140                                    "multiple values for validate_only",
6141                                ));
6142                            }
6143                            result.validate_only = map
6144                                .next_value::<std::option::Option<bool>>()?
6145                                .unwrap_or_default();
6146                        }
6147                        __FieldTag::__allow_missing => {
6148                            if !fields.insert(__FieldTag::__allow_missing) {
6149                                return std::result::Result::Err(A::Error::duplicate_field(
6150                                    "multiple values for allow_missing",
6151                                ));
6152                            }
6153                            result.allow_missing = map
6154                                .next_value::<std::option::Option<bool>>()?
6155                                .unwrap_or_default();
6156                        }
6157                        __FieldTag::Unknown(key) => {
6158                            let value = map.next_value::<serde_json::Value>()?;
6159                            result._unknown_fields.insert(key, value);
6160                        }
6161                    }
6162                }
6163                std::result::Result::Ok(result)
6164            }
6165        }
6166        deserializer.deserialize_any(Visitor)
6167    }
6168}
6169
6170#[doc(hidden)]
6171impl serde::ser::Serialize for UpdateJobRequest {
6172    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6173    where
6174        S: serde::ser::Serializer,
6175    {
6176        use serde::ser::SerializeMap;
6177        #[allow(unused_imports)]
6178        use std::option::Option::Some;
6179        let mut state = serializer.serialize_map(std::option::Option::None)?;
6180        if self.job.is_some() {
6181            state.serialize_entry("job", &self.job)?;
6182        }
6183        if !wkt::internal::is_default(&self.validate_only) {
6184            state.serialize_entry("validateOnly", &self.validate_only)?;
6185        }
6186        if !wkt::internal::is_default(&self.allow_missing) {
6187            state.serialize_entry("allowMissing", &self.allow_missing)?;
6188        }
6189        if !self._unknown_fields.is_empty() {
6190            for (key, value) in self._unknown_fields.iter() {
6191                state.serialize_entry(key, &value)?;
6192            }
6193        }
6194        state.end()
6195    }
6196}
6197
6198impl std::fmt::Debug for UpdateJobRequest {
6199    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6200        let mut debug_struct = f.debug_struct("UpdateJobRequest");
6201        debug_struct.field("job", &self.job);
6202        debug_struct.field("validate_only", &self.validate_only);
6203        debug_struct.field("allow_missing", &self.allow_missing);
6204        if !self._unknown_fields.is_empty() {
6205            debug_struct.field("_unknown_fields", &self._unknown_fields);
6206        }
6207        debug_struct.finish()
6208    }
6209}
6210
6211/// Request message for retrieving a list of Jobs.
6212#[derive(Clone, Default, PartialEq)]
6213#[non_exhaustive]
6214pub struct ListJobsRequest {
6215    /// Required. The location and project to list resources on.
6216    /// Format: projects/{project}/locations/{location}, where {project} can be
6217    /// project id or number.
6218    pub parent: std::string::String,
6219
6220    /// Maximum number of Jobs to return in this call.
6221    pub page_size: i32,
6222
6223    /// A page token received from a previous call to ListJobs.
6224    /// All other parameters must match.
6225    pub page_token: std::string::String,
6226
6227    /// If true, returns deleted (but unexpired) resources along with active ones.
6228    pub show_deleted: bool,
6229
6230    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6231}
6232
6233impl ListJobsRequest {
6234    pub fn new() -> Self {
6235        std::default::Default::default()
6236    }
6237
6238    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
6239    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6240        self.parent = v.into();
6241        self
6242    }
6243
6244    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
6245    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6246        self.page_size = v.into();
6247        self
6248    }
6249
6250    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
6251    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6252        self.page_token = v.into();
6253        self
6254    }
6255
6256    /// Sets the value of [show_deleted][crate::model::ListJobsRequest::show_deleted].
6257    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6258        self.show_deleted = v.into();
6259        self
6260    }
6261}
6262
6263impl wkt::message::Message for ListJobsRequest {
6264    fn typename() -> &'static str {
6265        "type.googleapis.com/google.cloud.run.v2.ListJobsRequest"
6266    }
6267}
6268
6269#[doc(hidden)]
6270impl<'de> serde::de::Deserialize<'de> for ListJobsRequest {
6271    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6272    where
6273        D: serde::Deserializer<'de>,
6274    {
6275        #[allow(non_camel_case_types)]
6276        #[doc(hidden)]
6277        #[derive(PartialEq, Eq, Hash)]
6278        enum __FieldTag {
6279            __parent,
6280            __page_size,
6281            __page_token,
6282            __show_deleted,
6283            Unknown(std::string::String),
6284        }
6285        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6286            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6287            where
6288                D: serde::Deserializer<'de>,
6289            {
6290                struct Visitor;
6291                impl<'de> serde::de::Visitor<'de> for Visitor {
6292                    type Value = __FieldTag;
6293                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6294                        formatter.write_str("a field name for ListJobsRequest")
6295                    }
6296                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6297                    where
6298                        E: serde::de::Error,
6299                    {
6300                        use std::result::Result::Ok;
6301                        use std::string::ToString;
6302                        match value {
6303                            "parent" => Ok(__FieldTag::__parent),
6304                            "pageSize" => Ok(__FieldTag::__page_size),
6305                            "page_size" => Ok(__FieldTag::__page_size),
6306                            "pageToken" => Ok(__FieldTag::__page_token),
6307                            "page_token" => Ok(__FieldTag::__page_token),
6308                            "showDeleted" => Ok(__FieldTag::__show_deleted),
6309                            "show_deleted" => Ok(__FieldTag::__show_deleted),
6310                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6311                        }
6312                    }
6313                }
6314                deserializer.deserialize_identifier(Visitor)
6315            }
6316        }
6317        struct Visitor;
6318        impl<'de> serde::de::Visitor<'de> for Visitor {
6319            type Value = ListJobsRequest;
6320            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6321                formatter.write_str("struct ListJobsRequest")
6322            }
6323            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6324            where
6325                A: serde::de::MapAccess<'de>,
6326            {
6327                #[allow(unused_imports)]
6328                use serde::de::Error;
6329                use std::option::Option::Some;
6330                let mut fields = std::collections::HashSet::new();
6331                let mut result = Self::Value::new();
6332                while let Some(tag) = map.next_key::<__FieldTag>()? {
6333                    #[allow(clippy::match_single_binding)]
6334                    match tag {
6335                        __FieldTag::__parent => {
6336                            if !fields.insert(__FieldTag::__parent) {
6337                                return std::result::Result::Err(A::Error::duplicate_field(
6338                                    "multiple values for parent",
6339                                ));
6340                            }
6341                            result.parent = map
6342                                .next_value::<std::option::Option<std::string::String>>()?
6343                                .unwrap_or_default();
6344                        }
6345                        __FieldTag::__page_size => {
6346                            if !fields.insert(__FieldTag::__page_size) {
6347                                return std::result::Result::Err(A::Error::duplicate_field(
6348                                    "multiple values for page_size",
6349                                ));
6350                            }
6351                            struct __With(std::option::Option<i32>);
6352                            impl<'de> serde::de::Deserialize<'de> for __With {
6353                                fn deserialize<D>(
6354                                    deserializer: D,
6355                                ) -> std::result::Result<Self, D::Error>
6356                                where
6357                                    D: serde::de::Deserializer<'de>,
6358                                {
6359                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
6360                                }
6361                            }
6362                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
6363                        }
6364                        __FieldTag::__page_token => {
6365                            if !fields.insert(__FieldTag::__page_token) {
6366                                return std::result::Result::Err(A::Error::duplicate_field(
6367                                    "multiple values for page_token",
6368                                ));
6369                            }
6370                            result.page_token = map
6371                                .next_value::<std::option::Option<std::string::String>>()?
6372                                .unwrap_or_default();
6373                        }
6374                        __FieldTag::__show_deleted => {
6375                            if !fields.insert(__FieldTag::__show_deleted) {
6376                                return std::result::Result::Err(A::Error::duplicate_field(
6377                                    "multiple values for show_deleted",
6378                                ));
6379                            }
6380                            result.show_deleted = map
6381                                .next_value::<std::option::Option<bool>>()?
6382                                .unwrap_or_default();
6383                        }
6384                        __FieldTag::Unknown(key) => {
6385                            let value = map.next_value::<serde_json::Value>()?;
6386                            result._unknown_fields.insert(key, value);
6387                        }
6388                    }
6389                }
6390                std::result::Result::Ok(result)
6391            }
6392        }
6393        deserializer.deserialize_any(Visitor)
6394    }
6395}
6396
6397#[doc(hidden)]
6398impl serde::ser::Serialize for ListJobsRequest {
6399    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6400    where
6401        S: serde::ser::Serializer,
6402    {
6403        use serde::ser::SerializeMap;
6404        #[allow(unused_imports)]
6405        use std::option::Option::Some;
6406        let mut state = serializer.serialize_map(std::option::Option::None)?;
6407        if !self.parent.is_empty() {
6408            state.serialize_entry("parent", &self.parent)?;
6409        }
6410        if !wkt::internal::is_default(&self.page_size) {
6411            struct __With<'a>(&'a i32);
6412            impl<'a> serde::ser::Serialize for __With<'a> {
6413                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6414                where
6415                    S: serde::ser::Serializer,
6416                {
6417                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
6418                }
6419            }
6420            state.serialize_entry("pageSize", &__With(&self.page_size))?;
6421        }
6422        if !self.page_token.is_empty() {
6423            state.serialize_entry("pageToken", &self.page_token)?;
6424        }
6425        if !wkt::internal::is_default(&self.show_deleted) {
6426            state.serialize_entry("showDeleted", &self.show_deleted)?;
6427        }
6428        if !self._unknown_fields.is_empty() {
6429            for (key, value) in self._unknown_fields.iter() {
6430                state.serialize_entry(key, &value)?;
6431            }
6432        }
6433        state.end()
6434    }
6435}
6436
6437impl std::fmt::Debug for ListJobsRequest {
6438    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6439        let mut debug_struct = f.debug_struct("ListJobsRequest");
6440        debug_struct.field("parent", &self.parent);
6441        debug_struct.field("page_size", &self.page_size);
6442        debug_struct.field("page_token", &self.page_token);
6443        debug_struct.field("show_deleted", &self.show_deleted);
6444        if !self._unknown_fields.is_empty() {
6445            debug_struct.field("_unknown_fields", &self._unknown_fields);
6446        }
6447        debug_struct.finish()
6448    }
6449}
6450
6451/// Response message containing a list of Jobs.
6452#[derive(Clone, Default, PartialEq)]
6453#[non_exhaustive]
6454pub struct ListJobsResponse {
6455    /// The resulting list of Jobs.
6456    pub jobs: std::vec::Vec<crate::model::Job>,
6457
6458    /// A token indicating there are more items than page_size. Use it in the next
6459    /// ListJobs request to continue.
6460    pub next_page_token: std::string::String,
6461
6462    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6463}
6464
6465impl ListJobsResponse {
6466    pub fn new() -> Self {
6467        std::default::Default::default()
6468    }
6469
6470    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
6471    pub fn set_jobs<T, V>(mut self, v: T) -> Self
6472    where
6473        T: std::iter::IntoIterator<Item = V>,
6474        V: std::convert::Into<crate::model::Job>,
6475    {
6476        use std::iter::Iterator;
6477        self.jobs = v.into_iter().map(|i| i.into()).collect();
6478        self
6479    }
6480
6481    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
6482    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6483        self.next_page_token = v.into();
6484        self
6485    }
6486}
6487
6488impl wkt::message::Message for ListJobsResponse {
6489    fn typename() -> &'static str {
6490        "type.googleapis.com/google.cloud.run.v2.ListJobsResponse"
6491    }
6492}
6493
6494#[doc(hidden)]
6495impl gax::paginator::internal::PageableResponse for ListJobsResponse {
6496    type PageItem = crate::model::Job;
6497
6498    fn items(self) -> std::vec::Vec<Self::PageItem> {
6499        self.jobs
6500    }
6501
6502    fn next_page_token(&self) -> std::string::String {
6503        use std::clone::Clone;
6504        self.next_page_token.clone()
6505    }
6506}
6507
6508#[doc(hidden)]
6509impl<'de> serde::de::Deserialize<'de> for ListJobsResponse {
6510    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6511    where
6512        D: serde::Deserializer<'de>,
6513    {
6514        #[allow(non_camel_case_types)]
6515        #[doc(hidden)]
6516        #[derive(PartialEq, Eq, Hash)]
6517        enum __FieldTag {
6518            __jobs,
6519            __next_page_token,
6520            Unknown(std::string::String),
6521        }
6522        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6523            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6524            where
6525                D: serde::Deserializer<'de>,
6526            {
6527                struct Visitor;
6528                impl<'de> serde::de::Visitor<'de> for Visitor {
6529                    type Value = __FieldTag;
6530                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6531                        formatter.write_str("a field name for ListJobsResponse")
6532                    }
6533                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6534                    where
6535                        E: serde::de::Error,
6536                    {
6537                        use std::result::Result::Ok;
6538                        use std::string::ToString;
6539                        match value {
6540                            "jobs" => Ok(__FieldTag::__jobs),
6541                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
6542                            "next_page_token" => Ok(__FieldTag::__next_page_token),
6543                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6544                        }
6545                    }
6546                }
6547                deserializer.deserialize_identifier(Visitor)
6548            }
6549        }
6550        struct Visitor;
6551        impl<'de> serde::de::Visitor<'de> for Visitor {
6552            type Value = ListJobsResponse;
6553            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6554                formatter.write_str("struct ListJobsResponse")
6555            }
6556            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6557            where
6558                A: serde::de::MapAccess<'de>,
6559            {
6560                #[allow(unused_imports)]
6561                use serde::de::Error;
6562                use std::option::Option::Some;
6563                let mut fields = std::collections::HashSet::new();
6564                let mut result = Self::Value::new();
6565                while let Some(tag) = map.next_key::<__FieldTag>()? {
6566                    #[allow(clippy::match_single_binding)]
6567                    match tag {
6568                        __FieldTag::__jobs => {
6569                            if !fields.insert(__FieldTag::__jobs) {
6570                                return std::result::Result::Err(A::Error::duplicate_field(
6571                                    "multiple values for jobs",
6572                                ));
6573                            }
6574                            result.jobs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Job>>>()?.unwrap_or_default();
6575                        }
6576                        __FieldTag::__next_page_token => {
6577                            if !fields.insert(__FieldTag::__next_page_token) {
6578                                return std::result::Result::Err(A::Error::duplicate_field(
6579                                    "multiple values for next_page_token",
6580                                ));
6581                            }
6582                            result.next_page_token = map
6583                                .next_value::<std::option::Option<std::string::String>>()?
6584                                .unwrap_or_default();
6585                        }
6586                        __FieldTag::Unknown(key) => {
6587                            let value = map.next_value::<serde_json::Value>()?;
6588                            result._unknown_fields.insert(key, value);
6589                        }
6590                    }
6591                }
6592                std::result::Result::Ok(result)
6593            }
6594        }
6595        deserializer.deserialize_any(Visitor)
6596    }
6597}
6598
6599#[doc(hidden)]
6600impl serde::ser::Serialize for ListJobsResponse {
6601    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6602    where
6603        S: serde::ser::Serializer,
6604    {
6605        use serde::ser::SerializeMap;
6606        #[allow(unused_imports)]
6607        use std::option::Option::Some;
6608        let mut state = serializer.serialize_map(std::option::Option::None)?;
6609        if !self.jobs.is_empty() {
6610            state.serialize_entry("jobs", &self.jobs)?;
6611        }
6612        if !self.next_page_token.is_empty() {
6613            state.serialize_entry("nextPageToken", &self.next_page_token)?;
6614        }
6615        if !self._unknown_fields.is_empty() {
6616            for (key, value) in self._unknown_fields.iter() {
6617                state.serialize_entry(key, &value)?;
6618            }
6619        }
6620        state.end()
6621    }
6622}
6623
6624impl std::fmt::Debug for ListJobsResponse {
6625    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6626        let mut debug_struct = f.debug_struct("ListJobsResponse");
6627        debug_struct.field("jobs", &self.jobs);
6628        debug_struct.field("next_page_token", &self.next_page_token);
6629        if !self._unknown_fields.is_empty() {
6630            debug_struct.field("_unknown_fields", &self._unknown_fields);
6631        }
6632        debug_struct.finish()
6633    }
6634}
6635
6636/// Request message to delete a Job by its full name.
6637#[derive(Clone, Default, PartialEq)]
6638#[non_exhaustive]
6639pub struct DeleteJobRequest {
6640    /// Required. The full name of the Job.
6641    /// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
6642    /// can be project id or number.
6643    pub name: std::string::String,
6644
6645    /// Indicates that the request should be validated without actually
6646    /// deleting any resources.
6647    pub validate_only: bool,
6648
6649    /// A system-generated fingerprint for this version of the
6650    /// resource. May be used to detect modification conflict during updates.
6651    pub etag: std::string::String,
6652
6653    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6654}
6655
6656impl DeleteJobRequest {
6657    pub fn new() -> Self {
6658        std::default::Default::default()
6659    }
6660
6661    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
6662    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663        self.name = v.into();
6664        self
6665    }
6666
6667    /// Sets the value of [validate_only][crate::model::DeleteJobRequest::validate_only].
6668    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6669        self.validate_only = v.into();
6670        self
6671    }
6672
6673    /// Sets the value of [etag][crate::model::DeleteJobRequest::etag].
6674    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6675        self.etag = v.into();
6676        self
6677    }
6678}
6679
6680impl wkt::message::Message for DeleteJobRequest {
6681    fn typename() -> &'static str {
6682        "type.googleapis.com/google.cloud.run.v2.DeleteJobRequest"
6683    }
6684}
6685
6686#[doc(hidden)]
6687impl<'de> serde::de::Deserialize<'de> for DeleteJobRequest {
6688    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6689    where
6690        D: serde::Deserializer<'de>,
6691    {
6692        #[allow(non_camel_case_types)]
6693        #[doc(hidden)]
6694        #[derive(PartialEq, Eq, Hash)]
6695        enum __FieldTag {
6696            __name,
6697            __validate_only,
6698            __etag,
6699            Unknown(std::string::String),
6700        }
6701        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6702            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6703            where
6704                D: serde::Deserializer<'de>,
6705            {
6706                struct Visitor;
6707                impl<'de> serde::de::Visitor<'de> for Visitor {
6708                    type Value = __FieldTag;
6709                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6710                        formatter.write_str("a field name for DeleteJobRequest")
6711                    }
6712                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6713                    where
6714                        E: serde::de::Error,
6715                    {
6716                        use std::result::Result::Ok;
6717                        use std::string::ToString;
6718                        match value {
6719                            "name" => Ok(__FieldTag::__name),
6720                            "validateOnly" => Ok(__FieldTag::__validate_only),
6721                            "validate_only" => Ok(__FieldTag::__validate_only),
6722                            "etag" => Ok(__FieldTag::__etag),
6723                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6724                        }
6725                    }
6726                }
6727                deserializer.deserialize_identifier(Visitor)
6728            }
6729        }
6730        struct Visitor;
6731        impl<'de> serde::de::Visitor<'de> for Visitor {
6732            type Value = DeleteJobRequest;
6733            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6734                formatter.write_str("struct DeleteJobRequest")
6735            }
6736            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6737            where
6738                A: serde::de::MapAccess<'de>,
6739            {
6740                #[allow(unused_imports)]
6741                use serde::de::Error;
6742                use std::option::Option::Some;
6743                let mut fields = std::collections::HashSet::new();
6744                let mut result = Self::Value::new();
6745                while let Some(tag) = map.next_key::<__FieldTag>()? {
6746                    #[allow(clippy::match_single_binding)]
6747                    match tag {
6748                        __FieldTag::__name => {
6749                            if !fields.insert(__FieldTag::__name) {
6750                                return std::result::Result::Err(A::Error::duplicate_field(
6751                                    "multiple values for name",
6752                                ));
6753                            }
6754                            result.name = map
6755                                .next_value::<std::option::Option<std::string::String>>()?
6756                                .unwrap_or_default();
6757                        }
6758                        __FieldTag::__validate_only => {
6759                            if !fields.insert(__FieldTag::__validate_only) {
6760                                return std::result::Result::Err(A::Error::duplicate_field(
6761                                    "multiple values for validate_only",
6762                                ));
6763                            }
6764                            result.validate_only = map
6765                                .next_value::<std::option::Option<bool>>()?
6766                                .unwrap_or_default();
6767                        }
6768                        __FieldTag::__etag => {
6769                            if !fields.insert(__FieldTag::__etag) {
6770                                return std::result::Result::Err(A::Error::duplicate_field(
6771                                    "multiple values for etag",
6772                                ));
6773                            }
6774                            result.etag = map
6775                                .next_value::<std::option::Option<std::string::String>>()?
6776                                .unwrap_or_default();
6777                        }
6778                        __FieldTag::Unknown(key) => {
6779                            let value = map.next_value::<serde_json::Value>()?;
6780                            result._unknown_fields.insert(key, value);
6781                        }
6782                    }
6783                }
6784                std::result::Result::Ok(result)
6785            }
6786        }
6787        deserializer.deserialize_any(Visitor)
6788    }
6789}
6790
6791#[doc(hidden)]
6792impl serde::ser::Serialize for DeleteJobRequest {
6793    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6794    where
6795        S: serde::ser::Serializer,
6796    {
6797        use serde::ser::SerializeMap;
6798        #[allow(unused_imports)]
6799        use std::option::Option::Some;
6800        let mut state = serializer.serialize_map(std::option::Option::None)?;
6801        if !self.name.is_empty() {
6802            state.serialize_entry("name", &self.name)?;
6803        }
6804        if !wkt::internal::is_default(&self.validate_only) {
6805            state.serialize_entry("validateOnly", &self.validate_only)?;
6806        }
6807        if !self.etag.is_empty() {
6808            state.serialize_entry("etag", &self.etag)?;
6809        }
6810        if !self._unknown_fields.is_empty() {
6811            for (key, value) in self._unknown_fields.iter() {
6812                state.serialize_entry(key, &value)?;
6813            }
6814        }
6815        state.end()
6816    }
6817}
6818
6819impl std::fmt::Debug for DeleteJobRequest {
6820    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6821        let mut debug_struct = f.debug_struct("DeleteJobRequest");
6822        debug_struct.field("name", &self.name);
6823        debug_struct.field("validate_only", &self.validate_only);
6824        debug_struct.field("etag", &self.etag);
6825        if !self._unknown_fields.is_empty() {
6826            debug_struct.field("_unknown_fields", &self._unknown_fields);
6827        }
6828        debug_struct.finish()
6829    }
6830}
6831
6832/// Request message to create a new Execution of a Job.
6833#[derive(Clone, Default, PartialEq)]
6834#[non_exhaustive]
6835pub struct RunJobRequest {
6836    /// Required. The full name of the Job.
6837    /// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
6838    /// can be project id or number.
6839    pub name: std::string::String,
6840
6841    /// Indicates that the request should be validated without actually
6842    /// deleting any resources.
6843    pub validate_only: bool,
6844
6845    /// A system-generated fingerprint for this version of the
6846    /// resource. May be used to detect modification conflict during updates.
6847    pub etag: std::string::String,
6848
6849    /// Overrides specification for a given execution of a job. If provided,
6850    /// overrides will be applied to update the execution or task spec.
6851    pub overrides: std::option::Option<crate::model::run_job_request::Overrides>,
6852
6853    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6854}
6855
6856impl RunJobRequest {
6857    pub fn new() -> Self {
6858        std::default::Default::default()
6859    }
6860
6861    /// Sets the value of [name][crate::model::RunJobRequest::name].
6862    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6863        self.name = v.into();
6864        self
6865    }
6866
6867    /// Sets the value of [validate_only][crate::model::RunJobRequest::validate_only].
6868    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6869        self.validate_only = v.into();
6870        self
6871    }
6872
6873    /// Sets the value of [etag][crate::model::RunJobRequest::etag].
6874    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6875        self.etag = v.into();
6876        self
6877    }
6878
6879    /// Sets the value of [overrides][crate::model::RunJobRequest::overrides].
6880    pub fn set_overrides<T>(mut self, v: T) -> Self
6881    where
6882        T: std::convert::Into<crate::model::run_job_request::Overrides>,
6883    {
6884        self.overrides = std::option::Option::Some(v.into());
6885        self
6886    }
6887
6888    /// Sets or clears the value of [overrides][crate::model::RunJobRequest::overrides].
6889    pub fn set_or_clear_overrides<T>(mut self, v: std::option::Option<T>) -> Self
6890    where
6891        T: std::convert::Into<crate::model::run_job_request::Overrides>,
6892    {
6893        self.overrides = v.map(|x| x.into());
6894        self
6895    }
6896}
6897
6898impl wkt::message::Message for RunJobRequest {
6899    fn typename() -> &'static str {
6900        "type.googleapis.com/google.cloud.run.v2.RunJobRequest"
6901    }
6902}
6903
6904#[doc(hidden)]
6905impl<'de> serde::de::Deserialize<'de> for RunJobRequest {
6906    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6907    where
6908        D: serde::Deserializer<'de>,
6909    {
6910        #[allow(non_camel_case_types)]
6911        #[doc(hidden)]
6912        #[derive(PartialEq, Eq, Hash)]
6913        enum __FieldTag {
6914            __name,
6915            __validate_only,
6916            __etag,
6917            __overrides,
6918            Unknown(std::string::String),
6919        }
6920        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6921            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6922            where
6923                D: serde::Deserializer<'de>,
6924            {
6925                struct Visitor;
6926                impl<'de> serde::de::Visitor<'de> for Visitor {
6927                    type Value = __FieldTag;
6928                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6929                        formatter.write_str("a field name for RunJobRequest")
6930                    }
6931                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6932                    where
6933                        E: serde::de::Error,
6934                    {
6935                        use std::result::Result::Ok;
6936                        use std::string::ToString;
6937                        match value {
6938                            "name" => Ok(__FieldTag::__name),
6939                            "validateOnly" => Ok(__FieldTag::__validate_only),
6940                            "validate_only" => Ok(__FieldTag::__validate_only),
6941                            "etag" => Ok(__FieldTag::__etag),
6942                            "overrides" => Ok(__FieldTag::__overrides),
6943                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6944                        }
6945                    }
6946                }
6947                deserializer.deserialize_identifier(Visitor)
6948            }
6949        }
6950        struct Visitor;
6951        impl<'de> serde::de::Visitor<'de> for Visitor {
6952            type Value = RunJobRequest;
6953            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6954                formatter.write_str("struct RunJobRequest")
6955            }
6956            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6957            where
6958                A: serde::de::MapAccess<'de>,
6959            {
6960                #[allow(unused_imports)]
6961                use serde::de::Error;
6962                use std::option::Option::Some;
6963                let mut fields = std::collections::HashSet::new();
6964                let mut result = Self::Value::new();
6965                while let Some(tag) = map.next_key::<__FieldTag>()? {
6966                    #[allow(clippy::match_single_binding)]
6967                    match tag {
6968                        __FieldTag::__name => {
6969                            if !fields.insert(__FieldTag::__name) {
6970                                return std::result::Result::Err(A::Error::duplicate_field(
6971                                    "multiple values for name",
6972                                ));
6973                            }
6974                            result.name = map
6975                                .next_value::<std::option::Option<std::string::String>>()?
6976                                .unwrap_or_default();
6977                        }
6978                        __FieldTag::__validate_only => {
6979                            if !fields.insert(__FieldTag::__validate_only) {
6980                                return std::result::Result::Err(A::Error::duplicate_field(
6981                                    "multiple values for validate_only",
6982                                ));
6983                            }
6984                            result.validate_only = map
6985                                .next_value::<std::option::Option<bool>>()?
6986                                .unwrap_or_default();
6987                        }
6988                        __FieldTag::__etag => {
6989                            if !fields.insert(__FieldTag::__etag) {
6990                                return std::result::Result::Err(A::Error::duplicate_field(
6991                                    "multiple values for etag",
6992                                ));
6993                            }
6994                            result.etag = map
6995                                .next_value::<std::option::Option<std::string::String>>()?
6996                                .unwrap_or_default();
6997                        }
6998                        __FieldTag::__overrides => {
6999                            if !fields.insert(__FieldTag::__overrides) {
7000                                return std::result::Result::Err(A::Error::duplicate_field(
7001                                    "multiple values for overrides",
7002                                ));
7003                            }
7004                            result.overrides = map.next_value::<std::option::Option<crate::model::run_job_request::Overrides>>()?
7005                                ;
7006                        }
7007                        __FieldTag::Unknown(key) => {
7008                            let value = map.next_value::<serde_json::Value>()?;
7009                            result._unknown_fields.insert(key, value);
7010                        }
7011                    }
7012                }
7013                std::result::Result::Ok(result)
7014            }
7015        }
7016        deserializer.deserialize_any(Visitor)
7017    }
7018}
7019
7020#[doc(hidden)]
7021impl serde::ser::Serialize for RunJobRequest {
7022    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7023    where
7024        S: serde::ser::Serializer,
7025    {
7026        use serde::ser::SerializeMap;
7027        #[allow(unused_imports)]
7028        use std::option::Option::Some;
7029        let mut state = serializer.serialize_map(std::option::Option::None)?;
7030        if !self.name.is_empty() {
7031            state.serialize_entry("name", &self.name)?;
7032        }
7033        if !wkt::internal::is_default(&self.validate_only) {
7034            state.serialize_entry("validateOnly", &self.validate_only)?;
7035        }
7036        if !self.etag.is_empty() {
7037            state.serialize_entry("etag", &self.etag)?;
7038        }
7039        if self.overrides.is_some() {
7040            state.serialize_entry("overrides", &self.overrides)?;
7041        }
7042        if !self._unknown_fields.is_empty() {
7043            for (key, value) in self._unknown_fields.iter() {
7044                state.serialize_entry(key, &value)?;
7045            }
7046        }
7047        state.end()
7048    }
7049}
7050
7051impl std::fmt::Debug for RunJobRequest {
7052    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7053        let mut debug_struct = f.debug_struct("RunJobRequest");
7054        debug_struct.field("name", &self.name);
7055        debug_struct.field("validate_only", &self.validate_only);
7056        debug_struct.field("etag", &self.etag);
7057        debug_struct.field("overrides", &self.overrides);
7058        if !self._unknown_fields.is_empty() {
7059            debug_struct.field("_unknown_fields", &self._unknown_fields);
7060        }
7061        debug_struct.finish()
7062    }
7063}
7064
7065/// Defines additional types related to [RunJobRequest].
7066pub mod run_job_request {
7067    #[allow(unused_imports)]
7068    use super::*;
7069
7070    /// RunJob Overrides that contains Execution fields to be overridden.
7071    #[derive(Clone, Default, PartialEq)]
7072    #[non_exhaustive]
7073    pub struct Overrides {
7074        /// Per container override specification.
7075        pub container_overrides:
7076            std::vec::Vec<crate::model::run_job_request::overrides::ContainerOverride>,
7077
7078        /// Optional. The desired number of tasks the execution should run. Will
7079        /// replace existing task_count value.
7080        pub task_count: i32,
7081
7082        /// Duration in seconds the task may be active before the system will
7083        /// actively try to mark it failed and kill associated containers. Will
7084        /// replace existing timeout_seconds value.
7085        pub timeout: std::option::Option<wkt::Duration>,
7086
7087        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7088    }
7089
7090    impl Overrides {
7091        pub fn new() -> Self {
7092            std::default::Default::default()
7093        }
7094
7095        /// Sets the value of [container_overrides][crate::model::run_job_request::Overrides::container_overrides].
7096        pub fn set_container_overrides<T, V>(mut self, v: T) -> Self
7097        where
7098            T: std::iter::IntoIterator<Item = V>,
7099            V: std::convert::Into<crate::model::run_job_request::overrides::ContainerOverride>,
7100        {
7101            use std::iter::Iterator;
7102            self.container_overrides = v.into_iter().map(|i| i.into()).collect();
7103            self
7104        }
7105
7106        /// Sets the value of [task_count][crate::model::run_job_request::Overrides::task_count].
7107        pub fn set_task_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7108            self.task_count = v.into();
7109            self
7110        }
7111
7112        /// Sets the value of [timeout][crate::model::run_job_request::Overrides::timeout].
7113        pub fn set_timeout<T>(mut self, v: T) -> Self
7114        where
7115            T: std::convert::Into<wkt::Duration>,
7116        {
7117            self.timeout = std::option::Option::Some(v.into());
7118            self
7119        }
7120
7121        /// Sets or clears the value of [timeout][crate::model::run_job_request::Overrides::timeout].
7122        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
7123        where
7124            T: std::convert::Into<wkt::Duration>,
7125        {
7126            self.timeout = v.map(|x| x.into());
7127            self
7128        }
7129    }
7130
7131    impl wkt::message::Message for Overrides {
7132        fn typename() -> &'static str {
7133            "type.googleapis.com/google.cloud.run.v2.RunJobRequest.Overrides"
7134        }
7135    }
7136
7137    #[doc(hidden)]
7138    impl<'de> serde::de::Deserialize<'de> for Overrides {
7139        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7140        where
7141            D: serde::Deserializer<'de>,
7142        {
7143            #[allow(non_camel_case_types)]
7144            #[doc(hidden)]
7145            #[derive(PartialEq, Eq, Hash)]
7146            enum __FieldTag {
7147                __container_overrides,
7148                __task_count,
7149                __timeout,
7150                Unknown(std::string::String),
7151            }
7152            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7153                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7154                where
7155                    D: serde::Deserializer<'de>,
7156                {
7157                    struct Visitor;
7158                    impl<'de> serde::de::Visitor<'de> for Visitor {
7159                        type Value = __FieldTag;
7160                        fn expecting(
7161                            &self,
7162                            formatter: &mut std::fmt::Formatter,
7163                        ) -> std::fmt::Result {
7164                            formatter.write_str("a field name for Overrides")
7165                        }
7166                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7167                        where
7168                            E: serde::de::Error,
7169                        {
7170                            use std::result::Result::Ok;
7171                            use std::string::ToString;
7172                            match value {
7173                                "containerOverrides" => Ok(__FieldTag::__container_overrides),
7174                                "container_overrides" => Ok(__FieldTag::__container_overrides),
7175                                "taskCount" => Ok(__FieldTag::__task_count),
7176                                "task_count" => Ok(__FieldTag::__task_count),
7177                                "timeout" => Ok(__FieldTag::__timeout),
7178                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7179                            }
7180                        }
7181                    }
7182                    deserializer.deserialize_identifier(Visitor)
7183                }
7184            }
7185            struct Visitor;
7186            impl<'de> serde::de::Visitor<'de> for Visitor {
7187                type Value = Overrides;
7188                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7189                    formatter.write_str("struct Overrides")
7190                }
7191                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7192                where
7193                    A: serde::de::MapAccess<'de>,
7194                {
7195                    #[allow(unused_imports)]
7196                    use serde::de::Error;
7197                    use std::option::Option::Some;
7198                    let mut fields = std::collections::HashSet::new();
7199                    let mut result = Self::Value::new();
7200                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7201                        #[allow(clippy::match_single_binding)]
7202                        match tag {
7203                            __FieldTag::__container_overrides => {
7204                                if !fields.insert(__FieldTag::__container_overrides) {
7205                                    return std::result::Result::Err(A::Error::duplicate_field(
7206                                        "multiple values for container_overrides",
7207                                    ));
7208                                }
7209                                result.container_overrides = map.next_value::<std::option::Option<std::vec::Vec<crate::model::run_job_request::overrides::ContainerOverride>>>()?.unwrap_or_default();
7210                            }
7211                            __FieldTag::__task_count => {
7212                                if !fields.insert(__FieldTag::__task_count) {
7213                                    return std::result::Result::Err(A::Error::duplicate_field(
7214                                        "multiple values for task_count",
7215                                    ));
7216                                }
7217                                struct __With(std::option::Option<i32>);
7218                                impl<'de> serde::de::Deserialize<'de> for __With {
7219                                    fn deserialize<D>(
7220                                        deserializer: D,
7221                                    ) -> std::result::Result<Self, D::Error>
7222                                    where
7223                                        D: serde::de::Deserializer<'de>,
7224                                    {
7225                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
7226                                    }
7227                                }
7228                                result.task_count =
7229                                    map.next_value::<__With>()?.0.unwrap_or_default();
7230                            }
7231                            __FieldTag::__timeout => {
7232                                if !fields.insert(__FieldTag::__timeout) {
7233                                    return std::result::Result::Err(A::Error::duplicate_field(
7234                                        "multiple values for timeout",
7235                                    ));
7236                                }
7237                                result.timeout =
7238                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
7239                            }
7240                            __FieldTag::Unknown(key) => {
7241                                let value = map.next_value::<serde_json::Value>()?;
7242                                result._unknown_fields.insert(key, value);
7243                            }
7244                        }
7245                    }
7246                    std::result::Result::Ok(result)
7247                }
7248            }
7249            deserializer.deserialize_any(Visitor)
7250        }
7251    }
7252
7253    #[doc(hidden)]
7254    impl serde::ser::Serialize for Overrides {
7255        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7256        where
7257            S: serde::ser::Serializer,
7258        {
7259            use serde::ser::SerializeMap;
7260            #[allow(unused_imports)]
7261            use std::option::Option::Some;
7262            let mut state = serializer.serialize_map(std::option::Option::None)?;
7263            if !self.container_overrides.is_empty() {
7264                state.serialize_entry("containerOverrides", &self.container_overrides)?;
7265            }
7266            if !wkt::internal::is_default(&self.task_count) {
7267                struct __With<'a>(&'a i32);
7268                impl<'a> serde::ser::Serialize for __With<'a> {
7269                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7270                    where
7271                        S: serde::ser::Serializer,
7272                    {
7273                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
7274                    }
7275                }
7276                state.serialize_entry("taskCount", &__With(&self.task_count))?;
7277            }
7278            if self.timeout.is_some() {
7279                state.serialize_entry("timeout", &self.timeout)?;
7280            }
7281            if !self._unknown_fields.is_empty() {
7282                for (key, value) in self._unknown_fields.iter() {
7283                    state.serialize_entry(key, &value)?;
7284                }
7285            }
7286            state.end()
7287        }
7288    }
7289
7290    impl std::fmt::Debug for Overrides {
7291        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7292            let mut debug_struct = f.debug_struct("Overrides");
7293            debug_struct.field("container_overrides", &self.container_overrides);
7294            debug_struct.field("task_count", &self.task_count);
7295            debug_struct.field("timeout", &self.timeout);
7296            if !self._unknown_fields.is_empty() {
7297                debug_struct.field("_unknown_fields", &self._unknown_fields);
7298            }
7299            debug_struct.finish()
7300        }
7301    }
7302
7303    /// Defines additional types related to [Overrides].
7304    pub mod overrides {
7305        #[allow(unused_imports)]
7306        use super::*;
7307
7308        /// Per-container override specification.
7309        #[derive(Clone, Default, PartialEq)]
7310        #[non_exhaustive]
7311        pub struct ContainerOverride {
7312            /// The name of the container specified as a DNS_LABEL.
7313            pub name: std::string::String,
7314
7315            /// Optional. Arguments to the entrypoint. Will replace existing args for
7316            /// override.
7317            pub args: std::vec::Vec<std::string::String>,
7318
7319            /// List of environment variables to set in the container. Will be merged
7320            /// with existing env for override.
7321            pub env: std::vec::Vec<crate::model::EnvVar>,
7322
7323            /// Optional. True if the intention is to clear out existing args list.
7324            pub clear_args: bool,
7325
7326            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7327        }
7328
7329        impl ContainerOverride {
7330            pub fn new() -> Self {
7331                std::default::Default::default()
7332            }
7333
7334            /// Sets the value of [name][crate::model::run_job_request::overrides::ContainerOverride::name].
7335            pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7336                self.name = v.into();
7337                self
7338            }
7339
7340            /// Sets the value of [args][crate::model::run_job_request::overrides::ContainerOverride::args].
7341            pub fn set_args<T, V>(mut self, v: T) -> Self
7342            where
7343                T: std::iter::IntoIterator<Item = V>,
7344                V: std::convert::Into<std::string::String>,
7345            {
7346                use std::iter::Iterator;
7347                self.args = v.into_iter().map(|i| i.into()).collect();
7348                self
7349            }
7350
7351            /// Sets the value of [env][crate::model::run_job_request::overrides::ContainerOverride::env].
7352            pub fn set_env<T, V>(mut self, v: T) -> Self
7353            where
7354                T: std::iter::IntoIterator<Item = V>,
7355                V: std::convert::Into<crate::model::EnvVar>,
7356            {
7357                use std::iter::Iterator;
7358                self.env = v.into_iter().map(|i| i.into()).collect();
7359                self
7360            }
7361
7362            /// Sets the value of [clear_args][crate::model::run_job_request::overrides::ContainerOverride::clear_args].
7363            pub fn set_clear_args<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7364                self.clear_args = v.into();
7365                self
7366            }
7367        }
7368
7369        impl wkt::message::Message for ContainerOverride {
7370            fn typename() -> &'static str {
7371                "type.googleapis.com/google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride"
7372            }
7373        }
7374
7375        #[doc(hidden)]
7376        impl<'de> serde::de::Deserialize<'de> for ContainerOverride {
7377            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7378            where
7379                D: serde::Deserializer<'de>,
7380            {
7381                #[allow(non_camel_case_types)]
7382                #[doc(hidden)]
7383                #[derive(PartialEq, Eq, Hash)]
7384                enum __FieldTag {
7385                    __name,
7386                    __args,
7387                    __env,
7388                    __clear_args,
7389                    Unknown(std::string::String),
7390                }
7391                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7392                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7393                    where
7394                        D: serde::Deserializer<'de>,
7395                    {
7396                        struct Visitor;
7397                        impl<'de> serde::de::Visitor<'de> for Visitor {
7398                            type Value = __FieldTag;
7399                            fn expecting(
7400                                &self,
7401                                formatter: &mut std::fmt::Formatter,
7402                            ) -> std::fmt::Result {
7403                                formatter.write_str("a field name for ContainerOverride")
7404                            }
7405                            fn visit_str<E>(
7406                                self,
7407                                value: &str,
7408                            ) -> std::result::Result<Self::Value, E>
7409                            where
7410                                E: serde::de::Error,
7411                            {
7412                                use std::result::Result::Ok;
7413                                use std::string::ToString;
7414                                match value {
7415                                    "name" => Ok(__FieldTag::__name),
7416                                    "args" => Ok(__FieldTag::__args),
7417                                    "env" => Ok(__FieldTag::__env),
7418                                    "clearArgs" => Ok(__FieldTag::__clear_args),
7419                                    "clear_args" => Ok(__FieldTag::__clear_args),
7420                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
7421                                }
7422                            }
7423                        }
7424                        deserializer.deserialize_identifier(Visitor)
7425                    }
7426                }
7427                struct Visitor;
7428                impl<'de> serde::de::Visitor<'de> for Visitor {
7429                    type Value = ContainerOverride;
7430                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7431                        formatter.write_str("struct ContainerOverride")
7432                    }
7433                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7434                    where
7435                        A: serde::de::MapAccess<'de>,
7436                    {
7437                        #[allow(unused_imports)]
7438                        use serde::de::Error;
7439                        use std::option::Option::Some;
7440                        let mut fields = std::collections::HashSet::new();
7441                        let mut result = Self::Value::new();
7442                        while let Some(tag) = map.next_key::<__FieldTag>()? {
7443                            #[allow(clippy::match_single_binding)]
7444                            match tag {
7445                                __FieldTag::__name => {
7446                                    if !fields.insert(__FieldTag::__name) {
7447                                        return std::result::Result::Err(
7448                                            A::Error::duplicate_field("multiple values for name"),
7449                                        );
7450                                    }
7451                                    result.name = map
7452                                        .next_value::<std::option::Option<std::string::String>>()?
7453                                        .unwrap_or_default();
7454                                }
7455                                __FieldTag::__args => {
7456                                    if !fields.insert(__FieldTag::__args) {
7457                                        return std::result::Result::Err(
7458                                            A::Error::duplicate_field("multiple values for args"),
7459                                        );
7460                                    }
7461                                    result.args = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
7462                                }
7463                                __FieldTag::__env => {
7464                                    if !fields.insert(__FieldTag::__env) {
7465                                        return std::result::Result::Err(
7466                                            A::Error::duplicate_field("multiple values for env"),
7467                                        );
7468                                    }
7469                                    result.env =
7470                                        map.next_value::<std::option::Option<
7471                                            std::vec::Vec<crate::model::EnvVar>,
7472                                        >>()?
7473                                        .unwrap_or_default();
7474                                }
7475                                __FieldTag::__clear_args => {
7476                                    if !fields.insert(__FieldTag::__clear_args) {
7477                                        return std::result::Result::Err(
7478                                            A::Error::duplicate_field(
7479                                                "multiple values for clear_args",
7480                                            ),
7481                                        );
7482                                    }
7483                                    result.clear_args = map
7484                                        .next_value::<std::option::Option<bool>>()?
7485                                        .unwrap_or_default();
7486                                }
7487                                __FieldTag::Unknown(key) => {
7488                                    let value = map.next_value::<serde_json::Value>()?;
7489                                    result._unknown_fields.insert(key, value);
7490                                }
7491                            }
7492                        }
7493                        std::result::Result::Ok(result)
7494                    }
7495                }
7496                deserializer.deserialize_any(Visitor)
7497            }
7498        }
7499
7500        #[doc(hidden)]
7501        impl serde::ser::Serialize for ContainerOverride {
7502            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7503            where
7504                S: serde::ser::Serializer,
7505            {
7506                use serde::ser::SerializeMap;
7507                #[allow(unused_imports)]
7508                use std::option::Option::Some;
7509                let mut state = serializer.serialize_map(std::option::Option::None)?;
7510                if !self.name.is_empty() {
7511                    state.serialize_entry("name", &self.name)?;
7512                }
7513                if !self.args.is_empty() {
7514                    state.serialize_entry("args", &self.args)?;
7515                }
7516                if !self.env.is_empty() {
7517                    state.serialize_entry("env", &self.env)?;
7518                }
7519                if !wkt::internal::is_default(&self.clear_args) {
7520                    state.serialize_entry("clearArgs", &self.clear_args)?;
7521                }
7522                if !self._unknown_fields.is_empty() {
7523                    for (key, value) in self._unknown_fields.iter() {
7524                        state.serialize_entry(key, &value)?;
7525                    }
7526                }
7527                state.end()
7528            }
7529        }
7530
7531        impl std::fmt::Debug for ContainerOverride {
7532            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7533                let mut debug_struct = f.debug_struct("ContainerOverride");
7534                debug_struct.field("name", &self.name);
7535                debug_struct.field("args", &self.args);
7536                debug_struct.field("env", &self.env);
7537                debug_struct.field("clear_args", &self.clear_args);
7538                if !self._unknown_fields.is_empty() {
7539                    debug_struct.field("_unknown_fields", &self._unknown_fields);
7540                }
7541                debug_struct.finish()
7542            }
7543        }
7544    }
7545}
7546
7547/// Job represents the configuration of a single job, which references a
7548/// container image that is run to completion.
7549#[derive(Clone, Default, PartialEq)]
7550#[non_exhaustive]
7551pub struct Job {
7552    /// The fully qualified name of this Job.
7553    ///
7554    /// Format:
7555    /// projects/{project}/locations/{location}/jobs/{job}
7556    pub name: std::string::String,
7557
7558    /// Output only. Server assigned unique identifier for the Execution. The value
7559    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
7560    /// deleted.
7561    pub uid: std::string::String,
7562
7563    /// Output only. A number that monotonically increases every time the user
7564    /// modifies the desired state.
7565    pub generation: i64,
7566
7567    /// Unstructured key value map that can be used to organize and categorize
7568    /// objects.
7569    /// User-provided labels are shared with Google's billing system, so they can
7570    /// be used to filter, or break down billing charges by team, component,
7571    /// environment, state, etc. For more information, visit
7572    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
7573    /// <https://cloud.google.com/run/docs/configuring/labels>.
7574    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7575
7576    /// Unstructured key value map that may
7577    /// be set by external tools to store and arbitrary metadata.
7578    /// They are not queryable and should be preserved
7579    /// when modifying objects.
7580    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7581
7582    /// Output only. The creation time.
7583    pub create_time: std::option::Option<wkt::Timestamp>,
7584
7585    /// Output only. The last-modified time.
7586    pub update_time: std::option::Option<wkt::Timestamp>,
7587
7588    /// Output only. The deletion time. It is only populated as a response to a
7589    /// Delete request.
7590    pub delete_time: std::option::Option<wkt::Timestamp>,
7591
7592    /// Output only. For a deleted resource, the time after which it will be
7593    /// permamently deleted.
7594    pub expire_time: std::option::Option<wkt::Timestamp>,
7595
7596    /// Output only. Email address of the authenticated creator.
7597    pub creator: std::string::String,
7598
7599    /// Output only. Email address of the last authenticated modifier.
7600    pub last_modifier: std::string::String,
7601
7602    /// Arbitrary identifier for the API client.
7603    pub client: std::string::String,
7604
7605    /// Arbitrary version identifier for the API client.
7606    pub client_version: std::string::String,
7607
7608    /// The launch stage as defined by [Google Cloud Platform
7609    /// Launch Stages](https://cloud.google.com/terms/launch-stages).
7610    /// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
7611    /// is assumed.
7612    /// Set the launch stage to a preview stage on input to allow use of preview
7613    /// features in that stage. On read (or output), describes whether the resource
7614    /// uses preview features.
7615    ///
7616    /// For example, if ALPHA is provided as input, but only BETA and GA-level
7617    /// features are used, this field will be BETA on output.
7618    pub launch_stage: api::model::LaunchStage,
7619
7620    /// Settings for the Binary Authorization feature.
7621    pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
7622
7623    /// Required. The template used to create executions for this Job.
7624    pub template: std::option::Option<crate::model::ExecutionTemplate>,
7625
7626    /// Output only. The generation of this Job. See comments in `reconciling` for
7627    /// additional information on reconciliation process in Cloud Run.
7628    pub observed_generation: i64,
7629
7630    /// Output only. The Condition of this Job, containing its readiness status,
7631    /// and detailed error information in case it did not reach the desired state.
7632    pub terminal_condition: std::option::Option<crate::model::Condition>,
7633
7634    /// Output only. The Conditions of all other associated sub-resources. They
7635    /// contain additional diagnostics information in case the Job does not reach
7636    /// its desired state. See comments in `reconciling` for additional information
7637    /// on reconciliation process in Cloud Run.
7638    pub conditions: std::vec::Vec<crate::model::Condition>,
7639
7640    /// Output only. Number of executions created for this job.
7641    pub execution_count: i32,
7642
7643    /// Output only. Name of the last created execution.
7644    pub latest_created_execution: std::option::Option<crate::model::ExecutionReference>,
7645
7646    /// Output only. Returns true if the Job is currently being acted upon by the
7647    /// system to bring it into the desired state.
7648    ///
7649    /// When a new Job is created, or an existing one is updated, Cloud Run
7650    /// will asynchronously perform all necessary steps to bring the Job to the
7651    /// desired state. This process is called reconciliation.
7652    /// While reconciliation is in process, `observed_generation` and
7653    /// `latest_succeeded_execution`, will have transient values that might
7654    /// mismatch the intended state: Once reconciliation is over (and this field is
7655    /// false), there are two possible outcomes: reconciliation succeeded and the
7656    /// state matches the Job, or there was an error,  and reconciliation failed.
7657    /// This state can be found in `terminal_condition.state`.
7658    ///
7659    /// If reconciliation succeeded, the following fields will match:
7660    /// `observed_generation` and `generation`, `latest_succeeded_execution` and
7661    /// `latest_created_execution`.
7662    ///
7663    /// If reconciliation failed, `observed_generation` and
7664    /// `latest_succeeded_execution` will have the state of the last succeeded
7665    /// execution or empty for newly created Job. Additional information on the
7666    /// failure can be found in `terminal_condition` and `conditions`.
7667    pub reconciling: bool,
7668
7669    /// Output only. Reserved for future use.
7670    pub satisfies_pzs: bool,
7671
7672    /// Output only. A system-generated fingerprint for this version of the
7673    /// resource. May be used to detect modification conflict during updates.
7674    pub etag: std::string::String,
7675
7676    pub create_execution: std::option::Option<crate::model::job::CreateExecution>,
7677
7678    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7679}
7680
7681impl Job {
7682    pub fn new() -> Self {
7683        std::default::Default::default()
7684    }
7685
7686    /// Sets the value of [name][crate::model::Job::name].
7687    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7688        self.name = v.into();
7689        self
7690    }
7691
7692    /// Sets the value of [uid][crate::model::Job::uid].
7693    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7694        self.uid = v.into();
7695        self
7696    }
7697
7698    /// Sets the value of [generation][crate::model::Job::generation].
7699    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7700        self.generation = v.into();
7701        self
7702    }
7703
7704    /// Sets the value of [labels][crate::model::Job::labels].
7705    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7706    where
7707        T: std::iter::IntoIterator<Item = (K, V)>,
7708        K: std::convert::Into<std::string::String>,
7709        V: std::convert::Into<std::string::String>,
7710    {
7711        use std::iter::Iterator;
7712        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7713        self
7714    }
7715
7716    /// Sets the value of [annotations][crate::model::Job::annotations].
7717    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7718    where
7719        T: std::iter::IntoIterator<Item = (K, V)>,
7720        K: std::convert::Into<std::string::String>,
7721        V: std::convert::Into<std::string::String>,
7722    {
7723        use std::iter::Iterator;
7724        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7725        self
7726    }
7727
7728    /// Sets the value of [create_time][crate::model::Job::create_time].
7729    pub fn set_create_time<T>(mut self, v: T) -> Self
7730    where
7731        T: std::convert::Into<wkt::Timestamp>,
7732    {
7733        self.create_time = std::option::Option::Some(v.into());
7734        self
7735    }
7736
7737    /// Sets or clears the value of [create_time][crate::model::Job::create_time].
7738    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7739    where
7740        T: std::convert::Into<wkt::Timestamp>,
7741    {
7742        self.create_time = v.map(|x| x.into());
7743        self
7744    }
7745
7746    /// Sets the value of [update_time][crate::model::Job::update_time].
7747    pub fn set_update_time<T>(mut self, v: T) -> Self
7748    where
7749        T: std::convert::Into<wkt::Timestamp>,
7750    {
7751        self.update_time = std::option::Option::Some(v.into());
7752        self
7753    }
7754
7755    /// Sets or clears the value of [update_time][crate::model::Job::update_time].
7756    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7757    where
7758        T: std::convert::Into<wkt::Timestamp>,
7759    {
7760        self.update_time = v.map(|x| x.into());
7761        self
7762    }
7763
7764    /// Sets the value of [delete_time][crate::model::Job::delete_time].
7765    pub fn set_delete_time<T>(mut self, v: T) -> Self
7766    where
7767        T: std::convert::Into<wkt::Timestamp>,
7768    {
7769        self.delete_time = std::option::Option::Some(v.into());
7770        self
7771    }
7772
7773    /// Sets or clears the value of [delete_time][crate::model::Job::delete_time].
7774    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
7775    where
7776        T: std::convert::Into<wkt::Timestamp>,
7777    {
7778        self.delete_time = v.map(|x| x.into());
7779        self
7780    }
7781
7782    /// Sets the value of [expire_time][crate::model::Job::expire_time].
7783    pub fn set_expire_time<T>(mut self, v: T) -> Self
7784    where
7785        T: std::convert::Into<wkt::Timestamp>,
7786    {
7787        self.expire_time = std::option::Option::Some(v.into());
7788        self
7789    }
7790
7791    /// Sets or clears the value of [expire_time][crate::model::Job::expire_time].
7792    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
7793    where
7794        T: std::convert::Into<wkt::Timestamp>,
7795    {
7796        self.expire_time = v.map(|x| x.into());
7797        self
7798    }
7799
7800    /// Sets the value of [creator][crate::model::Job::creator].
7801    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7802        self.creator = v.into();
7803        self
7804    }
7805
7806    /// Sets the value of [last_modifier][crate::model::Job::last_modifier].
7807    pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7808        self.last_modifier = v.into();
7809        self
7810    }
7811
7812    /// Sets the value of [client][crate::model::Job::client].
7813    pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7814        self.client = v.into();
7815        self
7816    }
7817
7818    /// Sets the value of [client_version][crate::model::Job::client_version].
7819    pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7820        self.client_version = v.into();
7821        self
7822    }
7823
7824    /// Sets the value of [launch_stage][crate::model::Job::launch_stage].
7825    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
7826        mut self,
7827        v: T,
7828    ) -> Self {
7829        self.launch_stage = v.into();
7830        self
7831    }
7832
7833    /// Sets the value of [binary_authorization][crate::model::Job::binary_authorization].
7834    pub fn set_binary_authorization<T>(mut self, v: T) -> Self
7835    where
7836        T: std::convert::Into<crate::model::BinaryAuthorization>,
7837    {
7838        self.binary_authorization = std::option::Option::Some(v.into());
7839        self
7840    }
7841
7842    /// Sets or clears the value of [binary_authorization][crate::model::Job::binary_authorization].
7843    pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
7844    where
7845        T: std::convert::Into<crate::model::BinaryAuthorization>,
7846    {
7847        self.binary_authorization = v.map(|x| x.into());
7848        self
7849    }
7850
7851    /// Sets the value of [template][crate::model::Job::template].
7852    pub fn set_template<T>(mut self, v: T) -> Self
7853    where
7854        T: std::convert::Into<crate::model::ExecutionTemplate>,
7855    {
7856        self.template = std::option::Option::Some(v.into());
7857        self
7858    }
7859
7860    /// Sets or clears the value of [template][crate::model::Job::template].
7861    pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
7862    where
7863        T: std::convert::Into<crate::model::ExecutionTemplate>,
7864    {
7865        self.template = v.map(|x| x.into());
7866        self
7867    }
7868
7869    /// Sets the value of [observed_generation][crate::model::Job::observed_generation].
7870    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7871        self.observed_generation = v.into();
7872        self
7873    }
7874
7875    /// Sets the value of [terminal_condition][crate::model::Job::terminal_condition].
7876    pub fn set_terminal_condition<T>(mut self, v: T) -> Self
7877    where
7878        T: std::convert::Into<crate::model::Condition>,
7879    {
7880        self.terminal_condition = std::option::Option::Some(v.into());
7881        self
7882    }
7883
7884    /// Sets or clears the value of [terminal_condition][crate::model::Job::terminal_condition].
7885    pub fn set_or_clear_terminal_condition<T>(mut self, v: std::option::Option<T>) -> Self
7886    where
7887        T: std::convert::Into<crate::model::Condition>,
7888    {
7889        self.terminal_condition = v.map(|x| x.into());
7890        self
7891    }
7892
7893    /// Sets the value of [conditions][crate::model::Job::conditions].
7894    pub fn set_conditions<T, V>(mut self, v: T) -> Self
7895    where
7896        T: std::iter::IntoIterator<Item = V>,
7897        V: std::convert::Into<crate::model::Condition>,
7898    {
7899        use std::iter::Iterator;
7900        self.conditions = v.into_iter().map(|i| i.into()).collect();
7901        self
7902    }
7903
7904    /// Sets the value of [execution_count][crate::model::Job::execution_count].
7905    pub fn set_execution_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7906        self.execution_count = v.into();
7907        self
7908    }
7909
7910    /// Sets the value of [latest_created_execution][crate::model::Job::latest_created_execution].
7911    pub fn set_latest_created_execution<T>(mut self, v: T) -> Self
7912    where
7913        T: std::convert::Into<crate::model::ExecutionReference>,
7914    {
7915        self.latest_created_execution = std::option::Option::Some(v.into());
7916        self
7917    }
7918
7919    /// Sets or clears the value of [latest_created_execution][crate::model::Job::latest_created_execution].
7920    pub fn set_or_clear_latest_created_execution<T>(mut self, v: std::option::Option<T>) -> Self
7921    where
7922        T: std::convert::Into<crate::model::ExecutionReference>,
7923    {
7924        self.latest_created_execution = v.map(|x| x.into());
7925        self
7926    }
7927
7928    /// Sets the value of [reconciling][crate::model::Job::reconciling].
7929    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7930        self.reconciling = v.into();
7931        self
7932    }
7933
7934    /// Sets the value of [satisfies_pzs][crate::model::Job::satisfies_pzs].
7935    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7936        self.satisfies_pzs = v.into();
7937        self
7938    }
7939
7940    /// Sets the value of [etag][crate::model::Job::etag].
7941    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7942        self.etag = v.into();
7943        self
7944    }
7945
7946    /// Sets the value of [create_execution][crate::model::Job::create_execution].
7947    ///
7948    /// Note that all the setters affecting `create_execution` are mutually
7949    /// exclusive.
7950    pub fn set_create_execution<
7951        T: std::convert::Into<std::option::Option<crate::model::job::CreateExecution>>,
7952    >(
7953        mut self,
7954        v: T,
7955    ) -> Self {
7956        self.create_execution = v.into();
7957        self
7958    }
7959
7960    /// The value of [create_execution][crate::model::Job::create_execution]
7961    /// if it holds a `StartExecutionToken`, `None` if the field is not set or
7962    /// holds a different branch.
7963    pub fn start_execution_token(&self) -> std::option::Option<&std::string::String> {
7964        #[allow(unreachable_patterns)]
7965        self.create_execution.as_ref().and_then(|v| match v {
7966            crate::model::job::CreateExecution::StartExecutionToken(v) => {
7967                std::option::Option::Some(v)
7968            }
7969            _ => std::option::Option::None,
7970        })
7971    }
7972
7973    /// Sets the value of [create_execution][crate::model::Job::create_execution]
7974    /// to hold a `StartExecutionToken`.
7975    ///
7976    /// Note that all the setters affecting `create_execution` are
7977    /// mutually exclusive.
7978    pub fn set_start_execution_token<T: std::convert::Into<std::string::String>>(
7979        mut self,
7980        v: T,
7981    ) -> Self {
7982        self.create_execution = std::option::Option::Some(
7983            crate::model::job::CreateExecution::StartExecutionToken(v.into()),
7984        );
7985        self
7986    }
7987
7988    /// The value of [create_execution][crate::model::Job::create_execution]
7989    /// if it holds a `RunExecutionToken`, `None` if the field is not set or
7990    /// holds a different branch.
7991    pub fn run_execution_token(&self) -> std::option::Option<&std::string::String> {
7992        #[allow(unreachable_patterns)]
7993        self.create_execution.as_ref().and_then(|v| match v {
7994            crate::model::job::CreateExecution::RunExecutionToken(v) => {
7995                std::option::Option::Some(v)
7996            }
7997            _ => std::option::Option::None,
7998        })
7999    }
8000
8001    /// Sets the value of [create_execution][crate::model::Job::create_execution]
8002    /// to hold a `RunExecutionToken`.
8003    ///
8004    /// Note that all the setters affecting `create_execution` are
8005    /// mutually exclusive.
8006    pub fn set_run_execution_token<T: std::convert::Into<std::string::String>>(
8007        mut self,
8008        v: T,
8009    ) -> Self {
8010        self.create_execution = std::option::Option::Some(
8011            crate::model::job::CreateExecution::RunExecutionToken(v.into()),
8012        );
8013        self
8014    }
8015}
8016
8017impl wkt::message::Message for Job {
8018    fn typename() -> &'static str {
8019        "type.googleapis.com/google.cloud.run.v2.Job"
8020    }
8021}
8022
8023#[doc(hidden)]
8024impl<'de> serde::de::Deserialize<'de> for Job {
8025    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8026    where
8027        D: serde::Deserializer<'de>,
8028    {
8029        #[allow(non_camel_case_types)]
8030        #[doc(hidden)]
8031        #[derive(PartialEq, Eq, Hash)]
8032        enum __FieldTag {
8033            __name,
8034            __uid,
8035            __generation,
8036            __labels,
8037            __annotations,
8038            __create_time,
8039            __update_time,
8040            __delete_time,
8041            __expire_time,
8042            __creator,
8043            __last_modifier,
8044            __client,
8045            __client_version,
8046            __launch_stage,
8047            __binary_authorization,
8048            __template,
8049            __observed_generation,
8050            __terminal_condition,
8051            __conditions,
8052            __execution_count,
8053            __latest_created_execution,
8054            __reconciling,
8055            __satisfies_pzs,
8056            __start_execution_token,
8057            __run_execution_token,
8058            __etag,
8059            Unknown(std::string::String),
8060        }
8061        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8062            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8063            where
8064                D: serde::Deserializer<'de>,
8065            {
8066                struct Visitor;
8067                impl<'de> serde::de::Visitor<'de> for Visitor {
8068                    type Value = __FieldTag;
8069                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8070                        formatter.write_str("a field name for Job")
8071                    }
8072                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8073                    where
8074                        E: serde::de::Error,
8075                    {
8076                        use std::result::Result::Ok;
8077                        use std::string::ToString;
8078                        match value {
8079                            "name" => Ok(__FieldTag::__name),
8080                            "uid" => Ok(__FieldTag::__uid),
8081                            "generation" => Ok(__FieldTag::__generation),
8082                            "labels" => Ok(__FieldTag::__labels),
8083                            "annotations" => Ok(__FieldTag::__annotations),
8084                            "createTime" => Ok(__FieldTag::__create_time),
8085                            "create_time" => Ok(__FieldTag::__create_time),
8086                            "updateTime" => Ok(__FieldTag::__update_time),
8087                            "update_time" => Ok(__FieldTag::__update_time),
8088                            "deleteTime" => Ok(__FieldTag::__delete_time),
8089                            "delete_time" => Ok(__FieldTag::__delete_time),
8090                            "expireTime" => Ok(__FieldTag::__expire_time),
8091                            "expire_time" => Ok(__FieldTag::__expire_time),
8092                            "creator" => Ok(__FieldTag::__creator),
8093                            "lastModifier" => Ok(__FieldTag::__last_modifier),
8094                            "last_modifier" => Ok(__FieldTag::__last_modifier),
8095                            "client" => Ok(__FieldTag::__client),
8096                            "clientVersion" => Ok(__FieldTag::__client_version),
8097                            "client_version" => Ok(__FieldTag::__client_version),
8098                            "launchStage" => Ok(__FieldTag::__launch_stage),
8099                            "launch_stage" => Ok(__FieldTag::__launch_stage),
8100                            "binaryAuthorization" => Ok(__FieldTag::__binary_authorization),
8101                            "binary_authorization" => Ok(__FieldTag::__binary_authorization),
8102                            "template" => Ok(__FieldTag::__template),
8103                            "observedGeneration" => Ok(__FieldTag::__observed_generation),
8104                            "observed_generation" => Ok(__FieldTag::__observed_generation),
8105                            "terminalCondition" => Ok(__FieldTag::__terminal_condition),
8106                            "terminal_condition" => Ok(__FieldTag::__terminal_condition),
8107                            "conditions" => Ok(__FieldTag::__conditions),
8108                            "executionCount" => Ok(__FieldTag::__execution_count),
8109                            "execution_count" => Ok(__FieldTag::__execution_count),
8110                            "latestCreatedExecution" => Ok(__FieldTag::__latest_created_execution),
8111                            "latest_created_execution" => {
8112                                Ok(__FieldTag::__latest_created_execution)
8113                            }
8114                            "reconciling" => Ok(__FieldTag::__reconciling),
8115                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
8116                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
8117                            "startExecutionToken" => Ok(__FieldTag::__start_execution_token),
8118                            "start_execution_token" => Ok(__FieldTag::__start_execution_token),
8119                            "runExecutionToken" => Ok(__FieldTag::__run_execution_token),
8120                            "run_execution_token" => Ok(__FieldTag::__run_execution_token),
8121                            "etag" => Ok(__FieldTag::__etag),
8122                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8123                        }
8124                    }
8125                }
8126                deserializer.deserialize_identifier(Visitor)
8127            }
8128        }
8129        struct Visitor;
8130        impl<'de> serde::de::Visitor<'de> for Visitor {
8131            type Value = Job;
8132            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8133                formatter.write_str("struct Job")
8134            }
8135            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8136            where
8137                A: serde::de::MapAccess<'de>,
8138            {
8139                #[allow(unused_imports)]
8140                use serde::de::Error;
8141                use std::option::Option::Some;
8142                let mut fields = std::collections::HashSet::new();
8143                let mut result = Self::Value::new();
8144                while let Some(tag) = map.next_key::<__FieldTag>()? {
8145                    #[allow(clippy::match_single_binding)]
8146                    match tag {
8147                        __FieldTag::__name => {
8148                            if !fields.insert(__FieldTag::__name) {
8149                                return std::result::Result::Err(A::Error::duplicate_field(
8150                                    "multiple values for name",
8151                                ));
8152                            }
8153                            result.name = map
8154                                .next_value::<std::option::Option<std::string::String>>()?
8155                                .unwrap_or_default();
8156                        }
8157                        __FieldTag::__uid => {
8158                            if !fields.insert(__FieldTag::__uid) {
8159                                return std::result::Result::Err(A::Error::duplicate_field(
8160                                    "multiple values for uid",
8161                                ));
8162                            }
8163                            result.uid = map
8164                                .next_value::<std::option::Option<std::string::String>>()?
8165                                .unwrap_or_default();
8166                        }
8167                        __FieldTag::__generation => {
8168                            if !fields.insert(__FieldTag::__generation) {
8169                                return std::result::Result::Err(A::Error::duplicate_field(
8170                                    "multiple values for generation",
8171                                ));
8172                            }
8173                            struct __With(std::option::Option<i64>);
8174                            impl<'de> serde::de::Deserialize<'de> for __With {
8175                                fn deserialize<D>(
8176                                    deserializer: D,
8177                                ) -> std::result::Result<Self, D::Error>
8178                                where
8179                                    D: serde::de::Deserializer<'de>,
8180                                {
8181                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
8182                                }
8183                            }
8184                            result.generation = map.next_value::<__With>()?.0.unwrap_or_default();
8185                        }
8186                        __FieldTag::__labels => {
8187                            if !fields.insert(__FieldTag::__labels) {
8188                                return std::result::Result::Err(A::Error::duplicate_field(
8189                                    "multiple values for labels",
8190                                ));
8191                            }
8192                            result.labels = map
8193                                .next_value::<std::option::Option<
8194                                    std::collections::HashMap<
8195                                        std::string::String,
8196                                        std::string::String,
8197                                    >,
8198                                >>()?
8199                                .unwrap_or_default();
8200                        }
8201                        __FieldTag::__annotations => {
8202                            if !fields.insert(__FieldTag::__annotations) {
8203                                return std::result::Result::Err(A::Error::duplicate_field(
8204                                    "multiple values for annotations",
8205                                ));
8206                            }
8207                            result.annotations = map
8208                                .next_value::<std::option::Option<
8209                                    std::collections::HashMap<
8210                                        std::string::String,
8211                                        std::string::String,
8212                                    >,
8213                                >>()?
8214                                .unwrap_or_default();
8215                        }
8216                        __FieldTag::__create_time => {
8217                            if !fields.insert(__FieldTag::__create_time) {
8218                                return std::result::Result::Err(A::Error::duplicate_field(
8219                                    "multiple values for create_time",
8220                                ));
8221                            }
8222                            result.create_time =
8223                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8224                        }
8225                        __FieldTag::__update_time => {
8226                            if !fields.insert(__FieldTag::__update_time) {
8227                                return std::result::Result::Err(A::Error::duplicate_field(
8228                                    "multiple values for update_time",
8229                                ));
8230                            }
8231                            result.update_time =
8232                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8233                        }
8234                        __FieldTag::__delete_time => {
8235                            if !fields.insert(__FieldTag::__delete_time) {
8236                                return std::result::Result::Err(A::Error::duplicate_field(
8237                                    "multiple values for delete_time",
8238                                ));
8239                            }
8240                            result.delete_time =
8241                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8242                        }
8243                        __FieldTag::__expire_time => {
8244                            if !fields.insert(__FieldTag::__expire_time) {
8245                                return std::result::Result::Err(A::Error::duplicate_field(
8246                                    "multiple values for expire_time",
8247                                ));
8248                            }
8249                            result.expire_time =
8250                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8251                        }
8252                        __FieldTag::__creator => {
8253                            if !fields.insert(__FieldTag::__creator) {
8254                                return std::result::Result::Err(A::Error::duplicate_field(
8255                                    "multiple values for creator",
8256                                ));
8257                            }
8258                            result.creator = map
8259                                .next_value::<std::option::Option<std::string::String>>()?
8260                                .unwrap_or_default();
8261                        }
8262                        __FieldTag::__last_modifier => {
8263                            if !fields.insert(__FieldTag::__last_modifier) {
8264                                return std::result::Result::Err(A::Error::duplicate_field(
8265                                    "multiple values for last_modifier",
8266                                ));
8267                            }
8268                            result.last_modifier = map
8269                                .next_value::<std::option::Option<std::string::String>>()?
8270                                .unwrap_or_default();
8271                        }
8272                        __FieldTag::__client => {
8273                            if !fields.insert(__FieldTag::__client) {
8274                                return std::result::Result::Err(A::Error::duplicate_field(
8275                                    "multiple values for client",
8276                                ));
8277                            }
8278                            result.client = map
8279                                .next_value::<std::option::Option<std::string::String>>()?
8280                                .unwrap_or_default();
8281                        }
8282                        __FieldTag::__client_version => {
8283                            if !fields.insert(__FieldTag::__client_version) {
8284                                return std::result::Result::Err(A::Error::duplicate_field(
8285                                    "multiple values for client_version",
8286                                ));
8287                            }
8288                            result.client_version = map
8289                                .next_value::<std::option::Option<std::string::String>>()?
8290                                .unwrap_or_default();
8291                        }
8292                        __FieldTag::__launch_stage => {
8293                            if !fields.insert(__FieldTag::__launch_stage) {
8294                                return std::result::Result::Err(A::Error::duplicate_field(
8295                                    "multiple values for launch_stage",
8296                                ));
8297                            }
8298                            result.launch_stage = map
8299                                .next_value::<std::option::Option<api::model::LaunchStage>>()?
8300                                .unwrap_or_default();
8301                        }
8302                        __FieldTag::__binary_authorization => {
8303                            if !fields.insert(__FieldTag::__binary_authorization) {
8304                                return std::result::Result::Err(A::Error::duplicate_field(
8305                                    "multiple values for binary_authorization",
8306                                ));
8307                            }
8308                            result.binary_authorization = map.next_value::<std::option::Option<crate::model::BinaryAuthorization>>()?
8309                                ;
8310                        }
8311                        __FieldTag::__template => {
8312                            if !fields.insert(__FieldTag::__template) {
8313                                return std::result::Result::Err(A::Error::duplicate_field(
8314                                    "multiple values for template",
8315                                ));
8316                            }
8317                            result.template = map
8318                                .next_value::<std::option::Option<crate::model::ExecutionTemplate>>(
8319                                )?;
8320                        }
8321                        __FieldTag::__observed_generation => {
8322                            if !fields.insert(__FieldTag::__observed_generation) {
8323                                return std::result::Result::Err(A::Error::duplicate_field(
8324                                    "multiple values for observed_generation",
8325                                ));
8326                            }
8327                            struct __With(std::option::Option<i64>);
8328                            impl<'de> serde::de::Deserialize<'de> for __With {
8329                                fn deserialize<D>(
8330                                    deserializer: D,
8331                                ) -> std::result::Result<Self, D::Error>
8332                                where
8333                                    D: serde::de::Deserializer<'de>,
8334                                {
8335                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
8336                                }
8337                            }
8338                            result.observed_generation =
8339                                map.next_value::<__With>()?.0.unwrap_or_default();
8340                        }
8341                        __FieldTag::__terminal_condition => {
8342                            if !fields.insert(__FieldTag::__terminal_condition) {
8343                                return std::result::Result::Err(A::Error::duplicate_field(
8344                                    "multiple values for terminal_condition",
8345                                ));
8346                            }
8347                            result.terminal_condition =
8348                                map.next_value::<std::option::Option<crate::model::Condition>>()?;
8349                        }
8350                        __FieldTag::__conditions => {
8351                            if !fields.insert(__FieldTag::__conditions) {
8352                                return std::result::Result::Err(A::Error::duplicate_field(
8353                                    "multiple values for conditions",
8354                                ));
8355                            }
8356                            result.conditions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Condition>>>()?.unwrap_or_default();
8357                        }
8358                        __FieldTag::__execution_count => {
8359                            if !fields.insert(__FieldTag::__execution_count) {
8360                                return std::result::Result::Err(A::Error::duplicate_field(
8361                                    "multiple values for execution_count",
8362                                ));
8363                            }
8364                            struct __With(std::option::Option<i32>);
8365                            impl<'de> serde::de::Deserialize<'de> for __With {
8366                                fn deserialize<D>(
8367                                    deserializer: D,
8368                                ) -> std::result::Result<Self, D::Error>
8369                                where
8370                                    D: serde::de::Deserializer<'de>,
8371                                {
8372                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8373                                }
8374                            }
8375                            result.execution_count =
8376                                map.next_value::<__With>()?.0.unwrap_or_default();
8377                        }
8378                        __FieldTag::__latest_created_execution => {
8379                            if !fields.insert(__FieldTag::__latest_created_execution) {
8380                                return std::result::Result::Err(A::Error::duplicate_field(
8381                                    "multiple values for latest_created_execution",
8382                                ));
8383                            }
8384                            result.latest_created_execution = map.next_value::<std::option::Option<crate::model::ExecutionReference>>()?
8385                                ;
8386                        }
8387                        __FieldTag::__reconciling => {
8388                            if !fields.insert(__FieldTag::__reconciling) {
8389                                return std::result::Result::Err(A::Error::duplicate_field(
8390                                    "multiple values for reconciling",
8391                                ));
8392                            }
8393                            result.reconciling = map
8394                                .next_value::<std::option::Option<bool>>()?
8395                                .unwrap_or_default();
8396                        }
8397                        __FieldTag::__satisfies_pzs => {
8398                            if !fields.insert(__FieldTag::__satisfies_pzs) {
8399                                return std::result::Result::Err(A::Error::duplicate_field(
8400                                    "multiple values for satisfies_pzs",
8401                                ));
8402                            }
8403                            result.satisfies_pzs = map
8404                                .next_value::<std::option::Option<bool>>()?
8405                                .unwrap_or_default();
8406                        }
8407                        __FieldTag::__start_execution_token => {
8408                            if !fields.insert(__FieldTag::__start_execution_token) {
8409                                return std::result::Result::Err(A::Error::duplicate_field(
8410                                    "multiple values for start_execution_token",
8411                                ));
8412                            }
8413                            if result.create_execution.is_some() {
8414                                return std::result::Result::Err(A::Error::duplicate_field(
8415                                    "multiple values for `create_execution`, a oneof with full ID .google.cloud.run.v2.Job.start_execution_token, latest field was startExecutionToken",
8416                                ));
8417                            }
8418                            result.create_execution = std::option::Option::Some(
8419                                crate::model::job::CreateExecution::StartExecutionToken(
8420                                    map.next_value::<std::option::Option<std::string::String>>()?
8421                                        .unwrap_or_default(),
8422                                ),
8423                            );
8424                        }
8425                        __FieldTag::__run_execution_token => {
8426                            if !fields.insert(__FieldTag::__run_execution_token) {
8427                                return std::result::Result::Err(A::Error::duplicate_field(
8428                                    "multiple values for run_execution_token",
8429                                ));
8430                            }
8431                            if result.create_execution.is_some() {
8432                                return std::result::Result::Err(A::Error::duplicate_field(
8433                                    "multiple values for `create_execution`, a oneof with full ID .google.cloud.run.v2.Job.run_execution_token, latest field was runExecutionToken",
8434                                ));
8435                            }
8436                            result.create_execution = std::option::Option::Some(
8437                                crate::model::job::CreateExecution::RunExecutionToken(
8438                                    map.next_value::<std::option::Option<std::string::String>>()?
8439                                        .unwrap_or_default(),
8440                                ),
8441                            );
8442                        }
8443                        __FieldTag::__etag => {
8444                            if !fields.insert(__FieldTag::__etag) {
8445                                return std::result::Result::Err(A::Error::duplicate_field(
8446                                    "multiple values for etag",
8447                                ));
8448                            }
8449                            result.etag = map
8450                                .next_value::<std::option::Option<std::string::String>>()?
8451                                .unwrap_or_default();
8452                        }
8453                        __FieldTag::Unknown(key) => {
8454                            let value = map.next_value::<serde_json::Value>()?;
8455                            result._unknown_fields.insert(key, value);
8456                        }
8457                    }
8458                }
8459                std::result::Result::Ok(result)
8460            }
8461        }
8462        deserializer.deserialize_any(Visitor)
8463    }
8464}
8465
8466#[doc(hidden)]
8467impl serde::ser::Serialize for Job {
8468    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8469    where
8470        S: serde::ser::Serializer,
8471    {
8472        use serde::ser::SerializeMap;
8473        #[allow(unused_imports)]
8474        use std::option::Option::Some;
8475        let mut state = serializer.serialize_map(std::option::Option::None)?;
8476        if !self.name.is_empty() {
8477            state.serialize_entry("name", &self.name)?;
8478        }
8479        if !self.uid.is_empty() {
8480            state.serialize_entry("uid", &self.uid)?;
8481        }
8482        if !wkt::internal::is_default(&self.generation) {
8483            struct __With<'a>(&'a i64);
8484            impl<'a> serde::ser::Serialize for __With<'a> {
8485                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8486                where
8487                    S: serde::ser::Serializer,
8488                {
8489                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
8490                }
8491            }
8492            state.serialize_entry("generation", &__With(&self.generation))?;
8493        }
8494        if !self.labels.is_empty() {
8495            state.serialize_entry("labels", &self.labels)?;
8496        }
8497        if !self.annotations.is_empty() {
8498            state.serialize_entry("annotations", &self.annotations)?;
8499        }
8500        if self.create_time.is_some() {
8501            state.serialize_entry("createTime", &self.create_time)?;
8502        }
8503        if self.update_time.is_some() {
8504            state.serialize_entry("updateTime", &self.update_time)?;
8505        }
8506        if self.delete_time.is_some() {
8507            state.serialize_entry("deleteTime", &self.delete_time)?;
8508        }
8509        if self.expire_time.is_some() {
8510            state.serialize_entry("expireTime", &self.expire_time)?;
8511        }
8512        if !self.creator.is_empty() {
8513            state.serialize_entry("creator", &self.creator)?;
8514        }
8515        if !self.last_modifier.is_empty() {
8516            state.serialize_entry("lastModifier", &self.last_modifier)?;
8517        }
8518        if !self.client.is_empty() {
8519            state.serialize_entry("client", &self.client)?;
8520        }
8521        if !self.client_version.is_empty() {
8522            state.serialize_entry("clientVersion", &self.client_version)?;
8523        }
8524        if !wkt::internal::is_default(&self.launch_stage) {
8525            state.serialize_entry("launchStage", &self.launch_stage)?;
8526        }
8527        if self.binary_authorization.is_some() {
8528            state.serialize_entry("binaryAuthorization", &self.binary_authorization)?;
8529        }
8530        if self.template.is_some() {
8531            state.serialize_entry("template", &self.template)?;
8532        }
8533        if !wkt::internal::is_default(&self.observed_generation) {
8534            struct __With<'a>(&'a i64);
8535            impl<'a> serde::ser::Serialize for __With<'a> {
8536                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8537                where
8538                    S: serde::ser::Serializer,
8539                {
8540                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
8541                }
8542            }
8543            state.serialize_entry("observedGeneration", &__With(&self.observed_generation))?;
8544        }
8545        if self.terminal_condition.is_some() {
8546            state.serialize_entry("terminalCondition", &self.terminal_condition)?;
8547        }
8548        if !self.conditions.is_empty() {
8549            state.serialize_entry("conditions", &self.conditions)?;
8550        }
8551        if !wkt::internal::is_default(&self.execution_count) {
8552            struct __With<'a>(&'a i32);
8553            impl<'a> serde::ser::Serialize for __With<'a> {
8554                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8555                where
8556                    S: serde::ser::Serializer,
8557                {
8558                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8559                }
8560            }
8561            state.serialize_entry("executionCount", &__With(&self.execution_count))?;
8562        }
8563        if self.latest_created_execution.is_some() {
8564            state.serialize_entry("latestCreatedExecution", &self.latest_created_execution)?;
8565        }
8566        if !wkt::internal::is_default(&self.reconciling) {
8567            state.serialize_entry("reconciling", &self.reconciling)?;
8568        }
8569        if !wkt::internal::is_default(&self.satisfies_pzs) {
8570            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
8571        }
8572        if let Some(value) = self.start_execution_token() {
8573            state.serialize_entry("startExecutionToken", value)?;
8574        }
8575        if let Some(value) = self.run_execution_token() {
8576            state.serialize_entry("runExecutionToken", value)?;
8577        }
8578        if !self.etag.is_empty() {
8579            state.serialize_entry("etag", &self.etag)?;
8580        }
8581        if !self._unknown_fields.is_empty() {
8582            for (key, value) in self._unknown_fields.iter() {
8583                state.serialize_entry(key, &value)?;
8584            }
8585        }
8586        state.end()
8587    }
8588}
8589
8590impl std::fmt::Debug for Job {
8591    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8592        let mut debug_struct = f.debug_struct("Job");
8593        debug_struct.field("name", &self.name);
8594        debug_struct.field("uid", &self.uid);
8595        debug_struct.field("generation", &self.generation);
8596        debug_struct.field("labels", &self.labels);
8597        debug_struct.field("annotations", &self.annotations);
8598        debug_struct.field("create_time", &self.create_time);
8599        debug_struct.field("update_time", &self.update_time);
8600        debug_struct.field("delete_time", &self.delete_time);
8601        debug_struct.field("expire_time", &self.expire_time);
8602        debug_struct.field("creator", &self.creator);
8603        debug_struct.field("last_modifier", &self.last_modifier);
8604        debug_struct.field("client", &self.client);
8605        debug_struct.field("client_version", &self.client_version);
8606        debug_struct.field("launch_stage", &self.launch_stage);
8607        debug_struct.field("binary_authorization", &self.binary_authorization);
8608        debug_struct.field("template", &self.template);
8609        debug_struct.field("observed_generation", &self.observed_generation);
8610        debug_struct.field("terminal_condition", &self.terminal_condition);
8611        debug_struct.field("conditions", &self.conditions);
8612        debug_struct.field("execution_count", &self.execution_count);
8613        debug_struct.field("latest_created_execution", &self.latest_created_execution);
8614        debug_struct.field("reconciling", &self.reconciling);
8615        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
8616        debug_struct.field("etag", &self.etag);
8617        debug_struct.field("create_execution", &self.create_execution);
8618        if !self._unknown_fields.is_empty() {
8619            debug_struct.field("_unknown_fields", &self._unknown_fields);
8620        }
8621        debug_struct.finish()
8622    }
8623}
8624
8625/// Defines additional types related to [Job].
8626pub mod job {
8627    #[allow(unused_imports)]
8628    use super::*;
8629
8630    #[derive(Clone, Debug, PartialEq)]
8631    #[non_exhaustive]
8632    pub enum CreateExecution {
8633        /// A unique string used as a suffix creating a new execution. The Job will
8634        /// become ready when the execution is successfully started.
8635        /// The sum of job name and token length must be fewer than 63 characters.
8636        StartExecutionToken(std::string::String),
8637        /// A unique string used as a suffix for creating a new execution. The Job
8638        /// will become ready when the execution is successfully completed.
8639        /// The sum of job name and token length must be fewer than 63 characters.
8640        RunExecutionToken(std::string::String),
8641    }
8642}
8643
8644/// Reference to an Execution. Use /Executions.GetExecution with the given name
8645/// to get full execution including the latest status.
8646#[derive(Clone, Default, PartialEq)]
8647#[non_exhaustive]
8648pub struct ExecutionReference {
8649    /// Name of the execution.
8650    pub name: std::string::String,
8651
8652    /// Creation timestamp of the execution.
8653    pub create_time: std::option::Option<wkt::Timestamp>,
8654
8655    /// Creation timestamp of the execution.
8656    pub completion_time: std::option::Option<wkt::Timestamp>,
8657
8658    /// The deletion time of the execution. It is only
8659    /// populated as a response to a Delete request.
8660    pub delete_time: std::option::Option<wkt::Timestamp>,
8661
8662    /// Status for the execution completion.
8663    pub completion_status: crate::model::execution_reference::CompletionStatus,
8664
8665    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8666}
8667
8668impl ExecutionReference {
8669    pub fn new() -> Self {
8670        std::default::Default::default()
8671    }
8672
8673    /// Sets the value of [name][crate::model::ExecutionReference::name].
8674    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8675        self.name = v.into();
8676        self
8677    }
8678
8679    /// Sets the value of [create_time][crate::model::ExecutionReference::create_time].
8680    pub fn set_create_time<T>(mut self, v: T) -> Self
8681    where
8682        T: std::convert::Into<wkt::Timestamp>,
8683    {
8684        self.create_time = std::option::Option::Some(v.into());
8685        self
8686    }
8687
8688    /// Sets or clears the value of [create_time][crate::model::ExecutionReference::create_time].
8689    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8690    where
8691        T: std::convert::Into<wkt::Timestamp>,
8692    {
8693        self.create_time = v.map(|x| x.into());
8694        self
8695    }
8696
8697    /// Sets the value of [completion_time][crate::model::ExecutionReference::completion_time].
8698    pub fn set_completion_time<T>(mut self, v: T) -> Self
8699    where
8700        T: std::convert::Into<wkt::Timestamp>,
8701    {
8702        self.completion_time = std::option::Option::Some(v.into());
8703        self
8704    }
8705
8706    /// Sets or clears the value of [completion_time][crate::model::ExecutionReference::completion_time].
8707    pub fn set_or_clear_completion_time<T>(mut self, v: std::option::Option<T>) -> Self
8708    where
8709        T: std::convert::Into<wkt::Timestamp>,
8710    {
8711        self.completion_time = v.map(|x| x.into());
8712        self
8713    }
8714
8715    /// Sets the value of [delete_time][crate::model::ExecutionReference::delete_time].
8716    pub fn set_delete_time<T>(mut self, v: T) -> Self
8717    where
8718        T: std::convert::Into<wkt::Timestamp>,
8719    {
8720        self.delete_time = std::option::Option::Some(v.into());
8721        self
8722    }
8723
8724    /// Sets or clears the value of [delete_time][crate::model::ExecutionReference::delete_time].
8725    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
8726    where
8727        T: std::convert::Into<wkt::Timestamp>,
8728    {
8729        self.delete_time = v.map(|x| x.into());
8730        self
8731    }
8732
8733    /// Sets the value of [completion_status][crate::model::ExecutionReference::completion_status].
8734    pub fn set_completion_status<
8735        T: std::convert::Into<crate::model::execution_reference::CompletionStatus>,
8736    >(
8737        mut self,
8738        v: T,
8739    ) -> Self {
8740        self.completion_status = v.into();
8741        self
8742    }
8743}
8744
8745impl wkt::message::Message for ExecutionReference {
8746    fn typename() -> &'static str {
8747        "type.googleapis.com/google.cloud.run.v2.ExecutionReference"
8748    }
8749}
8750
8751#[doc(hidden)]
8752impl<'de> serde::de::Deserialize<'de> for ExecutionReference {
8753    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8754    where
8755        D: serde::Deserializer<'de>,
8756    {
8757        #[allow(non_camel_case_types)]
8758        #[doc(hidden)]
8759        #[derive(PartialEq, Eq, Hash)]
8760        enum __FieldTag {
8761            __name,
8762            __create_time,
8763            __completion_time,
8764            __delete_time,
8765            __completion_status,
8766            Unknown(std::string::String),
8767        }
8768        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8769            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8770            where
8771                D: serde::Deserializer<'de>,
8772            {
8773                struct Visitor;
8774                impl<'de> serde::de::Visitor<'de> for Visitor {
8775                    type Value = __FieldTag;
8776                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8777                        formatter.write_str("a field name for ExecutionReference")
8778                    }
8779                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8780                    where
8781                        E: serde::de::Error,
8782                    {
8783                        use std::result::Result::Ok;
8784                        use std::string::ToString;
8785                        match value {
8786                            "name" => Ok(__FieldTag::__name),
8787                            "createTime" => Ok(__FieldTag::__create_time),
8788                            "create_time" => Ok(__FieldTag::__create_time),
8789                            "completionTime" => Ok(__FieldTag::__completion_time),
8790                            "completion_time" => Ok(__FieldTag::__completion_time),
8791                            "deleteTime" => Ok(__FieldTag::__delete_time),
8792                            "delete_time" => Ok(__FieldTag::__delete_time),
8793                            "completionStatus" => Ok(__FieldTag::__completion_status),
8794                            "completion_status" => Ok(__FieldTag::__completion_status),
8795                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8796                        }
8797                    }
8798                }
8799                deserializer.deserialize_identifier(Visitor)
8800            }
8801        }
8802        struct Visitor;
8803        impl<'de> serde::de::Visitor<'de> for Visitor {
8804            type Value = ExecutionReference;
8805            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8806                formatter.write_str("struct ExecutionReference")
8807            }
8808            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8809            where
8810                A: serde::de::MapAccess<'de>,
8811            {
8812                #[allow(unused_imports)]
8813                use serde::de::Error;
8814                use std::option::Option::Some;
8815                let mut fields = std::collections::HashSet::new();
8816                let mut result = Self::Value::new();
8817                while let Some(tag) = map.next_key::<__FieldTag>()? {
8818                    #[allow(clippy::match_single_binding)]
8819                    match tag {
8820                        __FieldTag::__name => {
8821                            if !fields.insert(__FieldTag::__name) {
8822                                return std::result::Result::Err(A::Error::duplicate_field(
8823                                    "multiple values for name",
8824                                ));
8825                            }
8826                            result.name = map
8827                                .next_value::<std::option::Option<std::string::String>>()?
8828                                .unwrap_or_default();
8829                        }
8830                        __FieldTag::__create_time => {
8831                            if !fields.insert(__FieldTag::__create_time) {
8832                                return std::result::Result::Err(A::Error::duplicate_field(
8833                                    "multiple values for create_time",
8834                                ));
8835                            }
8836                            result.create_time =
8837                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8838                        }
8839                        __FieldTag::__completion_time => {
8840                            if !fields.insert(__FieldTag::__completion_time) {
8841                                return std::result::Result::Err(A::Error::duplicate_field(
8842                                    "multiple values for completion_time",
8843                                ));
8844                            }
8845                            result.completion_time =
8846                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8847                        }
8848                        __FieldTag::__delete_time => {
8849                            if !fields.insert(__FieldTag::__delete_time) {
8850                                return std::result::Result::Err(A::Error::duplicate_field(
8851                                    "multiple values for delete_time",
8852                                ));
8853                            }
8854                            result.delete_time =
8855                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8856                        }
8857                        __FieldTag::__completion_status => {
8858                            if !fields.insert(__FieldTag::__completion_status) {
8859                                return std::result::Result::Err(A::Error::duplicate_field(
8860                                    "multiple values for completion_status",
8861                                ));
8862                            }
8863                            result.completion_status = map
8864                                .next_value::<std::option::Option<
8865                                    crate::model::execution_reference::CompletionStatus,
8866                                >>()?
8867                                .unwrap_or_default();
8868                        }
8869                        __FieldTag::Unknown(key) => {
8870                            let value = map.next_value::<serde_json::Value>()?;
8871                            result._unknown_fields.insert(key, value);
8872                        }
8873                    }
8874                }
8875                std::result::Result::Ok(result)
8876            }
8877        }
8878        deserializer.deserialize_any(Visitor)
8879    }
8880}
8881
8882#[doc(hidden)]
8883impl serde::ser::Serialize for ExecutionReference {
8884    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8885    where
8886        S: serde::ser::Serializer,
8887    {
8888        use serde::ser::SerializeMap;
8889        #[allow(unused_imports)]
8890        use std::option::Option::Some;
8891        let mut state = serializer.serialize_map(std::option::Option::None)?;
8892        if !self.name.is_empty() {
8893            state.serialize_entry("name", &self.name)?;
8894        }
8895        if self.create_time.is_some() {
8896            state.serialize_entry("createTime", &self.create_time)?;
8897        }
8898        if self.completion_time.is_some() {
8899            state.serialize_entry("completionTime", &self.completion_time)?;
8900        }
8901        if self.delete_time.is_some() {
8902            state.serialize_entry("deleteTime", &self.delete_time)?;
8903        }
8904        if !wkt::internal::is_default(&self.completion_status) {
8905            state.serialize_entry("completionStatus", &self.completion_status)?;
8906        }
8907        if !self._unknown_fields.is_empty() {
8908            for (key, value) in self._unknown_fields.iter() {
8909                state.serialize_entry(key, &value)?;
8910            }
8911        }
8912        state.end()
8913    }
8914}
8915
8916impl std::fmt::Debug for ExecutionReference {
8917    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8918        let mut debug_struct = f.debug_struct("ExecutionReference");
8919        debug_struct.field("name", &self.name);
8920        debug_struct.field("create_time", &self.create_time);
8921        debug_struct.field("completion_time", &self.completion_time);
8922        debug_struct.field("delete_time", &self.delete_time);
8923        debug_struct.field("completion_status", &self.completion_status);
8924        if !self._unknown_fields.is_empty() {
8925            debug_struct.field("_unknown_fields", &self._unknown_fields);
8926        }
8927        debug_struct.finish()
8928    }
8929}
8930
8931/// Defines additional types related to [ExecutionReference].
8932pub mod execution_reference {
8933    #[allow(unused_imports)]
8934    use super::*;
8935
8936    /// Possible execution completion status.
8937    ///
8938    /// # Working with unknown values
8939    ///
8940    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8941    /// additional enum variants at any time. Adding new variants is not considered
8942    /// a breaking change. Applications should write their code in anticipation of:
8943    ///
8944    /// - New values appearing in future releases of the client library, **and**
8945    /// - New values received dynamically, without application changes.
8946    ///
8947    /// Please consult the [Working with enums] section in the user guide for some
8948    /// guidelines.
8949    ///
8950    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8951    #[derive(Clone, Debug, PartialEq)]
8952    #[non_exhaustive]
8953    pub enum CompletionStatus {
8954        /// The default value. This value is used if the state is omitted.
8955        Unspecified,
8956        /// Job execution has succeeded.
8957        ExecutionSucceeded,
8958        /// Job execution has failed.
8959        ExecutionFailed,
8960        /// Job execution is running normally.
8961        ExecutionRunning,
8962        /// Waiting for backing resources to be provisioned.
8963        ExecutionPending,
8964        /// Job execution has been cancelled by the user.
8965        ExecutionCancelled,
8966        /// If set, the enum was initialized with an unknown value.
8967        ///
8968        /// Applications can examine the value using [CompletionStatus::value] or
8969        /// [CompletionStatus::name].
8970        UnknownValue(completion_status::UnknownValue),
8971    }
8972
8973    #[doc(hidden)]
8974    pub mod completion_status {
8975        #[allow(unused_imports)]
8976        use super::*;
8977        #[derive(Clone, Debug, PartialEq)]
8978        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8979    }
8980
8981    impl CompletionStatus {
8982        /// Gets the enum value.
8983        ///
8984        /// Returns `None` if the enum contains an unknown value deserialized from
8985        /// the string representation of enums.
8986        pub fn value(&self) -> std::option::Option<i32> {
8987            match self {
8988                Self::Unspecified => std::option::Option::Some(0),
8989                Self::ExecutionSucceeded => std::option::Option::Some(1),
8990                Self::ExecutionFailed => std::option::Option::Some(2),
8991                Self::ExecutionRunning => std::option::Option::Some(3),
8992                Self::ExecutionPending => std::option::Option::Some(4),
8993                Self::ExecutionCancelled => std::option::Option::Some(5),
8994                Self::UnknownValue(u) => u.0.value(),
8995            }
8996        }
8997
8998        /// Gets the enum value as a string.
8999        ///
9000        /// Returns `None` if the enum contains an unknown value deserialized from
9001        /// the integer representation of enums.
9002        pub fn name(&self) -> std::option::Option<&str> {
9003            match self {
9004                Self::Unspecified => std::option::Option::Some("COMPLETION_STATUS_UNSPECIFIED"),
9005                Self::ExecutionSucceeded => std::option::Option::Some("EXECUTION_SUCCEEDED"),
9006                Self::ExecutionFailed => std::option::Option::Some("EXECUTION_FAILED"),
9007                Self::ExecutionRunning => std::option::Option::Some("EXECUTION_RUNNING"),
9008                Self::ExecutionPending => std::option::Option::Some("EXECUTION_PENDING"),
9009                Self::ExecutionCancelled => std::option::Option::Some("EXECUTION_CANCELLED"),
9010                Self::UnknownValue(u) => u.0.name(),
9011            }
9012        }
9013    }
9014
9015    impl std::default::Default for CompletionStatus {
9016        fn default() -> Self {
9017            use std::convert::From;
9018            Self::from(0)
9019        }
9020    }
9021
9022    impl std::fmt::Display for CompletionStatus {
9023        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9024            wkt::internal::display_enum(f, self.name(), self.value())
9025        }
9026    }
9027
9028    impl std::convert::From<i32> for CompletionStatus {
9029        fn from(value: i32) -> Self {
9030            match value {
9031                0 => Self::Unspecified,
9032                1 => Self::ExecutionSucceeded,
9033                2 => Self::ExecutionFailed,
9034                3 => Self::ExecutionRunning,
9035                4 => Self::ExecutionPending,
9036                5 => Self::ExecutionCancelled,
9037                _ => Self::UnknownValue(completion_status::UnknownValue(
9038                    wkt::internal::UnknownEnumValue::Integer(value),
9039                )),
9040            }
9041        }
9042    }
9043
9044    impl std::convert::From<&str> for CompletionStatus {
9045        fn from(value: &str) -> Self {
9046            use std::string::ToString;
9047            match value {
9048                "COMPLETION_STATUS_UNSPECIFIED" => Self::Unspecified,
9049                "EXECUTION_SUCCEEDED" => Self::ExecutionSucceeded,
9050                "EXECUTION_FAILED" => Self::ExecutionFailed,
9051                "EXECUTION_RUNNING" => Self::ExecutionRunning,
9052                "EXECUTION_PENDING" => Self::ExecutionPending,
9053                "EXECUTION_CANCELLED" => Self::ExecutionCancelled,
9054                _ => Self::UnknownValue(completion_status::UnknownValue(
9055                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9056                )),
9057            }
9058        }
9059    }
9060
9061    impl serde::ser::Serialize for CompletionStatus {
9062        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9063        where
9064            S: serde::Serializer,
9065        {
9066            match self {
9067                Self::Unspecified => serializer.serialize_i32(0),
9068                Self::ExecutionSucceeded => serializer.serialize_i32(1),
9069                Self::ExecutionFailed => serializer.serialize_i32(2),
9070                Self::ExecutionRunning => serializer.serialize_i32(3),
9071                Self::ExecutionPending => serializer.serialize_i32(4),
9072                Self::ExecutionCancelled => serializer.serialize_i32(5),
9073                Self::UnknownValue(u) => u.0.serialize(serializer),
9074            }
9075        }
9076    }
9077
9078    impl<'de> serde::de::Deserialize<'de> for CompletionStatus {
9079        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9080        where
9081            D: serde::Deserializer<'de>,
9082        {
9083            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CompletionStatus>::new(
9084                ".google.cloud.run.v2.ExecutionReference.CompletionStatus",
9085            ))
9086        }
9087    }
9088}
9089
9090/// A single application container.
9091/// This specifies both the container to run, the command to run in the container
9092/// and the arguments to supply to it.
9093/// Note that additional arguments can be supplied by the system to the container
9094/// at runtime.
9095#[derive(Clone, Default, PartialEq)]
9096#[non_exhaustive]
9097pub struct Container {
9098    /// Name of the container specified as a DNS_LABEL (RFC 1123).
9099    pub name: std::string::String,
9100
9101    /// Required. Name of the container image in Dockerhub, Google Artifact
9102    /// Registry, or Google Container Registry. If the host is not provided,
9103    /// Dockerhub is assumed.
9104    pub image: std::string::String,
9105
9106    /// Entrypoint array. Not executed within a shell.
9107    /// The docker image's ENTRYPOINT is used if this is not provided.
9108    pub command: std::vec::Vec<std::string::String>,
9109
9110    /// Arguments to the entrypoint.
9111    /// The docker image's CMD is used if this is not provided.
9112    pub args: std::vec::Vec<std::string::String>,
9113
9114    /// List of environment variables to set in the container.
9115    pub env: std::vec::Vec<crate::model::EnvVar>,
9116
9117    /// Compute Resource requirements by this container.
9118    pub resources: std::option::Option<crate::model::ResourceRequirements>,
9119
9120    /// List of ports to expose from the container. Only a single port can be
9121    /// specified. The specified ports must be listening on all interfaces
9122    /// (0.0.0.0) within the container to be accessible.
9123    ///
9124    /// If omitted, a port number will be chosen and passed to the container
9125    /// through the PORT environment variable for the container to listen on.
9126    pub ports: std::vec::Vec<crate::model::ContainerPort>,
9127
9128    /// Volume to mount into the container's filesystem.
9129    pub volume_mounts: std::vec::Vec<crate::model::VolumeMount>,
9130
9131    /// Container's working directory.
9132    /// If not specified, the container runtime's default will be used, which
9133    /// might be configured in the container image.
9134    pub working_dir: std::string::String,
9135
9136    /// Periodic probe of container liveness.
9137    /// Container will be restarted if the probe fails.
9138    pub liveness_probe: std::option::Option<crate::model::Probe>,
9139
9140    /// Startup probe of application within the container.
9141    /// All other probes are disabled if a startup probe is provided, until it
9142    /// succeeds. Container will not be added to service endpoints if the probe
9143    /// fails.
9144    pub startup_probe: std::option::Option<crate::model::Probe>,
9145
9146    /// Names of the containers that must start before this container.
9147    pub depends_on: std::vec::Vec<std::string::String>,
9148
9149    /// Base image for this container. Only supported for services. If set, it
9150    /// indicates that the service is enrolled into automatic base image update.
9151    pub base_image_uri: std::string::String,
9152
9153    /// Output only. The build info of the container image.
9154    pub build_info: std::option::Option<crate::model::BuildInfo>,
9155
9156    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9157}
9158
9159impl Container {
9160    pub fn new() -> Self {
9161        std::default::Default::default()
9162    }
9163
9164    /// Sets the value of [name][crate::model::Container::name].
9165    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9166        self.name = v.into();
9167        self
9168    }
9169
9170    /// Sets the value of [image][crate::model::Container::image].
9171    pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9172        self.image = v.into();
9173        self
9174    }
9175
9176    /// Sets the value of [command][crate::model::Container::command].
9177    pub fn set_command<T, V>(mut self, v: T) -> Self
9178    where
9179        T: std::iter::IntoIterator<Item = V>,
9180        V: std::convert::Into<std::string::String>,
9181    {
9182        use std::iter::Iterator;
9183        self.command = v.into_iter().map(|i| i.into()).collect();
9184        self
9185    }
9186
9187    /// Sets the value of [args][crate::model::Container::args].
9188    pub fn set_args<T, V>(mut self, v: T) -> Self
9189    where
9190        T: std::iter::IntoIterator<Item = V>,
9191        V: std::convert::Into<std::string::String>,
9192    {
9193        use std::iter::Iterator;
9194        self.args = v.into_iter().map(|i| i.into()).collect();
9195        self
9196    }
9197
9198    /// Sets the value of [env][crate::model::Container::env].
9199    pub fn set_env<T, V>(mut self, v: T) -> Self
9200    where
9201        T: std::iter::IntoIterator<Item = V>,
9202        V: std::convert::Into<crate::model::EnvVar>,
9203    {
9204        use std::iter::Iterator;
9205        self.env = v.into_iter().map(|i| i.into()).collect();
9206        self
9207    }
9208
9209    /// Sets the value of [resources][crate::model::Container::resources].
9210    pub fn set_resources<T>(mut self, v: T) -> Self
9211    where
9212        T: std::convert::Into<crate::model::ResourceRequirements>,
9213    {
9214        self.resources = std::option::Option::Some(v.into());
9215        self
9216    }
9217
9218    /// Sets or clears the value of [resources][crate::model::Container::resources].
9219    pub fn set_or_clear_resources<T>(mut self, v: std::option::Option<T>) -> Self
9220    where
9221        T: std::convert::Into<crate::model::ResourceRequirements>,
9222    {
9223        self.resources = v.map(|x| x.into());
9224        self
9225    }
9226
9227    /// Sets the value of [ports][crate::model::Container::ports].
9228    pub fn set_ports<T, V>(mut self, v: T) -> Self
9229    where
9230        T: std::iter::IntoIterator<Item = V>,
9231        V: std::convert::Into<crate::model::ContainerPort>,
9232    {
9233        use std::iter::Iterator;
9234        self.ports = v.into_iter().map(|i| i.into()).collect();
9235        self
9236    }
9237
9238    /// Sets the value of [volume_mounts][crate::model::Container::volume_mounts].
9239    pub fn set_volume_mounts<T, V>(mut self, v: T) -> Self
9240    where
9241        T: std::iter::IntoIterator<Item = V>,
9242        V: std::convert::Into<crate::model::VolumeMount>,
9243    {
9244        use std::iter::Iterator;
9245        self.volume_mounts = v.into_iter().map(|i| i.into()).collect();
9246        self
9247    }
9248
9249    /// Sets the value of [working_dir][crate::model::Container::working_dir].
9250    pub fn set_working_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9251        self.working_dir = v.into();
9252        self
9253    }
9254
9255    /// Sets the value of [liveness_probe][crate::model::Container::liveness_probe].
9256    pub fn set_liveness_probe<T>(mut self, v: T) -> Self
9257    where
9258        T: std::convert::Into<crate::model::Probe>,
9259    {
9260        self.liveness_probe = std::option::Option::Some(v.into());
9261        self
9262    }
9263
9264    /// Sets or clears the value of [liveness_probe][crate::model::Container::liveness_probe].
9265    pub fn set_or_clear_liveness_probe<T>(mut self, v: std::option::Option<T>) -> Self
9266    where
9267        T: std::convert::Into<crate::model::Probe>,
9268    {
9269        self.liveness_probe = v.map(|x| x.into());
9270        self
9271    }
9272
9273    /// Sets the value of [startup_probe][crate::model::Container::startup_probe].
9274    pub fn set_startup_probe<T>(mut self, v: T) -> Self
9275    where
9276        T: std::convert::Into<crate::model::Probe>,
9277    {
9278        self.startup_probe = std::option::Option::Some(v.into());
9279        self
9280    }
9281
9282    /// Sets or clears the value of [startup_probe][crate::model::Container::startup_probe].
9283    pub fn set_or_clear_startup_probe<T>(mut self, v: std::option::Option<T>) -> Self
9284    where
9285        T: std::convert::Into<crate::model::Probe>,
9286    {
9287        self.startup_probe = v.map(|x| x.into());
9288        self
9289    }
9290
9291    /// Sets the value of [depends_on][crate::model::Container::depends_on].
9292    pub fn set_depends_on<T, V>(mut self, v: T) -> Self
9293    where
9294        T: std::iter::IntoIterator<Item = V>,
9295        V: std::convert::Into<std::string::String>,
9296    {
9297        use std::iter::Iterator;
9298        self.depends_on = v.into_iter().map(|i| i.into()).collect();
9299        self
9300    }
9301
9302    /// Sets the value of [base_image_uri][crate::model::Container::base_image_uri].
9303    pub fn set_base_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9304        self.base_image_uri = v.into();
9305        self
9306    }
9307
9308    /// Sets the value of [build_info][crate::model::Container::build_info].
9309    pub fn set_build_info<T>(mut self, v: T) -> Self
9310    where
9311        T: std::convert::Into<crate::model::BuildInfo>,
9312    {
9313        self.build_info = std::option::Option::Some(v.into());
9314        self
9315    }
9316
9317    /// Sets or clears the value of [build_info][crate::model::Container::build_info].
9318    pub fn set_or_clear_build_info<T>(mut self, v: std::option::Option<T>) -> Self
9319    where
9320        T: std::convert::Into<crate::model::BuildInfo>,
9321    {
9322        self.build_info = v.map(|x| x.into());
9323        self
9324    }
9325}
9326
9327impl wkt::message::Message for Container {
9328    fn typename() -> &'static str {
9329        "type.googleapis.com/google.cloud.run.v2.Container"
9330    }
9331}
9332
9333#[doc(hidden)]
9334impl<'de> serde::de::Deserialize<'de> for Container {
9335    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9336    where
9337        D: serde::Deserializer<'de>,
9338    {
9339        #[allow(non_camel_case_types)]
9340        #[doc(hidden)]
9341        #[derive(PartialEq, Eq, Hash)]
9342        enum __FieldTag {
9343            __name,
9344            __image,
9345            __command,
9346            __args,
9347            __env,
9348            __resources,
9349            __ports,
9350            __volume_mounts,
9351            __working_dir,
9352            __liveness_probe,
9353            __startup_probe,
9354            __depends_on,
9355            __base_image_uri,
9356            __build_info,
9357            Unknown(std::string::String),
9358        }
9359        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9360            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9361            where
9362                D: serde::Deserializer<'de>,
9363            {
9364                struct Visitor;
9365                impl<'de> serde::de::Visitor<'de> for Visitor {
9366                    type Value = __FieldTag;
9367                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9368                        formatter.write_str("a field name for Container")
9369                    }
9370                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9371                    where
9372                        E: serde::de::Error,
9373                    {
9374                        use std::result::Result::Ok;
9375                        use std::string::ToString;
9376                        match value {
9377                            "name" => Ok(__FieldTag::__name),
9378                            "image" => Ok(__FieldTag::__image),
9379                            "command" => Ok(__FieldTag::__command),
9380                            "args" => Ok(__FieldTag::__args),
9381                            "env" => Ok(__FieldTag::__env),
9382                            "resources" => Ok(__FieldTag::__resources),
9383                            "ports" => Ok(__FieldTag::__ports),
9384                            "volumeMounts" => Ok(__FieldTag::__volume_mounts),
9385                            "volume_mounts" => Ok(__FieldTag::__volume_mounts),
9386                            "workingDir" => Ok(__FieldTag::__working_dir),
9387                            "working_dir" => Ok(__FieldTag::__working_dir),
9388                            "livenessProbe" => Ok(__FieldTag::__liveness_probe),
9389                            "liveness_probe" => Ok(__FieldTag::__liveness_probe),
9390                            "startupProbe" => Ok(__FieldTag::__startup_probe),
9391                            "startup_probe" => Ok(__FieldTag::__startup_probe),
9392                            "dependsOn" => Ok(__FieldTag::__depends_on),
9393                            "depends_on" => Ok(__FieldTag::__depends_on),
9394                            "baseImageUri" => Ok(__FieldTag::__base_image_uri),
9395                            "base_image_uri" => Ok(__FieldTag::__base_image_uri),
9396                            "buildInfo" => Ok(__FieldTag::__build_info),
9397                            "build_info" => Ok(__FieldTag::__build_info),
9398                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9399                        }
9400                    }
9401                }
9402                deserializer.deserialize_identifier(Visitor)
9403            }
9404        }
9405        struct Visitor;
9406        impl<'de> serde::de::Visitor<'de> for Visitor {
9407            type Value = Container;
9408            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9409                formatter.write_str("struct Container")
9410            }
9411            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9412            where
9413                A: serde::de::MapAccess<'de>,
9414            {
9415                #[allow(unused_imports)]
9416                use serde::de::Error;
9417                use std::option::Option::Some;
9418                let mut fields = std::collections::HashSet::new();
9419                let mut result = Self::Value::new();
9420                while let Some(tag) = map.next_key::<__FieldTag>()? {
9421                    #[allow(clippy::match_single_binding)]
9422                    match tag {
9423                        __FieldTag::__name => {
9424                            if !fields.insert(__FieldTag::__name) {
9425                                return std::result::Result::Err(A::Error::duplicate_field(
9426                                    "multiple values for name",
9427                                ));
9428                            }
9429                            result.name = map
9430                                .next_value::<std::option::Option<std::string::String>>()?
9431                                .unwrap_or_default();
9432                        }
9433                        __FieldTag::__image => {
9434                            if !fields.insert(__FieldTag::__image) {
9435                                return std::result::Result::Err(A::Error::duplicate_field(
9436                                    "multiple values for image",
9437                                ));
9438                            }
9439                            result.image = map
9440                                .next_value::<std::option::Option<std::string::String>>()?
9441                                .unwrap_or_default();
9442                        }
9443                        __FieldTag::__command => {
9444                            if !fields.insert(__FieldTag::__command) {
9445                                return std::result::Result::Err(A::Error::duplicate_field(
9446                                    "multiple values for command",
9447                                ));
9448                            }
9449                            result.command = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
9450                        }
9451                        __FieldTag::__args => {
9452                            if !fields.insert(__FieldTag::__args) {
9453                                return std::result::Result::Err(A::Error::duplicate_field(
9454                                    "multiple values for args",
9455                                ));
9456                            }
9457                            result.args = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
9458                        }
9459                        __FieldTag::__env => {
9460                            if !fields.insert(__FieldTag::__env) {
9461                                return std::result::Result::Err(A::Error::duplicate_field(
9462                                    "multiple values for env",
9463                                ));
9464                            }
9465                            result.env = map.next_value::<std::option::Option<std::vec::Vec<crate::model::EnvVar>>>()?.unwrap_or_default();
9466                        }
9467                        __FieldTag::__resources => {
9468                            if !fields.insert(__FieldTag::__resources) {
9469                                return std::result::Result::Err(A::Error::duplicate_field(
9470                                    "multiple values for resources",
9471                                ));
9472                            }
9473                            result.resources = map.next_value::<std::option::Option<crate::model::ResourceRequirements>>()?
9474                                ;
9475                        }
9476                        __FieldTag::__ports => {
9477                            if !fields.insert(__FieldTag::__ports) {
9478                                return std::result::Result::Err(A::Error::duplicate_field(
9479                                    "multiple values for ports",
9480                                ));
9481                            }
9482                            result.ports = map.next_value::<std::option::Option<std::vec::Vec<crate::model::ContainerPort>>>()?.unwrap_or_default();
9483                        }
9484                        __FieldTag::__volume_mounts => {
9485                            if !fields.insert(__FieldTag::__volume_mounts) {
9486                                return std::result::Result::Err(A::Error::duplicate_field(
9487                                    "multiple values for volume_mounts",
9488                                ));
9489                            }
9490                            result.volume_mounts = map.next_value::<std::option::Option<std::vec::Vec<crate::model::VolumeMount>>>()?.unwrap_or_default();
9491                        }
9492                        __FieldTag::__working_dir => {
9493                            if !fields.insert(__FieldTag::__working_dir) {
9494                                return std::result::Result::Err(A::Error::duplicate_field(
9495                                    "multiple values for working_dir",
9496                                ));
9497                            }
9498                            result.working_dir = map
9499                                .next_value::<std::option::Option<std::string::String>>()?
9500                                .unwrap_or_default();
9501                        }
9502                        __FieldTag::__liveness_probe => {
9503                            if !fields.insert(__FieldTag::__liveness_probe) {
9504                                return std::result::Result::Err(A::Error::duplicate_field(
9505                                    "multiple values for liveness_probe",
9506                                ));
9507                            }
9508                            result.liveness_probe =
9509                                map.next_value::<std::option::Option<crate::model::Probe>>()?;
9510                        }
9511                        __FieldTag::__startup_probe => {
9512                            if !fields.insert(__FieldTag::__startup_probe) {
9513                                return std::result::Result::Err(A::Error::duplicate_field(
9514                                    "multiple values for startup_probe",
9515                                ));
9516                            }
9517                            result.startup_probe =
9518                                map.next_value::<std::option::Option<crate::model::Probe>>()?;
9519                        }
9520                        __FieldTag::__depends_on => {
9521                            if !fields.insert(__FieldTag::__depends_on) {
9522                                return std::result::Result::Err(A::Error::duplicate_field(
9523                                    "multiple values for depends_on",
9524                                ));
9525                            }
9526                            result.depends_on = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
9527                        }
9528                        __FieldTag::__base_image_uri => {
9529                            if !fields.insert(__FieldTag::__base_image_uri) {
9530                                return std::result::Result::Err(A::Error::duplicate_field(
9531                                    "multiple values for base_image_uri",
9532                                ));
9533                            }
9534                            result.base_image_uri = map
9535                                .next_value::<std::option::Option<std::string::String>>()?
9536                                .unwrap_or_default();
9537                        }
9538                        __FieldTag::__build_info => {
9539                            if !fields.insert(__FieldTag::__build_info) {
9540                                return std::result::Result::Err(A::Error::duplicate_field(
9541                                    "multiple values for build_info",
9542                                ));
9543                            }
9544                            result.build_info =
9545                                map.next_value::<std::option::Option<crate::model::BuildInfo>>()?;
9546                        }
9547                        __FieldTag::Unknown(key) => {
9548                            let value = map.next_value::<serde_json::Value>()?;
9549                            result._unknown_fields.insert(key, value);
9550                        }
9551                    }
9552                }
9553                std::result::Result::Ok(result)
9554            }
9555        }
9556        deserializer.deserialize_any(Visitor)
9557    }
9558}
9559
9560#[doc(hidden)]
9561impl serde::ser::Serialize for Container {
9562    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9563    where
9564        S: serde::ser::Serializer,
9565    {
9566        use serde::ser::SerializeMap;
9567        #[allow(unused_imports)]
9568        use std::option::Option::Some;
9569        let mut state = serializer.serialize_map(std::option::Option::None)?;
9570        if !self.name.is_empty() {
9571            state.serialize_entry("name", &self.name)?;
9572        }
9573        if !self.image.is_empty() {
9574            state.serialize_entry("image", &self.image)?;
9575        }
9576        if !self.command.is_empty() {
9577            state.serialize_entry("command", &self.command)?;
9578        }
9579        if !self.args.is_empty() {
9580            state.serialize_entry("args", &self.args)?;
9581        }
9582        if !self.env.is_empty() {
9583            state.serialize_entry("env", &self.env)?;
9584        }
9585        if self.resources.is_some() {
9586            state.serialize_entry("resources", &self.resources)?;
9587        }
9588        if !self.ports.is_empty() {
9589            state.serialize_entry("ports", &self.ports)?;
9590        }
9591        if !self.volume_mounts.is_empty() {
9592            state.serialize_entry("volumeMounts", &self.volume_mounts)?;
9593        }
9594        if !self.working_dir.is_empty() {
9595            state.serialize_entry("workingDir", &self.working_dir)?;
9596        }
9597        if self.liveness_probe.is_some() {
9598            state.serialize_entry("livenessProbe", &self.liveness_probe)?;
9599        }
9600        if self.startup_probe.is_some() {
9601            state.serialize_entry("startupProbe", &self.startup_probe)?;
9602        }
9603        if !self.depends_on.is_empty() {
9604            state.serialize_entry("dependsOn", &self.depends_on)?;
9605        }
9606        if !self.base_image_uri.is_empty() {
9607            state.serialize_entry("baseImageUri", &self.base_image_uri)?;
9608        }
9609        if self.build_info.is_some() {
9610            state.serialize_entry("buildInfo", &self.build_info)?;
9611        }
9612        if !self._unknown_fields.is_empty() {
9613            for (key, value) in self._unknown_fields.iter() {
9614                state.serialize_entry(key, &value)?;
9615            }
9616        }
9617        state.end()
9618    }
9619}
9620
9621impl std::fmt::Debug for Container {
9622    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9623        let mut debug_struct = f.debug_struct("Container");
9624        debug_struct.field("name", &self.name);
9625        debug_struct.field("image", &self.image);
9626        debug_struct.field("command", &self.command);
9627        debug_struct.field("args", &self.args);
9628        debug_struct.field("env", &self.env);
9629        debug_struct.field("resources", &self.resources);
9630        debug_struct.field("ports", &self.ports);
9631        debug_struct.field("volume_mounts", &self.volume_mounts);
9632        debug_struct.field("working_dir", &self.working_dir);
9633        debug_struct.field("liveness_probe", &self.liveness_probe);
9634        debug_struct.field("startup_probe", &self.startup_probe);
9635        debug_struct.field("depends_on", &self.depends_on);
9636        debug_struct.field("base_image_uri", &self.base_image_uri);
9637        debug_struct.field("build_info", &self.build_info);
9638        if !self._unknown_fields.is_empty() {
9639            debug_struct.field("_unknown_fields", &self._unknown_fields);
9640        }
9641        debug_struct.finish()
9642    }
9643}
9644
9645/// ResourceRequirements describes the compute resource requirements.
9646#[derive(Clone, Default, PartialEq)]
9647#[non_exhaustive]
9648pub struct ResourceRequirements {
9649    /// Only `memory` and `cpu` keys in the map are supported.
9650    pub limits: std::collections::HashMap<std::string::String, std::string::String>,
9651
9652    /// Determines whether CPU is only allocated during requests (true by default).
9653    /// However, if ResourceRequirements is set, the caller must explicitly
9654    /// set this field to true to preserve the default behavior.
9655    pub cpu_idle: bool,
9656
9657    /// Determines whether CPU should be boosted on startup of a new container
9658    /// instance above the requested CPU threshold, this can help reduce cold-start
9659    /// latency.
9660    pub startup_cpu_boost: bool,
9661
9662    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9663}
9664
9665impl ResourceRequirements {
9666    pub fn new() -> Self {
9667        std::default::Default::default()
9668    }
9669
9670    /// Sets the value of [limits][crate::model::ResourceRequirements::limits].
9671    pub fn set_limits<T, K, V>(mut self, v: T) -> Self
9672    where
9673        T: std::iter::IntoIterator<Item = (K, V)>,
9674        K: std::convert::Into<std::string::String>,
9675        V: std::convert::Into<std::string::String>,
9676    {
9677        use std::iter::Iterator;
9678        self.limits = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9679        self
9680    }
9681
9682    /// Sets the value of [cpu_idle][crate::model::ResourceRequirements::cpu_idle].
9683    pub fn set_cpu_idle<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9684        self.cpu_idle = v.into();
9685        self
9686    }
9687
9688    /// Sets the value of [startup_cpu_boost][crate::model::ResourceRequirements::startup_cpu_boost].
9689    pub fn set_startup_cpu_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9690        self.startup_cpu_boost = v.into();
9691        self
9692    }
9693}
9694
9695impl wkt::message::Message for ResourceRequirements {
9696    fn typename() -> &'static str {
9697        "type.googleapis.com/google.cloud.run.v2.ResourceRequirements"
9698    }
9699}
9700
9701#[doc(hidden)]
9702impl<'de> serde::de::Deserialize<'de> for ResourceRequirements {
9703    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9704    where
9705        D: serde::Deserializer<'de>,
9706    {
9707        #[allow(non_camel_case_types)]
9708        #[doc(hidden)]
9709        #[derive(PartialEq, Eq, Hash)]
9710        enum __FieldTag {
9711            __limits,
9712            __cpu_idle,
9713            __startup_cpu_boost,
9714            Unknown(std::string::String),
9715        }
9716        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9717            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9718            where
9719                D: serde::Deserializer<'de>,
9720            {
9721                struct Visitor;
9722                impl<'de> serde::de::Visitor<'de> for Visitor {
9723                    type Value = __FieldTag;
9724                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9725                        formatter.write_str("a field name for ResourceRequirements")
9726                    }
9727                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9728                    where
9729                        E: serde::de::Error,
9730                    {
9731                        use std::result::Result::Ok;
9732                        use std::string::ToString;
9733                        match value {
9734                            "limits" => Ok(__FieldTag::__limits),
9735                            "cpuIdle" => Ok(__FieldTag::__cpu_idle),
9736                            "cpu_idle" => Ok(__FieldTag::__cpu_idle),
9737                            "startupCpuBoost" => Ok(__FieldTag::__startup_cpu_boost),
9738                            "startup_cpu_boost" => Ok(__FieldTag::__startup_cpu_boost),
9739                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9740                        }
9741                    }
9742                }
9743                deserializer.deserialize_identifier(Visitor)
9744            }
9745        }
9746        struct Visitor;
9747        impl<'de> serde::de::Visitor<'de> for Visitor {
9748            type Value = ResourceRequirements;
9749            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9750                formatter.write_str("struct ResourceRequirements")
9751            }
9752            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9753            where
9754                A: serde::de::MapAccess<'de>,
9755            {
9756                #[allow(unused_imports)]
9757                use serde::de::Error;
9758                use std::option::Option::Some;
9759                let mut fields = std::collections::HashSet::new();
9760                let mut result = Self::Value::new();
9761                while let Some(tag) = map.next_key::<__FieldTag>()? {
9762                    #[allow(clippy::match_single_binding)]
9763                    match tag {
9764                        __FieldTag::__limits => {
9765                            if !fields.insert(__FieldTag::__limits) {
9766                                return std::result::Result::Err(A::Error::duplicate_field(
9767                                    "multiple values for limits",
9768                                ));
9769                            }
9770                            result.limits = map
9771                                .next_value::<std::option::Option<
9772                                    std::collections::HashMap<
9773                                        std::string::String,
9774                                        std::string::String,
9775                                    >,
9776                                >>()?
9777                                .unwrap_or_default();
9778                        }
9779                        __FieldTag::__cpu_idle => {
9780                            if !fields.insert(__FieldTag::__cpu_idle) {
9781                                return std::result::Result::Err(A::Error::duplicate_field(
9782                                    "multiple values for cpu_idle",
9783                                ));
9784                            }
9785                            result.cpu_idle = map
9786                                .next_value::<std::option::Option<bool>>()?
9787                                .unwrap_or_default();
9788                        }
9789                        __FieldTag::__startup_cpu_boost => {
9790                            if !fields.insert(__FieldTag::__startup_cpu_boost) {
9791                                return std::result::Result::Err(A::Error::duplicate_field(
9792                                    "multiple values for startup_cpu_boost",
9793                                ));
9794                            }
9795                            result.startup_cpu_boost = map
9796                                .next_value::<std::option::Option<bool>>()?
9797                                .unwrap_or_default();
9798                        }
9799                        __FieldTag::Unknown(key) => {
9800                            let value = map.next_value::<serde_json::Value>()?;
9801                            result._unknown_fields.insert(key, value);
9802                        }
9803                    }
9804                }
9805                std::result::Result::Ok(result)
9806            }
9807        }
9808        deserializer.deserialize_any(Visitor)
9809    }
9810}
9811
9812#[doc(hidden)]
9813impl serde::ser::Serialize for ResourceRequirements {
9814    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9815    where
9816        S: serde::ser::Serializer,
9817    {
9818        use serde::ser::SerializeMap;
9819        #[allow(unused_imports)]
9820        use std::option::Option::Some;
9821        let mut state = serializer.serialize_map(std::option::Option::None)?;
9822        if !self.limits.is_empty() {
9823            state.serialize_entry("limits", &self.limits)?;
9824        }
9825        if !wkt::internal::is_default(&self.cpu_idle) {
9826            state.serialize_entry("cpuIdle", &self.cpu_idle)?;
9827        }
9828        if !wkt::internal::is_default(&self.startup_cpu_boost) {
9829            state.serialize_entry("startupCpuBoost", &self.startup_cpu_boost)?;
9830        }
9831        if !self._unknown_fields.is_empty() {
9832            for (key, value) in self._unknown_fields.iter() {
9833                state.serialize_entry(key, &value)?;
9834            }
9835        }
9836        state.end()
9837    }
9838}
9839
9840impl std::fmt::Debug for ResourceRequirements {
9841    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9842        let mut debug_struct = f.debug_struct("ResourceRequirements");
9843        debug_struct.field("limits", &self.limits);
9844        debug_struct.field("cpu_idle", &self.cpu_idle);
9845        debug_struct.field("startup_cpu_boost", &self.startup_cpu_boost);
9846        if !self._unknown_fields.is_empty() {
9847            debug_struct.field("_unknown_fields", &self._unknown_fields);
9848        }
9849        debug_struct.finish()
9850    }
9851}
9852
9853/// EnvVar represents an environment variable present in a Container.
9854#[derive(Clone, Default, PartialEq)]
9855#[non_exhaustive]
9856pub struct EnvVar {
9857    /// Required. Name of the environment variable. Must not exceed 32768
9858    /// characters.
9859    pub name: std::string::String,
9860
9861    pub values: std::option::Option<crate::model::env_var::Values>,
9862
9863    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9864}
9865
9866impl EnvVar {
9867    pub fn new() -> Self {
9868        std::default::Default::default()
9869    }
9870
9871    /// Sets the value of [name][crate::model::EnvVar::name].
9872    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9873        self.name = v.into();
9874        self
9875    }
9876
9877    /// Sets the value of [values][crate::model::EnvVar::values].
9878    ///
9879    /// Note that all the setters affecting `values` are mutually
9880    /// exclusive.
9881    pub fn set_values<T: std::convert::Into<std::option::Option<crate::model::env_var::Values>>>(
9882        mut self,
9883        v: T,
9884    ) -> Self {
9885        self.values = v.into();
9886        self
9887    }
9888
9889    /// The value of [values][crate::model::EnvVar::values]
9890    /// if it holds a `Value`, `None` if the field is not set or
9891    /// holds a different branch.
9892    pub fn value(&self) -> std::option::Option<&std::string::String> {
9893        #[allow(unreachable_patterns)]
9894        self.values.as_ref().and_then(|v| match v {
9895            crate::model::env_var::Values::Value(v) => std::option::Option::Some(v),
9896            _ => std::option::Option::None,
9897        })
9898    }
9899
9900    /// Sets the value of [values][crate::model::EnvVar::values]
9901    /// to hold a `Value`.
9902    ///
9903    /// Note that all the setters affecting `values` are
9904    /// mutually exclusive.
9905    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9906        self.values = std::option::Option::Some(crate::model::env_var::Values::Value(v.into()));
9907        self
9908    }
9909
9910    /// The value of [values][crate::model::EnvVar::values]
9911    /// if it holds a `ValueSource`, `None` if the field is not set or
9912    /// holds a different branch.
9913    pub fn value_source(
9914        &self,
9915    ) -> std::option::Option<&std::boxed::Box<crate::model::EnvVarSource>> {
9916        #[allow(unreachable_patterns)]
9917        self.values.as_ref().and_then(|v| match v {
9918            crate::model::env_var::Values::ValueSource(v) => std::option::Option::Some(v),
9919            _ => std::option::Option::None,
9920        })
9921    }
9922
9923    /// Sets the value of [values][crate::model::EnvVar::values]
9924    /// to hold a `ValueSource`.
9925    ///
9926    /// Note that all the setters affecting `values` are
9927    /// mutually exclusive.
9928    pub fn set_value_source<T: std::convert::Into<std::boxed::Box<crate::model::EnvVarSource>>>(
9929        mut self,
9930        v: T,
9931    ) -> Self {
9932        self.values =
9933            std::option::Option::Some(crate::model::env_var::Values::ValueSource(v.into()));
9934        self
9935    }
9936}
9937
9938impl wkt::message::Message for EnvVar {
9939    fn typename() -> &'static str {
9940        "type.googleapis.com/google.cloud.run.v2.EnvVar"
9941    }
9942}
9943
9944#[doc(hidden)]
9945impl<'de> serde::de::Deserialize<'de> for EnvVar {
9946    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9947    where
9948        D: serde::Deserializer<'de>,
9949    {
9950        #[allow(non_camel_case_types)]
9951        #[doc(hidden)]
9952        #[derive(PartialEq, Eq, Hash)]
9953        enum __FieldTag {
9954            __name,
9955            __value,
9956            __value_source,
9957            Unknown(std::string::String),
9958        }
9959        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9960            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9961            where
9962                D: serde::Deserializer<'de>,
9963            {
9964                struct Visitor;
9965                impl<'de> serde::de::Visitor<'de> for Visitor {
9966                    type Value = __FieldTag;
9967                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9968                        formatter.write_str("a field name for EnvVar")
9969                    }
9970                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9971                    where
9972                        E: serde::de::Error,
9973                    {
9974                        use std::result::Result::Ok;
9975                        use std::string::ToString;
9976                        match value {
9977                            "name" => Ok(__FieldTag::__name),
9978                            "value" => Ok(__FieldTag::__value),
9979                            "valueSource" => Ok(__FieldTag::__value_source),
9980                            "value_source" => Ok(__FieldTag::__value_source),
9981                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9982                        }
9983                    }
9984                }
9985                deserializer.deserialize_identifier(Visitor)
9986            }
9987        }
9988        struct Visitor;
9989        impl<'de> serde::de::Visitor<'de> for Visitor {
9990            type Value = EnvVar;
9991            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9992                formatter.write_str("struct EnvVar")
9993            }
9994            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9995            where
9996                A: serde::de::MapAccess<'de>,
9997            {
9998                #[allow(unused_imports)]
9999                use serde::de::Error;
10000                use std::option::Option::Some;
10001                let mut fields = std::collections::HashSet::new();
10002                let mut result = Self::Value::new();
10003                while let Some(tag) = map.next_key::<__FieldTag>()? {
10004                    #[allow(clippy::match_single_binding)]
10005                    match tag {
10006                        __FieldTag::__name => {
10007                            if !fields.insert(__FieldTag::__name) {
10008                                return std::result::Result::Err(A::Error::duplicate_field(
10009                                    "multiple values for name",
10010                                ));
10011                            }
10012                            result.name = map
10013                                .next_value::<std::option::Option<std::string::String>>()?
10014                                .unwrap_or_default();
10015                        }
10016                        __FieldTag::__value => {
10017                            if !fields.insert(__FieldTag::__value) {
10018                                return std::result::Result::Err(A::Error::duplicate_field(
10019                                    "multiple values for value",
10020                                ));
10021                            }
10022                            if result.values.is_some() {
10023                                return std::result::Result::Err(A::Error::duplicate_field(
10024                                    "multiple values for `values`, a oneof with full ID .google.cloud.run.v2.EnvVar.value, latest field was value",
10025                                ));
10026                            }
10027                            result.values =
10028                                std::option::Option::Some(crate::model::env_var::Values::Value(
10029                                    map.next_value::<std::option::Option<std::string::String>>()?
10030                                        .unwrap_or_default(),
10031                                ));
10032                        }
10033                        __FieldTag::__value_source => {
10034                            if !fields.insert(__FieldTag::__value_source) {
10035                                return std::result::Result::Err(A::Error::duplicate_field(
10036                                    "multiple values for value_source",
10037                                ));
10038                            }
10039                            if result.values.is_some() {
10040                                return std::result::Result::Err(A::Error::duplicate_field(
10041                                    "multiple values for `values`, a oneof with full ID .google.cloud.run.v2.EnvVar.value_source, latest field was valueSource",
10042                                ));
10043                            }
10044                            result.values = std::option::Option::Some(
10045                                crate::model::env_var::Values::ValueSource(
10046                                    map.next_value::<std::option::Option<
10047                                        std::boxed::Box<crate::model::EnvVarSource>,
10048                                    >>()?
10049                                    .unwrap_or_default(),
10050                                ),
10051                            );
10052                        }
10053                        __FieldTag::Unknown(key) => {
10054                            let value = map.next_value::<serde_json::Value>()?;
10055                            result._unknown_fields.insert(key, value);
10056                        }
10057                    }
10058                }
10059                std::result::Result::Ok(result)
10060            }
10061        }
10062        deserializer.deserialize_any(Visitor)
10063    }
10064}
10065
10066#[doc(hidden)]
10067impl serde::ser::Serialize for EnvVar {
10068    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10069    where
10070        S: serde::ser::Serializer,
10071    {
10072        use serde::ser::SerializeMap;
10073        #[allow(unused_imports)]
10074        use std::option::Option::Some;
10075        let mut state = serializer.serialize_map(std::option::Option::None)?;
10076        if !self.name.is_empty() {
10077            state.serialize_entry("name", &self.name)?;
10078        }
10079        if let Some(value) = self.value() {
10080            state.serialize_entry("value", value)?;
10081        }
10082        if let Some(value) = self.value_source() {
10083            state.serialize_entry("valueSource", value)?;
10084        }
10085        if !self._unknown_fields.is_empty() {
10086            for (key, value) in self._unknown_fields.iter() {
10087                state.serialize_entry(key, &value)?;
10088            }
10089        }
10090        state.end()
10091    }
10092}
10093
10094impl std::fmt::Debug for EnvVar {
10095    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10096        let mut debug_struct = f.debug_struct("EnvVar");
10097        debug_struct.field("name", &self.name);
10098        debug_struct.field("values", &self.values);
10099        if !self._unknown_fields.is_empty() {
10100            debug_struct.field("_unknown_fields", &self._unknown_fields);
10101        }
10102        debug_struct.finish()
10103    }
10104}
10105
10106/// Defines additional types related to [EnvVar].
10107pub mod env_var {
10108    #[allow(unused_imports)]
10109    use super::*;
10110
10111    #[derive(Clone, Debug, PartialEq)]
10112    #[non_exhaustive]
10113    pub enum Values {
10114        /// Literal value of the environment variable.
10115        /// Defaults to "", and the maximum length is 32768 bytes.
10116        /// Variable references are not supported in Cloud Run.
10117        Value(std::string::String),
10118        /// Source for the environment variable's value.
10119        ValueSource(std::boxed::Box<crate::model::EnvVarSource>),
10120    }
10121}
10122
10123/// EnvVarSource represents a source for the value of an EnvVar.
10124#[derive(Clone, Default, PartialEq)]
10125#[non_exhaustive]
10126pub struct EnvVarSource {
10127    /// Selects a secret and a specific version from Cloud Secret Manager.
10128    pub secret_key_ref: std::option::Option<crate::model::SecretKeySelector>,
10129
10130    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10131}
10132
10133impl EnvVarSource {
10134    pub fn new() -> Self {
10135        std::default::Default::default()
10136    }
10137
10138    /// Sets the value of [secret_key_ref][crate::model::EnvVarSource::secret_key_ref].
10139    pub fn set_secret_key_ref<T>(mut self, v: T) -> Self
10140    where
10141        T: std::convert::Into<crate::model::SecretKeySelector>,
10142    {
10143        self.secret_key_ref = std::option::Option::Some(v.into());
10144        self
10145    }
10146
10147    /// Sets or clears the value of [secret_key_ref][crate::model::EnvVarSource::secret_key_ref].
10148    pub fn set_or_clear_secret_key_ref<T>(mut self, v: std::option::Option<T>) -> Self
10149    where
10150        T: std::convert::Into<crate::model::SecretKeySelector>,
10151    {
10152        self.secret_key_ref = v.map(|x| x.into());
10153        self
10154    }
10155}
10156
10157impl wkt::message::Message for EnvVarSource {
10158    fn typename() -> &'static str {
10159        "type.googleapis.com/google.cloud.run.v2.EnvVarSource"
10160    }
10161}
10162
10163#[doc(hidden)]
10164impl<'de> serde::de::Deserialize<'de> for EnvVarSource {
10165    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10166    where
10167        D: serde::Deserializer<'de>,
10168    {
10169        #[allow(non_camel_case_types)]
10170        #[doc(hidden)]
10171        #[derive(PartialEq, Eq, Hash)]
10172        enum __FieldTag {
10173            __secret_key_ref,
10174            Unknown(std::string::String),
10175        }
10176        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10177            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10178            where
10179                D: serde::Deserializer<'de>,
10180            {
10181                struct Visitor;
10182                impl<'de> serde::de::Visitor<'de> for Visitor {
10183                    type Value = __FieldTag;
10184                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10185                        formatter.write_str("a field name for EnvVarSource")
10186                    }
10187                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10188                    where
10189                        E: serde::de::Error,
10190                    {
10191                        use std::result::Result::Ok;
10192                        use std::string::ToString;
10193                        match value {
10194                            "secretKeyRef" => Ok(__FieldTag::__secret_key_ref),
10195                            "secret_key_ref" => Ok(__FieldTag::__secret_key_ref),
10196                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10197                        }
10198                    }
10199                }
10200                deserializer.deserialize_identifier(Visitor)
10201            }
10202        }
10203        struct Visitor;
10204        impl<'de> serde::de::Visitor<'de> for Visitor {
10205            type Value = EnvVarSource;
10206            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10207                formatter.write_str("struct EnvVarSource")
10208            }
10209            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10210            where
10211                A: serde::de::MapAccess<'de>,
10212            {
10213                #[allow(unused_imports)]
10214                use serde::de::Error;
10215                use std::option::Option::Some;
10216                let mut fields = std::collections::HashSet::new();
10217                let mut result = Self::Value::new();
10218                while let Some(tag) = map.next_key::<__FieldTag>()? {
10219                    #[allow(clippy::match_single_binding)]
10220                    match tag {
10221                        __FieldTag::__secret_key_ref => {
10222                            if !fields.insert(__FieldTag::__secret_key_ref) {
10223                                return std::result::Result::Err(A::Error::duplicate_field(
10224                                    "multiple values for secret_key_ref",
10225                                ));
10226                            }
10227                            result.secret_key_ref = map
10228                                .next_value::<std::option::Option<crate::model::SecretKeySelector>>(
10229                                )?;
10230                        }
10231                        __FieldTag::Unknown(key) => {
10232                            let value = map.next_value::<serde_json::Value>()?;
10233                            result._unknown_fields.insert(key, value);
10234                        }
10235                    }
10236                }
10237                std::result::Result::Ok(result)
10238            }
10239        }
10240        deserializer.deserialize_any(Visitor)
10241    }
10242}
10243
10244#[doc(hidden)]
10245impl serde::ser::Serialize for EnvVarSource {
10246    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10247    where
10248        S: serde::ser::Serializer,
10249    {
10250        use serde::ser::SerializeMap;
10251        #[allow(unused_imports)]
10252        use std::option::Option::Some;
10253        let mut state = serializer.serialize_map(std::option::Option::None)?;
10254        if self.secret_key_ref.is_some() {
10255            state.serialize_entry("secretKeyRef", &self.secret_key_ref)?;
10256        }
10257        if !self._unknown_fields.is_empty() {
10258            for (key, value) in self._unknown_fields.iter() {
10259                state.serialize_entry(key, &value)?;
10260            }
10261        }
10262        state.end()
10263    }
10264}
10265
10266impl std::fmt::Debug for EnvVarSource {
10267    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10268        let mut debug_struct = f.debug_struct("EnvVarSource");
10269        debug_struct.field("secret_key_ref", &self.secret_key_ref);
10270        if !self._unknown_fields.is_empty() {
10271            debug_struct.field("_unknown_fields", &self._unknown_fields);
10272        }
10273        debug_struct.finish()
10274    }
10275}
10276
10277/// SecretEnvVarSource represents a source for the value of an EnvVar.
10278#[derive(Clone, Default, PartialEq)]
10279#[non_exhaustive]
10280pub struct SecretKeySelector {
10281    /// Required. The name of the secret in Cloud Secret Manager.
10282    /// Format: {secret_name} if the secret is in the same project.
10283    /// projects/{project}/secrets/{secret_name} if the secret is
10284    /// in a different project.
10285    pub secret: std::string::String,
10286
10287    /// The Cloud Secret Manager secret version.
10288    /// Can be 'latest' for the latest version, an integer for a specific version,
10289    /// or a version alias.
10290    pub version: std::string::String,
10291
10292    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10293}
10294
10295impl SecretKeySelector {
10296    pub fn new() -> Self {
10297        std::default::Default::default()
10298    }
10299
10300    /// Sets the value of [secret][crate::model::SecretKeySelector::secret].
10301    pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10302        self.secret = v.into();
10303        self
10304    }
10305
10306    /// Sets the value of [version][crate::model::SecretKeySelector::version].
10307    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10308        self.version = v.into();
10309        self
10310    }
10311}
10312
10313impl wkt::message::Message for SecretKeySelector {
10314    fn typename() -> &'static str {
10315        "type.googleapis.com/google.cloud.run.v2.SecretKeySelector"
10316    }
10317}
10318
10319#[doc(hidden)]
10320impl<'de> serde::de::Deserialize<'de> for SecretKeySelector {
10321    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10322    where
10323        D: serde::Deserializer<'de>,
10324    {
10325        #[allow(non_camel_case_types)]
10326        #[doc(hidden)]
10327        #[derive(PartialEq, Eq, Hash)]
10328        enum __FieldTag {
10329            __secret,
10330            __version,
10331            Unknown(std::string::String),
10332        }
10333        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10334            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10335            where
10336                D: serde::Deserializer<'de>,
10337            {
10338                struct Visitor;
10339                impl<'de> serde::de::Visitor<'de> for Visitor {
10340                    type Value = __FieldTag;
10341                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10342                        formatter.write_str("a field name for SecretKeySelector")
10343                    }
10344                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10345                    where
10346                        E: serde::de::Error,
10347                    {
10348                        use std::result::Result::Ok;
10349                        use std::string::ToString;
10350                        match value {
10351                            "secret" => Ok(__FieldTag::__secret),
10352                            "version" => Ok(__FieldTag::__version),
10353                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10354                        }
10355                    }
10356                }
10357                deserializer.deserialize_identifier(Visitor)
10358            }
10359        }
10360        struct Visitor;
10361        impl<'de> serde::de::Visitor<'de> for Visitor {
10362            type Value = SecretKeySelector;
10363            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10364                formatter.write_str("struct SecretKeySelector")
10365            }
10366            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10367            where
10368                A: serde::de::MapAccess<'de>,
10369            {
10370                #[allow(unused_imports)]
10371                use serde::de::Error;
10372                use std::option::Option::Some;
10373                let mut fields = std::collections::HashSet::new();
10374                let mut result = Self::Value::new();
10375                while let Some(tag) = map.next_key::<__FieldTag>()? {
10376                    #[allow(clippy::match_single_binding)]
10377                    match tag {
10378                        __FieldTag::__secret => {
10379                            if !fields.insert(__FieldTag::__secret) {
10380                                return std::result::Result::Err(A::Error::duplicate_field(
10381                                    "multiple values for secret",
10382                                ));
10383                            }
10384                            result.secret = map
10385                                .next_value::<std::option::Option<std::string::String>>()?
10386                                .unwrap_or_default();
10387                        }
10388                        __FieldTag::__version => {
10389                            if !fields.insert(__FieldTag::__version) {
10390                                return std::result::Result::Err(A::Error::duplicate_field(
10391                                    "multiple values for version",
10392                                ));
10393                            }
10394                            result.version = map
10395                                .next_value::<std::option::Option<std::string::String>>()?
10396                                .unwrap_or_default();
10397                        }
10398                        __FieldTag::Unknown(key) => {
10399                            let value = map.next_value::<serde_json::Value>()?;
10400                            result._unknown_fields.insert(key, value);
10401                        }
10402                    }
10403                }
10404                std::result::Result::Ok(result)
10405            }
10406        }
10407        deserializer.deserialize_any(Visitor)
10408    }
10409}
10410
10411#[doc(hidden)]
10412impl serde::ser::Serialize for SecretKeySelector {
10413    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10414    where
10415        S: serde::ser::Serializer,
10416    {
10417        use serde::ser::SerializeMap;
10418        #[allow(unused_imports)]
10419        use std::option::Option::Some;
10420        let mut state = serializer.serialize_map(std::option::Option::None)?;
10421        if !self.secret.is_empty() {
10422            state.serialize_entry("secret", &self.secret)?;
10423        }
10424        if !self.version.is_empty() {
10425            state.serialize_entry("version", &self.version)?;
10426        }
10427        if !self._unknown_fields.is_empty() {
10428            for (key, value) in self._unknown_fields.iter() {
10429                state.serialize_entry(key, &value)?;
10430            }
10431        }
10432        state.end()
10433    }
10434}
10435
10436impl std::fmt::Debug for SecretKeySelector {
10437    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10438        let mut debug_struct = f.debug_struct("SecretKeySelector");
10439        debug_struct.field("secret", &self.secret);
10440        debug_struct.field("version", &self.version);
10441        if !self._unknown_fields.is_empty() {
10442            debug_struct.field("_unknown_fields", &self._unknown_fields);
10443        }
10444        debug_struct.finish()
10445    }
10446}
10447
10448/// ContainerPort represents a network port in a single container.
10449#[derive(Clone, Default, PartialEq)]
10450#[non_exhaustive]
10451pub struct ContainerPort {
10452    /// If specified, used to specify which protocol to use.
10453    /// Allowed values are "http1" and "h2c".
10454    pub name: std::string::String,
10455
10456    /// Port number the container listens on.
10457    /// This must be a valid TCP port number, 0 < container_port < 65536.
10458    pub container_port: i32,
10459
10460    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10461}
10462
10463impl ContainerPort {
10464    pub fn new() -> Self {
10465        std::default::Default::default()
10466    }
10467
10468    /// Sets the value of [name][crate::model::ContainerPort::name].
10469    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10470        self.name = v.into();
10471        self
10472    }
10473
10474    /// Sets the value of [container_port][crate::model::ContainerPort::container_port].
10475    pub fn set_container_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10476        self.container_port = v.into();
10477        self
10478    }
10479}
10480
10481impl wkt::message::Message for ContainerPort {
10482    fn typename() -> &'static str {
10483        "type.googleapis.com/google.cloud.run.v2.ContainerPort"
10484    }
10485}
10486
10487#[doc(hidden)]
10488impl<'de> serde::de::Deserialize<'de> for ContainerPort {
10489    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10490    where
10491        D: serde::Deserializer<'de>,
10492    {
10493        #[allow(non_camel_case_types)]
10494        #[doc(hidden)]
10495        #[derive(PartialEq, Eq, Hash)]
10496        enum __FieldTag {
10497            __name,
10498            __container_port,
10499            Unknown(std::string::String),
10500        }
10501        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10502            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10503            where
10504                D: serde::Deserializer<'de>,
10505            {
10506                struct Visitor;
10507                impl<'de> serde::de::Visitor<'de> for Visitor {
10508                    type Value = __FieldTag;
10509                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10510                        formatter.write_str("a field name for ContainerPort")
10511                    }
10512                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10513                    where
10514                        E: serde::de::Error,
10515                    {
10516                        use std::result::Result::Ok;
10517                        use std::string::ToString;
10518                        match value {
10519                            "name" => Ok(__FieldTag::__name),
10520                            "containerPort" => Ok(__FieldTag::__container_port),
10521                            "container_port" => Ok(__FieldTag::__container_port),
10522                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10523                        }
10524                    }
10525                }
10526                deserializer.deserialize_identifier(Visitor)
10527            }
10528        }
10529        struct Visitor;
10530        impl<'de> serde::de::Visitor<'de> for Visitor {
10531            type Value = ContainerPort;
10532            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10533                formatter.write_str("struct ContainerPort")
10534            }
10535            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10536            where
10537                A: serde::de::MapAccess<'de>,
10538            {
10539                #[allow(unused_imports)]
10540                use serde::de::Error;
10541                use std::option::Option::Some;
10542                let mut fields = std::collections::HashSet::new();
10543                let mut result = Self::Value::new();
10544                while let Some(tag) = map.next_key::<__FieldTag>()? {
10545                    #[allow(clippy::match_single_binding)]
10546                    match tag {
10547                        __FieldTag::__name => {
10548                            if !fields.insert(__FieldTag::__name) {
10549                                return std::result::Result::Err(A::Error::duplicate_field(
10550                                    "multiple values for name",
10551                                ));
10552                            }
10553                            result.name = map
10554                                .next_value::<std::option::Option<std::string::String>>()?
10555                                .unwrap_or_default();
10556                        }
10557                        __FieldTag::__container_port => {
10558                            if !fields.insert(__FieldTag::__container_port) {
10559                                return std::result::Result::Err(A::Error::duplicate_field(
10560                                    "multiple values for container_port",
10561                                ));
10562                            }
10563                            struct __With(std::option::Option<i32>);
10564                            impl<'de> serde::de::Deserialize<'de> for __With {
10565                                fn deserialize<D>(
10566                                    deserializer: D,
10567                                ) -> std::result::Result<Self, D::Error>
10568                                where
10569                                    D: serde::de::Deserializer<'de>,
10570                                {
10571                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10572                                }
10573                            }
10574                            result.container_port =
10575                                map.next_value::<__With>()?.0.unwrap_or_default();
10576                        }
10577                        __FieldTag::Unknown(key) => {
10578                            let value = map.next_value::<serde_json::Value>()?;
10579                            result._unknown_fields.insert(key, value);
10580                        }
10581                    }
10582                }
10583                std::result::Result::Ok(result)
10584            }
10585        }
10586        deserializer.deserialize_any(Visitor)
10587    }
10588}
10589
10590#[doc(hidden)]
10591impl serde::ser::Serialize for ContainerPort {
10592    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10593    where
10594        S: serde::ser::Serializer,
10595    {
10596        use serde::ser::SerializeMap;
10597        #[allow(unused_imports)]
10598        use std::option::Option::Some;
10599        let mut state = serializer.serialize_map(std::option::Option::None)?;
10600        if !self.name.is_empty() {
10601            state.serialize_entry("name", &self.name)?;
10602        }
10603        if !wkt::internal::is_default(&self.container_port) {
10604            struct __With<'a>(&'a i32);
10605            impl<'a> serde::ser::Serialize for __With<'a> {
10606                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10607                where
10608                    S: serde::ser::Serializer,
10609                {
10610                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10611                }
10612            }
10613            state.serialize_entry("containerPort", &__With(&self.container_port))?;
10614        }
10615        if !self._unknown_fields.is_empty() {
10616            for (key, value) in self._unknown_fields.iter() {
10617                state.serialize_entry(key, &value)?;
10618            }
10619        }
10620        state.end()
10621    }
10622}
10623
10624impl std::fmt::Debug for ContainerPort {
10625    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10626        let mut debug_struct = f.debug_struct("ContainerPort");
10627        debug_struct.field("name", &self.name);
10628        debug_struct.field("container_port", &self.container_port);
10629        if !self._unknown_fields.is_empty() {
10630            debug_struct.field("_unknown_fields", &self._unknown_fields);
10631        }
10632        debug_struct.finish()
10633    }
10634}
10635
10636/// VolumeMount describes a mounting of a Volume within a container.
10637#[derive(Clone, Default, PartialEq)]
10638#[non_exhaustive]
10639pub struct VolumeMount {
10640    /// Required. This must match the Name of a Volume.
10641    pub name: std::string::String,
10642
10643    /// Required. Path within the container at which the volume should be mounted.
10644    /// Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must
10645    /// otherwise be `/cloudsql`. All instances defined in the Volume will be
10646    /// available as `/cloudsql/[instance]`. For more information on Cloud SQL
10647    /// volumes, visit <https://cloud.google.com/sql/docs/mysql/connect-run>
10648    pub mount_path: std::string::String,
10649
10650    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10651}
10652
10653impl VolumeMount {
10654    pub fn new() -> Self {
10655        std::default::Default::default()
10656    }
10657
10658    /// Sets the value of [name][crate::model::VolumeMount::name].
10659    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10660        self.name = v.into();
10661        self
10662    }
10663
10664    /// Sets the value of [mount_path][crate::model::VolumeMount::mount_path].
10665    pub fn set_mount_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10666        self.mount_path = v.into();
10667        self
10668    }
10669}
10670
10671impl wkt::message::Message for VolumeMount {
10672    fn typename() -> &'static str {
10673        "type.googleapis.com/google.cloud.run.v2.VolumeMount"
10674    }
10675}
10676
10677#[doc(hidden)]
10678impl<'de> serde::de::Deserialize<'de> for VolumeMount {
10679    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10680    where
10681        D: serde::Deserializer<'de>,
10682    {
10683        #[allow(non_camel_case_types)]
10684        #[doc(hidden)]
10685        #[derive(PartialEq, Eq, Hash)]
10686        enum __FieldTag {
10687            __name,
10688            __mount_path,
10689            Unknown(std::string::String),
10690        }
10691        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10692            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10693            where
10694                D: serde::Deserializer<'de>,
10695            {
10696                struct Visitor;
10697                impl<'de> serde::de::Visitor<'de> for Visitor {
10698                    type Value = __FieldTag;
10699                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10700                        formatter.write_str("a field name for VolumeMount")
10701                    }
10702                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10703                    where
10704                        E: serde::de::Error,
10705                    {
10706                        use std::result::Result::Ok;
10707                        use std::string::ToString;
10708                        match value {
10709                            "name" => Ok(__FieldTag::__name),
10710                            "mountPath" => Ok(__FieldTag::__mount_path),
10711                            "mount_path" => Ok(__FieldTag::__mount_path),
10712                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10713                        }
10714                    }
10715                }
10716                deserializer.deserialize_identifier(Visitor)
10717            }
10718        }
10719        struct Visitor;
10720        impl<'de> serde::de::Visitor<'de> for Visitor {
10721            type Value = VolumeMount;
10722            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10723                formatter.write_str("struct VolumeMount")
10724            }
10725            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10726            where
10727                A: serde::de::MapAccess<'de>,
10728            {
10729                #[allow(unused_imports)]
10730                use serde::de::Error;
10731                use std::option::Option::Some;
10732                let mut fields = std::collections::HashSet::new();
10733                let mut result = Self::Value::new();
10734                while let Some(tag) = map.next_key::<__FieldTag>()? {
10735                    #[allow(clippy::match_single_binding)]
10736                    match tag {
10737                        __FieldTag::__name => {
10738                            if !fields.insert(__FieldTag::__name) {
10739                                return std::result::Result::Err(A::Error::duplicate_field(
10740                                    "multiple values for name",
10741                                ));
10742                            }
10743                            result.name = map
10744                                .next_value::<std::option::Option<std::string::String>>()?
10745                                .unwrap_or_default();
10746                        }
10747                        __FieldTag::__mount_path => {
10748                            if !fields.insert(__FieldTag::__mount_path) {
10749                                return std::result::Result::Err(A::Error::duplicate_field(
10750                                    "multiple values for mount_path",
10751                                ));
10752                            }
10753                            result.mount_path = map
10754                                .next_value::<std::option::Option<std::string::String>>()?
10755                                .unwrap_or_default();
10756                        }
10757                        __FieldTag::Unknown(key) => {
10758                            let value = map.next_value::<serde_json::Value>()?;
10759                            result._unknown_fields.insert(key, value);
10760                        }
10761                    }
10762                }
10763                std::result::Result::Ok(result)
10764            }
10765        }
10766        deserializer.deserialize_any(Visitor)
10767    }
10768}
10769
10770#[doc(hidden)]
10771impl serde::ser::Serialize for VolumeMount {
10772    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10773    where
10774        S: serde::ser::Serializer,
10775    {
10776        use serde::ser::SerializeMap;
10777        #[allow(unused_imports)]
10778        use std::option::Option::Some;
10779        let mut state = serializer.serialize_map(std::option::Option::None)?;
10780        if !self.name.is_empty() {
10781            state.serialize_entry("name", &self.name)?;
10782        }
10783        if !self.mount_path.is_empty() {
10784            state.serialize_entry("mountPath", &self.mount_path)?;
10785        }
10786        if !self._unknown_fields.is_empty() {
10787            for (key, value) in self._unknown_fields.iter() {
10788                state.serialize_entry(key, &value)?;
10789            }
10790        }
10791        state.end()
10792    }
10793}
10794
10795impl std::fmt::Debug for VolumeMount {
10796    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10797        let mut debug_struct = f.debug_struct("VolumeMount");
10798        debug_struct.field("name", &self.name);
10799        debug_struct.field("mount_path", &self.mount_path);
10800        if !self._unknown_fields.is_empty() {
10801            debug_struct.field("_unknown_fields", &self._unknown_fields);
10802        }
10803        debug_struct.finish()
10804    }
10805}
10806
10807/// Volume represents a named volume in a container.
10808#[derive(Clone, Default, PartialEq)]
10809#[non_exhaustive]
10810pub struct Volume {
10811    /// Required. Volume's name.
10812    pub name: std::string::String,
10813
10814    pub volume_type: std::option::Option<crate::model::volume::VolumeType>,
10815
10816    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10817}
10818
10819impl Volume {
10820    pub fn new() -> Self {
10821        std::default::Default::default()
10822    }
10823
10824    /// Sets the value of [name][crate::model::Volume::name].
10825    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10826        self.name = v.into();
10827        self
10828    }
10829
10830    /// Sets the value of [volume_type][crate::model::Volume::volume_type].
10831    ///
10832    /// Note that all the setters affecting `volume_type` are mutually
10833    /// exclusive.
10834    pub fn set_volume_type<
10835        T: std::convert::Into<std::option::Option<crate::model::volume::VolumeType>>,
10836    >(
10837        mut self,
10838        v: T,
10839    ) -> Self {
10840        self.volume_type = v.into();
10841        self
10842    }
10843
10844    /// The value of [volume_type][crate::model::Volume::volume_type]
10845    /// if it holds a `Secret`, `None` if the field is not set or
10846    /// holds a different branch.
10847    pub fn secret(
10848        &self,
10849    ) -> std::option::Option<&std::boxed::Box<crate::model::SecretVolumeSource>> {
10850        #[allow(unreachable_patterns)]
10851        self.volume_type.as_ref().and_then(|v| match v {
10852            crate::model::volume::VolumeType::Secret(v) => std::option::Option::Some(v),
10853            _ => std::option::Option::None,
10854        })
10855    }
10856
10857    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
10858    /// to hold a `Secret`.
10859    ///
10860    /// Note that all the setters affecting `volume_type` are
10861    /// mutually exclusive.
10862    pub fn set_secret<T: std::convert::Into<std::boxed::Box<crate::model::SecretVolumeSource>>>(
10863        mut self,
10864        v: T,
10865    ) -> Self {
10866        self.volume_type =
10867            std::option::Option::Some(crate::model::volume::VolumeType::Secret(v.into()));
10868        self
10869    }
10870
10871    /// The value of [volume_type][crate::model::Volume::volume_type]
10872    /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
10873    /// holds a different branch.
10874    pub fn cloud_sql_instance(
10875        &self,
10876    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlInstance>> {
10877        #[allow(unreachable_patterns)]
10878        self.volume_type.as_ref().and_then(|v| match v {
10879            crate::model::volume::VolumeType::CloudSqlInstance(v) => std::option::Option::Some(v),
10880            _ => std::option::Option::None,
10881        })
10882    }
10883
10884    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
10885    /// to hold a `CloudSqlInstance`.
10886    ///
10887    /// Note that all the setters affecting `volume_type` are
10888    /// mutually exclusive.
10889    pub fn set_cloud_sql_instance<
10890        T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlInstance>>,
10891    >(
10892        mut self,
10893        v: T,
10894    ) -> Self {
10895        self.volume_type =
10896            std::option::Option::Some(crate::model::volume::VolumeType::CloudSqlInstance(v.into()));
10897        self
10898    }
10899
10900    /// The value of [volume_type][crate::model::Volume::volume_type]
10901    /// if it holds a `EmptyDir`, `None` if the field is not set or
10902    /// holds a different branch.
10903    pub fn empty_dir(
10904        &self,
10905    ) -> std::option::Option<&std::boxed::Box<crate::model::EmptyDirVolumeSource>> {
10906        #[allow(unreachable_patterns)]
10907        self.volume_type.as_ref().and_then(|v| match v {
10908            crate::model::volume::VolumeType::EmptyDir(v) => std::option::Option::Some(v),
10909            _ => std::option::Option::None,
10910        })
10911    }
10912
10913    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
10914    /// to hold a `EmptyDir`.
10915    ///
10916    /// Note that all the setters affecting `volume_type` are
10917    /// mutually exclusive.
10918    pub fn set_empty_dir<
10919        T: std::convert::Into<std::boxed::Box<crate::model::EmptyDirVolumeSource>>,
10920    >(
10921        mut self,
10922        v: T,
10923    ) -> Self {
10924        self.volume_type =
10925            std::option::Option::Some(crate::model::volume::VolumeType::EmptyDir(v.into()));
10926        self
10927    }
10928
10929    /// The value of [volume_type][crate::model::Volume::volume_type]
10930    /// if it holds a `Nfs`, `None` if the field is not set or
10931    /// holds a different branch.
10932    pub fn nfs(&self) -> std::option::Option<&std::boxed::Box<crate::model::NFSVolumeSource>> {
10933        #[allow(unreachable_patterns)]
10934        self.volume_type.as_ref().and_then(|v| match v {
10935            crate::model::volume::VolumeType::Nfs(v) => std::option::Option::Some(v),
10936            _ => std::option::Option::None,
10937        })
10938    }
10939
10940    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
10941    /// to hold a `Nfs`.
10942    ///
10943    /// Note that all the setters affecting `volume_type` are
10944    /// mutually exclusive.
10945    pub fn set_nfs<T: std::convert::Into<std::boxed::Box<crate::model::NFSVolumeSource>>>(
10946        mut self,
10947        v: T,
10948    ) -> Self {
10949        self.volume_type =
10950            std::option::Option::Some(crate::model::volume::VolumeType::Nfs(v.into()));
10951        self
10952    }
10953
10954    /// The value of [volume_type][crate::model::Volume::volume_type]
10955    /// if it holds a `Gcs`, `None` if the field is not set or
10956    /// holds a different branch.
10957    pub fn gcs(&self) -> std::option::Option<&std::boxed::Box<crate::model::GCSVolumeSource>> {
10958        #[allow(unreachable_patterns)]
10959        self.volume_type.as_ref().and_then(|v| match v {
10960            crate::model::volume::VolumeType::Gcs(v) => std::option::Option::Some(v),
10961            _ => std::option::Option::None,
10962        })
10963    }
10964
10965    /// Sets the value of [volume_type][crate::model::Volume::volume_type]
10966    /// to hold a `Gcs`.
10967    ///
10968    /// Note that all the setters affecting `volume_type` are
10969    /// mutually exclusive.
10970    pub fn set_gcs<T: std::convert::Into<std::boxed::Box<crate::model::GCSVolumeSource>>>(
10971        mut self,
10972        v: T,
10973    ) -> Self {
10974        self.volume_type =
10975            std::option::Option::Some(crate::model::volume::VolumeType::Gcs(v.into()));
10976        self
10977    }
10978}
10979
10980impl wkt::message::Message for Volume {
10981    fn typename() -> &'static str {
10982        "type.googleapis.com/google.cloud.run.v2.Volume"
10983    }
10984}
10985
10986#[doc(hidden)]
10987impl<'de> serde::de::Deserialize<'de> for Volume {
10988    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10989    where
10990        D: serde::Deserializer<'de>,
10991    {
10992        #[allow(non_camel_case_types)]
10993        #[doc(hidden)]
10994        #[derive(PartialEq, Eq, Hash)]
10995        enum __FieldTag {
10996            __name,
10997            __secret,
10998            __cloud_sql_instance,
10999            __empty_dir,
11000            __nfs,
11001            __gcs,
11002            Unknown(std::string::String),
11003        }
11004        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11005            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11006            where
11007                D: serde::Deserializer<'de>,
11008            {
11009                struct Visitor;
11010                impl<'de> serde::de::Visitor<'de> for Visitor {
11011                    type Value = __FieldTag;
11012                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11013                        formatter.write_str("a field name for Volume")
11014                    }
11015                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11016                    where
11017                        E: serde::de::Error,
11018                    {
11019                        use std::result::Result::Ok;
11020                        use std::string::ToString;
11021                        match value {
11022                            "name" => Ok(__FieldTag::__name),
11023                            "secret" => Ok(__FieldTag::__secret),
11024                            "cloudSqlInstance" => Ok(__FieldTag::__cloud_sql_instance),
11025                            "cloud_sql_instance" => Ok(__FieldTag::__cloud_sql_instance),
11026                            "emptyDir" => Ok(__FieldTag::__empty_dir),
11027                            "empty_dir" => Ok(__FieldTag::__empty_dir),
11028                            "nfs" => Ok(__FieldTag::__nfs),
11029                            "gcs" => Ok(__FieldTag::__gcs),
11030                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11031                        }
11032                    }
11033                }
11034                deserializer.deserialize_identifier(Visitor)
11035            }
11036        }
11037        struct Visitor;
11038        impl<'de> serde::de::Visitor<'de> for Visitor {
11039            type Value = Volume;
11040            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11041                formatter.write_str("struct Volume")
11042            }
11043            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11044            where
11045                A: serde::de::MapAccess<'de>,
11046            {
11047                #[allow(unused_imports)]
11048                use serde::de::Error;
11049                use std::option::Option::Some;
11050                let mut fields = std::collections::HashSet::new();
11051                let mut result = Self::Value::new();
11052                while let Some(tag) = map.next_key::<__FieldTag>()? {
11053                    #[allow(clippy::match_single_binding)]
11054                    match tag {
11055                        __FieldTag::__name => {
11056                            if !fields.insert(__FieldTag::__name) {
11057                                return std::result::Result::Err(A::Error::duplicate_field(
11058                                    "multiple values for name",
11059                                ));
11060                            }
11061                            result.name = map
11062                                .next_value::<std::option::Option<std::string::String>>()?
11063                                .unwrap_or_default();
11064                        }
11065                        __FieldTag::__secret => {
11066                            if !fields.insert(__FieldTag::__secret) {
11067                                return std::result::Result::Err(A::Error::duplicate_field(
11068                                    "multiple values for secret",
11069                                ));
11070                            }
11071                            if result.volume_type.is_some() {
11072                                return std::result::Result::Err(A::Error::duplicate_field(
11073                                    "multiple values for `volume_type`, a oneof with full ID .google.cloud.run.v2.Volume.secret, latest field was secret",
11074                                ));
11075                            }
11076                            result.volume_type = std::option::Option::Some(
11077                                crate::model::volume::VolumeType::Secret(
11078                                    map.next_value::<std::option::Option<
11079                                        std::boxed::Box<crate::model::SecretVolumeSource>,
11080                                    >>()?
11081                                    .unwrap_or_default(),
11082                                ),
11083                            );
11084                        }
11085                        __FieldTag::__cloud_sql_instance => {
11086                            if !fields.insert(__FieldTag::__cloud_sql_instance) {
11087                                return std::result::Result::Err(A::Error::duplicate_field(
11088                                    "multiple values for cloud_sql_instance",
11089                                ));
11090                            }
11091                            if result.volume_type.is_some() {
11092                                return std::result::Result::Err(A::Error::duplicate_field(
11093                                    "multiple values for `volume_type`, a oneof with full ID .google.cloud.run.v2.Volume.cloud_sql_instance, latest field was cloudSqlInstance",
11094                                ));
11095                            }
11096                            result.volume_type = std::option::Option::Some(
11097                                crate::model::volume::VolumeType::CloudSqlInstance(
11098                                    map.next_value::<std::option::Option<
11099                                        std::boxed::Box<crate::model::CloudSqlInstance>,
11100                                    >>()?
11101                                    .unwrap_or_default(),
11102                                ),
11103                            );
11104                        }
11105                        __FieldTag::__empty_dir => {
11106                            if !fields.insert(__FieldTag::__empty_dir) {
11107                                return std::result::Result::Err(A::Error::duplicate_field(
11108                                    "multiple values for empty_dir",
11109                                ));
11110                            }
11111                            if result.volume_type.is_some() {
11112                                return std::result::Result::Err(A::Error::duplicate_field(
11113                                    "multiple values for `volume_type`, a oneof with full ID .google.cloud.run.v2.Volume.empty_dir, latest field was emptyDir",
11114                                ));
11115                            }
11116                            result.volume_type = std::option::Option::Some(
11117                                crate::model::volume::VolumeType::EmptyDir(
11118                                    map.next_value::<std::option::Option<
11119                                        std::boxed::Box<crate::model::EmptyDirVolumeSource>,
11120                                    >>()?
11121                                    .unwrap_or_default(),
11122                                ),
11123                            );
11124                        }
11125                        __FieldTag::__nfs => {
11126                            if !fields.insert(__FieldTag::__nfs) {
11127                                return std::result::Result::Err(A::Error::duplicate_field(
11128                                    "multiple values for nfs",
11129                                ));
11130                            }
11131                            if result.volume_type.is_some() {
11132                                return std::result::Result::Err(A::Error::duplicate_field(
11133                                    "multiple values for `volume_type`, a oneof with full ID .google.cloud.run.v2.Volume.nfs, latest field was nfs",
11134                                ));
11135                            }
11136                            result.volume_type =
11137                                std::option::Option::Some(crate::model::volume::VolumeType::Nfs(
11138                                    map.next_value::<std::option::Option<
11139                                        std::boxed::Box<crate::model::NFSVolumeSource>,
11140                                    >>()?
11141                                    .unwrap_or_default(),
11142                                ));
11143                        }
11144                        __FieldTag::__gcs => {
11145                            if !fields.insert(__FieldTag::__gcs) {
11146                                return std::result::Result::Err(A::Error::duplicate_field(
11147                                    "multiple values for gcs",
11148                                ));
11149                            }
11150                            if result.volume_type.is_some() {
11151                                return std::result::Result::Err(A::Error::duplicate_field(
11152                                    "multiple values for `volume_type`, a oneof with full ID .google.cloud.run.v2.Volume.gcs, latest field was gcs",
11153                                ));
11154                            }
11155                            result.volume_type =
11156                                std::option::Option::Some(crate::model::volume::VolumeType::Gcs(
11157                                    map.next_value::<std::option::Option<
11158                                        std::boxed::Box<crate::model::GCSVolumeSource>,
11159                                    >>()?
11160                                    .unwrap_or_default(),
11161                                ));
11162                        }
11163                        __FieldTag::Unknown(key) => {
11164                            let value = map.next_value::<serde_json::Value>()?;
11165                            result._unknown_fields.insert(key, value);
11166                        }
11167                    }
11168                }
11169                std::result::Result::Ok(result)
11170            }
11171        }
11172        deserializer.deserialize_any(Visitor)
11173    }
11174}
11175
11176#[doc(hidden)]
11177impl serde::ser::Serialize for Volume {
11178    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11179    where
11180        S: serde::ser::Serializer,
11181    {
11182        use serde::ser::SerializeMap;
11183        #[allow(unused_imports)]
11184        use std::option::Option::Some;
11185        let mut state = serializer.serialize_map(std::option::Option::None)?;
11186        if !self.name.is_empty() {
11187            state.serialize_entry("name", &self.name)?;
11188        }
11189        if let Some(value) = self.secret() {
11190            state.serialize_entry("secret", value)?;
11191        }
11192        if let Some(value) = self.cloud_sql_instance() {
11193            state.serialize_entry("cloudSqlInstance", value)?;
11194        }
11195        if let Some(value) = self.empty_dir() {
11196            state.serialize_entry("emptyDir", value)?;
11197        }
11198        if let Some(value) = self.nfs() {
11199            state.serialize_entry("nfs", value)?;
11200        }
11201        if let Some(value) = self.gcs() {
11202            state.serialize_entry("gcs", value)?;
11203        }
11204        if !self._unknown_fields.is_empty() {
11205            for (key, value) in self._unknown_fields.iter() {
11206                state.serialize_entry(key, &value)?;
11207            }
11208        }
11209        state.end()
11210    }
11211}
11212
11213impl std::fmt::Debug for Volume {
11214    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11215        let mut debug_struct = f.debug_struct("Volume");
11216        debug_struct.field("name", &self.name);
11217        debug_struct.field("volume_type", &self.volume_type);
11218        if !self._unknown_fields.is_empty() {
11219            debug_struct.field("_unknown_fields", &self._unknown_fields);
11220        }
11221        debug_struct.finish()
11222    }
11223}
11224
11225/// Defines additional types related to [Volume].
11226pub mod volume {
11227    #[allow(unused_imports)]
11228    use super::*;
11229
11230    #[derive(Clone, Debug, PartialEq)]
11231    #[non_exhaustive]
11232    pub enum VolumeType {
11233        /// Secret represents a secret that should populate this volume.
11234        Secret(std::boxed::Box<crate::model::SecretVolumeSource>),
11235        /// For Cloud SQL volumes, contains the specific instances that should be
11236        /// mounted. Visit <https://cloud.google.com/sql/docs/mysql/connect-run> for
11237        /// more information on how to connect Cloud SQL and Cloud Run.
11238        CloudSqlInstance(std::boxed::Box<crate::model::CloudSqlInstance>),
11239        /// Ephemeral storage used as a shared volume.
11240        EmptyDir(std::boxed::Box<crate::model::EmptyDirVolumeSource>),
11241        /// For NFS Voumes, contains the path to the nfs Volume
11242        Nfs(std::boxed::Box<crate::model::NFSVolumeSource>),
11243        /// Persistent storage backed by a Google Cloud Storage bucket.
11244        Gcs(std::boxed::Box<crate::model::GCSVolumeSource>),
11245    }
11246}
11247
11248/// The secret's value will be presented as the content of a file whose
11249/// name is defined in the item path. If no items are defined, the name of
11250/// the file is the secret.
11251#[derive(Clone, Default, PartialEq)]
11252#[non_exhaustive]
11253pub struct SecretVolumeSource {
11254    /// Required. The name of the secret in Cloud Secret Manager.
11255    /// Format: {secret} if the secret is in the same project.
11256    /// projects/{project}/secrets/{secret} if the secret is
11257    /// in a different project.
11258    pub secret: std::string::String,
11259
11260    /// If unspecified, the volume will expose a file whose name is the
11261    /// secret, relative to VolumeMount.mount_path.
11262    /// If specified, the key will be used as the version to fetch from Cloud
11263    /// Secret Manager and the path will be the name of the file exposed in the
11264    /// volume. When items are defined, they must specify a path and a version.
11265    pub items: std::vec::Vec<crate::model::VersionToPath>,
11266
11267    /// Integer representation of mode bits to use on created files by default.
11268    /// Must be a value between 0000 and 0777 (octal), defaulting to 0444.
11269    /// Directories within the path are not affected by  this setting.
11270    ///
11271    /// Notes
11272    ///
11273    /// * Internally, a umask of 0222 will be applied to any non-zero value.
11274    /// * This is an integer representation of the mode bits. So, the octal
11275    ///   integer value should look exactly as the chmod numeric notation with a
11276    ///   leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal)
11277    ///   or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or
11278    ///   493 (base-10).
11279    /// * This might be in conflict with other options that affect the
11280    ///   file mode, like fsGroup, and the result can be other mode bits set.
11281    ///
11282    /// This might be in conflict with other options that affect the
11283    /// file mode, like fsGroup, and as a result, other mode bits could be set.
11284    pub default_mode: i32,
11285
11286    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11287}
11288
11289impl SecretVolumeSource {
11290    pub fn new() -> Self {
11291        std::default::Default::default()
11292    }
11293
11294    /// Sets the value of [secret][crate::model::SecretVolumeSource::secret].
11295    pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11296        self.secret = v.into();
11297        self
11298    }
11299
11300    /// Sets the value of [items][crate::model::SecretVolumeSource::items].
11301    pub fn set_items<T, V>(mut self, v: T) -> Self
11302    where
11303        T: std::iter::IntoIterator<Item = V>,
11304        V: std::convert::Into<crate::model::VersionToPath>,
11305    {
11306        use std::iter::Iterator;
11307        self.items = v.into_iter().map(|i| i.into()).collect();
11308        self
11309    }
11310
11311    /// Sets the value of [default_mode][crate::model::SecretVolumeSource::default_mode].
11312    pub fn set_default_mode<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11313        self.default_mode = v.into();
11314        self
11315    }
11316}
11317
11318impl wkt::message::Message for SecretVolumeSource {
11319    fn typename() -> &'static str {
11320        "type.googleapis.com/google.cloud.run.v2.SecretVolumeSource"
11321    }
11322}
11323
11324#[doc(hidden)]
11325impl<'de> serde::de::Deserialize<'de> for SecretVolumeSource {
11326    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11327    where
11328        D: serde::Deserializer<'de>,
11329    {
11330        #[allow(non_camel_case_types)]
11331        #[doc(hidden)]
11332        #[derive(PartialEq, Eq, Hash)]
11333        enum __FieldTag {
11334            __secret,
11335            __items,
11336            __default_mode,
11337            Unknown(std::string::String),
11338        }
11339        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11340            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11341            where
11342                D: serde::Deserializer<'de>,
11343            {
11344                struct Visitor;
11345                impl<'de> serde::de::Visitor<'de> for Visitor {
11346                    type Value = __FieldTag;
11347                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11348                        formatter.write_str("a field name for SecretVolumeSource")
11349                    }
11350                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11351                    where
11352                        E: serde::de::Error,
11353                    {
11354                        use std::result::Result::Ok;
11355                        use std::string::ToString;
11356                        match value {
11357                            "secret" => Ok(__FieldTag::__secret),
11358                            "items" => Ok(__FieldTag::__items),
11359                            "defaultMode" => Ok(__FieldTag::__default_mode),
11360                            "default_mode" => Ok(__FieldTag::__default_mode),
11361                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11362                        }
11363                    }
11364                }
11365                deserializer.deserialize_identifier(Visitor)
11366            }
11367        }
11368        struct Visitor;
11369        impl<'de> serde::de::Visitor<'de> for Visitor {
11370            type Value = SecretVolumeSource;
11371            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11372                formatter.write_str("struct SecretVolumeSource")
11373            }
11374            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11375            where
11376                A: serde::de::MapAccess<'de>,
11377            {
11378                #[allow(unused_imports)]
11379                use serde::de::Error;
11380                use std::option::Option::Some;
11381                let mut fields = std::collections::HashSet::new();
11382                let mut result = Self::Value::new();
11383                while let Some(tag) = map.next_key::<__FieldTag>()? {
11384                    #[allow(clippy::match_single_binding)]
11385                    match tag {
11386                        __FieldTag::__secret => {
11387                            if !fields.insert(__FieldTag::__secret) {
11388                                return std::result::Result::Err(A::Error::duplicate_field(
11389                                    "multiple values for secret",
11390                                ));
11391                            }
11392                            result.secret = map
11393                                .next_value::<std::option::Option<std::string::String>>()?
11394                                .unwrap_or_default();
11395                        }
11396                        __FieldTag::__items => {
11397                            if !fields.insert(__FieldTag::__items) {
11398                                return std::result::Result::Err(A::Error::duplicate_field(
11399                                    "multiple values for items",
11400                                ));
11401                            }
11402                            result.items = map.next_value::<std::option::Option<std::vec::Vec<crate::model::VersionToPath>>>()?.unwrap_or_default();
11403                        }
11404                        __FieldTag::__default_mode => {
11405                            if !fields.insert(__FieldTag::__default_mode) {
11406                                return std::result::Result::Err(A::Error::duplicate_field(
11407                                    "multiple values for default_mode",
11408                                ));
11409                            }
11410                            struct __With(std::option::Option<i32>);
11411                            impl<'de> serde::de::Deserialize<'de> for __With {
11412                                fn deserialize<D>(
11413                                    deserializer: D,
11414                                ) -> std::result::Result<Self, D::Error>
11415                                where
11416                                    D: serde::de::Deserializer<'de>,
11417                                {
11418                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11419                                }
11420                            }
11421                            result.default_mode = map.next_value::<__With>()?.0.unwrap_or_default();
11422                        }
11423                        __FieldTag::Unknown(key) => {
11424                            let value = map.next_value::<serde_json::Value>()?;
11425                            result._unknown_fields.insert(key, value);
11426                        }
11427                    }
11428                }
11429                std::result::Result::Ok(result)
11430            }
11431        }
11432        deserializer.deserialize_any(Visitor)
11433    }
11434}
11435
11436#[doc(hidden)]
11437impl serde::ser::Serialize for SecretVolumeSource {
11438    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11439    where
11440        S: serde::ser::Serializer,
11441    {
11442        use serde::ser::SerializeMap;
11443        #[allow(unused_imports)]
11444        use std::option::Option::Some;
11445        let mut state = serializer.serialize_map(std::option::Option::None)?;
11446        if !self.secret.is_empty() {
11447            state.serialize_entry("secret", &self.secret)?;
11448        }
11449        if !self.items.is_empty() {
11450            state.serialize_entry("items", &self.items)?;
11451        }
11452        if !wkt::internal::is_default(&self.default_mode) {
11453            struct __With<'a>(&'a i32);
11454            impl<'a> serde::ser::Serialize for __With<'a> {
11455                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11456                where
11457                    S: serde::ser::Serializer,
11458                {
11459                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11460                }
11461            }
11462            state.serialize_entry("defaultMode", &__With(&self.default_mode))?;
11463        }
11464        if !self._unknown_fields.is_empty() {
11465            for (key, value) in self._unknown_fields.iter() {
11466                state.serialize_entry(key, &value)?;
11467            }
11468        }
11469        state.end()
11470    }
11471}
11472
11473impl std::fmt::Debug for SecretVolumeSource {
11474    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11475        let mut debug_struct = f.debug_struct("SecretVolumeSource");
11476        debug_struct.field("secret", &self.secret);
11477        debug_struct.field("items", &self.items);
11478        debug_struct.field("default_mode", &self.default_mode);
11479        if !self._unknown_fields.is_empty() {
11480            debug_struct.field("_unknown_fields", &self._unknown_fields);
11481        }
11482        debug_struct.finish()
11483    }
11484}
11485
11486/// VersionToPath maps a specific version of a secret to a relative file to mount
11487/// to, relative to VolumeMount's mount_path.
11488#[derive(Clone, Default, PartialEq)]
11489#[non_exhaustive]
11490pub struct VersionToPath {
11491    /// Required. The relative path of the secret in the container.
11492    pub path: std::string::String,
11493
11494    /// The Cloud Secret Manager secret version.
11495    /// Can be 'latest' for the latest value, or an integer or a secret alias for a
11496    /// specific version.
11497    pub version: std::string::String,
11498
11499    /// Integer octal mode bits to use on this file, must be a value between
11500    /// 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be
11501    /// used.
11502    ///
11503    /// Notes
11504    ///
11505    /// * Internally, a umask of 0222 will be applied to any non-zero value.
11506    /// * This is an integer representation of the mode bits. So, the octal
11507    ///   integer value should look exactly as the chmod numeric notation with a
11508    ///   leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal)
11509    ///   or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or
11510    ///   493 (base-10).
11511    /// * This might be in conflict with other options that affect the
11512    ///   file mode, like fsGroup, and the result can be other mode bits set.
11513    pub mode: i32,
11514
11515    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11516}
11517
11518impl VersionToPath {
11519    pub fn new() -> Self {
11520        std::default::Default::default()
11521    }
11522
11523    /// Sets the value of [path][crate::model::VersionToPath::path].
11524    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11525        self.path = v.into();
11526        self
11527    }
11528
11529    /// Sets the value of [version][crate::model::VersionToPath::version].
11530    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11531        self.version = v.into();
11532        self
11533    }
11534
11535    /// Sets the value of [mode][crate::model::VersionToPath::mode].
11536    pub fn set_mode<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11537        self.mode = v.into();
11538        self
11539    }
11540}
11541
11542impl wkt::message::Message for VersionToPath {
11543    fn typename() -> &'static str {
11544        "type.googleapis.com/google.cloud.run.v2.VersionToPath"
11545    }
11546}
11547
11548#[doc(hidden)]
11549impl<'de> serde::de::Deserialize<'de> for VersionToPath {
11550    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11551    where
11552        D: serde::Deserializer<'de>,
11553    {
11554        #[allow(non_camel_case_types)]
11555        #[doc(hidden)]
11556        #[derive(PartialEq, Eq, Hash)]
11557        enum __FieldTag {
11558            __path,
11559            __version,
11560            __mode,
11561            Unknown(std::string::String),
11562        }
11563        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11564            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11565            where
11566                D: serde::Deserializer<'de>,
11567            {
11568                struct Visitor;
11569                impl<'de> serde::de::Visitor<'de> for Visitor {
11570                    type Value = __FieldTag;
11571                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11572                        formatter.write_str("a field name for VersionToPath")
11573                    }
11574                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11575                    where
11576                        E: serde::de::Error,
11577                    {
11578                        use std::result::Result::Ok;
11579                        use std::string::ToString;
11580                        match value {
11581                            "path" => Ok(__FieldTag::__path),
11582                            "version" => Ok(__FieldTag::__version),
11583                            "mode" => Ok(__FieldTag::__mode),
11584                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11585                        }
11586                    }
11587                }
11588                deserializer.deserialize_identifier(Visitor)
11589            }
11590        }
11591        struct Visitor;
11592        impl<'de> serde::de::Visitor<'de> for Visitor {
11593            type Value = VersionToPath;
11594            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11595                formatter.write_str("struct VersionToPath")
11596            }
11597            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11598            where
11599                A: serde::de::MapAccess<'de>,
11600            {
11601                #[allow(unused_imports)]
11602                use serde::de::Error;
11603                use std::option::Option::Some;
11604                let mut fields = std::collections::HashSet::new();
11605                let mut result = Self::Value::new();
11606                while let Some(tag) = map.next_key::<__FieldTag>()? {
11607                    #[allow(clippy::match_single_binding)]
11608                    match tag {
11609                        __FieldTag::__path => {
11610                            if !fields.insert(__FieldTag::__path) {
11611                                return std::result::Result::Err(A::Error::duplicate_field(
11612                                    "multiple values for path",
11613                                ));
11614                            }
11615                            result.path = map
11616                                .next_value::<std::option::Option<std::string::String>>()?
11617                                .unwrap_or_default();
11618                        }
11619                        __FieldTag::__version => {
11620                            if !fields.insert(__FieldTag::__version) {
11621                                return std::result::Result::Err(A::Error::duplicate_field(
11622                                    "multiple values for version",
11623                                ));
11624                            }
11625                            result.version = map
11626                                .next_value::<std::option::Option<std::string::String>>()?
11627                                .unwrap_or_default();
11628                        }
11629                        __FieldTag::__mode => {
11630                            if !fields.insert(__FieldTag::__mode) {
11631                                return std::result::Result::Err(A::Error::duplicate_field(
11632                                    "multiple values for mode",
11633                                ));
11634                            }
11635                            struct __With(std::option::Option<i32>);
11636                            impl<'de> serde::de::Deserialize<'de> for __With {
11637                                fn deserialize<D>(
11638                                    deserializer: D,
11639                                ) -> std::result::Result<Self, D::Error>
11640                                where
11641                                    D: serde::de::Deserializer<'de>,
11642                                {
11643                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11644                                }
11645                            }
11646                            result.mode = map.next_value::<__With>()?.0.unwrap_or_default();
11647                        }
11648                        __FieldTag::Unknown(key) => {
11649                            let value = map.next_value::<serde_json::Value>()?;
11650                            result._unknown_fields.insert(key, value);
11651                        }
11652                    }
11653                }
11654                std::result::Result::Ok(result)
11655            }
11656        }
11657        deserializer.deserialize_any(Visitor)
11658    }
11659}
11660
11661#[doc(hidden)]
11662impl serde::ser::Serialize for VersionToPath {
11663    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11664    where
11665        S: serde::ser::Serializer,
11666    {
11667        use serde::ser::SerializeMap;
11668        #[allow(unused_imports)]
11669        use std::option::Option::Some;
11670        let mut state = serializer.serialize_map(std::option::Option::None)?;
11671        if !self.path.is_empty() {
11672            state.serialize_entry("path", &self.path)?;
11673        }
11674        if !self.version.is_empty() {
11675            state.serialize_entry("version", &self.version)?;
11676        }
11677        if !wkt::internal::is_default(&self.mode) {
11678            struct __With<'a>(&'a i32);
11679            impl<'a> serde::ser::Serialize for __With<'a> {
11680                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11681                where
11682                    S: serde::ser::Serializer,
11683                {
11684                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11685                }
11686            }
11687            state.serialize_entry("mode", &__With(&self.mode))?;
11688        }
11689        if !self._unknown_fields.is_empty() {
11690            for (key, value) in self._unknown_fields.iter() {
11691                state.serialize_entry(key, &value)?;
11692            }
11693        }
11694        state.end()
11695    }
11696}
11697
11698impl std::fmt::Debug for VersionToPath {
11699    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11700        let mut debug_struct = f.debug_struct("VersionToPath");
11701        debug_struct.field("path", &self.path);
11702        debug_struct.field("version", &self.version);
11703        debug_struct.field("mode", &self.mode);
11704        if !self._unknown_fields.is_empty() {
11705            debug_struct.field("_unknown_fields", &self._unknown_fields);
11706        }
11707        debug_struct.finish()
11708    }
11709}
11710
11711/// Represents a set of Cloud SQL instances. Each one will be available under
11712/// /cloudsql/[instance]. Visit
11713/// <https://cloud.google.com/sql/docs/mysql/connect-run> for more information on
11714/// how to connect Cloud SQL and Cloud Run.
11715#[derive(Clone, Default, PartialEq)]
11716#[non_exhaustive]
11717pub struct CloudSqlInstance {
11718    /// The Cloud SQL instance connection names, as can be found in
11719    /// <https://console.cloud.google.com/sql/instances>. Visit
11720    /// <https://cloud.google.com/sql/docs/mysql/connect-run> for more information on
11721    /// how to connect Cloud SQL and Cloud Run. Format:
11722    /// {project}:{location}:{instance}
11723    pub instances: std::vec::Vec<std::string::String>,
11724
11725    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11726}
11727
11728impl CloudSqlInstance {
11729    pub fn new() -> Self {
11730        std::default::Default::default()
11731    }
11732
11733    /// Sets the value of [instances][crate::model::CloudSqlInstance::instances].
11734    pub fn set_instances<T, V>(mut self, v: T) -> Self
11735    where
11736        T: std::iter::IntoIterator<Item = V>,
11737        V: std::convert::Into<std::string::String>,
11738    {
11739        use std::iter::Iterator;
11740        self.instances = v.into_iter().map(|i| i.into()).collect();
11741        self
11742    }
11743}
11744
11745impl wkt::message::Message for CloudSqlInstance {
11746    fn typename() -> &'static str {
11747        "type.googleapis.com/google.cloud.run.v2.CloudSqlInstance"
11748    }
11749}
11750
11751#[doc(hidden)]
11752impl<'de> serde::de::Deserialize<'de> for CloudSqlInstance {
11753    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11754    where
11755        D: serde::Deserializer<'de>,
11756    {
11757        #[allow(non_camel_case_types)]
11758        #[doc(hidden)]
11759        #[derive(PartialEq, Eq, Hash)]
11760        enum __FieldTag {
11761            __instances,
11762            Unknown(std::string::String),
11763        }
11764        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11765            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11766            where
11767                D: serde::Deserializer<'de>,
11768            {
11769                struct Visitor;
11770                impl<'de> serde::de::Visitor<'de> for Visitor {
11771                    type Value = __FieldTag;
11772                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11773                        formatter.write_str("a field name for CloudSqlInstance")
11774                    }
11775                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11776                    where
11777                        E: serde::de::Error,
11778                    {
11779                        use std::result::Result::Ok;
11780                        use std::string::ToString;
11781                        match value {
11782                            "instances" => Ok(__FieldTag::__instances),
11783                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11784                        }
11785                    }
11786                }
11787                deserializer.deserialize_identifier(Visitor)
11788            }
11789        }
11790        struct Visitor;
11791        impl<'de> serde::de::Visitor<'de> for Visitor {
11792            type Value = CloudSqlInstance;
11793            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11794                formatter.write_str("struct CloudSqlInstance")
11795            }
11796            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11797            where
11798                A: serde::de::MapAccess<'de>,
11799            {
11800                #[allow(unused_imports)]
11801                use serde::de::Error;
11802                use std::option::Option::Some;
11803                let mut fields = std::collections::HashSet::new();
11804                let mut result = Self::Value::new();
11805                while let Some(tag) = map.next_key::<__FieldTag>()? {
11806                    #[allow(clippy::match_single_binding)]
11807                    match tag {
11808                        __FieldTag::__instances => {
11809                            if !fields.insert(__FieldTag::__instances) {
11810                                return std::result::Result::Err(A::Error::duplicate_field(
11811                                    "multiple values for instances",
11812                                ));
11813                            }
11814                            result.instances = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
11815                        }
11816                        __FieldTag::Unknown(key) => {
11817                            let value = map.next_value::<serde_json::Value>()?;
11818                            result._unknown_fields.insert(key, value);
11819                        }
11820                    }
11821                }
11822                std::result::Result::Ok(result)
11823            }
11824        }
11825        deserializer.deserialize_any(Visitor)
11826    }
11827}
11828
11829#[doc(hidden)]
11830impl serde::ser::Serialize for CloudSqlInstance {
11831    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11832    where
11833        S: serde::ser::Serializer,
11834    {
11835        use serde::ser::SerializeMap;
11836        #[allow(unused_imports)]
11837        use std::option::Option::Some;
11838        let mut state = serializer.serialize_map(std::option::Option::None)?;
11839        if !self.instances.is_empty() {
11840            state.serialize_entry("instances", &self.instances)?;
11841        }
11842        if !self._unknown_fields.is_empty() {
11843            for (key, value) in self._unknown_fields.iter() {
11844                state.serialize_entry(key, &value)?;
11845            }
11846        }
11847        state.end()
11848    }
11849}
11850
11851impl std::fmt::Debug for CloudSqlInstance {
11852    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11853        let mut debug_struct = f.debug_struct("CloudSqlInstance");
11854        debug_struct.field("instances", &self.instances);
11855        if !self._unknown_fields.is_empty() {
11856            debug_struct.field("_unknown_fields", &self._unknown_fields);
11857        }
11858        debug_struct.finish()
11859    }
11860}
11861
11862/// In memory (tmpfs) ephemeral storage.
11863/// It is ephemeral in the sense that when the sandbox is taken down, the data is
11864/// destroyed with it (it does not persist across sandbox runs).
11865#[derive(Clone, Default, PartialEq)]
11866#[non_exhaustive]
11867pub struct EmptyDirVolumeSource {
11868    /// The medium on which the data is stored. Acceptable values today is only
11869    /// MEMORY or none. When none, the default will currently be backed by memory
11870    /// but could change over time. +optional
11871    pub medium: crate::model::empty_dir_volume_source::Medium,
11872
11873    /// Limit on the storage usable by this EmptyDir volume.
11874    /// The size limit is also applicable for memory medium.
11875    /// The maximum usage on memory medium EmptyDir would be the minimum value
11876    /// between the SizeLimit specified here and the sum of memory limits of all
11877    /// containers. The default is nil which means that the limit is undefined.
11878    /// More info:
11879    /// <https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume>.
11880    /// Info in Kubernetes:
11881    /// <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir>
11882    pub size_limit: std::string::String,
11883
11884    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11885}
11886
11887impl EmptyDirVolumeSource {
11888    pub fn new() -> Self {
11889        std::default::Default::default()
11890    }
11891
11892    /// Sets the value of [medium][crate::model::EmptyDirVolumeSource::medium].
11893    pub fn set_medium<T: std::convert::Into<crate::model::empty_dir_volume_source::Medium>>(
11894        mut self,
11895        v: T,
11896    ) -> Self {
11897        self.medium = v.into();
11898        self
11899    }
11900
11901    /// Sets the value of [size_limit][crate::model::EmptyDirVolumeSource::size_limit].
11902    pub fn set_size_limit<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11903        self.size_limit = v.into();
11904        self
11905    }
11906}
11907
11908impl wkt::message::Message for EmptyDirVolumeSource {
11909    fn typename() -> &'static str {
11910        "type.googleapis.com/google.cloud.run.v2.EmptyDirVolumeSource"
11911    }
11912}
11913
11914#[doc(hidden)]
11915impl<'de> serde::de::Deserialize<'de> for EmptyDirVolumeSource {
11916    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11917    where
11918        D: serde::Deserializer<'de>,
11919    {
11920        #[allow(non_camel_case_types)]
11921        #[doc(hidden)]
11922        #[derive(PartialEq, Eq, Hash)]
11923        enum __FieldTag {
11924            __medium,
11925            __size_limit,
11926            Unknown(std::string::String),
11927        }
11928        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11929            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11930            where
11931                D: serde::Deserializer<'de>,
11932            {
11933                struct Visitor;
11934                impl<'de> serde::de::Visitor<'de> for Visitor {
11935                    type Value = __FieldTag;
11936                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11937                        formatter.write_str("a field name for EmptyDirVolumeSource")
11938                    }
11939                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11940                    where
11941                        E: serde::de::Error,
11942                    {
11943                        use std::result::Result::Ok;
11944                        use std::string::ToString;
11945                        match value {
11946                            "medium" => Ok(__FieldTag::__medium),
11947                            "sizeLimit" => Ok(__FieldTag::__size_limit),
11948                            "size_limit" => Ok(__FieldTag::__size_limit),
11949                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11950                        }
11951                    }
11952                }
11953                deserializer.deserialize_identifier(Visitor)
11954            }
11955        }
11956        struct Visitor;
11957        impl<'de> serde::de::Visitor<'de> for Visitor {
11958            type Value = EmptyDirVolumeSource;
11959            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11960                formatter.write_str("struct EmptyDirVolumeSource")
11961            }
11962            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11963            where
11964                A: serde::de::MapAccess<'de>,
11965            {
11966                #[allow(unused_imports)]
11967                use serde::de::Error;
11968                use std::option::Option::Some;
11969                let mut fields = std::collections::HashSet::new();
11970                let mut result = Self::Value::new();
11971                while let Some(tag) = map.next_key::<__FieldTag>()? {
11972                    #[allow(clippy::match_single_binding)]
11973                    match tag {
11974                        __FieldTag::__medium => {
11975                            if !fields.insert(__FieldTag::__medium) {
11976                                return std::result::Result::Err(A::Error::duplicate_field(
11977                                    "multiple values for medium",
11978                                ));
11979                            }
11980                            result.medium =
11981                                map.next_value::<std::option::Option<
11982                                    crate::model::empty_dir_volume_source::Medium,
11983                                >>()?
11984                                .unwrap_or_default();
11985                        }
11986                        __FieldTag::__size_limit => {
11987                            if !fields.insert(__FieldTag::__size_limit) {
11988                                return std::result::Result::Err(A::Error::duplicate_field(
11989                                    "multiple values for size_limit",
11990                                ));
11991                            }
11992                            result.size_limit = map
11993                                .next_value::<std::option::Option<std::string::String>>()?
11994                                .unwrap_or_default();
11995                        }
11996                        __FieldTag::Unknown(key) => {
11997                            let value = map.next_value::<serde_json::Value>()?;
11998                            result._unknown_fields.insert(key, value);
11999                        }
12000                    }
12001                }
12002                std::result::Result::Ok(result)
12003            }
12004        }
12005        deserializer.deserialize_any(Visitor)
12006    }
12007}
12008
12009#[doc(hidden)]
12010impl serde::ser::Serialize for EmptyDirVolumeSource {
12011    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12012    where
12013        S: serde::ser::Serializer,
12014    {
12015        use serde::ser::SerializeMap;
12016        #[allow(unused_imports)]
12017        use std::option::Option::Some;
12018        let mut state = serializer.serialize_map(std::option::Option::None)?;
12019        if !wkt::internal::is_default(&self.medium) {
12020            state.serialize_entry("medium", &self.medium)?;
12021        }
12022        if !self.size_limit.is_empty() {
12023            state.serialize_entry("sizeLimit", &self.size_limit)?;
12024        }
12025        if !self._unknown_fields.is_empty() {
12026            for (key, value) in self._unknown_fields.iter() {
12027                state.serialize_entry(key, &value)?;
12028            }
12029        }
12030        state.end()
12031    }
12032}
12033
12034impl std::fmt::Debug for EmptyDirVolumeSource {
12035    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12036        let mut debug_struct = f.debug_struct("EmptyDirVolumeSource");
12037        debug_struct.field("medium", &self.medium);
12038        debug_struct.field("size_limit", &self.size_limit);
12039        if !self._unknown_fields.is_empty() {
12040            debug_struct.field("_unknown_fields", &self._unknown_fields);
12041        }
12042        debug_struct.finish()
12043    }
12044}
12045
12046/// Defines additional types related to [EmptyDirVolumeSource].
12047pub mod empty_dir_volume_source {
12048    #[allow(unused_imports)]
12049    use super::*;
12050
12051    /// The different types of medium supported for EmptyDir.
12052    ///
12053    /// # Working with unknown values
12054    ///
12055    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12056    /// additional enum variants at any time. Adding new variants is not considered
12057    /// a breaking change. Applications should write their code in anticipation of:
12058    ///
12059    /// - New values appearing in future releases of the client library, **and**
12060    /// - New values received dynamically, without application changes.
12061    ///
12062    /// Please consult the [Working with enums] section in the user guide for some
12063    /// guidelines.
12064    ///
12065    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12066    #[derive(Clone, Debug, PartialEq)]
12067    #[non_exhaustive]
12068    pub enum Medium {
12069        /// When not specified, falls back to the default implementation which
12070        /// is currently in memory (this may change over time).
12071        Unspecified,
12072        /// Explicitly set the EmptyDir to be in memory. Uses tmpfs.
12073        Memory,
12074        /// If set, the enum was initialized with an unknown value.
12075        ///
12076        /// Applications can examine the value using [Medium::value] or
12077        /// [Medium::name].
12078        UnknownValue(medium::UnknownValue),
12079    }
12080
12081    #[doc(hidden)]
12082    pub mod medium {
12083        #[allow(unused_imports)]
12084        use super::*;
12085        #[derive(Clone, Debug, PartialEq)]
12086        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12087    }
12088
12089    impl Medium {
12090        /// Gets the enum value.
12091        ///
12092        /// Returns `None` if the enum contains an unknown value deserialized from
12093        /// the string representation of enums.
12094        pub fn value(&self) -> std::option::Option<i32> {
12095            match self {
12096                Self::Unspecified => std::option::Option::Some(0),
12097                Self::Memory => std::option::Option::Some(1),
12098                Self::UnknownValue(u) => u.0.value(),
12099            }
12100        }
12101
12102        /// Gets the enum value as a string.
12103        ///
12104        /// Returns `None` if the enum contains an unknown value deserialized from
12105        /// the integer representation of enums.
12106        pub fn name(&self) -> std::option::Option<&str> {
12107            match self {
12108                Self::Unspecified => std::option::Option::Some("MEDIUM_UNSPECIFIED"),
12109                Self::Memory => std::option::Option::Some("MEMORY"),
12110                Self::UnknownValue(u) => u.0.name(),
12111            }
12112        }
12113    }
12114
12115    impl std::default::Default for Medium {
12116        fn default() -> Self {
12117            use std::convert::From;
12118            Self::from(0)
12119        }
12120    }
12121
12122    impl std::fmt::Display for Medium {
12123        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12124            wkt::internal::display_enum(f, self.name(), self.value())
12125        }
12126    }
12127
12128    impl std::convert::From<i32> for Medium {
12129        fn from(value: i32) -> Self {
12130            match value {
12131                0 => Self::Unspecified,
12132                1 => Self::Memory,
12133                _ => Self::UnknownValue(medium::UnknownValue(
12134                    wkt::internal::UnknownEnumValue::Integer(value),
12135                )),
12136            }
12137        }
12138    }
12139
12140    impl std::convert::From<&str> for Medium {
12141        fn from(value: &str) -> Self {
12142            use std::string::ToString;
12143            match value {
12144                "MEDIUM_UNSPECIFIED" => Self::Unspecified,
12145                "MEMORY" => Self::Memory,
12146                _ => Self::UnknownValue(medium::UnknownValue(
12147                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12148                )),
12149            }
12150        }
12151    }
12152
12153    impl serde::ser::Serialize for Medium {
12154        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12155        where
12156            S: serde::Serializer,
12157        {
12158            match self {
12159                Self::Unspecified => serializer.serialize_i32(0),
12160                Self::Memory => serializer.serialize_i32(1),
12161                Self::UnknownValue(u) => u.0.serialize(serializer),
12162            }
12163        }
12164    }
12165
12166    impl<'de> serde::de::Deserialize<'de> for Medium {
12167        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12168        where
12169            D: serde::Deserializer<'de>,
12170        {
12171            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Medium>::new(
12172                ".google.cloud.run.v2.EmptyDirVolumeSource.Medium",
12173            ))
12174        }
12175    }
12176}
12177
12178/// Represents an NFS mount.
12179#[derive(Clone, Default, PartialEq)]
12180#[non_exhaustive]
12181pub struct NFSVolumeSource {
12182    /// Hostname or IP address of the NFS server
12183    pub server: std::string::String,
12184
12185    /// Path that is exported by the NFS server.
12186    pub path: std::string::String,
12187
12188    /// If true, the volume will be mounted as read only for all mounts.
12189    pub read_only: bool,
12190
12191    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12192}
12193
12194impl NFSVolumeSource {
12195    pub fn new() -> Self {
12196        std::default::Default::default()
12197    }
12198
12199    /// Sets the value of [server][crate::model::NFSVolumeSource::server].
12200    pub fn set_server<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12201        self.server = v.into();
12202        self
12203    }
12204
12205    /// Sets the value of [path][crate::model::NFSVolumeSource::path].
12206    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12207        self.path = v.into();
12208        self
12209    }
12210
12211    /// Sets the value of [read_only][crate::model::NFSVolumeSource::read_only].
12212    pub fn set_read_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12213        self.read_only = v.into();
12214        self
12215    }
12216}
12217
12218impl wkt::message::Message for NFSVolumeSource {
12219    fn typename() -> &'static str {
12220        "type.googleapis.com/google.cloud.run.v2.NFSVolumeSource"
12221    }
12222}
12223
12224#[doc(hidden)]
12225impl<'de> serde::de::Deserialize<'de> for NFSVolumeSource {
12226    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12227    where
12228        D: serde::Deserializer<'de>,
12229    {
12230        #[allow(non_camel_case_types)]
12231        #[doc(hidden)]
12232        #[derive(PartialEq, Eq, Hash)]
12233        enum __FieldTag {
12234            __server,
12235            __path,
12236            __read_only,
12237            Unknown(std::string::String),
12238        }
12239        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12240            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12241            where
12242                D: serde::Deserializer<'de>,
12243            {
12244                struct Visitor;
12245                impl<'de> serde::de::Visitor<'de> for Visitor {
12246                    type Value = __FieldTag;
12247                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12248                        formatter.write_str("a field name for NFSVolumeSource")
12249                    }
12250                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12251                    where
12252                        E: serde::de::Error,
12253                    {
12254                        use std::result::Result::Ok;
12255                        use std::string::ToString;
12256                        match value {
12257                            "server" => Ok(__FieldTag::__server),
12258                            "path" => Ok(__FieldTag::__path),
12259                            "readOnly" => Ok(__FieldTag::__read_only),
12260                            "read_only" => Ok(__FieldTag::__read_only),
12261                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12262                        }
12263                    }
12264                }
12265                deserializer.deserialize_identifier(Visitor)
12266            }
12267        }
12268        struct Visitor;
12269        impl<'de> serde::de::Visitor<'de> for Visitor {
12270            type Value = NFSVolumeSource;
12271            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12272                formatter.write_str("struct NFSVolumeSource")
12273            }
12274            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12275            where
12276                A: serde::de::MapAccess<'de>,
12277            {
12278                #[allow(unused_imports)]
12279                use serde::de::Error;
12280                use std::option::Option::Some;
12281                let mut fields = std::collections::HashSet::new();
12282                let mut result = Self::Value::new();
12283                while let Some(tag) = map.next_key::<__FieldTag>()? {
12284                    #[allow(clippy::match_single_binding)]
12285                    match tag {
12286                        __FieldTag::__server => {
12287                            if !fields.insert(__FieldTag::__server) {
12288                                return std::result::Result::Err(A::Error::duplicate_field(
12289                                    "multiple values for server",
12290                                ));
12291                            }
12292                            result.server = map
12293                                .next_value::<std::option::Option<std::string::String>>()?
12294                                .unwrap_or_default();
12295                        }
12296                        __FieldTag::__path => {
12297                            if !fields.insert(__FieldTag::__path) {
12298                                return std::result::Result::Err(A::Error::duplicate_field(
12299                                    "multiple values for path",
12300                                ));
12301                            }
12302                            result.path = map
12303                                .next_value::<std::option::Option<std::string::String>>()?
12304                                .unwrap_or_default();
12305                        }
12306                        __FieldTag::__read_only => {
12307                            if !fields.insert(__FieldTag::__read_only) {
12308                                return std::result::Result::Err(A::Error::duplicate_field(
12309                                    "multiple values for read_only",
12310                                ));
12311                            }
12312                            result.read_only = map
12313                                .next_value::<std::option::Option<bool>>()?
12314                                .unwrap_or_default();
12315                        }
12316                        __FieldTag::Unknown(key) => {
12317                            let value = map.next_value::<serde_json::Value>()?;
12318                            result._unknown_fields.insert(key, value);
12319                        }
12320                    }
12321                }
12322                std::result::Result::Ok(result)
12323            }
12324        }
12325        deserializer.deserialize_any(Visitor)
12326    }
12327}
12328
12329#[doc(hidden)]
12330impl serde::ser::Serialize for NFSVolumeSource {
12331    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12332    where
12333        S: serde::ser::Serializer,
12334    {
12335        use serde::ser::SerializeMap;
12336        #[allow(unused_imports)]
12337        use std::option::Option::Some;
12338        let mut state = serializer.serialize_map(std::option::Option::None)?;
12339        if !self.server.is_empty() {
12340            state.serialize_entry("server", &self.server)?;
12341        }
12342        if !self.path.is_empty() {
12343            state.serialize_entry("path", &self.path)?;
12344        }
12345        if !wkt::internal::is_default(&self.read_only) {
12346            state.serialize_entry("readOnly", &self.read_only)?;
12347        }
12348        if !self._unknown_fields.is_empty() {
12349            for (key, value) in self._unknown_fields.iter() {
12350                state.serialize_entry(key, &value)?;
12351            }
12352        }
12353        state.end()
12354    }
12355}
12356
12357impl std::fmt::Debug for NFSVolumeSource {
12358    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12359        let mut debug_struct = f.debug_struct("NFSVolumeSource");
12360        debug_struct.field("server", &self.server);
12361        debug_struct.field("path", &self.path);
12362        debug_struct.field("read_only", &self.read_only);
12363        if !self._unknown_fields.is_empty() {
12364            debug_struct.field("_unknown_fields", &self._unknown_fields);
12365        }
12366        debug_struct.finish()
12367    }
12368}
12369
12370/// Represents a volume backed by a Cloud Storage bucket using Cloud Storage
12371/// FUSE.
12372#[derive(Clone, Default, PartialEq)]
12373#[non_exhaustive]
12374pub struct GCSVolumeSource {
12375    /// Cloud Storage Bucket name.
12376    pub bucket: std::string::String,
12377
12378    /// If true, the volume will be mounted as read only for all mounts.
12379    pub read_only: bool,
12380
12381    /// A list of additional flags to pass to the gcsfuse CLI.
12382    /// Options should be specified without the leading "--".
12383    pub mount_options: std::vec::Vec<std::string::String>,
12384
12385    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12386}
12387
12388impl GCSVolumeSource {
12389    pub fn new() -> Self {
12390        std::default::Default::default()
12391    }
12392
12393    /// Sets the value of [bucket][crate::model::GCSVolumeSource::bucket].
12394    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12395        self.bucket = v.into();
12396        self
12397    }
12398
12399    /// Sets the value of [read_only][crate::model::GCSVolumeSource::read_only].
12400    pub fn set_read_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12401        self.read_only = v.into();
12402        self
12403    }
12404
12405    /// Sets the value of [mount_options][crate::model::GCSVolumeSource::mount_options].
12406    pub fn set_mount_options<T, V>(mut self, v: T) -> Self
12407    where
12408        T: std::iter::IntoIterator<Item = V>,
12409        V: std::convert::Into<std::string::String>,
12410    {
12411        use std::iter::Iterator;
12412        self.mount_options = v.into_iter().map(|i| i.into()).collect();
12413        self
12414    }
12415}
12416
12417impl wkt::message::Message for GCSVolumeSource {
12418    fn typename() -> &'static str {
12419        "type.googleapis.com/google.cloud.run.v2.GCSVolumeSource"
12420    }
12421}
12422
12423#[doc(hidden)]
12424impl<'de> serde::de::Deserialize<'de> for GCSVolumeSource {
12425    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12426    where
12427        D: serde::Deserializer<'de>,
12428    {
12429        #[allow(non_camel_case_types)]
12430        #[doc(hidden)]
12431        #[derive(PartialEq, Eq, Hash)]
12432        enum __FieldTag {
12433            __bucket,
12434            __read_only,
12435            __mount_options,
12436            Unknown(std::string::String),
12437        }
12438        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12439            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12440            where
12441                D: serde::Deserializer<'de>,
12442            {
12443                struct Visitor;
12444                impl<'de> serde::de::Visitor<'de> for Visitor {
12445                    type Value = __FieldTag;
12446                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12447                        formatter.write_str("a field name for GCSVolumeSource")
12448                    }
12449                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12450                    where
12451                        E: serde::de::Error,
12452                    {
12453                        use std::result::Result::Ok;
12454                        use std::string::ToString;
12455                        match value {
12456                            "bucket" => Ok(__FieldTag::__bucket),
12457                            "readOnly" => Ok(__FieldTag::__read_only),
12458                            "read_only" => Ok(__FieldTag::__read_only),
12459                            "mountOptions" => Ok(__FieldTag::__mount_options),
12460                            "mount_options" => Ok(__FieldTag::__mount_options),
12461                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12462                        }
12463                    }
12464                }
12465                deserializer.deserialize_identifier(Visitor)
12466            }
12467        }
12468        struct Visitor;
12469        impl<'de> serde::de::Visitor<'de> for Visitor {
12470            type Value = GCSVolumeSource;
12471            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12472                formatter.write_str("struct GCSVolumeSource")
12473            }
12474            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12475            where
12476                A: serde::de::MapAccess<'de>,
12477            {
12478                #[allow(unused_imports)]
12479                use serde::de::Error;
12480                use std::option::Option::Some;
12481                let mut fields = std::collections::HashSet::new();
12482                let mut result = Self::Value::new();
12483                while let Some(tag) = map.next_key::<__FieldTag>()? {
12484                    #[allow(clippy::match_single_binding)]
12485                    match tag {
12486                        __FieldTag::__bucket => {
12487                            if !fields.insert(__FieldTag::__bucket) {
12488                                return std::result::Result::Err(A::Error::duplicate_field(
12489                                    "multiple values for bucket",
12490                                ));
12491                            }
12492                            result.bucket = map
12493                                .next_value::<std::option::Option<std::string::String>>()?
12494                                .unwrap_or_default();
12495                        }
12496                        __FieldTag::__read_only => {
12497                            if !fields.insert(__FieldTag::__read_only) {
12498                                return std::result::Result::Err(A::Error::duplicate_field(
12499                                    "multiple values for read_only",
12500                                ));
12501                            }
12502                            result.read_only = map
12503                                .next_value::<std::option::Option<bool>>()?
12504                                .unwrap_or_default();
12505                        }
12506                        __FieldTag::__mount_options => {
12507                            if !fields.insert(__FieldTag::__mount_options) {
12508                                return std::result::Result::Err(A::Error::duplicate_field(
12509                                    "multiple values for mount_options",
12510                                ));
12511                            }
12512                            result.mount_options = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
12513                        }
12514                        __FieldTag::Unknown(key) => {
12515                            let value = map.next_value::<serde_json::Value>()?;
12516                            result._unknown_fields.insert(key, value);
12517                        }
12518                    }
12519                }
12520                std::result::Result::Ok(result)
12521            }
12522        }
12523        deserializer.deserialize_any(Visitor)
12524    }
12525}
12526
12527#[doc(hidden)]
12528impl serde::ser::Serialize for GCSVolumeSource {
12529    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12530    where
12531        S: serde::ser::Serializer,
12532    {
12533        use serde::ser::SerializeMap;
12534        #[allow(unused_imports)]
12535        use std::option::Option::Some;
12536        let mut state = serializer.serialize_map(std::option::Option::None)?;
12537        if !self.bucket.is_empty() {
12538            state.serialize_entry("bucket", &self.bucket)?;
12539        }
12540        if !wkt::internal::is_default(&self.read_only) {
12541            state.serialize_entry("readOnly", &self.read_only)?;
12542        }
12543        if !self.mount_options.is_empty() {
12544            state.serialize_entry("mountOptions", &self.mount_options)?;
12545        }
12546        if !self._unknown_fields.is_empty() {
12547            for (key, value) in self._unknown_fields.iter() {
12548                state.serialize_entry(key, &value)?;
12549            }
12550        }
12551        state.end()
12552    }
12553}
12554
12555impl std::fmt::Debug for GCSVolumeSource {
12556    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12557        let mut debug_struct = f.debug_struct("GCSVolumeSource");
12558        debug_struct.field("bucket", &self.bucket);
12559        debug_struct.field("read_only", &self.read_only);
12560        debug_struct.field("mount_options", &self.mount_options);
12561        if !self._unknown_fields.is_empty() {
12562            debug_struct.field("_unknown_fields", &self._unknown_fields);
12563        }
12564        debug_struct.finish()
12565    }
12566}
12567
12568/// Probe describes a health check to be performed against a container to
12569/// determine whether it is alive or ready to receive traffic.
12570#[derive(Clone, Default, PartialEq)]
12571#[non_exhaustive]
12572pub struct Probe {
12573    /// Optional. Number of seconds after the container has started before the
12574    /// probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum
12575    /// value for liveness probe is 3600. Maximum value for startup probe is 240.
12576    pub initial_delay_seconds: i32,
12577
12578    /// Optional. Number of seconds after which the probe times out.
12579    /// Defaults to 1 second. Minimum value is 1. Maximum value is 3600.
12580    /// Must be smaller than period_seconds.
12581    pub timeout_seconds: i32,
12582
12583    /// Optional. How often (in seconds) to perform the probe.
12584    /// Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe
12585    /// is 3600. Maximum value for startup probe is 240.
12586    /// Must be greater or equal than timeout_seconds.
12587    pub period_seconds: i32,
12588
12589    /// Optional. Minimum consecutive failures for the probe to be considered
12590    /// failed after having succeeded. Defaults to 3. Minimum value is 1.
12591    pub failure_threshold: i32,
12592
12593    pub probe_type: std::option::Option<crate::model::probe::ProbeType>,
12594
12595    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12596}
12597
12598impl Probe {
12599    pub fn new() -> Self {
12600        std::default::Default::default()
12601    }
12602
12603    /// Sets the value of [initial_delay_seconds][crate::model::Probe::initial_delay_seconds].
12604    pub fn set_initial_delay_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12605        self.initial_delay_seconds = v.into();
12606        self
12607    }
12608
12609    /// Sets the value of [timeout_seconds][crate::model::Probe::timeout_seconds].
12610    pub fn set_timeout_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12611        self.timeout_seconds = v.into();
12612        self
12613    }
12614
12615    /// Sets the value of [period_seconds][crate::model::Probe::period_seconds].
12616    pub fn set_period_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12617        self.period_seconds = v.into();
12618        self
12619    }
12620
12621    /// Sets the value of [failure_threshold][crate::model::Probe::failure_threshold].
12622    pub fn set_failure_threshold<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12623        self.failure_threshold = v.into();
12624        self
12625    }
12626
12627    /// Sets the value of [probe_type][crate::model::Probe::probe_type].
12628    ///
12629    /// Note that all the setters affecting `probe_type` are mutually
12630    /// exclusive.
12631    pub fn set_probe_type<
12632        T: std::convert::Into<std::option::Option<crate::model::probe::ProbeType>>,
12633    >(
12634        mut self,
12635        v: T,
12636    ) -> Self {
12637        self.probe_type = v.into();
12638        self
12639    }
12640
12641    /// The value of [probe_type][crate::model::Probe::probe_type]
12642    /// if it holds a `HttpGet`, `None` if the field is not set or
12643    /// holds a different branch.
12644    pub fn http_get(&self) -> std::option::Option<&std::boxed::Box<crate::model::HTTPGetAction>> {
12645        #[allow(unreachable_patterns)]
12646        self.probe_type.as_ref().and_then(|v| match v {
12647            crate::model::probe::ProbeType::HttpGet(v) => std::option::Option::Some(v),
12648            _ => std::option::Option::None,
12649        })
12650    }
12651
12652    /// Sets the value of [probe_type][crate::model::Probe::probe_type]
12653    /// to hold a `HttpGet`.
12654    ///
12655    /// Note that all the setters affecting `probe_type` are
12656    /// mutually exclusive.
12657    pub fn set_http_get<T: std::convert::Into<std::boxed::Box<crate::model::HTTPGetAction>>>(
12658        mut self,
12659        v: T,
12660    ) -> Self {
12661        self.probe_type =
12662            std::option::Option::Some(crate::model::probe::ProbeType::HttpGet(v.into()));
12663        self
12664    }
12665
12666    /// The value of [probe_type][crate::model::Probe::probe_type]
12667    /// if it holds a `TcpSocket`, `None` if the field is not set or
12668    /// holds a different branch.
12669    pub fn tcp_socket(
12670        &self,
12671    ) -> std::option::Option<&std::boxed::Box<crate::model::TCPSocketAction>> {
12672        #[allow(unreachable_patterns)]
12673        self.probe_type.as_ref().and_then(|v| match v {
12674            crate::model::probe::ProbeType::TcpSocket(v) => std::option::Option::Some(v),
12675            _ => std::option::Option::None,
12676        })
12677    }
12678
12679    /// Sets the value of [probe_type][crate::model::Probe::probe_type]
12680    /// to hold a `TcpSocket`.
12681    ///
12682    /// Note that all the setters affecting `probe_type` are
12683    /// mutually exclusive.
12684    pub fn set_tcp_socket<T: std::convert::Into<std::boxed::Box<crate::model::TCPSocketAction>>>(
12685        mut self,
12686        v: T,
12687    ) -> Self {
12688        self.probe_type =
12689            std::option::Option::Some(crate::model::probe::ProbeType::TcpSocket(v.into()));
12690        self
12691    }
12692
12693    /// The value of [probe_type][crate::model::Probe::probe_type]
12694    /// if it holds a `Grpc`, `None` if the field is not set or
12695    /// holds a different branch.
12696    pub fn grpc(&self) -> std::option::Option<&std::boxed::Box<crate::model::GRPCAction>> {
12697        #[allow(unreachable_patterns)]
12698        self.probe_type.as_ref().and_then(|v| match v {
12699            crate::model::probe::ProbeType::Grpc(v) => std::option::Option::Some(v),
12700            _ => std::option::Option::None,
12701        })
12702    }
12703
12704    /// Sets the value of [probe_type][crate::model::Probe::probe_type]
12705    /// to hold a `Grpc`.
12706    ///
12707    /// Note that all the setters affecting `probe_type` are
12708    /// mutually exclusive.
12709    pub fn set_grpc<T: std::convert::Into<std::boxed::Box<crate::model::GRPCAction>>>(
12710        mut self,
12711        v: T,
12712    ) -> Self {
12713        self.probe_type = std::option::Option::Some(crate::model::probe::ProbeType::Grpc(v.into()));
12714        self
12715    }
12716}
12717
12718impl wkt::message::Message for Probe {
12719    fn typename() -> &'static str {
12720        "type.googleapis.com/google.cloud.run.v2.Probe"
12721    }
12722}
12723
12724#[doc(hidden)]
12725impl<'de> serde::de::Deserialize<'de> for Probe {
12726    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12727    where
12728        D: serde::Deserializer<'de>,
12729    {
12730        #[allow(non_camel_case_types)]
12731        #[doc(hidden)]
12732        #[derive(PartialEq, Eq, Hash)]
12733        enum __FieldTag {
12734            __initial_delay_seconds,
12735            __timeout_seconds,
12736            __period_seconds,
12737            __failure_threshold,
12738            __http_get,
12739            __tcp_socket,
12740            __grpc,
12741            Unknown(std::string::String),
12742        }
12743        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12744            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12745            where
12746                D: serde::Deserializer<'de>,
12747            {
12748                struct Visitor;
12749                impl<'de> serde::de::Visitor<'de> for Visitor {
12750                    type Value = __FieldTag;
12751                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12752                        formatter.write_str("a field name for Probe")
12753                    }
12754                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12755                    where
12756                        E: serde::de::Error,
12757                    {
12758                        use std::result::Result::Ok;
12759                        use std::string::ToString;
12760                        match value {
12761                            "initialDelaySeconds" => Ok(__FieldTag::__initial_delay_seconds),
12762                            "initial_delay_seconds" => Ok(__FieldTag::__initial_delay_seconds),
12763                            "timeoutSeconds" => Ok(__FieldTag::__timeout_seconds),
12764                            "timeout_seconds" => Ok(__FieldTag::__timeout_seconds),
12765                            "periodSeconds" => Ok(__FieldTag::__period_seconds),
12766                            "period_seconds" => Ok(__FieldTag::__period_seconds),
12767                            "failureThreshold" => Ok(__FieldTag::__failure_threshold),
12768                            "failure_threshold" => Ok(__FieldTag::__failure_threshold),
12769                            "httpGet" => Ok(__FieldTag::__http_get),
12770                            "http_get" => Ok(__FieldTag::__http_get),
12771                            "tcpSocket" => Ok(__FieldTag::__tcp_socket),
12772                            "tcp_socket" => Ok(__FieldTag::__tcp_socket),
12773                            "grpc" => Ok(__FieldTag::__grpc),
12774                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12775                        }
12776                    }
12777                }
12778                deserializer.deserialize_identifier(Visitor)
12779            }
12780        }
12781        struct Visitor;
12782        impl<'de> serde::de::Visitor<'de> for Visitor {
12783            type Value = Probe;
12784            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12785                formatter.write_str("struct Probe")
12786            }
12787            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12788            where
12789                A: serde::de::MapAccess<'de>,
12790            {
12791                #[allow(unused_imports)]
12792                use serde::de::Error;
12793                use std::option::Option::Some;
12794                let mut fields = std::collections::HashSet::new();
12795                let mut result = Self::Value::new();
12796                while let Some(tag) = map.next_key::<__FieldTag>()? {
12797                    #[allow(clippy::match_single_binding)]
12798                    match tag {
12799                        __FieldTag::__initial_delay_seconds => {
12800                            if !fields.insert(__FieldTag::__initial_delay_seconds) {
12801                                return std::result::Result::Err(A::Error::duplicate_field(
12802                                    "multiple values for initial_delay_seconds",
12803                                ));
12804                            }
12805                            struct __With(std::option::Option<i32>);
12806                            impl<'de> serde::de::Deserialize<'de> for __With {
12807                                fn deserialize<D>(
12808                                    deserializer: D,
12809                                ) -> std::result::Result<Self, D::Error>
12810                                where
12811                                    D: serde::de::Deserializer<'de>,
12812                                {
12813                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12814                                }
12815                            }
12816                            result.initial_delay_seconds =
12817                                map.next_value::<__With>()?.0.unwrap_or_default();
12818                        }
12819                        __FieldTag::__timeout_seconds => {
12820                            if !fields.insert(__FieldTag::__timeout_seconds) {
12821                                return std::result::Result::Err(A::Error::duplicate_field(
12822                                    "multiple values for timeout_seconds",
12823                                ));
12824                            }
12825                            struct __With(std::option::Option<i32>);
12826                            impl<'de> serde::de::Deserialize<'de> for __With {
12827                                fn deserialize<D>(
12828                                    deserializer: D,
12829                                ) -> std::result::Result<Self, D::Error>
12830                                where
12831                                    D: serde::de::Deserializer<'de>,
12832                                {
12833                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12834                                }
12835                            }
12836                            result.timeout_seconds =
12837                                map.next_value::<__With>()?.0.unwrap_or_default();
12838                        }
12839                        __FieldTag::__period_seconds => {
12840                            if !fields.insert(__FieldTag::__period_seconds) {
12841                                return std::result::Result::Err(A::Error::duplicate_field(
12842                                    "multiple values for period_seconds",
12843                                ));
12844                            }
12845                            struct __With(std::option::Option<i32>);
12846                            impl<'de> serde::de::Deserialize<'de> for __With {
12847                                fn deserialize<D>(
12848                                    deserializer: D,
12849                                ) -> std::result::Result<Self, D::Error>
12850                                where
12851                                    D: serde::de::Deserializer<'de>,
12852                                {
12853                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12854                                }
12855                            }
12856                            result.period_seconds =
12857                                map.next_value::<__With>()?.0.unwrap_or_default();
12858                        }
12859                        __FieldTag::__failure_threshold => {
12860                            if !fields.insert(__FieldTag::__failure_threshold) {
12861                                return std::result::Result::Err(A::Error::duplicate_field(
12862                                    "multiple values for failure_threshold",
12863                                ));
12864                            }
12865                            struct __With(std::option::Option<i32>);
12866                            impl<'de> serde::de::Deserialize<'de> for __With {
12867                                fn deserialize<D>(
12868                                    deserializer: D,
12869                                ) -> std::result::Result<Self, D::Error>
12870                                where
12871                                    D: serde::de::Deserializer<'de>,
12872                                {
12873                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12874                                }
12875                            }
12876                            result.failure_threshold =
12877                                map.next_value::<__With>()?.0.unwrap_or_default();
12878                        }
12879                        __FieldTag::__http_get => {
12880                            if !fields.insert(__FieldTag::__http_get) {
12881                                return std::result::Result::Err(A::Error::duplicate_field(
12882                                    "multiple values for http_get",
12883                                ));
12884                            }
12885                            if result.probe_type.is_some() {
12886                                return std::result::Result::Err(A::Error::duplicate_field(
12887                                    "multiple values for `probe_type`, a oneof with full ID .google.cloud.run.v2.Probe.http_get, latest field was httpGet",
12888                                ));
12889                            }
12890                            result.probe_type =
12891                                std::option::Option::Some(crate::model::probe::ProbeType::HttpGet(
12892                                    map.next_value::<std::option::Option<
12893                                        std::boxed::Box<crate::model::HTTPGetAction>,
12894                                    >>()?
12895                                    .unwrap_or_default(),
12896                                ));
12897                        }
12898                        __FieldTag::__tcp_socket => {
12899                            if !fields.insert(__FieldTag::__tcp_socket) {
12900                                return std::result::Result::Err(A::Error::duplicate_field(
12901                                    "multiple values for tcp_socket",
12902                                ));
12903                            }
12904                            if result.probe_type.is_some() {
12905                                return std::result::Result::Err(A::Error::duplicate_field(
12906                                    "multiple values for `probe_type`, a oneof with full ID .google.cloud.run.v2.Probe.tcp_socket, latest field was tcpSocket",
12907                                ));
12908                            }
12909                            result.probe_type = std::option::Option::Some(
12910                                crate::model::probe::ProbeType::TcpSocket(
12911                                    map.next_value::<std::option::Option<
12912                                        std::boxed::Box<crate::model::TCPSocketAction>,
12913                                    >>()?
12914                                    .unwrap_or_default(),
12915                                ),
12916                            );
12917                        }
12918                        __FieldTag::__grpc => {
12919                            if !fields.insert(__FieldTag::__grpc) {
12920                                return std::result::Result::Err(A::Error::duplicate_field(
12921                                    "multiple values for grpc",
12922                                ));
12923                            }
12924                            if result.probe_type.is_some() {
12925                                return std::result::Result::Err(A::Error::duplicate_field(
12926                                    "multiple values for `probe_type`, a oneof with full ID .google.cloud.run.v2.Probe.grpc, latest field was grpc",
12927                                ));
12928                            }
12929                            result.probe_type =
12930                                std::option::Option::Some(crate::model::probe::ProbeType::Grpc(
12931                                    map.next_value::<std::option::Option<
12932                                        std::boxed::Box<crate::model::GRPCAction>,
12933                                    >>()?
12934                                    .unwrap_or_default(),
12935                                ));
12936                        }
12937                        __FieldTag::Unknown(key) => {
12938                            let value = map.next_value::<serde_json::Value>()?;
12939                            result._unknown_fields.insert(key, value);
12940                        }
12941                    }
12942                }
12943                std::result::Result::Ok(result)
12944            }
12945        }
12946        deserializer.deserialize_any(Visitor)
12947    }
12948}
12949
12950#[doc(hidden)]
12951impl serde::ser::Serialize for Probe {
12952    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12953    where
12954        S: serde::ser::Serializer,
12955    {
12956        use serde::ser::SerializeMap;
12957        #[allow(unused_imports)]
12958        use std::option::Option::Some;
12959        let mut state = serializer.serialize_map(std::option::Option::None)?;
12960        if !wkt::internal::is_default(&self.initial_delay_seconds) {
12961            struct __With<'a>(&'a i32);
12962            impl<'a> serde::ser::Serialize for __With<'a> {
12963                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12964                where
12965                    S: serde::ser::Serializer,
12966                {
12967                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12968                }
12969            }
12970            state.serialize_entry("initialDelaySeconds", &__With(&self.initial_delay_seconds))?;
12971        }
12972        if !wkt::internal::is_default(&self.timeout_seconds) {
12973            struct __With<'a>(&'a i32);
12974            impl<'a> serde::ser::Serialize for __With<'a> {
12975                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12976                where
12977                    S: serde::ser::Serializer,
12978                {
12979                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12980                }
12981            }
12982            state.serialize_entry("timeoutSeconds", &__With(&self.timeout_seconds))?;
12983        }
12984        if !wkt::internal::is_default(&self.period_seconds) {
12985            struct __With<'a>(&'a i32);
12986            impl<'a> serde::ser::Serialize for __With<'a> {
12987                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12988                where
12989                    S: serde::ser::Serializer,
12990                {
12991                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12992                }
12993            }
12994            state.serialize_entry("periodSeconds", &__With(&self.period_seconds))?;
12995        }
12996        if !wkt::internal::is_default(&self.failure_threshold) {
12997            struct __With<'a>(&'a i32);
12998            impl<'a> serde::ser::Serialize for __With<'a> {
12999                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13000                where
13001                    S: serde::ser::Serializer,
13002                {
13003                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13004                }
13005            }
13006            state.serialize_entry("failureThreshold", &__With(&self.failure_threshold))?;
13007        }
13008        if let Some(value) = self.http_get() {
13009            state.serialize_entry("httpGet", value)?;
13010        }
13011        if let Some(value) = self.tcp_socket() {
13012            state.serialize_entry("tcpSocket", value)?;
13013        }
13014        if let Some(value) = self.grpc() {
13015            state.serialize_entry("grpc", value)?;
13016        }
13017        if !self._unknown_fields.is_empty() {
13018            for (key, value) in self._unknown_fields.iter() {
13019                state.serialize_entry(key, &value)?;
13020            }
13021        }
13022        state.end()
13023    }
13024}
13025
13026impl std::fmt::Debug for Probe {
13027    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13028        let mut debug_struct = f.debug_struct("Probe");
13029        debug_struct.field("initial_delay_seconds", &self.initial_delay_seconds);
13030        debug_struct.field("timeout_seconds", &self.timeout_seconds);
13031        debug_struct.field("period_seconds", &self.period_seconds);
13032        debug_struct.field("failure_threshold", &self.failure_threshold);
13033        debug_struct.field("probe_type", &self.probe_type);
13034        if !self._unknown_fields.is_empty() {
13035            debug_struct.field("_unknown_fields", &self._unknown_fields);
13036        }
13037        debug_struct.finish()
13038    }
13039}
13040
13041/// Defines additional types related to [Probe].
13042pub mod probe {
13043    #[allow(unused_imports)]
13044    use super::*;
13045
13046    #[derive(Clone, Debug, PartialEq)]
13047    #[non_exhaustive]
13048    pub enum ProbeType {
13049        /// Optional. HTTPGet specifies the http request to perform.
13050        /// Exactly one of httpGet, tcpSocket, or grpc must be specified.
13051        HttpGet(std::boxed::Box<crate::model::HTTPGetAction>),
13052        /// Optional. TCPSocket specifies an action involving a TCP port.
13053        /// Exactly one of httpGet, tcpSocket, or grpc must be specified.
13054        TcpSocket(std::boxed::Box<crate::model::TCPSocketAction>),
13055        /// Optional. GRPC specifies an action involving a gRPC port.
13056        /// Exactly one of httpGet, tcpSocket, or grpc must be specified.
13057        Grpc(std::boxed::Box<crate::model::GRPCAction>),
13058    }
13059}
13060
13061/// HTTPGetAction describes an action based on HTTP Get requests.
13062#[derive(Clone, Default, PartialEq)]
13063#[non_exhaustive]
13064pub struct HTTPGetAction {
13065    /// Optional. Path to access on the HTTP server. Defaults to '/'.
13066    pub path: std::string::String,
13067
13068    /// Optional. Custom headers to set in the request. HTTP allows repeated
13069    /// headers.
13070    pub http_headers: std::vec::Vec<crate::model::HTTPHeader>,
13071
13072    /// Optional. Port number to access on the container. Must be in the range 1 to
13073    /// 65535. If not specified, defaults to the exposed port of the container,
13074    /// which is the value of container.ports[0].containerPort.
13075    pub port: i32,
13076
13077    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13078}
13079
13080impl HTTPGetAction {
13081    pub fn new() -> Self {
13082        std::default::Default::default()
13083    }
13084
13085    /// Sets the value of [path][crate::model::HTTPGetAction::path].
13086    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13087        self.path = v.into();
13088        self
13089    }
13090
13091    /// Sets the value of [http_headers][crate::model::HTTPGetAction::http_headers].
13092    pub fn set_http_headers<T, V>(mut self, v: T) -> Self
13093    where
13094        T: std::iter::IntoIterator<Item = V>,
13095        V: std::convert::Into<crate::model::HTTPHeader>,
13096    {
13097        use std::iter::Iterator;
13098        self.http_headers = v.into_iter().map(|i| i.into()).collect();
13099        self
13100    }
13101
13102    /// Sets the value of [port][crate::model::HTTPGetAction::port].
13103    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13104        self.port = v.into();
13105        self
13106    }
13107}
13108
13109impl wkt::message::Message for HTTPGetAction {
13110    fn typename() -> &'static str {
13111        "type.googleapis.com/google.cloud.run.v2.HTTPGetAction"
13112    }
13113}
13114
13115#[doc(hidden)]
13116impl<'de> serde::de::Deserialize<'de> for HTTPGetAction {
13117    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13118    where
13119        D: serde::Deserializer<'de>,
13120    {
13121        #[allow(non_camel_case_types)]
13122        #[doc(hidden)]
13123        #[derive(PartialEq, Eq, Hash)]
13124        enum __FieldTag {
13125            __path,
13126            __http_headers,
13127            __port,
13128            Unknown(std::string::String),
13129        }
13130        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13131            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13132            where
13133                D: serde::Deserializer<'de>,
13134            {
13135                struct Visitor;
13136                impl<'de> serde::de::Visitor<'de> for Visitor {
13137                    type Value = __FieldTag;
13138                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13139                        formatter.write_str("a field name for HTTPGetAction")
13140                    }
13141                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13142                    where
13143                        E: serde::de::Error,
13144                    {
13145                        use std::result::Result::Ok;
13146                        use std::string::ToString;
13147                        match value {
13148                            "path" => Ok(__FieldTag::__path),
13149                            "httpHeaders" => Ok(__FieldTag::__http_headers),
13150                            "http_headers" => Ok(__FieldTag::__http_headers),
13151                            "port" => Ok(__FieldTag::__port),
13152                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13153                        }
13154                    }
13155                }
13156                deserializer.deserialize_identifier(Visitor)
13157            }
13158        }
13159        struct Visitor;
13160        impl<'de> serde::de::Visitor<'de> for Visitor {
13161            type Value = HTTPGetAction;
13162            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13163                formatter.write_str("struct HTTPGetAction")
13164            }
13165            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13166            where
13167                A: serde::de::MapAccess<'de>,
13168            {
13169                #[allow(unused_imports)]
13170                use serde::de::Error;
13171                use std::option::Option::Some;
13172                let mut fields = std::collections::HashSet::new();
13173                let mut result = Self::Value::new();
13174                while let Some(tag) = map.next_key::<__FieldTag>()? {
13175                    #[allow(clippy::match_single_binding)]
13176                    match tag {
13177                        __FieldTag::__path => {
13178                            if !fields.insert(__FieldTag::__path) {
13179                                return std::result::Result::Err(A::Error::duplicate_field(
13180                                    "multiple values for path",
13181                                ));
13182                            }
13183                            result.path = map
13184                                .next_value::<std::option::Option<std::string::String>>()?
13185                                .unwrap_or_default();
13186                        }
13187                        __FieldTag::__http_headers => {
13188                            if !fields.insert(__FieldTag::__http_headers) {
13189                                return std::result::Result::Err(A::Error::duplicate_field(
13190                                    "multiple values for http_headers",
13191                                ));
13192                            }
13193                            result.http_headers = map.next_value::<std::option::Option<std::vec::Vec<crate::model::HTTPHeader>>>()?.unwrap_or_default();
13194                        }
13195                        __FieldTag::__port => {
13196                            if !fields.insert(__FieldTag::__port) {
13197                                return std::result::Result::Err(A::Error::duplicate_field(
13198                                    "multiple values for port",
13199                                ));
13200                            }
13201                            struct __With(std::option::Option<i32>);
13202                            impl<'de> serde::de::Deserialize<'de> for __With {
13203                                fn deserialize<D>(
13204                                    deserializer: D,
13205                                ) -> std::result::Result<Self, D::Error>
13206                                where
13207                                    D: serde::de::Deserializer<'de>,
13208                                {
13209                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13210                                }
13211                            }
13212                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
13213                        }
13214                        __FieldTag::Unknown(key) => {
13215                            let value = map.next_value::<serde_json::Value>()?;
13216                            result._unknown_fields.insert(key, value);
13217                        }
13218                    }
13219                }
13220                std::result::Result::Ok(result)
13221            }
13222        }
13223        deserializer.deserialize_any(Visitor)
13224    }
13225}
13226
13227#[doc(hidden)]
13228impl serde::ser::Serialize for HTTPGetAction {
13229    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13230    where
13231        S: serde::ser::Serializer,
13232    {
13233        use serde::ser::SerializeMap;
13234        #[allow(unused_imports)]
13235        use std::option::Option::Some;
13236        let mut state = serializer.serialize_map(std::option::Option::None)?;
13237        if !self.path.is_empty() {
13238            state.serialize_entry("path", &self.path)?;
13239        }
13240        if !self.http_headers.is_empty() {
13241            state.serialize_entry("httpHeaders", &self.http_headers)?;
13242        }
13243        if !wkt::internal::is_default(&self.port) {
13244            struct __With<'a>(&'a i32);
13245            impl<'a> serde::ser::Serialize for __With<'a> {
13246                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13247                where
13248                    S: serde::ser::Serializer,
13249                {
13250                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13251                }
13252            }
13253            state.serialize_entry("port", &__With(&self.port))?;
13254        }
13255        if !self._unknown_fields.is_empty() {
13256            for (key, value) in self._unknown_fields.iter() {
13257                state.serialize_entry(key, &value)?;
13258            }
13259        }
13260        state.end()
13261    }
13262}
13263
13264impl std::fmt::Debug for HTTPGetAction {
13265    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13266        let mut debug_struct = f.debug_struct("HTTPGetAction");
13267        debug_struct.field("path", &self.path);
13268        debug_struct.field("http_headers", &self.http_headers);
13269        debug_struct.field("port", &self.port);
13270        if !self._unknown_fields.is_empty() {
13271            debug_struct.field("_unknown_fields", &self._unknown_fields);
13272        }
13273        debug_struct.finish()
13274    }
13275}
13276
13277/// HTTPHeader describes a custom header to be used in HTTP probes
13278#[derive(Clone, Default, PartialEq)]
13279#[non_exhaustive]
13280pub struct HTTPHeader {
13281    /// Required. The header field name
13282    pub name: std::string::String,
13283
13284    /// Optional. The header field value
13285    pub value: std::string::String,
13286
13287    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13288}
13289
13290impl HTTPHeader {
13291    pub fn new() -> Self {
13292        std::default::Default::default()
13293    }
13294
13295    /// Sets the value of [name][crate::model::HTTPHeader::name].
13296    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13297        self.name = v.into();
13298        self
13299    }
13300
13301    /// Sets the value of [value][crate::model::HTTPHeader::value].
13302    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13303        self.value = v.into();
13304        self
13305    }
13306}
13307
13308impl wkt::message::Message for HTTPHeader {
13309    fn typename() -> &'static str {
13310        "type.googleapis.com/google.cloud.run.v2.HTTPHeader"
13311    }
13312}
13313
13314#[doc(hidden)]
13315impl<'de> serde::de::Deserialize<'de> for HTTPHeader {
13316    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13317    where
13318        D: serde::Deserializer<'de>,
13319    {
13320        #[allow(non_camel_case_types)]
13321        #[doc(hidden)]
13322        #[derive(PartialEq, Eq, Hash)]
13323        enum __FieldTag {
13324            __name,
13325            __value,
13326            Unknown(std::string::String),
13327        }
13328        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13329            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13330            where
13331                D: serde::Deserializer<'de>,
13332            {
13333                struct Visitor;
13334                impl<'de> serde::de::Visitor<'de> for Visitor {
13335                    type Value = __FieldTag;
13336                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13337                        formatter.write_str("a field name for HTTPHeader")
13338                    }
13339                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13340                    where
13341                        E: serde::de::Error,
13342                    {
13343                        use std::result::Result::Ok;
13344                        use std::string::ToString;
13345                        match value {
13346                            "name" => Ok(__FieldTag::__name),
13347                            "value" => Ok(__FieldTag::__value),
13348                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13349                        }
13350                    }
13351                }
13352                deserializer.deserialize_identifier(Visitor)
13353            }
13354        }
13355        struct Visitor;
13356        impl<'de> serde::de::Visitor<'de> for Visitor {
13357            type Value = HTTPHeader;
13358            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13359                formatter.write_str("struct HTTPHeader")
13360            }
13361            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13362            where
13363                A: serde::de::MapAccess<'de>,
13364            {
13365                #[allow(unused_imports)]
13366                use serde::de::Error;
13367                use std::option::Option::Some;
13368                let mut fields = std::collections::HashSet::new();
13369                let mut result = Self::Value::new();
13370                while let Some(tag) = map.next_key::<__FieldTag>()? {
13371                    #[allow(clippy::match_single_binding)]
13372                    match tag {
13373                        __FieldTag::__name => {
13374                            if !fields.insert(__FieldTag::__name) {
13375                                return std::result::Result::Err(A::Error::duplicate_field(
13376                                    "multiple values for name",
13377                                ));
13378                            }
13379                            result.name = map
13380                                .next_value::<std::option::Option<std::string::String>>()?
13381                                .unwrap_or_default();
13382                        }
13383                        __FieldTag::__value => {
13384                            if !fields.insert(__FieldTag::__value) {
13385                                return std::result::Result::Err(A::Error::duplicate_field(
13386                                    "multiple values for value",
13387                                ));
13388                            }
13389                            result.value = map
13390                                .next_value::<std::option::Option<std::string::String>>()?
13391                                .unwrap_or_default();
13392                        }
13393                        __FieldTag::Unknown(key) => {
13394                            let value = map.next_value::<serde_json::Value>()?;
13395                            result._unknown_fields.insert(key, value);
13396                        }
13397                    }
13398                }
13399                std::result::Result::Ok(result)
13400            }
13401        }
13402        deserializer.deserialize_any(Visitor)
13403    }
13404}
13405
13406#[doc(hidden)]
13407impl serde::ser::Serialize for HTTPHeader {
13408    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13409    where
13410        S: serde::ser::Serializer,
13411    {
13412        use serde::ser::SerializeMap;
13413        #[allow(unused_imports)]
13414        use std::option::Option::Some;
13415        let mut state = serializer.serialize_map(std::option::Option::None)?;
13416        if !self.name.is_empty() {
13417            state.serialize_entry("name", &self.name)?;
13418        }
13419        if !self.value.is_empty() {
13420            state.serialize_entry("value", &self.value)?;
13421        }
13422        if !self._unknown_fields.is_empty() {
13423            for (key, value) in self._unknown_fields.iter() {
13424                state.serialize_entry(key, &value)?;
13425            }
13426        }
13427        state.end()
13428    }
13429}
13430
13431impl std::fmt::Debug for HTTPHeader {
13432    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13433        let mut debug_struct = f.debug_struct("HTTPHeader");
13434        debug_struct.field("name", &self.name);
13435        debug_struct.field("value", &self.value);
13436        if !self._unknown_fields.is_empty() {
13437            debug_struct.field("_unknown_fields", &self._unknown_fields);
13438        }
13439        debug_struct.finish()
13440    }
13441}
13442
13443/// TCPSocketAction describes an action based on opening a socket
13444#[derive(Clone, Default, PartialEq)]
13445#[non_exhaustive]
13446pub struct TCPSocketAction {
13447    /// Optional. Port number to access on the container. Must be in the range 1 to
13448    /// 65535. If not specified, defaults to the exposed port of the container,
13449    /// which is the value of container.ports[0].containerPort.
13450    pub port: i32,
13451
13452    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13453}
13454
13455impl TCPSocketAction {
13456    pub fn new() -> Self {
13457        std::default::Default::default()
13458    }
13459
13460    /// Sets the value of [port][crate::model::TCPSocketAction::port].
13461    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13462        self.port = v.into();
13463        self
13464    }
13465}
13466
13467impl wkt::message::Message for TCPSocketAction {
13468    fn typename() -> &'static str {
13469        "type.googleapis.com/google.cloud.run.v2.TCPSocketAction"
13470    }
13471}
13472
13473#[doc(hidden)]
13474impl<'de> serde::de::Deserialize<'de> for TCPSocketAction {
13475    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13476    where
13477        D: serde::Deserializer<'de>,
13478    {
13479        #[allow(non_camel_case_types)]
13480        #[doc(hidden)]
13481        #[derive(PartialEq, Eq, Hash)]
13482        enum __FieldTag {
13483            __port,
13484            Unknown(std::string::String),
13485        }
13486        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13487            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13488            where
13489                D: serde::Deserializer<'de>,
13490            {
13491                struct Visitor;
13492                impl<'de> serde::de::Visitor<'de> for Visitor {
13493                    type Value = __FieldTag;
13494                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13495                        formatter.write_str("a field name for TCPSocketAction")
13496                    }
13497                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13498                    where
13499                        E: serde::de::Error,
13500                    {
13501                        use std::result::Result::Ok;
13502                        use std::string::ToString;
13503                        match value {
13504                            "port" => Ok(__FieldTag::__port),
13505                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13506                        }
13507                    }
13508                }
13509                deserializer.deserialize_identifier(Visitor)
13510            }
13511        }
13512        struct Visitor;
13513        impl<'de> serde::de::Visitor<'de> for Visitor {
13514            type Value = TCPSocketAction;
13515            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13516                formatter.write_str("struct TCPSocketAction")
13517            }
13518            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13519            where
13520                A: serde::de::MapAccess<'de>,
13521            {
13522                #[allow(unused_imports)]
13523                use serde::de::Error;
13524                use std::option::Option::Some;
13525                let mut fields = std::collections::HashSet::new();
13526                let mut result = Self::Value::new();
13527                while let Some(tag) = map.next_key::<__FieldTag>()? {
13528                    #[allow(clippy::match_single_binding)]
13529                    match tag {
13530                        __FieldTag::__port => {
13531                            if !fields.insert(__FieldTag::__port) {
13532                                return std::result::Result::Err(A::Error::duplicate_field(
13533                                    "multiple values for port",
13534                                ));
13535                            }
13536                            struct __With(std::option::Option<i32>);
13537                            impl<'de> serde::de::Deserialize<'de> for __With {
13538                                fn deserialize<D>(
13539                                    deserializer: D,
13540                                ) -> std::result::Result<Self, D::Error>
13541                                where
13542                                    D: serde::de::Deserializer<'de>,
13543                                {
13544                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13545                                }
13546                            }
13547                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
13548                        }
13549                        __FieldTag::Unknown(key) => {
13550                            let value = map.next_value::<serde_json::Value>()?;
13551                            result._unknown_fields.insert(key, value);
13552                        }
13553                    }
13554                }
13555                std::result::Result::Ok(result)
13556            }
13557        }
13558        deserializer.deserialize_any(Visitor)
13559    }
13560}
13561
13562#[doc(hidden)]
13563impl serde::ser::Serialize for TCPSocketAction {
13564    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13565    where
13566        S: serde::ser::Serializer,
13567    {
13568        use serde::ser::SerializeMap;
13569        #[allow(unused_imports)]
13570        use std::option::Option::Some;
13571        let mut state = serializer.serialize_map(std::option::Option::None)?;
13572        if !wkt::internal::is_default(&self.port) {
13573            struct __With<'a>(&'a i32);
13574            impl<'a> serde::ser::Serialize for __With<'a> {
13575                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13576                where
13577                    S: serde::ser::Serializer,
13578                {
13579                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13580                }
13581            }
13582            state.serialize_entry("port", &__With(&self.port))?;
13583        }
13584        if !self._unknown_fields.is_empty() {
13585            for (key, value) in self._unknown_fields.iter() {
13586                state.serialize_entry(key, &value)?;
13587            }
13588        }
13589        state.end()
13590    }
13591}
13592
13593impl std::fmt::Debug for TCPSocketAction {
13594    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13595        let mut debug_struct = f.debug_struct("TCPSocketAction");
13596        debug_struct.field("port", &self.port);
13597        if !self._unknown_fields.is_empty() {
13598            debug_struct.field("_unknown_fields", &self._unknown_fields);
13599        }
13600        debug_struct.finish()
13601    }
13602}
13603
13604/// GRPCAction describes an action involving a GRPC port.
13605#[derive(Clone, Default, PartialEq)]
13606#[non_exhaustive]
13607pub struct GRPCAction {
13608    /// Optional. Port number of the gRPC service. Number must be in the range 1 to
13609    /// 65535. If not specified, defaults to the exposed port of the container,
13610    /// which is the value of container.ports[0].containerPort.
13611    pub port: i32,
13612
13613    /// Optional. Service is the name of the service to place in the gRPC
13614    /// HealthCheckRequest (see
13615    /// <https://github.com/grpc/grpc/blob/master/doc/health-checking.md> ). If this
13616    /// is not specified, the default behavior is defined by gRPC.
13617    pub service: std::string::String,
13618
13619    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13620}
13621
13622impl GRPCAction {
13623    pub fn new() -> Self {
13624        std::default::Default::default()
13625    }
13626
13627    /// Sets the value of [port][crate::model::GRPCAction::port].
13628    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13629        self.port = v.into();
13630        self
13631    }
13632
13633    /// Sets the value of [service][crate::model::GRPCAction::service].
13634    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13635        self.service = v.into();
13636        self
13637    }
13638}
13639
13640impl wkt::message::Message for GRPCAction {
13641    fn typename() -> &'static str {
13642        "type.googleapis.com/google.cloud.run.v2.GRPCAction"
13643    }
13644}
13645
13646#[doc(hidden)]
13647impl<'de> serde::de::Deserialize<'de> for GRPCAction {
13648    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13649    where
13650        D: serde::Deserializer<'de>,
13651    {
13652        #[allow(non_camel_case_types)]
13653        #[doc(hidden)]
13654        #[derive(PartialEq, Eq, Hash)]
13655        enum __FieldTag {
13656            __port,
13657            __service,
13658            Unknown(std::string::String),
13659        }
13660        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13661            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13662            where
13663                D: serde::Deserializer<'de>,
13664            {
13665                struct Visitor;
13666                impl<'de> serde::de::Visitor<'de> for Visitor {
13667                    type Value = __FieldTag;
13668                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13669                        formatter.write_str("a field name for GRPCAction")
13670                    }
13671                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13672                    where
13673                        E: serde::de::Error,
13674                    {
13675                        use std::result::Result::Ok;
13676                        use std::string::ToString;
13677                        match value {
13678                            "port" => Ok(__FieldTag::__port),
13679                            "service" => Ok(__FieldTag::__service),
13680                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13681                        }
13682                    }
13683                }
13684                deserializer.deserialize_identifier(Visitor)
13685            }
13686        }
13687        struct Visitor;
13688        impl<'de> serde::de::Visitor<'de> for Visitor {
13689            type Value = GRPCAction;
13690            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13691                formatter.write_str("struct GRPCAction")
13692            }
13693            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13694            where
13695                A: serde::de::MapAccess<'de>,
13696            {
13697                #[allow(unused_imports)]
13698                use serde::de::Error;
13699                use std::option::Option::Some;
13700                let mut fields = std::collections::HashSet::new();
13701                let mut result = Self::Value::new();
13702                while let Some(tag) = map.next_key::<__FieldTag>()? {
13703                    #[allow(clippy::match_single_binding)]
13704                    match tag {
13705                        __FieldTag::__port => {
13706                            if !fields.insert(__FieldTag::__port) {
13707                                return std::result::Result::Err(A::Error::duplicate_field(
13708                                    "multiple values for port",
13709                                ));
13710                            }
13711                            struct __With(std::option::Option<i32>);
13712                            impl<'de> serde::de::Deserialize<'de> for __With {
13713                                fn deserialize<D>(
13714                                    deserializer: D,
13715                                ) -> std::result::Result<Self, D::Error>
13716                                where
13717                                    D: serde::de::Deserializer<'de>,
13718                                {
13719                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13720                                }
13721                            }
13722                            result.port = map.next_value::<__With>()?.0.unwrap_or_default();
13723                        }
13724                        __FieldTag::__service => {
13725                            if !fields.insert(__FieldTag::__service) {
13726                                return std::result::Result::Err(A::Error::duplicate_field(
13727                                    "multiple values for service",
13728                                ));
13729                            }
13730                            result.service = map
13731                                .next_value::<std::option::Option<std::string::String>>()?
13732                                .unwrap_or_default();
13733                        }
13734                        __FieldTag::Unknown(key) => {
13735                            let value = map.next_value::<serde_json::Value>()?;
13736                            result._unknown_fields.insert(key, value);
13737                        }
13738                    }
13739                }
13740                std::result::Result::Ok(result)
13741            }
13742        }
13743        deserializer.deserialize_any(Visitor)
13744    }
13745}
13746
13747#[doc(hidden)]
13748impl serde::ser::Serialize for GRPCAction {
13749    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13750    where
13751        S: serde::ser::Serializer,
13752    {
13753        use serde::ser::SerializeMap;
13754        #[allow(unused_imports)]
13755        use std::option::Option::Some;
13756        let mut state = serializer.serialize_map(std::option::Option::None)?;
13757        if !wkt::internal::is_default(&self.port) {
13758            struct __With<'a>(&'a i32);
13759            impl<'a> serde::ser::Serialize for __With<'a> {
13760                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13761                where
13762                    S: serde::ser::Serializer,
13763                {
13764                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13765                }
13766            }
13767            state.serialize_entry("port", &__With(&self.port))?;
13768        }
13769        if !self.service.is_empty() {
13770            state.serialize_entry("service", &self.service)?;
13771        }
13772        if !self._unknown_fields.is_empty() {
13773            for (key, value) in self._unknown_fields.iter() {
13774                state.serialize_entry(key, &value)?;
13775            }
13776        }
13777        state.end()
13778    }
13779}
13780
13781impl std::fmt::Debug for GRPCAction {
13782    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13783        let mut debug_struct = f.debug_struct("GRPCAction");
13784        debug_struct.field("port", &self.port);
13785        debug_struct.field("service", &self.service);
13786        if !self._unknown_fields.is_empty() {
13787            debug_struct.field("_unknown_fields", &self._unknown_fields);
13788        }
13789        debug_struct.finish()
13790    }
13791}
13792
13793/// Build information of the image.
13794#[derive(Clone, Default, PartialEq)]
13795#[non_exhaustive]
13796pub struct BuildInfo {
13797    /// Output only. Entry point of the function when the image is a Cloud Run
13798    /// function.
13799    pub function_target: std::string::String,
13800
13801    /// Output only. Source code location of the image.
13802    pub source_location: std::string::String,
13803
13804    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13805}
13806
13807impl BuildInfo {
13808    pub fn new() -> Self {
13809        std::default::Default::default()
13810    }
13811
13812    /// Sets the value of [function_target][crate::model::BuildInfo::function_target].
13813    pub fn set_function_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13814        self.function_target = v.into();
13815        self
13816    }
13817
13818    /// Sets the value of [source_location][crate::model::BuildInfo::source_location].
13819    pub fn set_source_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13820        self.source_location = v.into();
13821        self
13822    }
13823}
13824
13825impl wkt::message::Message for BuildInfo {
13826    fn typename() -> &'static str {
13827        "type.googleapis.com/google.cloud.run.v2.BuildInfo"
13828    }
13829}
13830
13831#[doc(hidden)]
13832impl<'de> serde::de::Deserialize<'de> for BuildInfo {
13833    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13834    where
13835        D: serde::Deserializer<'de>,
13836    {
13837        #[allow(non_camel_case_types)]
13838        #[doc(hidden)]
13839        #[derive(PartialEq, Eq, Hash)]
13840        enum __FieldTag {
13841            __function_target,
13842            __source_location,
13843            Unknown(std::string::String),
13844        }
13845        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13846            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13847            where
13848                D: serde::Deserializer<'de>,
13849            {
13850                struct Visitor;
13851                impl<'de> serde::de::Visitor<'de> for Visitor {
13852                    type Value = __FieldTag;
13853                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13854                        formatter.write_str("a field name for BuildInfo")
13855                    }
13856                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13857                    where
13858                        E: serde::de::Error,
13859                    {
13860                        use std::result::Result::Ok;
13861                        use std::string::ToString;
13862                        match value {
13863                            "functionTarget" => Ok(__FieldTag::__function_target),
13864                            "function_target" => Ok(__FieldTag::__function_target),
13865                            "sourceLocation" => Ok(__FieldTag::__source_location),
13866                            "source_location" => Ok(__FieldTag::__source_location),
13867                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13868                        }
13869                    }
13870                }
13871                deserializer.deserialize_identifier(Visitor)
13872            }
13873        }
13874        struct Visitor;
13875        impl<'de> serde::de::Visitor<'de> for Visitor {
13876            type Value = BuildInfo;
13877            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13878                formatter.write_str("struct BuildInfo")
13879            }
13880            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13881            where
13882                A: serde::de::MapAccess<'de>,
13883            {
13884                #[allow(unused_imports)]
13885                use serde::de::Error;
13886                use std::option::Option::Some;
13887                let mut fields = std::collections::HashSet::new();
13888                let mut result = Self::Value::new();
13889                while let Some(tag) = map.next_key::<__FieldTag>()? {
13890                    #[allow(clippy::match_single_binding)]
13891                    match tag {
13892                        __FieldTag::__function_target => {
13893                            if !fields.insert(__FieldTag::__function_target) {
13894                                return std::result::Result::Err(A::Error::duplicate_field(
13895                                    "multiple values for function_target",
13896                                ));
13897                            }
13898                            result.function_target = map
13899                                .next_value::<std::option::Option<std::string::String>>()?
13900                                .unwrap_or_default();
13901                        }
13902                        __FieldTag::__source_location => {
13903                            if !fields.insert(__FieldTag::__source_location) {
13904                                return std::result::Result::Err(A::Error::duplicate_field(
13905                                    "multiple values for source_location",
13906                                ));
13907                            }
13908                            result.source_location = map
13909                                .next_value::<std::option::Option<std::string::String>>()?
13910                                .unwrap_or_default();
13911                        }
13912                        __FieldTag::Unknown(key) => {
13913                            let value = map.next_value::<serde_json::Value>()?;
13914                            result._unknown_fields.insert(key, value);
13915                        }
13916                    }
13917                }
13918                std::result::Result::Ok(result)
13919            }
13920        }
13921        deserializer.deserialize_any(Visitor)
13922    }
13923}
13924
13925#[doc(hidden)]
13926impl serde::ser::Serialize for BuildInfo {
13927    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13928    where
13929        S: serde::ser::Serializer,
13930    {
13931        use serde::ser::SerializeMap;
13932        #[allow(unused_imports)]
13933        use std::option::Option::Some;
13934        let mut state = serializer.serialize_map(std::option::Option::None)?;
13935        if !self.function_target.is_empty() {
13936            state.serialize_entry("functionTarget", &self.function_target)?;
13937        }
13938        if !self.source_location.is_empty() {
13939            state.serialize_entry("sourceLocation", &self.source_location)?;
13940        }
13941        if !self._unknown_fields.is_empty() {
13942            for (key, value) in self._unknown_fields.iter() {
13943                state.serialize_entry(key, &value)?;
13944            }
13945        }
13946        state.end()
13947    }
13948}
13949
13950impl std::fmt::Debug for BuildInfo {
13951    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13952        let mut debug_struct = f.debug_struct("BuildInfo");
13953        debug_struct.field("function_target", &self.function_target);
13954        debug_struct.field("source_location", &self.source_location);
13955        if !self._unknown_fields.is_empty() {
13956            debug_struct.field("_unknown_fields", &self._unknown_fields);
13957        }
13958        debug_struct.finish()
13959    }
13960}
13961
13962/// Request message for obtaining a Revision by its full name.
13963#[derive(Clone, Default, PartialEq)]
13964#[non_exhaustive]
13965pub struct GetRevisionRequest {
13966    /// Required. The full name of the Revision.
13967    /// Format:
13968    /// projects/{project}/locations/{location}/services/{service}/revisions/{revision}
13969    pub name: std::string::String,
13970
13971    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13972}
13973
13974impl GetRevisionRequest {
13975    pub fn new() -> Self {
13976        std::default::Default::default()
13977    }
13978
13979    /// Sets the value of [name][crate::model::GetRevisionRequest::name].
13980    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13981        self.name = v.into();
13982        self
13983    }
13984}
13985
13986impl wkt::message::Message for GetRevisionRequest {
13987    fn typename() -> &'static str {
13988        "type.googleapis.com/google.cloud.run.v2.GetRevisionRequest"
13989    }
13990}
13991
13992#[doc(hidden)]
13993impl<'de> serde::de::Deserialize<'de> for GetRevisionRequest {
13994    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13995    where
13996        D: serde::Deserializer<'de>,
13997    {
13998        #[allow(non_camel_case_types)]
13999        #[doc(hidden)]
14000        #[derive(PartialEq, Eq, Hash)]
14001        enum __FieldTag {
14002            __name,
14003            Unknown(std::string::String),
14004        }
14005        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14006            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14007            where
14008                D: serde::Deserializer<'de>,
14009            {
14010                struct Visitor;
14011                impl<'de> serde::de::Visitor<'de> for Visitor {
14012                    type Value = __FieldTag;
14013                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14014                        formatter.write_str("a field name for GetRevisionRequest")
14015                    }
14016                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14017                    where
14018                        E: serde::de::Error,
14019                    {
14020                        use std::result::Result::Ok;
14021                        use std::string::ToString;
14022                        match value {
14023                            "name" => Ok(__FieldTag::__name),
14024                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14025                        }
14026                    }
14027                }
14028                deserializer.deserialize_identifier(Visitor)
14029            }
14030        }
14031        struct Visitor;
14032        impl<'de> serde::de::Visitor<'de> for Visitor {
14033            type Value = GetRevisionRequest;
14034            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14035                formatter.write_str("struct GetRevisionRequest")
14036            }
14037            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14038            where
14039                A: serde::de::MapAccess<'de>,
14040            {
14041                #[allow(unused_imports)]
14042                use serde::de::Error;
14043                use std::option::Option::Some;
14044                let mut fields = std::collections::HashSet::new();
14045                let mut result = Self::Value::new();
14046                while let Some(tag) = map.next_key::<__FieldTag>()? {
14047                    #[allow(clippy::match_single_binding)]
14048                    match tag {
14049                        __FieldTag::__name => {
14050                            if !fields.insert(__FieldTag::__name) {
14051                                return std::result::Result::Err(A::Error::duplicate_field(
14052                                    "multiple values for name",
14053                                ));
14054                            }
14055                            result.name = map
14056                                .next_value::<std::option::Option<std::string::String>>()?
14057                                .unwrap_or_default();
14058                        }
14059                        __FieldTag::Unknown(key) => {
14060                            let value = map.next_value::<serde_json::Value>()?;
14061                            result._unknown_fields.insert(key, value);
14062                        }
14063                    }
14064                }
14065                std::result::Result::Ok(result)
14066            }
14067        }
14068        deserializer.deserialize_any(Visitor)
14069    }
14070}
14071
14072#[doc(hidden)]
14073impl serde::ser::Serialize for GetRevisionRequest {
14074    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14075    where
14076        S: serde::ser::Serializer,
14077    {
14078        use serde::ser::SerializeMap;
14079        #[allow(unused_imports)]
14080        use std::option::Option::Some;
14081        let mut state = serializer.serialize_map(std::option::Option::None)?;
14082        if !self.name.is_empty() {
14083            state.serialize_entry("name", &self.name)?;
14084        }
14085        if !self._unknown_fields.is_empty() {
14086            for (key, value) in self._unknown_fields.iter() {
14087                state.serialize_entry(key, &value)?;
14088            }
14089        }
14090        state.end()
14091    }
14092}
14093
14094impl std::fmt::Debug for GetRevisionRequest {
14095    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14096        let mut debug_struct = f.debug_struct("GetRevisionRequest");
14097        debug_struct.field("name", &self.name);
14098        if !self._unknown_fields.is_empty() {
14099            debug_struct.field("_unknown_fields", &self._unknown_fields);
14100        }
14101        debug_struct.finish()
14102    }
14103}
14104
14105/// Request message for retrieving a list of Revisions.
14106#[derive(Clone, Default, PartialEq)]
14107#[non_exhaustive]
14108pub struct ListRevisionsRequest {
14109    /// Required. The Service from which the Revisions should be listed.
14110    /// To list all Revisions across Services, use "-" instead of Service name.
14111    /// Format:
14112    /// projects/{project}/locations/{location}/services/{service}
14113    pub parent: std::string::String,
14114
14115    /// Maximum number of revisions to return in this call.
14116    pub page_size: i32,
14117
14118    /// A page token received from a previous call to ListRevisions.
14119    /// All other parameters must match.
14120    pub page_token: std::string::String,
14121
14122    /// If true, returns deleted (but unexpired) resources along with active ones.
14123    pub show_deleted: bool,
14124
14125    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14126}
14127
14128impl ListRevisionsRequest {
14129    pub fn new() -> Self {
14130        std::default::Default::default()
14131    }
14132
14133    /// Sets the value of [parent][crate::model::ListRevisionsRequest::parent].
14134    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14135        self.parent = v.into();
14136        self
14137    }
14138
14139    /// Sets the value of [page_size][crate::model::ListRevisionsRequest::page_size].
14140    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14141        self.page_size = v.into();
14142        self
14143    }
14144
14145    /// Sets the value of [page_token][crate::model::ListRevisionsRequest::page_token].
14146    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14147        self.page_token = v.into();
14148        self
14149    }
14150
14151    /// Sets the value of [show_deleted][crate::model::ListRevisionsRequest::show_deleted].
14152    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14153        self.show_deleted = v.into();
14154        self
14155    }
14156}
14157
14158impl wkt::message::Message for ListRevisionsRequest {
14159    fn typename() -> &'static str {
14160        "type.googleapis.com/google.cloud.run.v2.ListRevisionsRequest"
14161    }
14162}
14163
14164#[doc(hidden)]
14165impl<'de> serde::de::Deserialize<'de> for ListRevisionsRequest {
14166    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14167    where
14168        D: serde::Deserializer<'de>,
14169    {
14170        #[allow(non_camel_case_types)]
14171        #[doc(hidden)]
14172        #[derive(PartialEq, Eq, Hash)]
14173        enum __FieldTag {
14174            __parent,
14175            __page_size,
14176            __page_token,
14177            __show_deleted,
14178            Unknown(std::string::String),
14179        }
14180        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14181            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14182            where
14183                D: serde::Deserializer<'de>,
14184            {
14185                struct Visitor;
14186                impl<'de> serde::de::Visitor<'de> for Visitor {
14187                    type Value = __FieldTag;
14188                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14189                        formatter.write_str("a field name for ListRevisionsRequest")
14190                    }
14191                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14192                    where
14193                        E: serde::de::Error,
14194                    {
14195                        use std::result::Result::Ok;
14196                        use std::string::ToString;
14197                        match value {
14198                            "parent" => Ok(__FieldTag::__parent),
14199                            "pageSize" => Ok(__FieldTag::__page_size),
14200                            "page_size" => Ok(__FieldTag::__page_size),
14201                            "pageToken" => Ok(__FieldTag::__page_token),
14202                            "page_token" => Ok(__FieldTag::__page_token),
14203                            "showDeleted" => Ok(__FieldTag::__show_deleted),
14204                            "show_deleted" => Ok(__FieldTag::__show_deleted),
14205                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14206                        }
14207                    }
14208                }
14209                deserializer.deserialize_identifier(Visitor)
14210            }
14211        }
14212        struct Visitor;
14213        impl<'de> serde::de::Visitor<'de> for Visitor {
14214            type Value = ListRevisionsRequest;
14215            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14216                formatter.write_str("struct ListRevisionsRequest")
14217            }
14218            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14219            where
14220                A: serde::de::MapAccess<'de>,
14221            {
14222                #[allow(unused_imports)]
14223                use serde::de::Error;
14224                use std::option::Option::Some;
14225                let mut fields = std::collections::HashSet::new();
14226                let mut result = Self::Value::new();
14227                while let Some(tag) = map.next_key::<__FieldTag>()? {
14228                    #[allow(clippy::match_single_binding)]
14229                    match tag {
14230                        __FieldTag::__parent => {
14231                            if !fields.insert(__FieldTag::__parent) {
14232                                return std::result::Result::Err(A::Error::duplicate_field(
14233                                    "multiple values for parent",
14234                                ));
14235                            }
14236                            result.parent = map
14237                                .next_value::<std::option::Option<std::string::String>>()?
14238                                .unwrap_or_default();
14239                        }
14240                        __FieldTag::__page_size => {
14241                            if !fields.insert(__FieldTag::__page_size) {
14242                                return std::result::Result::Err(A::Error::duplicate_field(
14243                                    "multiple values for page_size",
14244                                ));
14245                            }
14246                            struct __With(std::option::Option<i32>);
14247                            impl<'de> serde::de::Deserialize<'de> for __With {
14248                                fn deserialize<D>(
14249                                    deserializer: D,
14250                                ) -> std::result::Result<Self, D::Error>
14251                                where
14252                                    D: serde::de::Deserializer<'de>,
14253                                {
14254                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14255                                }
14256                            }
14257                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
14258                        }
14259                        __FieldTag::__page_token => {
14260                            if !fields.insert(__FieldTag::__page_token) {
14261                                return std::result::Result::Err(A::Error::duplicate_field(
14262                                    "multiple values for page_token",
14263                                ));
14264                            }
14265                            result.page_token = map
14266                                .next_value::<std::option::Option<std::string::String>>()?
14267                                .unwrap_or_default();
14268                        }
14269                        __FieldTag::__show_deleted => {
14270                            if !fields.insert(__FieldTag::__show_deleted) {
14271                                return std::result::Result::Err(A::Error::duplicate_field(
14272                                    "multiple values for show_deleted",
14273                                ));
14274                            }
14275                            result.show_deleted = map
14276                                .next_value::<std::option::Option<bool>>()?
14277                                .unwrap_or_default();
14278                        }
14279                        __FieldTag::Unknown(key) => {
14280                            let value = map.next_value::<serde_json::Value>()?;
14281                            result._unknown_fields.insert(key, value);
14282                        }
14283                    }
14284                }
14285                std::result::Result::Ok(result)
14286            }
14287        }
14288        deserializer.deserialize_any(Visitor)
14289    }
14290}
14291
14292#[doc(hidden)]
14293impl serde::ser::Serialize for ListRevisionsRequest {
14294    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14295    where
14296        S: serde::ser::Serializer,
14297    {
14298        use serde::ser::SerializeMap;
14299        #[allow(unused_imports)]
14300        use std::option::Option::Some;
14301        let mut state = serializer.serialize_map(std::option::Option::None)?;
14302        if !self.parent.is_empty() {
14303            state.serialize_entry("parent", &self.parent)?;
14304        }
14305        if !wkt::internal::is_default(&self.page_size) {
14306            struct __With<'a>(&'a i32);
14307            impl<'a> serde::ser::Serialize for __With<'a> {
14308                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14309                where
14310                    S: serde::ser::Serializer,
14311                {
14312                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14313                }
14314            }
14315            state.serialize_entry("pageSize", &__With(&self.page_size))?;
14316        }
14317        if !self.page_token.is_empty() {
14318            state.serialize_entry("pageToken", &self.page_token)?;
14319        }
14320        if !wkt::internal::is_default(&self.show_deleted) {
14321            state.serialize_entry("showDeleted", &self.show_deleted)?;
14322        }
14323        if !self._unknown_fields.is_empty() {
14324            for (key, value) in self._unknown_fields.iter() {
14325                state.serialize_entry(key, &value)?;
14326            }
14327        }
14328        state.end()
14329    }
14330}
14331
14332impl std::fmt::Debug for ListRevisionsRequest {
14333    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14334        let mut debug_struct = f.debug_struct("ListRevisionsRequest");
14335        debug_struct.field("parent", &self.parent);
14336        debug_struct.field("page_size", &self.page_size);
14337        debug_struct.field("page_token", &self.page_token);
14338        debug_struct.field("show_deleted", &self.show_deleted);
14339        if !self._unknown_fields.is_empty() {
14340            debug_struct.field("_unknown_fields", &self._unknown_fields);
14341        }
14342        debug_struct.finish()
14343    }
14344}
14345
14346/// Response message containing a list of Revisions.
14347#[derive(Clone, Default, PartialEq)]
14348#[non_exhaustive]
14349pub struct ListRevisionsResponse {
14350    /// The resulting list of Revisions.
14351    pub revisions: std::vec::Vec<crate::model::Revision>,
14352
14353    /// A token indicating there are more items than page_size. Use it in the next
14354    /// ListRevisions request to continue.
14355    pub next_page_token: std::string::String,
14356
14357    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14358}
14359
14360impl ListRevisionsResponse {
14361    pub fn new() -> Self {
14362        std::default::Default::default()
14363    }
14364
14365    /// Sets the value of [revisions][crate::model::ListRevisionsResponse::revisions].
14366    pub fn set_revisions<T, V>(mut self, v: T) -> Self
14367    where
14368        T: std::iter::IntoIterator<Item = V>,
14369        V: std::convert::Into<crate::model::Revision>,
14370    {
14371        use std::iter::Iterator;
14372        self.revisions = v.into_iter().map(|i| i.into()).collect();
14373        self
14374    }
14375
14376    /// Sets the value of [next_page_token][crate::model::ListRevisionsResponse::next_page_token].
14377    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14378        self.next_page_token = v.into();
14379        self
14380    }
14381}
14382
14383impl wkt::message::Message for ListRevisionsResponse {
14384    fn typename() -> &'static str {
14385        "type.googleapis.com/google.cloud.run.v2.ListRevisionsResponse"
14386    }
14387}
14388
14389#[doc(hidden)]
14390impl gax::paginator::internal::PageableResponse for ListRevisionsResponse {
14391    type PageItem = crate::model::Revision;
14392
14393    fn items(self) -> std::vec::Vec<Self::PageItem> {
14394        self.revisions
14395    }
14396
14397    fn next_page_token(&self) -> std::string::String {
14398        use std::clone::Clone;
14399        self.next_page_token.clone()
14400    }
14401}
14402
14403#[doc(hidden)]
14404impl<'de> serde::de::Deserialize<'de> for ListRevisionsResponse {
14405    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14406    where
14407        D: serde::Deserializer<'de>,
14408    {
14409        #[allow(non_camel_case_types)]
14410        #[doc(hidden)]
14411        #[derive(PartialEq, Eq, Hash)]
14412        enum __FieldTag {
14413            __revisions,
14414            __next_page_token,
14415            Unknown(std::string::String),
14416        }
14417        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14418            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14419            where
14420                D: serde::Deserializer<'de>,
14421            {
14422                struct Visitor;
14423                impl<'de> serde::de::Visitor<'de> for Visitor {
14424                    type Value = __FieldTag;
14425                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14426                        formatter.write_str("a field name for ListRevisionsResponse")
14427                    }
14428                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14429                    where
14430                        E: serde::de::Error,
14431                    {
14432                        use std::result::Result::Ok;
14433                        use std::string::ToString;
14434                        match value {
14435                            "revisions" => Ok(__FieldTag::__revisions),
14436                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
14437                            "next_page_token" => Ok(__FieldTag::__next_page_token),
14438                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14439                        }
14440                    }
14441                }
14442                deserializer.deserialize_identifier(Visitor)
14443            }
14444        }
14445        struct Visitor;
14446        impl<'de> serde::de::Visitor<'de> for Visitor {
14447            type Value = ListRevisionsResponse;
14448            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14449                formatter.write_str("struct ListRevisionsResponse")
14450            }
14451            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14452            where
14453                A: serde::de::MapAccess<'de>,
14454            {
14455                #[allow(unused_imports)]
14456                use serde::de::Error;
14457                use std::option::Option::Some;
14458                let mut fields = std::collections::HashSet::new();
14459                let mut result = Self::Value::new();
14460                while let Some(tag) = map.next_key::<__FieldTag>()? {
14461                    #[allow(clippy::match_single_binding)]
14462                    match tag {
14463                        __FieldTag::__revisions => {
14464                            if !fields.insert(__FieldTag::__revisions) {
14465                                return std::result::Result::Err(A::Error::duplicate_field(
14466                                    "multiple values for revisions",
14467                                ));
14468                            }
14469                            result.revisions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Revision>>>()?.unwrap_or_default();
14470                        }
14471                        __FieldTag::__next_page_token => {
14472                            if !fields.insert(__FieldTag::__next_page_token) {
14473                                return std::result::Result::Err(A::Error::duplicate_field(
14474                                    "multiple values for next_page_token",
14475                                ));
14476                            }
14477                            result.next_page_token = map
14478                                .next_value::<std::option::Option<std::string::String>>()?
14479                                .unwrap_or_default();
14480                        }
14481                        __FieldTag::Unknown(key) => {
14482                            let value = map.next_value::<serde_json::Value>()?;
14483                            result._unknown_fields.insert(key, value);
14484                        }
14485                    }
14486                }
14487                std::result::Result::Ok(result)
14488            }
14489        }
14490        deserializer.deserialize_any(Visitor)
14491    }
14492}
14493
14494#[doc(hidden)]
14495impl serde::ser::Serialize for ListRevisionsResponse {
14496    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14497    where
14498        S: serde::ser::Serializer,
14499    {
14500        use serde::ser::SerializeMap;
14501        #[allow(unused_imports)]
14502        use std::option::Option::Some;
14503        let mut state = serializer.serialize_map(std::option::Option::None)?;
14504        if !self.revisions.is_empty() {
14505            state.serialize_entry("revisions", &self.revisions)?;
14506        }
14507        if !self.next_page_token.is_empty() {
14508            state.serialize_entry("nextPageToken", &self.next_page_token)?;
14509        }
14510        if !self._unknown_fields.is_empty() {
14511            for (key, value) in self._unknown_fields.iter() {
14512                state.serialize_entry(key, &value)?;
14513            }
14514        }
14515        state.end()
14516    }
14517}
14518
14519impl std::fmt::Debug for ListRevisionsResponse {
14520    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14521        let mut debug_struct = f.debug_struct("ListRevisionsResponse");
14522        debug_struct.field("revisions", &self.revisions);
14523        debug_struct.field("next_page_token", &self.next_page_token);
14524        if !self._unknown_fields.is_empty() {
14525            debug_struct.field("_unknown_fields", &self._unknown_fields);
14526        }
14527        debug_struct.finish()
14528    }
14529}
14530
14531/// Request message for deleting a retired Revision.
14532/// Revision lifecycle is usually managed by making changes to the parent
14533/// Service. Only retired revisions can be deleted with this API.
14534#[derive(Clone, Default, PartialEq)]
14535#[non_exhaustive]
14536pub struct DeleteRevisionRequest {
14537    /// Required. The name of the Revision to delete.
14538    /// Format:
14539    /// projects/{project}/locations/{location}/services/{service}/revisions/{revision}
14540    pub name: std::string::String,
14541
14542    /// Indicates that the request should be validated without actually
14543    /// deleting any resources.
14544    pub validate_only: bool,
14545
14546    /// A system-generated fingerprint for this version of the
14547    /// resource. This may be used to detect modification conflict during updates.
14548    pub etag: std::string::String,
14549
14550    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14551}
14552
14553impl DeleteRevisionRequest {
14554    pub fn new() -> Self {
14555        std::default::Default::default()
14556    }
14557
14558    /// Sets the value of [name][crate::model::DeleteRevisionRequest::name].
14559    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14560        self.name = v.into();
14561        self
14562    }
14563
14564    /// Sets the value of [validate_only][crate::model::DeleteRevisionRequest::validate_only].
14565    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14566        self.validate_only = v.into();
14567        self
14568    }
14569
14570    /// Sets the value of [etag][crate::model::DeleteRevisionRequest::etag].
14571    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14572        self.etag = v.into();
14573        self
14574    }
14575}
14576
14577impl wkt::message::Message for DeleteRevisionRequest {
14578    fn typename() -> &'static str {
14579        "type.googleapis.com/google.cloud.run.v2.DeleteRevisionRequest"
14580    }
14581}
14582
14583#[doc(hidden)]
14584impl<'de> serde::de::Deserialize<'de> for DeleteRevisionRequest {
14585    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14586    where
14587        D: serde::Deserializer<'de>,
14588    {
14589        #[allow(non_camel_case_types)]
14590        #[doc(hidden)]
14591        #[derive(PartialEq, Eq, Hash)]
14592        enum __FieldTag {
14593            __name,
14594            __validate_only,
14595            __etag,
14596            Unknown(std::string::String),
14597        }
14598        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14599            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14600            where
14601                D: serde::Deserializer<'de>,
14602            {
14603                struct Visitor;
14604                impl<'de> serde::de::Visitor<'de> for Visitor {
14605                    type Value = __FieldTag;
14606                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14607                        formatter.write_str("a field name for DeleteRevisionRequest")
14608                    }
14609                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14610                    where
14611                        E: serde::de::Error,
14612                    {
14613                        use std::result::Result::Ok;
14614                        use std::string::ToString;
14615                        match value {
14616                            "name" => Ok(__FieldTag::__name),
14617                            "validateOnly" => Ok(__FieldTag::__validate_only),
14618                            "validate_only" => Ok(__FieldTag::__validate_only),
14619                            "etag" => Ok(__FieldTag::__etag),
14620                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14621                        }
14622                    }
14623                }
14624                deserializer.deserialize_identifier(Visitor)
14625            }
14626        }
14627        struct Visitor;
14628        impl<'de> serde::de::Visitor<'de> for Visitor {
14629            type Value = DeleteRevisionRequest;
14630            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14631                formatter.write_str("struct DeleteRevisionRequest")
14632            }
14633            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14634            where
14635                A: serde::de::MapAccess<'de>,
14636            {
14637                #[allow(unused_imports)]
14638                use serde::de::Error;
14639                use std::option::Option::Some;
14640                let mut fields = std::collections::HashSet::new();
14641                let mut result = Self::Value::new();
14642                while let Some(tag) = map.next_key::<__FieldTag>()? {
14643                    #[allow(clippy::match_single_binding)]
14644                    match tag {
14645                        __FieldTag::__name => {
14646                            if !fields.insert(__FieldTag::__name) {
14647                                return std::result::Result::Err(A::Error::duplicate_field(
14648                                    "multiple values for name",
14649                                ));
14650                            }
14651                            result.name = map
14652                                .next_value::<std::option::Option<std::string::String>>()?
14653                                .unwrap_or_default();
14654                        }
14655                        __FieldTag::__validate_only => {
14656                            if !fields.insert(__FieldTag::__validate_only) {
14657                                return std::result::Result::Err(A::Error::duplicate_field(
14658                                    "multiple values for validate_only",
14659                                ));
14660                            }
14661                            result.validate_only = map
14662                                .next_value::<std::option::Option<bool>>()?
14663                                .unwrap_or_default();
14664                        }
14665                        __FieldTag::__etag => {
14666                            if !fields.insert(__FieldTag::__etag) {
14667                                return std::result::Result::Err(A::Error::duplicate_field(
14668                                    "multiple values for etag",
14669                                ));
14670                            }
14671                            result.etag = map
14672                                .next_value::<std::option::Option<std::string::String>>()?
14673                                .unwrap_or_default();
14674                        }
14675                        __FieldTag::Unknown(key) => {
14676                            let value = map.next_value::<serde_json::Value>()?;
14677                            result._unknown_fields.insert(key, value);
14678                        }
14679                    }
14680                }
14681                std::result::Result::Ok(result)
14682            }
14683        }
14684        deserializer.deserialize_any(Visitor)
14685    }
14686}
14687
14688#[doc(hidden)]
14689impl serde::ser::Serialize for DeleteRevisionRequest {
14690    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14691    where
14692        S: serde::ser::Serializer,
14693    {
14694        use serde::ser::SerializeMap;
14695        #[allow(unused_imports)]
14696        use std::option::Option::Some;
14697        let mut state = serializer.serialize_map(std::option::Option::None)?;
14698        if !self.name.is_empty() {
14699            state.serialize_entry("name", &self.name)?;
14700        }
14701        if !wkt::internal::is_default(&self.validate_only) {
14702            state.serialize_entry("validateOnly", &self.validate_only)?;
14703        }
14704        if !self.etag.is_empty() {
14705            state.serialize_entry("etag", &self.etag)?;
14706        }
14707        if !self._unknown_fields.is_empty() {
14708            for (key, value) in self._unknown_fields.iter() {
14709                state.serialize_entry(key, &value)?;
14710            }
14711        }
14712        state.end()
14713    }
14714}
14715
14716impl std::fmt::Debug for DeleteRevisionRequest {
14717    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14718        let mut debug_struct = f.debug_struct("DeleteRevisionRequest");
14719        debug_struct.field("name", &self.name);
14720        debug_struct.field("validate_only", &self.validate_only);
14721        debug_struct.field("etag", &self.etag);
14722        if !self._unknown_fields.is_empty() {
14723            debug_struct.field("_unknown_fields", &self._unknown_fields);
14724        }
14725        debug_struct.finish()
14726    }
14727}
14728
14729/// A Revision is an immutable snapshot of code and configuration.  A Revision
14730/// references a container image. Revisions are only created by updates to its
14731/// parent Service.
14732#[derive(Clone, Default, PartialEq)]
14733#[non_exhaustive]
14734pub struct Revision {
14735    /// Output only. The unique name of this Revision.
14736    pub name: std::string::String,
14737
14738    /// Output only. Server assigned unique identifier for the Revision. The value
14739    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
14740    /// deleted.
14741    pub uid: std::string::String,
14742
14743    /// Output only. A number that monotonically increases every time the user
14744    /// modifies the desired state.
14745    pub generation: i64,
14746
14747    /// Output only. Unstructured key value map that can be used to organize and
14748    /// categorize objects. User-provided labels are shared with Google's billing
14749    /// system, so they can be used to filter, or break down billing charges by
14750    /// team, component, environment, state, etc. For more information, visit
14751    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
14752    /// <https://cloud.google.com/run/docs/configuring/labels>.
14753    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14754
14755    /// Output only. Unstructured key value map that may
14756    /// be set by external tools to store and arbitrary metadata.
14757    /// They are not queryable and should be preserved
14758    /// when modifying objects.
14759    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
14760
14761    /// Output only. The creation time.
14762    pub create_time: std::option::Option<wkt::Timestamp>,
14763
14764    /// Output only. The last-modified time.
14765    pub update_time: std::option::Option<wkt::Timestamp>,
14766
14767    /// Output only. For a deleted resource, the deletion time. It is only
14768    /// populated as a response to a Delete request.
14769    pub delete_time: std::option::Option<wkt::Timestamp>,
14770
14771    /// Output only. For a deleted resource, the time after which it will be
14772    /// permamently deleted. It is only populated as a response to a Delete
14773    /// request.
14774    pub expire_time: std::option::Option<wkt::Timestamp>,
14775
14776    /// The least stable launch stage needed to create this resource, as defined by
14777    /// [Google Cloud Platform Launch
14778    /// Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports
14779    /// `ALPHA`, `BETA`, and `GA`.
14780    ///
14781    /// Note that this value might not be what was used
14782    /// as input. For example, if ALPHA was provided as input in the parent
14783    /// resource, but only BETA and GA-level features are were, this field will be
14784    /// BETA.
14785    pub launch_stage: api::model::LaunchStage,
14786
14787    /// Output only. The name of the parent service.
14788    pub service: std::string::String,
14789
14790    /// Scaling settings for this revision.
14791    pub scaling: std::option::Option<crate::model::RevisionScaling>,
14792
14793    /// VPC Access configuration for this Revision. For more information, visit
14794    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
14795    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
14796
14797    /// Sets the maximum number of requests that each serving instance can receive.
14798    pub max_instance_request_concurrency: i32,
14799
14800    /// Max allowed time for an instance to respond to a request.
14801    pub timeout: std::option::Option<wkt::Duration>,
14802
14803    /// Email address of the IAM service account associated with the revision of
14804    /// the service. The service account represents the identity of the running
14805    /// revision, and determines what permissions the revision has.
14806    pub service_account: std::string::String,
14807
14808    /// Holds the single container that defines the unit of execution for this
14809    /// Revision.
14810    pub containers: std::vec::Vec<crate::model::Container>,
14811
14812    /// A list of Volumes to make available to containers.
14813    pub volumes: std::vec::Vec<crate::model::Volume>,
14814
14815    /// The execution environment being used to host this Revision.
14816    pub execution_environment: crate::model::ExecutionEnvironment,
14817
14818    /// A reference to a customer managed encryption key (CMEK) to use to encrypt
14819    /// this container image. For more information, go to
14820    /// <https://cloud.google.com/run/docs/securing/using-cmek>
14821    pub encryption_key: std::string::String,
14822
14823    /// Enables service mesh connectivity.
14824    pub service_mesh: std::option::Option<crate::model::ServiceMesh>,
14825
14826    /// The action to take if the encryption key is revoked.
14827    pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
14828
14829    /// If encryption_key_revocation_action is SHUTDOWN, the duration before
14830    /// shutting down all instances. The minimum increment is 1 hour.
14831    pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
14832
14833    /// Output only. Indicates whether the resource's reconciliation is still in
14834    /// progress. See comments in `Service.reconciling` for additional information
14835    /// on reconciliation process in Cloud Run.
14836    pub reconciling: bool,
14837
14838    /// Output only. The Condition of this Revision, containing its readiness
14839    /// status, and detailed error information in case it did not reach a serving
14840    /// state.
14841    pub conditions: std::vec::Vec<crate::model::Condition>,
14842
14843    /// Output only. The generation of this Revision currently serving traffic. See
14844    /// comments in `reconciling` for additional information on reconciliation
14845    /// process in Cloud Run.
14846    pub observed_generation: i64,
14847
14848    /// Output only. The Google Console URI to obtain logs for the Revision.
14849    pub log_uri: std::string::String,
14850
14851    /// Output only. Reserved for future use.
14852    pub satisfies_pzs: bool,
14853
14854    /// Enable session affinity.
14855    pub session_affinity: bool,
14856
14857    /// Output only. The current effective scaling settings for the revision.
14858    pub scaling_status: std::option::Option<crate::model::RevisionScalingStatus>,
14859
14860    /// The node selector for the revision.
14861    pub node_selector: std::option::Option<crate::model::NodeSelector>,
14862
14863    /// Optional. Output only. True if GPU zonal redundancy is disabled on this
14864    /// revision.
14865    pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
14866
14867    /// Output only. Email address of the authenticated creator.
14868    pub creator: std::string::String,
14869
14870    /// Output only. A system-generated fingerprint for this version of the
14871    /// resource. May be used to detect modification conflict during updates.
14872    pub etag: std::string::String,
14873
14874    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14875}
14876
14877impl Revision {
14878    pub fn new() -> Self {
14879        std::default::Default::default()
14880    }
14881
14882    /// Sets the value of [name][crate::model::Revision::name].
14883    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14884        self.name = v.into();
14885        self
14886    }
14887
14888    /// Sets the value of [uid][crate::model::Revision::uid].
14889    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14890        self.uid = v.into();
14891        self
14892    }
14893
14894    /// Sets the value of [generation][crate::model::Revision::generation].
14895    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14896        self.generation = v.into();
14897        self
14898    }
14899
14900    /// Sets the value of [labels][crate::model::Revision::labels].
14901    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14902    where
14903        T: std::iter::IntoIterator<Item = (K, V)>,
14904        K: std::convert::Into<std::string::String>,
14905        V: std::convert::Into<std::string::String>,
14906    {
14907        use std::iter::Iterator;
14908        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14909        self
14910    }
14911
14912    /// Sets the value of [annotations][crate::model::Revision::annotations].
14913    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
14914    where
14915        T: std::iter::IntoIterator<Item = (K, V)>,
14916        K: std::convert::Into<std::string::String>,
14917        V: std::convert::Into<std::string::String>,
14918    {
14919        use std::iter::Iterator;
14920        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14921        self
14922    }
14923
14924    /// Sets the value of [create_time][crate::model::Revision::create_time].
14925    pub fn set_create_time<T>(mut self, v: T) -> Self
14926    where
14927        T: std::convert::Into<wkt::Timestamp>,
14928    {
14929        self.create_time = std::option::Option::Some(v.into());
14930        self
14931    }
14932
14933    /// Sets or clears the value of [create_time][crate::model::Revision::create_time].
14934    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14935    where
14936        T: std::convert::Into<wkt::Timestamp>,
14937    {
14938        self.create_time = v.map(|x| x.into());
14939        self
14940    }
14941
14942    /// Sets the value of [update_time][crate::model::Revision::update_time].
14943    pub fn set_update_time<T>(mut self, v: T) -> Self
14944    where
14945        T: std::convert::Into<wkt::Timestamp>,
14946    {
14947        self.update_time = std::option::Option::Some(v.into());
14948        self
14949    }
14950
14951    /// Sets or clears the value of [update_time][crate::model::Revision::update_time].
14952    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14953    where
14954        T: std::convert::Into<wkt::Timestamp>,
14955    {
14956        self.update_time = v.map(|x| x.into());
14957        self
14958    }
14959
14960    /// Sets the value of [delete_time][crate::model::Revision::delete_time].
14961    pub fn set_delete_time<T>(mut self, v: T) -> Self
14962    where
14963        T: std::convert::Into<wkt::Timestamp>,
14964    {
14965        self.delete_time = std::option::Option::Some(v.into());
14966        self
14967    }
14968
14969    /// Sets or clears the value of [delete_time][crate::model::Revision::delete_time].
14970    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
14971    where
14972        T: std::convert::Into<wkt::Timestamp>,
14973    {
14974        self.delete_time = v.map(|x| x.into());
14975        self
14976    }
14977
14978    /// Sets the value of [expire_time][crate::model::Revision::expire_time].
14979    pub fn set_expire_time<T>(mut self, v: T) -> Self
14980    where
14981        T: std::convert::Into<wkt::Timestamp>,
14982    {
14983        self.expire_time = std::option::Option::Some(v.into());
14984        self
14985    }
14986
14987    /// Sets or clears the value of [expire_time][crate::model::Revision::expire_time].
14988    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
14989    where
14990        T: std::convert::Into<wkt::Timestamp>,
14991    {
14992        self.expire_time = v.map(|x| x.into());
14993        self
14994    }
14995
14996    /// Sets the value of [launch_stage][crate::model::Revision::launch_stage].
14997    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
14998        mut self,
14999        v: T,
15000    ) -> Self {
15001        self.launch_stage = v.into();
15002        self
15003    }
15004
15005    /// Sets the value of [service][crate::model::Revision::service].
15006    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15007        self.service = v.into();
15008        self
15009    }
15010
15011    /// Sets the value of [scaling][crate::model::Revision::scaling].
15012    pub fn set_scaling<T>(mut self, v: T) -> Self
15013    where
15014        T: std::convert::Into<crate::model::RevisionScaling>,
15015    {
15016        self.scaling = std::option::Option::Some(v.into());
15017        self
15018    }
15019
15020    /// Sets or clears the value of [scaling][crate::model::Revision::scaling].
15021    pub fn set_or_clear_scaling<T>(mut self, v: std::option::Option<T>) -> Self
15022    where
15023        T: std::convert::Into<crate::model::RevisionScaling>,
15024    {
15025        self.scaling = v.map(|x| x.into());
15026        self
15027    }
15028
15029    /// Sets the value of [vpc_access][crate::model::Revision::vpc_access].
15030    pub fn set_vpc_access<T>(mut self, v: T) -> Self
15031    where
15032        T: std::convert::Into<crate::model::VpcAccess>,
15033    {
15034        self.vpc_access = std::option::Option::Some(v.into());
15035        self
15036    }
15037
15038    /// Sets or clears the value of [vpc_access][crate::model::Revision::vpc_access].
15039    pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
15040    where
15041        T: std::convert::Into<crate::model::VpcAccess>,
15042    {
15043        self.vpc_access = v.map(|x| x.into());
15044        self
15045    }
15046
15047    /// Sets the value of [max_instance_request_concurrency][crate::model::Revision::max_instance_request_concurrency].
15048    pub fn set_max_instance_request_concurrency<T: std::convert::Into<i32>>(
15049        mut self,
15050        v: T,
15051    ) -> Self {
15052        self.max_instance_request_concurrency = v.into();
15053        self
15054    }
15055
15056    /// Sets the value of [timeout][crate::model::Revision::timeout].
15057    pub fn set_timeout<T>(mut self, v: T) -> Self
15058    where
15059        T: std::convert::Into<wkt::Duration>,
15060    {
15061        self.timeout = std::option::Option::Some(v.into());
15062        self
15063    }
15064
15065    /// Sets or clears the value of [timeout][crate::model::Revision::timeout].
15066    pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
15067    where
15068        T: std::convert::Into<wkt::Duration>,
15069    {
15070        self.timeout = v.map(|x| x.into());
15071        self
15072    }
15073
15074    /// Sets the value of [service_account][crate::model::Revision::service_account].
15075    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15076        self.service_account = v.into();
15077        self
15078    }
15079
15080    /// Sets the value of [containers][crate::model::Revision::containers].
15081    pub fn set_containers<T, V>(mut self, v: T) -> Self
15082    where
15083        T: std::iter::IntoIterator<Item = V>,
15084        V: std::convert::Into<crate::model::Container>,
15085    {
15086        use std::iter::Iterator;
15087        self.containers = v.into_iter().map(|i| i.into()).collect();
15088        self
15089    }
15090
15091    /// Sets the value of [volumes][crate::model::Revision::volumes].
15092    pub fn set_volumes<T, V>(mut self, v: T) -> Self
15093    where
15094        T: std::iter::IntoIterator<Item = V>,
15095        V: std::convert::Into<crate::model::Volume>,
15096    {
15097        use std::iter::Iterator;
15098        self.volumes = v.into_iter().map(|i| i.into()).collect();
15099        self
15100    }
15101
15102    /// Sets the value of [execution_environment][crate::model::Revision::execution_environment].
15103    pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
15104        mut self,
15105        v: T,
15106    ) -> Self {
15107        self.execution_environment = v.into();
15108        self
15109    }
15110
15111    /// Sets the value of [encryption_key][crate::model::Revision::encryption_key].
15112    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15113        self.encryption_key = v.into();
15114        self
15115    }
15116
15117    /// Sets the value of [service_mesh][crate::model::Revision::service_mesh].
15118    pub fn set_service_mesh<T>(mut self, v: T) -> Self
15119    where
15120        T: std::convert::Into<crate::model::ServiceMesh>,
15121    {
15122        self.service_mesh = std::option::Option::Some(v.into());
15123        self
15124    }
15125
15126    /// Sets or clears the value of [service_mesh][crate::model::Revision::service_mesh].
15127    pub fn set_or_clear_service_mesh<T>(mut self, v: std::option::Option<T>) -> Self
15128    where
15129        T: std::convert::Into<crate::model::ServiceMesh>,
15130    {
15131        self.service_mesh = v.map(|x| x.into());
15132        self
15133    }
15134
15135    /// Sets the value of [encryption_key_revocation_action][crate::model::Revision::encryption_key_revocation_action].
15136    pub fn set_encryption_key_revocation_action<
15137        T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
15138    >(
15139        mut self,
15140        v: T,
15141    ) -> Self {
15142        self.encryption_key_revocation_action = v.into();
15143        self
15144    }
15145
15146    /// Sets the value of [encryption_key_shutdown_duration][crate::model::Revision::encryption_key_shutdown_duration].
15147    pub fn set_encryption_key_shutdown_duration<T>(mut self, v: T) -> Self
15148    where
15149        T: std::convert::Into<wkt::Duration>,
15150    {
15151        self.encryption_key_shutdown_duration = std::option::Option::Some(v.into());
15152        self
15153    }
15154
15155    /// Sets or clears the value of [encryption_key_shutdown_duration][crate::model::Revision::encryption_key_shutdown_duration].
15156    pub fn set_or_clear_encryption_key_shutdown_duration<T>(
15157        mut self,
15158        v: std::option::Option<T>,
15159    ) -> Self
15160    where
15161        T: std::convert::Into<wkt::Duration>,
15162    {
15163        self.encryption_key_shutdown_duration = v.map(|x| x.into());
15164        self
15165    }
15166
15167    /// Sets the value of [reconciling][crate::model::Revision::reconciling].
15168    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15169        self.reconciling = v.into();
15170        self
15171    }
15172
15173    /// Sets the value of [conditions][crate::model::Revision::conditions].
15174    pub fn set_conditions<T, V>(mut self, v: T) -> Self
15175    where
15176        T: std::iter::IntoIterator<Item = V>,
15177        V: std::convert::Into<crate::model::Condition>,
15178    {
15179        use std::iter::Iterator;
15180        self.conditions = v.into_iter().map(|i| i.into()).collect();
15181        self
15182    }
15183
15184    /// Sets the value of [observed_generation][crate::model::Revision::observed_generation].
15185    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15186        self.observed_generation = v.into();
15187        self
15188    }
15189
15190    /// Sets the value of [log_uri][crate::model::Revision::log_uri].
15191    pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15192        self.log_uri = v.into();
15193        self
15194    }
15195
15196    /// Sets the value of [satisfies_pzs][crate::model::Revision::satisfies_pzs].
15197    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15198        self.satisfies_pzs = v.into();
15199        self
15200    }
15201
15202    /// Sets the value of [session_affinity][crate::model::Revision::session_affinity].
15203    pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15204        self.session_affinity = v.into();
15205        self
15206    }
15207
15208    /// Sets the value of [scaling_status][crate::model::Revision::scaling_status].
15209    pub fn set_scaling_status<T>(mut self, v: T) -> Self
15210    where
15211        T: std::convert::Into<crate::model::RevisionScalingStatus>,
15212    {
15213        self.scaling_status = std::option::Option::Some(v.into());
15214        self
15215    }
15216
15217    /// Sets or clears the value of [scaling_status][crate::model::Revision::scaling_status].
15218    pub fn set_or_clear_scaling_status<T>(mut self, v: std::option::Option<T>) -> Self
15219    where
15220        T: std::convert::Into<crate::model::RevisionScalingStatus>,
15221    {
15222        self.scaling_status = v.map(|x| x.into());
15223        self
15224    }
15225
15226    /// Sets the value of [node_selector][crate::model::Revision::node_selector].
15227    pub fn set_node_selector<T>(mut self, v: T) -> Self
15228    where
15229        T: std::convert::Into<crate::model::NodeSelector>,
15230    {
15231        self.node_selector = std::option::Option::Some(v.into());
15232        self
15233    }
15234
15235    /// Sets or clears the value of [node_selector][crate::model::Revision::node_selector].
15236    pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
15237    where
15238        T: std::convert::Into<crate::model::NodeSelector>,
15239    {
15240        self.node_selector = v.map(|x| x.into());
15241        self
15242    }
15243
15244    /// Sets the value of [gpu_zonal_redundancy_disabled][crate::model::Revision::gpu_zonal_redundancy_disabled].
15245    pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
15246    where
15247        T: std::convert::Into<bool>,
15248    {
15249        self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
15250        self
15251    }
15252
15253    /// Sets or clears the value of [gpu_zonal_redundancy_disabled][crate::model::Revision::gpu_zonal_redundancy_disabled].
15254    pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
15255        mut self,
15256        v: std::option::Option<T>,
15257    ) -> Self
15258    where
15259        T: std::convert::Into<bool>,
15260    {
15261        self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
15262        self
15263    }
15264
15265    /// Sets the value of [creator][crate::model::Revision::creator].
15266    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15267        self.creator = v.into();
15268        self
15269    }
15270
15271    /// Sets the value of [etag][crate::model::Revision::etag].
15272    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15273        self.etag = v.into();
15274        self
15275    }
15276}
15277
15278impl wkt::message::Message for Revision {
15279    fn typename() -> &'static str {
15280        "type.googleapis.com/google.cloud.run.v2.Revision"
15281    }
15282}
15283
15284#[doc(hidden)]
15285impl<'de> serde::de::Deserialize<'de> for Revision {
15286    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15287    where
15288        D: serde::Deserializer<'de>,
15289    {
15290        #[allow(non_camel_case_types)]
15291        #[doc(hidden)]
15292        #[derive(PartialEq, Eq, Hash)]
15293        enum __FieldTag {
15294            __name,
15295            __uid,
15296            __generation,
15297            __labels,
15298            __annotations,
15299            __create_time,
15300            __update_time,
15301            __delete_time,
15302            __expire_time,
15303            __launch_stage,
15304            __service,
15305            __scaling,
15306            __vpc_access,
15307            __max_instance_request_concurrency,
15308            __timeout,
15309            __service_account,
15310            __containers,
15311            __volumes,
15312            __execution_environment,
15313            __encryption_key,
15314            __service_mesh,
15315            __encryption_key_revocation_action,
15316            __encryption_key_shutdown_duration,
15317            __reconciling,
15318            __conditions,
15319            __observed_generation,
15320            __log_uri,
15321            __satisfies_pzs,
15322            __session_affinity,
15323            __scaling_status,
15324            __node_selector,
15325            __gpu_zonal_redundancy_disabled,
15326            __creator,
15327            __etag,
15328            Unknown(std::string::String),
15329        }
15330        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15331            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15332            where
15333                D: serde::Deserializer<'de>,
15334            {
15335                struct Visitor;
15336                impl<'de> serde::de::Visitor<'de> for Visitor {
15337                    type Value = __FieldTag;
15338                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15339                        formatter.write_str("a field name for Revision")
15340                    }
15341                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15342                    where
15343                        E: serde::de::Error,
15344                    {
15345                        use std::result::Result::Ok;
15346                        use std::string::ToString;
15347                        match value {
15348                            "name" => Ok(__FieldTag::__name),
15349                            "uid" => Ok(__FieldTag::__uid),
15350                            "generation" => Ok(__FieldTag::__generation),
15351                            "labels" => Ok(__FieldTag::__labels),
15352                            "annotations" => Ok(__FieldTag::__annotations),
15353                            "createTime" => Ok(__FieldTag::__create_time),
15354                            "create_time" => Ok(__FieldTag::__create_time),
15355                            "updateTime" => Ok(__FieldTag::__update_time),
15356                            "update_time" => Ok(__FieldTag::__update_time),
15357                            "deleteTime" => Ok(__FieldTag::__delete_time),
15358                            "delete_time" => Ok(__FieldTag::__delete_time),
15359                            "expireTime" => Ok(__FieldTag::__expire_time),
15360                            "expire_time" => Ok(__FieldTag::__expire_time),
15361                            "launchStage" => Ok(__FieldTag::__launch_stage),
15362                            "launch_stage" => Ok(__FieldTag::__launch_stage),
15363                            "service" => Ok(__FieldTag::__service),
15364                            "scaling" => Ok(__FieldTag::__scaling),
15365                            "vpcAccess" => Ok(__FieldTag::__vpc_access),
15366                            "vpc_access" => Ok(__FieldTag::__vpc_access),
15367                            "maxInstanceRequestConcurrency" => {
15368                                Ok(__FieldTag::__max_instance_request_concurrency)
15369                            }
15370                            "max_instance_request_concurrency" => {
15371                                Ok(__FieldTag::__max_instance_request_concurrency)
15372                            }
15373                            "timeout" => Ok(__FieldTag::__timeout),
15374                            "serviceAccount" => Ok(__FieldTag::__service_account),
15375                            "service_account" => Ok(__FieldTag::__service_account),
15376                            "containers" => Ok(__FieldTag::__containers),
15377                            "volumes" => Ok(__FieldTag::__volumes),
15378                            "executionEnvironment" => Ok(__FieldTag::__execution_environment),
15379                            "execution_environment" => Ok(__FieldTag::__execution_environment),
15380                            "encryptionKey" => Ok(__FieldTag::__encryption_key),
15381                            "encryption_key" => Ok(__FieldTag::__encryption_key),
15382                            "serviceMesh" => Ok(__FieldTag::__service_mesh),
15383                            "service_mesh" => Ok(__FieldTag::__service_mesh),
15384                            "encryptionKeyRevocationAction" => {
15385                                Ok(__FieldTag::__encryption_key_revocation_action)
15386                            }
15387                            "encryption_key_revocation_action" => {
15388                                Ok(__FieldTag::__encryption_key_revocation_action)
15389                            }
15390                            "encryptionKeyShutdownDuration" => {
15391                                Ok(__FieldTag::__encryption_key_shutdown_duration)
15392                            }
15393                            "encryption_key_shutdown_duration" => {
15394                                Ok(__FieldTag::__encryption_key_shutdown_duration)
15395                            }
15396                            "reconciling" => Ok(__FieldTag::__reconciling),
15397                            "conditions" => Ok(__FieldTag::__conditions),
15398                            "observedGeneration" => Ok(__FieldTag::__observed_generation),
15399                            "observed_generation" => Ok(__FieldTag::__observed_generation),
15400                            "logUri" => Ok(__FieldTag::__log_uri),
15401                            "log_uri" => Ok(__FieldTag::__log_uri),
15402                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
15403                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
15404                            "sessionAffinity" => Ok(__FieldTag::__session_affinity),
15405                            "session_affinity" => Ok(__FieldTag::__session_affinity),
15406                            "scalingStatus" => Ok(__FieldTag::__scaling_status),
15407                            "scaling_status" => Ok(__FieldTag::__scaling_status),
15408                            "nodeSelector" => Ok(__FieldTag::__node_selector),
15409                            "node_selector" => Ok(__FieldTag::__node_selector),
15410                            "gpuZonalRedundancyDisabled" => {
15411                                Ok(__FieldTag::__gpu_zonal_redundancy_disabled)
15412                            }
15413                            "gpu_zonal_redundancy_disabled" => {
15414                                Ok(__FieldTag::__gpu_zonal_redundancy_disabled)
15415                            }
15416                            "creator" => Ok(__FieldTag::__creator),
15417                            "etag" => Ok(__FieldTag::__etag),
15418                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15419                        }
15420                    }
15421                }
15422                deserializer.deserialize_identifier(Visitor)
15423            }
15424        }
15425        struct Visitor;
15426        impl<'de> serde::de::Visitor<'de> for Visitor {
15427            type Value = Revision;
15428            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15429                formatter.write_str("struct Revision")
15430            }
15431            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15432            where
15433                A: serde::de::MapAccess<'de>,
15434            {
15435                #[allow(unused_imports)]
15436                use serde::de::Error;
15437                use std::option::Option::Some;
15438                let mut fields = std::collections::HashSet::new();
15439                let mut result = Self::Value::new();
15440                while let Some(tag) = map.next_key::<__FieldTag>()? {
15441                    #[allow(clippy::match_single_binding)]
15442                    match tag {
15443                        __FieldTag::__name => {
15444                            if !fields.insert(__FieldTag::__name) {
15445                                return std::result::Result::Err(A::Error::duplicate_field(
15446                                    "multiple values for name",
15447                                ));
15448                            }
15449                            result.name = map
15450                                .next_value::<std::option::Option<std::string::String>>()?
15451                                .unwrap_or_default();
15452                        }
15453                        __FieldTag::__uid => {
15454                            if !fields.insert(__FieldTag::__uid) {
15455                                return std::result::Result::Err(A::Error::duplicate_field(
15456                                    "multiple values for uid",
15457                                ));
15458                            }
15459                            result.uid = map
15460                                .next_value::<std::option::Option<std::string::String>>()?
15461                                .unwrap_or_default();
15462                        }
15463                        __FieldTag::__generation => {
15464                            if !fields.insert(__FieldTag::__generation) {
15465                                return std::result::Result::Err(A::Error::duplicate_field(
15466                                    "multiple values for generation",
15467                                ));
15468                            }
15469                            struct __With(std::option::Option<i64>);
15470                            impl<'de> serde::de::Deserialize<'de> for __With {
15471                                fn deserialize<D>(
15472                                    deserializer: D,
15473                                ) -> std::result::Result<Self, D::Error>
15474                                where
15475                                    D: serde::de::Deserializer<'de>,
15476                                {
15477                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
15478                                }
15479                            }
15480                            result.generation = map.next_value::<__With>()?.0.unwrap_or_default();
15481                        }
15482                        __FieldTag::__labels => {
15483                            if !fields.insert(__FieldTag::__labels) {
15484                                return std::result::Result::Err(A::Error::duplicate_field(
15485                                    "multiple values for labels",
15486                                ));
15487                            }
15488                            result.labels = map
15489                                .next_value::<std::option::Option<
15490                                    std::collections::HashMap<
15491                                        std::string::String,
15492                                        std::string::String,
15493                                    >,
15494                                >>()?
15495                                .unwrap_or_default();
15496                        }
15497                        __FieldTag::__annotations => {
15498                            if !fields.insert(__FieldTag::__annotations) {
15499                                return std::result::Result::Err(A::Error::duplicate_field(
15500                                    "multiple values for annotations",
15501                                ));
15502                            }
15503                            result.annotations = map
15504                                .next_value::<std::option::Option<
15505                                    std::collections::HashMap<
15506                                        std::string::String,
15507                                        std::string::String,
15508                                    >,
15509                                >>()?
15510                                .unwrap_or_default();
15511                        }
15512                        __FieldTag::__create_time => {
15513                            if !fields.insert(__FieldTag::__create_time) {
15514                                return std::result::Result::Err(A::Error::duplicate_field(
15515                                    "multiple values for create_time",
15516                                ));
15517                            }
15518                            result.create_time =
15519                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
15520                        }
15521                        __FieldTag::__update_time => {
15522                            if !fields.insert(__FieldTag::__update_time) {
15523                                return std::result::Result::Err(A::Error::duplicate_field(
15524                                    "multiple values for update_time",
15525                                ));
15526                            }
15527                            result.update_time =
15528                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
15529                        }
15530                        __FieldTag::__delete_time => {
15531                            if !fields.insert(__FieldTag::__delete_time) {
15532                                return std::result::Result::Err(A::Error::duplicate_field(
15533                                    "multiple values for delete_time",
15534                                ));
15535                            }
15536                            result.delete_time =
15537                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
15538                        }
15539                        __FieldTag::__expire_time => {
15540                            if !fields.insert(__FieldTag::__expire_time) {
15541                                return std::result::Result::Err(A::Error::duplicate_field(
15542                                    "multiple values for expire_time",
15543                                ));
15544                            }
15545                            result.expire_time =
15546                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
15547                        }
15548                        __FieldTag::__launch_stage => {
15549                            if !fields.insert(__FieldTag::__launch_stage) {
15550                                return std::result::Result::Err(A::Error::duplicate_field(
15551                                    "multiple values for launch_stage",
15552                                ));
15553                            }
15554                            result.launch_stage = map
15555                                .next_value::<std::option::Option<api::model::LaunchStage>>()?
15556                                .unwrap_or_default();
15557                        }
15558                        __FieldTag::__service => {
15559                            if !fields.insert(__FieldTag::__service) {
15560                                return std::result::Result::Err(A::Error::duplicate_field(
15561                                    "multiple values for service",
15562                                ));
15563                            }
15564                            result.service = map
15565                                .next_value::<std::option::Option<std::string::String>>()?
15566                                .unwrap_or_default();
15567                        }
15568                        __FieldTag::__scaling => {
15569                            if !fields.insert(__FieldTag::__scaling) {
15570                                return std::result::Result::Err(A::Error::duplicate_field(
15571                                    "multiple values for scaling",
15572                                ));
15573                            }
15574                            result.scaling = map
15575                                .next_value::<std::option::Option<crate::model::RevisionScaling>>(
15576                                )?;
15577                        }
15578                        __FieldTag::__vpc_access => {
15579                            if !fields.insert(__FieldTag::__vpc_access) {
15580                                return std::result::Result::Err(A::Error::duplicate_field(
15581                                    "multiple values for vpc_access",
15582                                ));
15583                            }
15584                            result.vpc_access =
15585                                map.next_value::<std::option::Option<crate::model::VpcAccess>>()?;
15586                        }
15587                        __FieldTag::__max_instance_request_concurrency => {
15588                            if !fields.insert(__FieldTag::__max_instance_request_concurrency) {
15589                                return std::result::Result::Err(A::Error::duplicate_field(
15590                                    "multiple values for max_instance_request_concurrency",
15591                                ));
15592                            }
15593                            struct __With(std::option::Option<i32>);
15594                            impl<'de> serde::de::Deserialize<'de> for __With {
15595                                fn deserialize<D>(
15596                                    deserializer: D,
15597                                ) -> std::result::Result<Self, D::Error>
15598                                where
15599                                    D: serde::de::Deserializer<'de>,
15600                                {
15601                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
15602                                }
15603                            }
15604                            result.max_instance_request_concurrency =
15605                                map.next_value::<__With>()?.0.unwrap_or_default();
15606                        }
15607                        __FieldTag::__timeout => {
15608                            if !fields.insert(__FieldTag::__timeout) {
15609                                return std::result::Result::Err(A::Error::duplicate_field(
15610                                    "multiple values for timeout",
15611                                ));
15612                            }
15613                            result.timeout =
15614                                map.next_value::<std::option::Option<wkt::Duration>>()?;
15615                        }
15616                        __FieldTag::__service_account => {
15617                            if !fields.insert(__FieldTag::__service_account) {
15618                                return std::result::Result::Err(A::Error::duplicate_field(
15619                                    "multiple values for service_account",
15620                                ));
15621                            }
15622                            result.service_account = map
15623                                .next_value::<std::option::Option<std::string::String>>()?
15624                                .unwrap_or_default();
15625                        }
15626                        __FieldTag::__containers => {
15627                            if !fields.insert(__FieldTag::__containers) {
15628                                return std::result::Result::Err(A::Error::duplicate_field(
15629                                    "multiple values for containers",
15630                                ));
15631                            }
15632                            result.containers = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Container>>>()?.unwrap_or_default();
15633                        }
15634                        __FieldTag::__volumes => {
15635                            if !fields.insert(__FieldTag::__volumes) {
15636                                return std::result::Result::Err(A::Error::duplicate_field(
15637                                    "multiple values for volumes",
15638                                ));
15639                            }
15640                            result.volumes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Volume>>>()?.unwrap_or_default();
15641                        }
15642                        __FieldTag::__execution_environment => {
15643                            if !fields.insert(__FieldTag::__execution_environment) {
15644                                return std::result::Result::Err(A::Error::duplicate_field(
15645                                    "multiple values for execution_environment",
15646                                ));
15647                            }
15648                            result.execution_environment = map.next_value::<std::option::Option<crate::model::ExecutionEnvironment>>()?.unwrap_or_default();
15649                        }
15650                        __FieldTag::__encryption_key => {
15651                            if !fields.insert(__FieldTag::__encryption_key) {
15652                                return std::result::Result::Err(A::Error::duplicate_field(
15653                                    "multiple values for encryption_key",
15654                                ));
15655                            }
15656                            result.encryption_key = map
15657                                .next_value::<std::option::Option<std::string::String>>()?
15658                                .unwrap_or_default();
15659                        }
15660                        __FieldTag::__service_mesh => {
15661                            if !fields.insert(__FieldTag::__service_mesh) {
15662                                return std::result::Result::Err(A::Error::duplicate_field(
15663                                    "multiple values for service_mesh",
15664                                ));
15665                            }
15666                            result.service_mesh =
15667                                map.next_value::<std::option::Option<crate::model::ServiceMesh>>()?;
15668                        }
15669                        __FieldTag::__encryption_key_revocation_action => {
15670                            if !fields.insert(__FieldTag::__encryption_key_revocation_action) {
15671                                return std::result::Result::Err(A::Error::duplicate_field(
15672                                    "multiple values for encryption_key_revocation_action",
15673                                ));
15674                            }
15675                            result.encryption_key_revocation_action =
15676                                map.next_value::<std::option::Option<
15677                                    crate::model::EncryptionKeyRevocationAction,
15678                                >>()?
15679                                .unwrap_or_default();
15680                        }
15681                        __FieldTag::__encryption_key_shutdown_duration => {
15682                            if !fields.insert(__FieldTag::__encryption_key_shutdown_duration) {
15683                                return std::result::Result::Err(A::Error::duplicate_field(
15684                                    "multiple values for encryption_key_shutdown_duration",
15685                                ));
15686                            }
15687                            result.encryption_key_shutdown_duration =
15688                                map.next_value::<std::option::Option<wkt::Duration>>()?;
15689                        }
15690                        __FieldTag::__reconciling => {
15691                            if !fields.insert(__FieldTag::__reconciling) {
15692                                return std::result::Result::Err(A::Error::duplicate_field(
15693                                    "multiple values for reconciling",
15694                                ));
15695                            }
15696                            result.reconciling = map
15697                                .next_value::<std::option::Option<bool>>()?
15698                                .unwrap_or_default();
15699                        }
15700                        __FieldTag::__conditions => {
15701                            if !fields.insert(__FieldTag::__conditions) {
15702                                return std::result::Result::Err(A::Error::duplicate_field(
15703                                    "multiple values for conditions",
15704                                ));
15705                            }
15706                            result.conditions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Condition>>>()?.unwrap_or_default();
15707                        }
15708                        __FieldTag::__observed_generation => {
15709                            if !fields.insert(__FieldTag::__observed_generation) {
15710                                return std::result::Result::Err(A::Error::duplicate_field(
15711                                    "multiple values for observed_generation",
15712                                ));
15713                            }
15714                            struct __With(std::option::Option<i64>);
15715                            impl<'de> serde::de::Deserialize<'de> for __With {
15716                                fn deserialize<D>(
15717                                    deserializer: D,
15718                                ) -> std::result::Result<Self, D::Error>
15719                                where
15720                                    D: serde::de::Deserializer<'de>,
15721                                {
15722                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
15723                                }
15724                            }
15725                            result.observed_generation =
15726                                map.next_value::<__With>()?.0.unwrap_or_default();
15727                        }
15728                        __FieldTag::__log_uri => {
15729                            if !fields.insert(__FieldTag::__log_uri) {
15730                                return std::result::Result::Err(A::Error::duplicate_field(
15731                                    "multiple values for log_uri",
15732                                ));
15733                            }
15734                            result.log_uri = map
15735                                .next_value::<std::option::Option<std::string::String>>()?
15736                                .unwrap_or_default();
15737                        }
15738                        __FieldTag::__satisfies_pzs => {
15739                            if !fields.insert(__FieldTag::__satisfies_pzs) {
15740                                return std::result::Result::Err(A::Error::duplicate_field(
15741                                    "multiple values for satisfies_pzs",
15742                                ));
15743                            }
15744                            result.satisfies_pzs = map
15745                                .next_value::<std::option::Option<bool>>()?
15746                                .unwrap_or_default();
15747                        }
15748                        __FieldTag::__session_affinity => {
15749                            if !fields.insert(__FieldTag::__session_affinity) {
15750                                return std::result::Result::Err(A::Error::duplicate_field(
15751                                    "multiple values for session_affinity",
15752                                ));
15753                            }
15754                            result.session_affinity = map
15755                                .next_value::<std::option::Option<bool>>()?
15756                                .unwrap_or_default();
15757                        }
15758                        __FieldTag::__scaling_status => {
15759                            if !fields.insert(__FieldTag::__scaling_status) {
15760                                return std::result::Result::Err(A::Error::duplicate_field(
15761                                    "multiple values for scaling_status",
15762                                ));
15763                            }
15764                            result.scaling_status = map.next_value::<std::option::Option<crate::model::RevisionScalingStatus>>()?
15765                                ;
15766                        }
15767                        __FieldTag::__node_selector => {
15768                            if !fields.insert(__FieldTag::__node_selector) {
15769                                return std::result::Result::Err(A::Error::duplicate_field(
15770                                    "multiple values for node_selector",
15771                                ));
15772                            }
15773                            result.node_selector = map
15774                                .next_value::<std::option::Option<crate::model::NodeSelector>>()?;
15775                        }
15776                        __FieldTag::__gpu_zonal_redundancy_disabled => {
15777                            if !fields.insert(__FieldTag::__gpu_zonal_redundancy_disabled) {
15778                                return std::result::Result::Err(A::Error::duplicate_field(
15779                                    "multiple values for gpu_zonal_redundancy_disabled",
15780                                ));
15781                            }
15782                            result.gpu_zonal_redundancy_disabled =
15783                                map.next_value::<std::option::Option<bool>>()?;
15784                        }
15785                        __FieldTag::__creator => {
15786                            if !fields.insert(__FieldTag::__creator) {
15787                                return std::result::Result::Err(A::Error::duplicate_field(
15788                                    "multiple values for creator",
15789                                ));
15790                            }
15791                            result.creator = map
15792                                .next_value::<std::option::Option<std::string::String>>()?
15793                                .unwrap_or_default();
15794                        }
15795                        __FieldTag::__etag => {
15796                            if !fields.insert(__FieldTag::__etag) {
15797                                return std::result::Result::Err(A::Error::duplicate_field(
15798                                    "multiple values for etag",
15799                                ));
15800                            }
15801                            result.etag = map
15802                                .next_value::<std::option::Option<std::string::String>>()?
15803                                .unwrap_or_default();
15804                        }
15805                        __FieldTag::Unknown(key) => {
15806                            let value = map.next_value::<serde_json::Value>()?;
15807                            result._unknown_fields.insert(key, value);
15808                        }
15809                    }
15810                }
15811                std::result::Result::Ok(result)
15812            }
15813        }
15814        deserializer.deserialize_any(Visitor)
15815    }
15816}
15817
15818#[doc(hidden)]
15819impl serde::ser::Serialize for Revision {
15820    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15821    where
15822        S: serde::ser::Serializer,
15823    {
15824        use serde::ser::SerializeMap;
15825        #[allow(unused_imports)]
15826        use std::option::Option::Some;
15827        let mut state = serializer.serialize_map(std::option::Option::None)?;
15828        if !self.name.is_empty() {
15829            state.serialize_entry("name", &self.name)?;
15830        }
15831        if !self.uid.is_empty() {
15832            state.serialize_entry("uid", &self.uid)?;
15833        }
15834        if !wkt::internal::is_default(&self.generation) {
15835            struct __With<'a>(&'a i64);
15836            impl<'a> serde::ser::Serialize for __With<'a> {
15837                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15838                where
15839                    S: serde::ser::Serializer,
15840                {
15841                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
15842                }
15843            }
15844            state.serialize_entry("generation", &__With(&self.generation))?;
15845        }
15846        if !self.labels.is_empty() {
15847            state.serialize_entry("labels", &self.labels)?;
15848        }
15849        if !self.annotations.is_empty() {
15850            state.serialize_entry("annotations", &self.annotations)?;
15851        }
15852        if self.create_time.is_some() {
15853            state.serialize_entry("createTime", &self.create_time)?;
15854        }
15855        if self.update_time.is_some() {
15856            state.serialize_entry("updateTime", &self.update_time)?;
15857        }
15858        if self.delete_time.is_some() {
15859            state.serialize_entry("deleteTime", &self.delete_time)?;
15860        }
15861        if self.expire_time.is_some() {
15862            state.serialize_entry("expireTime", &self.expire_time)?;
15863        }
15864        if !wkt::internal::is_default(&self.launch_stage) {
15865            state.serialize_entry("launchStage", &self.launch_stage)?;
15866        }
15867        if !self.service.is_empty() {
15868            state.serialize_entry("service", &self.service)?;
15869        }
15870        if self.scaling.is_some() {
15871            state.serialize_entry("scaling", &self.scaling)?;
15872        }
15873        if self.vpc_access.is_some() {
15874            state.serialize_entry("vpcAccess", &self.vpc_access)?;
15875        }
15876        if !wkt::internal::is_default(&self.max_instance_request_concurrency) {
15877            struct __With<'a>(&'a i32);
15878            impl<'a> serde::ser::Serialize for __With<'a> {
15879                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15880                where
15881                    S: serde::ser::Serializer,
15882                {
15883                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
15884                }
15885            }
15886            state.serialize_entry(
15887                "maxInstanceRequestConcurrency",
15888                &__With(&self.max_instance_request_concurrency),
15889            )?;
15890        }
15891        if self.timeout.is_some() {
15892            state.serialize_entry("timeout", &self.timeout)?;
15893        }
15894        if !self.service_account.is_empty() {
15895            state.serialize_entry("serviceAccount", &self.service_account)?;
15896        }
15897        if !self.containers.is_empty() {
15898            state.serialize_entry("containers", &self.containers)?;
15899        }
15900        if !self.volumes.is_empty() {
15901            state.serialize_entry("volumes", &self.volumes)?;
15902        }
15903        if !wkt::internal::is_default(&self.execution_environment) {
15904            state.serialize_entry("executionEnvironment", &self.execution_environment)?;
15905        }
15906        if !self.encryption_key.is_empty() {
15907            state.serialize_entry("encryptionKey", &self.encryption_key)?;
15908        }
15909        if self.service_mesh.is_some() {
15910            state.serialize_entry("serviceMesh", &self.service_mesh)?;
15911        }
15912        if !wkt::internal::is_default(&self.encryption_key_revocation_action) {
15913            state.serialize_entry(
15914                "encryptionKeyRevocationAction",
15915                &self.encryption_key_revocation_action,
15916            )?;
15917        }
15918        if self.encryption_key_shutdown_duration.is_some() {
15919            state.serialize_entry(
15920                "encryptionKeyShutdownDuration",
15921                &self.encryption_key_shutdown_duration,
15922            )?;
15923        }
15924        if !wkt::internal::is_default(&self.reconciling) {
15925            state.serialize_entry("reconciling", &self.reconciling)?;
15926        }
15927        if !self.conditions.is_empty() {
15928            state.serialize_entry("conditions", &self.conditions)?;
15929        }
15930        if !wkt::internal::is_default(&self.observed_generation) {
15931            struct __With<'a>(&'a i64);
15932            impl<'a> serde::ser::Serialize for __With<'a> {
15933                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15934                where
15935                    S: serde::ser::Serializer,
15936                {
15937                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
15938                }
15939            }
15940            state.serialize_entry("observedGeneration", &__With(&self.observed_generation))?;
15941        }
15942        if !self.log_uri.is_empty() {
15943            state.serialize_entry("logUri", &self.log_uri)?;
15944        }
15945        if !wkt::internal::is_default(&self.satisfies_pzs) {
15946            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
15947        }
15948        if !wkt::internal::is_default(&self.session_affinity) {
15949            state.serialize_entry("sessionAffinity", &self.session_affinity)?;
15950        }
15951        if self.scaling_status.is_some() {
15952            state.serialize_entry("scalingStatus", &self.scaling_status)?;
15953        }
15954        if self.node_selector.is_some() {
15955            state.serialize_entry("nodeSelector", &self.node_selector)?;
15956        }
15957        if self.gpu_zonal_redundancy_disabled.is_some() {
15958            state.serialize_entry(
15959                "gpuZonalRedundancyDisabled",
15960                &self.gpu_zonal_redundancy_disabled,
15961            )?;
15962        }
15963        if !self.creator.is_empty() {
15964            state.serialize_entry("creator", &self.creator)?;
15965        }
15966        if !self.etag.is_empty() {
15967            state.serialize_entry("etag", &self.etag)?;
15968        }
15969        if !self._unknown_fields.is_empty() {
15970            for (key, value) in self._unknown_fields.iter() {
15971                state.serialize_entry(key, &value)?;
15972            }
15973        }
15974        state.end()
15975    }
15976}
15977
15978impl std::fmt::Debug for Revision {
15979    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15980        let mut debug_struct = f.debug_struct("Revision");
15981        debug_struct.field("name", &self.name);
15982        debug_struct.field("uid", &self.uid);
15983        debug_struct.field("generation", &self.generation);
15984        debug_struct.field("labels", &self.labels);
15985        debug_struct.field("annotations", &self.annotations);
15986        debug_struct.field("create_time", &self.create_time);
15987        debug_struct.field("update_time", &self.update_time);
15988        debug_struct.field("delete_time", &self.delete_time);
15989        debug_struct.field("expire_time", &self.expire_time);
15990        debug_struct.field("launch_stage", &self.launch_stage);
15991        debug_struct.field("service", &self.service);
15992        debug_struct.field("scaling", &self.scaling);
15993        debug_struct.field("vpc_access", &self.vpc_access);
15994        debug_struct.field(
15995            "max_instance_request_concurrency",
15996            &self.max_instance_request_concurrency,
15997        );
15998        debug_struct.field("timeout", &self.timeout);
15999        debug_struct.field("service_account", &self.service_account);
16000        debug_struct.field("containers", &self.containers);
16001        debug_struct.field("volumes", &self.volumes);
16002        debug_struct.field("execution_environment", &self.execution_environment);
16003        debug_struct.field("encryption_key", &self.encryption_key);
16004        debug_struct.field("service_mesh", &self.service_mesh);
16005        debug_struct.field(
16006            "encryption_key_revocation_action",
16007            &self.encryption_key_revocation_action,
16008        );
16009        debug_struct.field(
16010            "encryption_key_shutdown_duration",
16011            &self.encryption_key_shutdown_duration,
16012        );
16013        debug_struct.field("reconciling", &self.reconciling);
16014        debug_struct.field("conditions", &self.conditions);
16015        debug_struct.field("observed_generation", &self.observed_generation);
16016        debug_struct.field("log_uri", &self.log_uri);
16017        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
16018        debug_struct.field("session_affinity", &self.session_affinity);
16019        debug_struct.field("scaling_status", &self.scaling_status);
16020        debug_struct.field("node_selector", &self.node_selector);
16021        debug_struct.field(
16022            "gpu_zonal_redundancy_disabled",
16023            &self.gpu_zonal_redundancy_disabled,
16024        );
16025        debug_struct.field("creator", &self.creator);
16026        debug_struct.field("etag", &self.etag);
16027        if !self._unknown_fields.is_empty() {
16028            debug_struct.field("_unknown_fields", &self._unknown_fields);
16029        }
16030        debug_struct.finish()
16031    }
16032}
16033
16034/// RevisionTemplate describes the data a revision should have when created from
16035/// a template.
16036#[derive(Clone, Default, PartialEq)]
16037#[non_exhaustive]
16038pub struct RevisionTemplate {
16039    /// Optional. The unique name for the revision. If this field is omitted, it
16040    /// will be automatically generated based on the Service name.
16041    pub revision: std::string::String,
16042
16043    /// Optional. Unstructured key value map that can be used to organize and
16044    /// categorize objects. User-provided labels are shared with Google's billing
16045    /// system, so they can be used to filter, or break down billing charges by
16046    /// team, component, environment, state, etc. For more information, visit
16047    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
16048    /// <https://cloud.google.com/run/docs/configuring/labels>.
16049    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16050
16051    /// Optional. Unstructured key value map that may be set by external tools to
16052    /// store and arbitrary metadata. They are not queryable and should be
16053    /// preserved when modifying objects.
16054    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
16055
16056    /// Optional. Scaling settings for this Revision.
16057    pub scaling: std::option::Option<crate::model::RevisionScaling>,
16058
16059    /// Optional. VPC Access configuration to use for this Revision. For more
16060    /// information, visit
16061    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
16062    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
16063
16064    /// Optional. Max allowed time for an instance to respond to a request.
16065    pub timeout: std::option::Option<wkt::Duration>,
16066
16067    /// Optional. Email address of the IAM service account associated with the
16068    /// revision of the service. The service account represents the identity of the
16069    /// running revision, and determines what permissions the revision has. If not
16070    /// provided, the revision will use the project's default service account.
16071    pub service_account: std::string::String,
16072
16073    /// Holds the single container that defines the unit of execution for this
16074    /// Revision.
16075    pub containers: std::vec::Vec<crate::model::Container>,
16076
16077    /// Optional. A list of Volumes to make available to containers.
16078    pub volumes: std::vec::Vec<crate::model::Volume>,
16079
16080    /// Optional. The sandbox environment to host this Revision.
16081    pub execution_environment: crate::model::ExecutionEnvironment,
16082
16083    /// A reference to a customer managed encryption key (CMEK) to use to encrypt
16084    /// this container image. For more information, go to
16085    /// <https://cloud.google.com/run/docs/securing/using-cmek>
16086    pub encryption_key: std::string::String,
16087
16088    /// Optional. Sets the maximum number of requests that each serving instance
16089    /// can receive. If not specified or 0, concurrency defaults to 80 when
16090    /// requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`.
16091    pub max_instance_request_concurrency: i32,
16092
16093    /// Optional. Enables service mesh connectivity.
16094    pub service_mesh: std::option::Option<crate::model::ServiceMesh>,
16095
16096    /// Optional. The action to take if the encryption key is revoked.
16097    pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
16098
16099    /// Optional. If encryption_key_revocation_action is SHUTDOWN, the duration
16100    /// before shutting down all instances. The minimum increment is 1 hour.
16101    pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
16102
16103    /// Optional. Enable session affinity.
16104    pub session_affinity: bool,
16105
16106    /// Optional. Disables health checking containers during deployment.
16107    pub health_check_disabled: bool,
16108
16109    /// Optional. The node selector for the revision template.
16110    pub node_selector: std::option::Option<crate::model::NodeSelector>,
16111
16112    /// Optional. True if GPU zonal redundancy is disabled on this revision.
16113    pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
16114
16115    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16116}
16117
16118impl RevisionTemplate {
16119    pub fn new() -> Self {
16120        std::default::Default::default()
16121    }
16122
16123    /// Sets the value of [revision][crate::model::RevisionTemplate::revision].
16124    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16125        self.revision = v.into();
16126        self
16127    }
16128
16129    /// Sets the value of [labels][crate::model::RevisionTemplate::labels].
16130    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16131    where
16132        T: std::iter::IntoIterator<Item = (K, V)>,
16133        K: std::convert::Into<std::string::String>,
16134        V: std::convert::Into<std::string::String>,
16135    {
16136        use std::iter::Iterator;
16137        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16138        self
16139    }
16140
16141    /// Sets the value of [annotations][crate::model::RevisionTemplate::annotations].
16142    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
16143    where
16144        T: std::iter::IntoIterator<Item = (K, V)>,
16145        K: std::convert::Into<std::string::String>,
16146        V: std::convert::Into<std::string::String>,
16147    {
16148        use std::iter::Iterator;
16149        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16150        self
16151    }
16152
16153    /// Sets the value of [scaling][crate::model::RevisionTemplate::scaling].
16154    pub fn set_scaling<T>(mut self, v: T) -> Self
16155    where
16156        T: std::convert::Into<crate::model::RevisionScaling>,
16157    {
16158        self.scaling = std::option::Option::Some(v.into());
16159        self
16160    }
16161
16162    /// Sets or clears the value of [scaling][crate::model::RevisionTemplate::scaling].
16163    pub fn set_or_clear_scaling<T>(mut self, v: std::option::Option<T>) -> Self
16164    where
16165        T: std::convert::Into<crate::model::RevisionScaling>,
16166    {
16167        self.scaling = v.map(|x| x.into());
16168        self
16169    }
16170
16171    /// Sets the value of [vpc_access][crate::model::RevisionTemplate::vpc_access].
16172    pub fn set_vpc_access<T>(mut self, v: T) -> Self
16173    where
16174        T: std::convert::Into<crate::model::VpcAccess>,
16175    {
16176        self.vpc_access = std::option::Option::Some(v.into());
16177        self
16178    }
16179
16180    /// Sets or clears the value of [vpc_access][crate::model::RevisionTemplate::vpc_access].
16181    pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
16182    where
16183        T: std::convert::Into<crate::model::VpcAccess>,
16184    {
16185        self.vpc_access = v.map(|x| x.into());
16186        self
16187    }
16188
16189    /// Sets the value of [timeout][crate::model::RevisionTemplate::timeout].
16190    pub fn set_timeout<T>(mut self, v: T) -> Self
16191    where
16192        T: std::convert::Into<wkt::Duration>,
16193    {
16194        self.timeout = std::option::Option::Some(v.into());
16195        self
16196    }
16197
16198    /// Sets or clears the value of [timeout][crate::model::RevisionTemplate::timeout].
16199    pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
16200    where
16201        T: std::convert::Into<wkt::Duration>,
16202    {
16203        self.timeout = v.map(|x| x.into());
16204        self
16205    }
16206
16207    /// Sets the value of [service_account][crate::model::RevisionTemplate::service_account].
16208    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16209        self.service_account = v.into();
16210        self
16211    }
16212
16213    /// Sets the value of [containers][crate::model::RevisionTemplate::containers].
16214    pub fn set_containers<T, V>(mut self, v: T) -> Self
16215    where
16216        T: std::iter::IntoIterator<Item = V>,
16217        V: std::convert::Into<crate::model::Container>,
16218    {
16219        use std::iter::Iterator;
16220        self.containers = v.into_iter().map(|i| i.into()).collect();
16221        self
16222    }
16223
16224    /// Sets the value of [volumes][crate::model::RevisionTemplate::volumes].
16225    pub fn set_volumes<T, V>(mut self, v: T) -> Self
16226    where
16227        T: std::iter::IntoIterator<Item = V>,
16228        V: std::convert::Into<crate::model::Volume>,
16229    {
16230        use std::iter::Iterator;
16231        self.volumes = v.into_iter().map(|i| i.into()).collect();
16232        self
16233    }
16234
16235    /// Sets the value of [execution_environment][crate::model::RevisionTemplate::execution_environment].
16236    pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
16237        mut self,
16238        v: T,
16239    ) -> Self {
16240        self.execution_environment = v.into();
16241        self
16242    }
16243
16244    /// Sets the value of [encryption_key][crate::model::RevisionTemplate::encryption_key].
16245    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16246        self.encryption_key = v.into();
16247        self
16248    }
16249
16250    /// Sets the value of [max_instance_request_concurrency][crate::model::RevisionTemplate::max_instance_request_concurrency].
16251    pub fn set_max_instance_request_concurrency<T: std::convert::Into<i32>>(
16252        mut self,
16253        v: T,
16254    ) -> Self {
16255        self.max_instance_request_concurrency = v.into();
16256        self
16257    }
16258
16259    /// Sets the value of [service_mesh][crate::model::RevisionTemplate::service_mesh].
16260    pub fn set_service_mesh<T>(mut self, v: T) -> Self
16261    where
16262        T: std::convert::Into<crate::model::ServiceMesh>,
16263    {
16264        self.service_mesh = std::option::Option::Some(v.into());
16265        self
16266    }
16267
16268    /// Sets or clears the value of [service_mesh][crate::model::RevisionTemplate::service_mesh].
16269    pub fn set_or_clear_service_mesh<T>(mut self, v: std::option::Option<T>) -> Self
16270    where
16271        T: std::convert::Into<crate::model::ServiceMesh>,
16272    {
16273        self.service_mesh = v.map(|x| x.into());
16274        self
16275    }
16276
16277    /// Sets the value of [encryption_key_revocation_action][crate::model::RevisionTemplate::encryption_key_revocation_action].
16278    pub fn set_encryption_key_revocation_action<
16279        T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
16280    >(
16281        mut self,
16282        v: T,
16283    ) -> Self {
16284        self.encryption_key_revocation_action = v.into();
16285        self
16286    }
16287
16288    /// Sets the value of [encryption_key_shutdown_duration][crate::model::RevisionTemplate::encryption_key_shutdown_duration].
16289    pub fn set_encryption_key_shutdown_duration<T>(mut self, v: T) -> Self
16290    where
16291        T: std::convert::Into<wkt::Duration>,
16292    {
16293        self.encryption_key_shutdown_duration = std::option::Option::Some(v.into());
16294        self
16295    }
16296
16297    /// Sets or clears the value of [encryption_key_shutdown_duration][crate::model::RevisionTemplate::encryption_key_shutdown_duration].
16298    pub fn set_or_clear_encryption_key_shutdown_duration<T>(
16299        mut self,
16300        v: std::option::Option<T>,
16301    ) -> Self
16302    where
16303        T: std::convert::Into<wkt::Duration>,
16304    {
16305        self.encryption_key_shutdown_duration = v.map(|x| x.into());
16306        self
16307    }
16308
16309    /// Sets the value of [session_affinity][crate::model::RevisionTemplate::session_affinity].
16310    pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16311        self.session_affinity = v.into();
16312        self
16313    }
16314
16315    /// Sets the value of [health_check_disabled][crate::model::RevisionTemplate::health_check_disabled].
16316    pub fn set_health_check_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16317        self.health_check_disabled = v.into();
16318        self
16319    }
16320
16321    /// Sets the value of [node_selector][crate::model::RevisionTemplate::node_selector].
16322    pub fn set_node_selector<T>(mut self, v: T) -> Self
16323    where
16324        T: std::convert::Into<crate::model::NodeSelector>,
16325    {
16326        self.node_selector = std::option::Option::Some(v.into());
16327        self
16328    }
16329
16330    /// Sets or clears the value of [node_selector][crate::model::RevisionTemplate::node_selector].
16331    pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
16332    where
16333        T: std::convert::Into<crate::model::NodeSelector>,
16334    {
16335        self.node_selector = v.map(|x| x.into());
16336        self
16337    }
16338
16339    /// Sets the value of [gpu_zonal_redundancy_disabled][crate::model::RevisionTemplate::gpu_zonal_redundancy_disabled].
16340    pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
16341    where
16342        T: std::convert::Into<bool>,
16343    {
16344        self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
16345        self
16346    }
16347
16348    /// Sets or clears the value of [gpu_zonal_redundancy_disabled][crate::model::RevisionTemplate::gpu_zonal_redundancy_disabled].
16349    pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
16350        mut self,
16351        v: std::option::Option<T>,
16352    ) -> Self
16353    where
16354        T: std::convert::Into<bool>,
16355    {
16356        self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
16357        self
16358    }
16359}
16360
16361impl wkt::message::Message for RevisionTemplate {
16362    fn typename() -> &'static str {
16363        "type.googleapis.com/google.cloud.run.v2.RevisionTemplate"
16364    }
16365}
16366
16367#[doc(hidden)]
16368impl<'de> serde::de::Deserialize<'de> for RevisionTemplate {
16369    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16370    where
16371        D: serde::Deserializer<'de>,
16372    {
16373        #[allow(non_camel_case_types)]
16374        #[doc(hidden)]
16375        #[derive(PartialEq, Eq, Hash)]
16376        enum __FieldTag {
16377            __revision,
16378            __labels,
16379            __annotations,
16380            __scaling,
16381            __vpc_access,
16382            __timeout,
16383            __service_account,
16384            __containers,
16385            __volumes,
16386            __execution_environment,
16387            __encryption_key,
16388            __max_instance_request_concurrency,
16389            __service_mesh,
16390            __encryption_key_revocation_action,
16391            __encryption_key_shutdown_duration,
16392            __session_affinity,
16393            __health_check_disabled,
16394            __node_selector,
16395            __gpu_zonal_redundancy_disabled,
16396            Unknown(std::string::String),
16397        }
16398        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16399            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16400            where
16401                D: serde::Deserializer<'de>,
16402            {
16403                struct Visitor;
16404                impl<'de> serde::de::Visitor<'de> for Visitor {
16405                    type Value = __FieldTag;
16406                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16407                        formatter.write_str("a field name for RevisionTemplate")
16408                    }
16409                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16410                    where
16411                        E: serde::de::Error,
16412                    {
16413                        use std::result::Result::Ok;
16414                        use std::string::ToString;
16415                        match value {
16416                            "revision" => Ok(__FieldTag::__revision),
16417                            "labels" => Ok(__FieldTag::__labels),
16418                            "annotations" => Ok(__FieldTag::__annotations),
16419                            "scaling" => Ok(__FieldTag::__scaling),
16420                            "vpcAccess" => Ok(__FieldTag::__vpc_access),
16421                            "vpc_access" => Ok(__FieldTag::__vpc_access),
16422                            "timeout" => Ok(__FieldTag::__timeout),
16423                            "serviceAccount" => Ok(__FieldTag::__service_account),
16424                            "service_account" => Ok(__FieldTag::__service_account),
16425                            "containers" => Ok(__FieldTag::__containers),
16426                            "volumes" => Ok(__FieldTag::__volumes),
16427                            "executionEnvironment" => Ok(__FieldTag::__execution_environment),
16428                            "execution_environment" => Ok(__FieldTag::__execution_environment),
16429                            "encryptionKey" => Ok(__FieldTag::__encryption_key),
16430                            "encryption_key" => Ok(__FieldTag::__encryption_key),
16431                            "maxInstanceRequestConcurrency" => {
16432                                Ok(__FieldTag::__max_instance_request_concurrency)
16433                            }
16434                            "max_instance_request_concurrency" => {
16435                                Ok(__FieldTag::__max_instance_request_concurrency)
16436                            }
16437                            "serviceMesh" => Ok(__FieldTag::__service_mesh),
16438                            "service_mesh" => Ok(__FieldTag::__service_mesh),
16439                            "encryptionKeyRevocationAction" => {
16440                                Ok(__FieldTag::__encryption_key_revocation_action)
16441                            }
16442                            "encryption_key_revocation_action" => {
16443                                Ok(__FieldTag::__encryption_key_revocation_action)
16444                            }
16445                            "encryptionKeyShutdownDuration" => {
16446                                Ok(__FieldTag::__encryption_key_shutdown_duration)
16447                            }
16448                            "encryption_key_shutdown_duration" => {
16449                                Ok(__FieldTag::__encryption_key_shutdown_duration)
16450                            }
16451                            "sessionAffinity" => Ok(__FieldTag::__session_affinity),
16452                            "session_affinity" => Ok(__FieldTag::__session_affinity),
16453                            "healthCheckDisabled" => Ok(__FieldTag::__health_check_disabled),
16454                            "health_check_disabled" => Ok(__FieldTag::__health_check_disabled),
16455                            "nodeSelector" => Ok(__FieldTag::__node_selector),
16456                            "node_selector" => Ok(__FieldTag::__node_selector),
16457                            "gpuZonalRedundancyDisabled" => {
16458                                Ok(__FieldTag::__gpu_zonal_redundancy_disabled)
16459                            }
16460                            "gpu_zonal_redundancy_disabled" => {
16461                                Ok(__FieldTag::__gpu_zonal_redundancy_disabled)
16462                            }
16463                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16464                        }
16465                    }
16466                }
16467                deserializer.deserialize_identifier(Visitor)
16468            }
16469        }
16470        struct Visitor;
16471        impl<'de> serde::de::Visitor<'de> for Visitor {
16472            type Value = RevisionTemplate;
16473            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16474                formatter.write_str("struct RevisionTemplate")
16475            }
16476            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16477            where
16478                A: serde::de::MapAccess<'de>,
16479            {
16480                #[allow(unused_imports)]
16481                use serde::de::Error;
16482                use std::option::Option::Some;
16483                let mut fields = std::collections::HashSet::new();
16484                let mut result = Self::Value::new();
16485                while let Some(tag) = map.next_key::<__FieldTag>()? {
16486                    #[allow(clippy::match_single_binding)]
16487                    match tag {
16488                        __FieldTag::__revision => {
16489                            if !fields.insert(__FieldTag::__revision) {
16490                                return std::result::Result::Err(A::Error::duplicate_field(
16491                                    "multiple values for revision",
16492                                ));
16493                            }
16494                            result.revision = map
16495                                .next_value::<std::option::Option<std::string::String>>()?
16496                                .unwrap_or_default();
16497                        }
16498                        __FieldTag::__labels => {
16499                            if !fields.insert(__FieldTag::__labels) {
16500                                return std::result::Result::Err(A::Error::duplicate_field(
16501                                    "multiple values for labels",
16502                                ));
16503                            }
16504                            result.labels = map
16505                                .next_value::<std::option::Option<
16506                                    std::collections::HashMap<
16507                                        std::string::String,
16508                                        std::string::String,
16509                                    >,
16510                                >>()?
16511                                .unwrap_or_default();
16512                        }
16513                        __FieldTag::__annotations => {
16514                            if !fields.insert(__FieldTag::__annotations) {
16515                                return std::result::Result::Err(A::Error::duplicate_field(
16516                                    "multiple values for annotations",
16517                                ));
16518                            }
16519                            result.annotations = map
16520                                .next_value::<std::option::Option<
16521                                    std::collections::HashMap<
16522                                        std::string::String,
16523                                        std::string::String,
16524                                    >,
16525                                >>()?
16526                                .unwrap_or_default();
16527                        }
16528                        __FieldTag::__scaling => {
16529                            if !fields.insert(__FieldTag::__scaling) {
16530                                return std::result::Result::Err(A::Error::duplicate_field(
16531                                    "multiple values for scaling",
16532                                ));
16533                            }
16534                            result.scaling = map
16535                                .next_value::<std::option::Option<crate::model::RevisionScaling>>(
16536                                )?;
16537                        }
16538                        __FieldTag::__vpc_access => {
16539                            if !fields.insert(__FieldTag::__vpc_access) {
16540                                return std::result::Result::Err(A::Error::duplicate_field(
16541                                    "multiple values for vpc_access",
16542                                ));
16543                            }
16544                            result.vpc_access =
16545                                map.next_value::<std::option::Option<crate::model::VpcAccess>>()?;
16546                        }
16547                        __FieldTag::__timeout => {
16548                            if !fields.insert(__FieldTag::__timeout) {
16549                                return std::result::Result::Err(A::Error::duplicate_field(
16550                                    "multiple values for timeout",
16551                                ));
16552                            }
16553                            result.timeout =
16554                                map.next_value::<std::option::Option<wkt::Duration>>()?;
16555                        }
16556                        __FieldTag::__service_account => {
16557                            if !fields.insert(__FieldTag::__service_account) {
16558                                return std::result::Result::Err(A::Error::duplicate_field(
16559                                    "multiple values for service_account",
16560                                ));
16561                            }
16562                            result.service_account = map
16563                                .next_value::<std::option::Option<std::string::String>>()?
16564                                .unwrap_or_default();
16565                        }
16566                        __FieldTag::__containers => {
16567                            if !fields.insert(__FieldTag::__containers) {
16568                                return std::result::Result::Err(A::Error::duplicate_field(
16569                                    "multiple values for containers",
16570                                ));
16571                            }
16572                            result.containers = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Container>>>()?.unwrap_or_default();
16573                        }
16574                        __FieldTag::__volumes => {
16575                            if !fields.insert(__FieldTag::__volumes) {
16576                                return std::result::Result::Err(A::Error::duplicate_field(
16577                                    "multiple values for volumes",
16578                                ));
16579                            }
16580                            result.volumes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Volume>>>()?.unwrap_or_default();
16581                        }
16582                        __FieldTag::__execution_environment => {
16583                            if !fields.insert(__FieldTag::__execution_environment) {
16584                                return std::result::Result::Err(A::Error::duplicate_field(
16585                                    "multiple values for execution_environment",
16586                                ));
16587                            }
16588                            result.execution_environment = map.next_value::<std::option::Option<crate::model::ExecutionEnvironment>>()?.unwrap_or_default();
16589                        }
16590                        __FieldTag::__encryption_key => {
16591                            if !fields.insert(__FieldTag::__encryption_key) {
16592                                return std::result::Result::Err(A::Error::duplicate_field(
16593                                    "multiple values for encryption_key",
16594                                ));
16595                            }
16596                            result.encryption_key = map
16597                                .next_value::<std::option::Option<std::string::String>>()?
16598                                .unwrap_or_default();
16599                        }
16600                        __FieldTag::__max_instance_request_concurrency => {
16601                            if !fields.insert(__FieldTag::__max_instance_request_concurrency) {
16602                                return std::result::Result::Err(A::Error::duplicate_field(
16603                                    "multiple values for max_instance_request_concurrency",
16604                                ));
16605                            }
16606                            struct __With(std::option::Option<i32>);
16607                            impl<'de> serde::de::Deserialize<'de> for __With {
16608                                fn deserialize<D>(
16609                                    deserializer: D,
16610                                ) -> std::result::Result<Self, D::Error>
16611                                where
16612                                    D: serde::de::Deserializer<'de>,
16613                                {
16614                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
16615                                }
16616                            }
16617                            result.max_instance_request_concurrency =
16618                                map.next_value::<__With>()?.0.unwrap_or_default();
16619                        }
16620                        __FieldTag::__service_mesh => {
16621                            if !fields.insert(__FieldTag::__service_mesh) {
16622                                return std::result::Result::Err(A::Error::duplicate_field(
16623                                    "multiple values for service_mesh",
16624                                ));
16625                            }
16626                            result.service_mesh =
16627                                map.next_value::<std::option::Option<crate::model::ServiceMesh>>()?;
16628                        }
16629                        __FieldTag::__encryption_key_revocation_action => {
16630                            if !fields.insert(__FieldTag::__encryption_key_revocation_action) {
16631                                return std::result::Result::Err(A::Error::duplicate_field(
16632                                    "multiple values for encryption_key_revocation_action",
16633                                ));
16634                            }
16635                            result.encryption_key_revocation_action =
16636                                map.next_value::<std::option::Option<
16637                                    crate::model::EncryptionKeyRevocationAction,
16638                                >>()?
16639                                .unwrap_or_default();
16640                        }
16641                        __FieldTag::__encryption_key_shutdown_duration => {
16642                            if !fields.insert(__FieldTag::__encryption_key_shutdown_duration) {
16643                                return std::result::Result::Err(A::Error::duplicate_field(
16644                                    "multiple values for encryption_key_shutdown_duration",
16645                                ));
16646                            }
16647                            result.encryption_key_shutdown_duration =
16648                                map.next_value::<std::option::Option<wkt::Duration>>()?;
16649                        }
16650                        __FieldTag::__session_affinity => {
16651                            if !fields.insert(__FieldTag::__session_affinity) {
16652                                return std::result::Result::Err(A::Error::duplicate_field(
16653                                    "multiple values for session_affinity",
16654                                ));
16655                            }
16656                            result.session_affinity = map
16657                                .next_value::<std::option::Option<bool>>()?
16658                                .unwrap_or_default();
16659                        }
16660                        __FieldTag::__health_check_disabled => {
16661                            if !fields.insert(__FieldTag::__health_check_disabled) {
16662                                return std::result::Result::Err(A::Error::duplicate_field(
16663                                    "multiple values for health_check_disabled",
16664                                ));
16665                            }
16666                            result.health_check_disabled = map
16667                                .next_value::<std::option::Option<bool>>()?
16668                                .unwrap_or_default();
16669                        }
16670                        __FieldTag::__node_selector => {
16671                            if !fields.insert(__FieldTag::__node_selector) {
16672                                return std::result::Result::Err(A::Error::duplicate_field(
16673                                    "multiple values for node_selector",
16674                                ));
16675                            }
16676                            result.node_selector = map
16677                                .next_value::<std::option::Option<crate::model::NodeSelector>>()?;
16678                        }
16679                        __FieldTag::__gpu_zonal_redundancy_disabled => {
16680                            if !fields.insert(__FieldTag::__gpu_zonal_redundancy_disabled) {
16681                                return std::result::Result::Err(A::Error::duplicate_field(
16682                                    "multiple values for gpu_zonal_redundancy_disabled",
16683                                ));
16684                            }
16685                            result.gpu_zonal_redundancy_disabled =
16686                                map.next_value::<std::option::Option<bool>>()?;
16687                        }
16688                        __FieldTag::Unknown(key) => {
16689                            let value = map.next_value::<serde_json::Value>()?;
16690                            result._unknown_fields.insert(key, value);
16691                        }
16692                    }
16693                }
16694                std::result::Result::Ok(result)
16695            }
16696        }
16697        deserializer.deserialize_any(Visitor)
16698    }
16699}
16700
16701#[doc(hidden)]
16702impl serde::ser::Serialize for RevisionTemplate {
16703    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16704    where
16705        S: serde::ser::Serializer,
16706    {
16707        use serde::ser::SerializeMap;
16708        #[allow(unused_imports)]
16709        use std::option::Option::Some;
16710        let mut state = serializer.serialize_map(std::option::Option::None)?;
16711        if !self.revision.is_empty() {
16712            state.serialize_entry("revision", &self.revision)?;
16713        }
16714        if !self.labels.is_empty() {
16715            state.serialize_entry("labels", &self.labels)?;
16716        }
16717        if !self.annotations.is_empty() {
16718            state.serialize_entry("annotations", &self.annotations)?;
16719        }
16720        if self.scaling.is_some() {
16721            state.serialize_entry("scaling", &self.scaling)?;
16722        }
16723        if self.vpc_access.is_some() {
16724            state.serialize_entry("vpcAccess", &self.vpc_access)?;
16725        }
16726        if self.timeout.is_some() {
16727            state.serialize_entry("timeout", &self.timeout)?;
16728        }
16729        if !self.service_account.is_empty() {
16730            state.serialize_entry("serviceAccount", &self.service_account)?;
16731        }
16732        if !self.containers.is_empty() {
16733            state.serialize_entry("containers", &self.containers)?;
16734        }
16735        if !self.volumes.is_empty() {
16736            state.serialize_entry("volumes", &self.volumes)?;
16737        }
16738        if !wkt::internal::is_default(&self.execution_environment) {
16739            state.serialize_entry("executionEnvironment", &self.execution_environment)?;
16740        }
16741        if !self.encryption_key.is_empty() {
16742            state.serialize_entry("encryptionKey", &self.encryption_key)?;
16743        }
16744        if !wkt::internal::is_default(&self.max_instance_request_concurrency) {
16745            struct __With<'a>(&'a i32);
16746            impl<'a> serde::ser::Serialize for __With<'a> {
16747                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16748                where
16749                    S: serde::ser::Serializer,
16750                {
16751                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
16752                }
16753            }
16754            state.serialize_entry(
16755                "maxInstanceRequestConcurrency",
16756                &__With(&self.max_instance_request_concurrency),
16757            )?;
16758        }
16759        if self.service_mesh.is_some() {
16760            state.serialize_entry("serviceMesh", &self.service_mesh)?;
16761        }
16762        if !wkt::internal::is_default(&self.encryption_key_revocation_action) {
16763            state.serialize_entry(
16764                "encryptionKeyRevocationAction",
16765                &self.encryption_key_revocation_action,
16766            )?;
16767        }
16768        if self.encryption_key_shutdown_duration.is_some() {
16769            state.serialize_entry(
16770                "encryptionKeyShutdownDuration",
16771                &self.encryption_key_shutdown_duration,
16772            )?;
16773        }
16774        if !wkt::internal::is_default(&self.session_affinity) {
16775            state.serialize_entry("sessionAffinity", &self.session_affinity)?;
16776        }
16777        if !wkt::internal::is_default(&self.health_check_disabled) {
16778            state.serialize_entry("healthCheckDisabled", &self.health_check_disabled)?;
16779        }
16780        if self.node_selector.is_some() {
16781            state.serialize_entry("nodeSelector", &self.node_selector)?;
16782        }
16783        if self.gpu_zonal_redundancy_disabled.is_some() {
16784            state.serialize_entry(
16785                "gpuZonalRedundancyDisabled",
16786                &self.gpu_zonal_redundancy_disabled,
16787            )?;
16788        }
16789        if !self._unknown_fields.is_empty() {
16790            for (key, value) in self._unknown_fields.iter() {
16791                state.serialize_entry(key, &value)?;
16792            }
16793        }
16794        state.end()
16795    }
16796}
16797
16798impl std::fmt::Debug for RevisionTemplate {
16799    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16800        let mut debug_struct = f.debug_struct("RevisionTemplate");
16801        debug_struct.field("revision", &self.revision);
16802        debug_struct.field("labels", &self.labels);
16803        debug_struct.field("annotations", &self.annotations);
16804        debug_struct.field("scaling", &self.scaling);
16805        debug_struct.field("vpc_access", &self.vpc_access);
16806        debug_struct.field("timeout", &self.timeout);
16807        debug_struct.field("service_account", &self.service_account);
16808        debug_struct.field("containers", &self.containers);
16809        debug_struct.field("volumes", &self.volumes);
16810        debug_struct.field("execution_environment", &self.execution_environment);
16811        debug_struct.field("encryption_key", &self.encryption_key);
16812        debug_struct.field(
16813            "max_instance_request_concurrency",
16814            &self.max_instance_request_concurrency,
16815        );
16816        debug_struct.field("service_mesh", &self.service_mesh);
16817        debug_struct.field(
16818            "encryption_key_revocation_action",
16819            &self.encryption_key_revocation_action,
16820        );
16821        debug_struct.field(
16822            "encryption_key_shutdown_duration",
16823            &self.encryption_key_shutdown_duration,
16824        );
16825        debug_struct.field("session_affinity", &self.session_affinity);
16826        debug_struct.field("health_check_disabled", &self.health_check_disabled);
16827        debug_struct.field("node_selector", &self.node_selector);
16828        debug_struct.field(
16829            "gpu_zonal_redundancy_disabled",
16830            &self.gpu_zonal_redundancy_disabled,
16831        );
16832        if !self._unknown_fields.is_empty() {
16833            debug_struct.field("_unknown_fields", &self._unknown_fields);
16834        }
16835        debug_struct.finish()
16836    }
16837}
16838
16839/// Request message for creating a Service.
16840#[derive(Clone, Default, PartialEq)]
16841#[non_exhaustive]
16842pub struct CreateServiceRequest {
16843    /// Required. The location and project in which this service should be created.
16844    /// Format: projects/{project}/locations/{location}, where {project} can be
16845    /// project id or number. Only lowercase characters, digits, and hyphens.
16846    pub parent: std::string::String,
16847
16848    /// Required. The Service instance to create.
16849    pub service: std::option::Option<crate::model::Service>,
16850
16851    /// Required. The unique identifier for the Service. It must begin with letter,
16852    /// and cannot end with hyphen; must contain fewer than 50 characters.
16853    /// The name of the service becomes {parent}/services/{service_id}.
16854    pub service_id: std::string::String,
16855
16856    /// Indicates that the request should be validated and default values
16857    /// populated, without persisting the request or creating any resources.
16858    pub validate_only: bool,
16859
16860    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16861}
16862
16863impl CreateServiceRequest {
16864    pub fn new() -> Self {
16865        std::default::Default::default()
16866    }
16867
16868    /// Sets the value of [parent][crate::model::CreateServiceRequest::parent].
16869    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16870        self.parent = v.into();
16871        self
16872    }
16873
16874    /// Sets the value of [service][crate::model::CreateServiceRequest::service].
16875    pub fn set_service<T>(mut self, v: T) -> Self
16876    where
16877        T: std::convert::Into<crate::model::Service>,
16878    {
16879        self.service = std::option::Option::Some(v.into());
16880        self
16881    }
16882
16883    /// Sets or clears the value of [service][crate::model::CreateServiceRequest::service].
16884    pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
16885    where
16886        T: std::convert::Into<crate::model::Service>,
16887    {
16888        self.service = v.map(|x| x.into());
16889        self
16890    }
16891
16892    /// Sets the value of [service_id][crate::model::CreateServiceRequest::service_id].
16893    pub fn set_service_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16894        self.service_id = v.into();
16895        self
16896    }
16897
16898    /// Sets the value of [validate_only][crate::model::CreateServiceRequest::validate_only].
16899    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16900        self.validate_only = v.into();
16901        self
16902    }
16903}
16904
16905impl wkt::message::Message for CreateServiceRequest {
16906    fn typename() -> &'static str {
16907        "type.googleapis.com/google.cloud.run.v2.CreateServiceRequest"
16908    }
16909}
16910
16911#[doc(hidden)]
16912impl<'de> serde::de::Deserialize<'de> for CreateServiceRequest {
16913    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16914    where
16915        D: serde::Deserializer<'de>,
16916    {
16917        #[allow(non_camel_case_types)]
16918        #[doc(hidden)]
16919        #[derive(PartialEq, Eq, Hash)]
16920        enum __FieldTag {
16921            __parent,
16922            __service,
16923            __service_id,
16924            __validate_only,
16925            Unknown(std::string::String),
16926        }
16927        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16928            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16929            where
16930                D: serde::Deserializer<'de>,
16931            {
16932                struct Visitor;
16933                impl<'de> serde::de::Visitor<'de> for Visitor {
16934                    type Value = __FieldTag;
16935                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16936                        formatter.write_str("a field name for CreateServiceRequest")
16937                    }
16938                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16939                    where
16940                        E: serde::de::Error,
16941                    {
16942                        use std::result::Result::Ok;
16943                        use std::string::ToString;
16944                        match value {
16945                            "parent" => Ok(__FieldTag::__parent),
16946                            "service" => Ok(__FieldTag::__service),
16947                            "serviceId" => Ok(__FieldTag::__service_id),
16948                            "service_id" => Ok(__FieldTag::__service_id),
16949                            "validateOnly" => Ok(__FieldTag::__validate_only),
16950                            "validate_only" => Ok(__FieldTag::__validate_only),
16951                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16952                        }
16953                    }
16954                }
16955                deserializer.deserialize_identifier(Visitor)
16956            }
16957        }
16958        struct Visitor;
16959        impl<'de> serde::de::Visitor<'de> for Visitor {
16960            type Value = CreateServiceRequest;
16961            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16962                formatter.write_str("struct CreateServiceRequest")
16963            }
16964            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16965            where
16966                A: serde::de::MapAccess<'de>,
16967            {
16968                #[allow(unused_imports)]
16969                use serde::de::Error;
16970                use std::option::Option::Some;
16971                let mut fields = std::collections::HashSet::new();
16972                let mut result = Self::Value::new();
16973                while let Some(tag) = map.next_key::<__FieldTag>()? {
16974                    #[allow(clippy::match_single_binding)]
16975                    match tag {
16976                        __FieldTag::__parent => {
16977                            if !fields.insert(__FieldTag::__parent) {
16978                                return std::result::Result::Err(A::Error::duplicate_field(
16979                                    "multiple values for parent",
16980                                ));
16981                            }
16982                            result.parent = map
16983                                .next_value::<std::option::Option<std::string::String>>()?
16984                                .unwrap_or_default();
16985                        }
16986                        __FieldTag::__service => {
16987                            if !fields.insert(__FieldTag::__service) {
16988                                return std::result::Result::Err(A::Error::duplicate_field(
16989                                    "multiple values for service",
16990                                ));
16991                            }
16992                            result.service =
16993                                map.next_value::<std::option::Option<crate::model::Service>>()?;
16994                        }
16995                        __FieldTag::__service_id => {
16996                            if !fields.insert(__FieldTag::__service_id) {
16997                                return std::result::Result::Err(A::Error::duplicate_field(
16998                                    "multiple values for service_id",
16999                                ));
17000                            }
17001                            result.service_id = map
17002                                .next_value::<std::option::Option<std::string::String>>()?
17003                                .unwrap_or_default();
17004                        }
17005                        __FieldTag::__validate_only => {
17006                            if !fields.insert(__FieldTag::__validate_only) {
17007                                return std::result::Result::Err(A::Error::duplicate_field(
17008                                    "multiple values for validate_only",
17009                                ));
17010                            }
17011                            result.validate_only = map
17012                                .next_value::<std::option::Option<bool>>()?
17013                                .unwrap_or_default();
17014                        }
17015                        __FieldTag::Unknown(key) => {
17016                            let value = map.next_value::<serde_json::Value>()?;
17017                            result._unknown_fields.insert(key, value);
17018                        }
17019                    }
17020                }
17021                std::result::Result::Ok(result)
17022            }
17023        }
17024        deserializer.deserialize_any(Visitor)
17025    }
17026}
17027
17028#[doc(hidden)]
17029impl serde::ser::Serialize for CreateServiceRequest {
17030    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17031    where
17032        S: serde::ser::Serializer,
17033    {
17034        use serde::ser::SerializeMap;
17035        #[allow(unused_imports)]
17036        use std::option::Option::Some;
17037        let mut state = serializer.serialize_map(std::option::Option::None)?;
17038        if !self.parent.is_empty() {
17039            state.serialize_entry("parent", &self.parent)?;
17040        }
17041        if self.service.is_some() {
17042            state.serialize_entry("service", &self.service)?;
17043        }
17044        if !self.service_id.is_empty() {
17045            state.serialize_entry("serviceId", &self.service_id)?;
17046        }
17047        if !wkt::internal::is_default(&self.validate_only) {
17048            state.serialize_entry("validateOnly", &self.validate_only)?;
17049        }
17050        if !self._unknown_fields.is_empty() {
17051            for (key, value) in self._unknown_fields.iter() {
17052                state.serialize_entry(key, &value)?;
17053            }
17054        }
17055        state.end()
17056    }
17057}
17058
17059impl std::fmt::Debug for CreateServiceRequest {
17060    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17061        let mut debug_struct = f.debug_struct("CreateServiceRequest");
17062        debug_struct.field("parent", &self.parent);
17063        debug_struct.field("service", &self.service);
17064        debug_struct.field("service_id", &self.service_id);
17065        debug_struct.field("validate_only", &self.validate_only);
17066        if !self._unknown_fields.is_empty() {
17067            debug_struct.field("_unknown_fields", &self._unknown_fields);
17068        }
17069        debug_struct.finish()
17070    }
17071}
17072
17073/// Request message for updating a service.
17074#[derive(Clone, Default, PartialEq)]
17075#[non_exhaustive]
17076pub struct UpdateServiceRequest {
17077    /// Optional. The list of fields to be updated.
17078    pub update_mask: std::option::Option<wkt::FieldMask>,
17079
17080    /// Required. The Service to be updated.
17081    pub service: std::option::Option<crate::model::Service>,
17082
17083    /// Indicates that the request should be validated and default values
17084    /// populated, without persisting the request or updating any resources.
17085    pub validate_only: bool,
17086
17087    /// Optional. If set to true, and if the Service does not exist, it will create
17088    /// a new one. The caller must have 'run.services.create' permissions if this
17089    /// is set to true and the Service does not exist.
17090    pub allow_missing: bool,
17091
17092    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17093}
17094
17095impl UpdateServiceRequest {
17096    pub fn new() -> Self {
17097        std::default::Default::default()
17098    }
17099
17100    /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
17101    pub fn set_update_mask<T>(mut self, v: T) -> Self
17102    where
17103        T: std::convert::Into<wkt::FieldMask>,
17104    {
17105        self.update_mask = std::option::Option::Some(v.into());
17106        self
17107    }
17108
17109    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
17110    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17111    where
17112        T: std::convert::Into<wkt::FieldMask>,
17113    {
17114        self.update_mask = v.map(|x| x.into());
17115        self
17116    }
17117
17118    /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
17119    pub fn set_service<T>(mut self, v: T) -> Self
17120    where
17121        T: std::convert::Into<crate::model::Service>,
17122    {
17123        self.service = std::option::Option::Some(v.into());
17124        self
17125    }
17126
17127    /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
17128    pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
17129    where
17130        T: std::convert::Into<crate::model::Service>,
17131    {
17132        self.service = v.map(|x| x.into());
17133        self
17134    }
17135
17136    /// Sets the value of [validate_only][crate::model::UpdateServiceRequest::validate_only].
17137    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17138        self.validate_only = v.into();
17139        self
17140    }
17141
17142    /// Sets the value of [allow_missing][crate::model::UpdateServiceRequest::allow_missing].
17143    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17144        self.allow_missing = v.into();
17145        self
17146    }
17147}
17148
17149impl wkt::message::Message for UpdateServiceRequest {
17150    fn typename() -> &'static str {
17151        "type.googleapis.com/google.cloud.run.v2.UpdateServiceRequest"
17152    }
17153}
17154
17155#[doc(hidden)]
17156impl<'de> serde::de::Deserialize<'de> for UpdateServiceRequest {
17157    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17158    where
17159        D: serde::Deserializer<'de>,
17160    {
17161        #[allow(non_camel_case_types)]
17162        #[doc(hidden)]
17163        #[derive(PartialEq, Eq, Hash)]
17164        enum __FieldTag {
17165            __update_mask,
17166            __service,
17167            __validate_only,
17168            __allow_missing,
17169            Unknown(std::string::String),
17170        }
17171        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17172            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17173            where
17174                D: serde::Deserializer<'de>,
17175            {
17176                struct Visitor;
17177                impl<'de> serde::de::Visitor<'de> for Visitor {
17178                    type Value = __FieldTag;
17179                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17180                        formatter.write_str("a field name for UpdateServiceRequest")
17181                    }
17182                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17183                    where
17184                        E: serde::de::Error,
17185                    {
17186                        use std::result::Result::Ok;
17187                        use std::string::ToString;
17188                        match value {
17189                            "updateMask" => Ok(__FieldTag::__update_mask),
17190                            "update_mask" => Ok(__FieldTag::__update_mask),
17191                            "service" => Ok(__FieldTag::__service),
17192                            "validateOnly" => Ok(__FieldTag::__validate_only),
17193                            "validate_only" => Ok(__FieldTag::__validate_only),
17194                            "allowMissing" => Ok(__FieldTag::__allow_missing),
17195                            "allow_missing" => Ok(__FieldTag::__allow_missing),
17196                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17197                        }
17198                    }
17199                }
17200                deserializer.deserialize_identifier(Visitor)
17201            }
17202        }
17203        struct Visitor;
17204        impl<'de> serde::de::Visitor<'de> for Visitor {
17205            type Value = UpdateServiceRequest;
17206            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17207                formatter.write_str("struct UpdateServiceRequest")
17208            }
17209            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17210            where
17211                A: serde::de::MapAccess<'de>,
17212            {
17213                #[allow(unused_imports)]
17214                use serde::de::Error;
17215                use std::option::Option::Some;
17216                let mut fields = std::collections::HashSet::new();
17217                let mut result = Self::Value::new();
17218                while let Some(tag) = map.next_key::<__FieldTag>()? {
17219                    #[allow(clippy::match_single_binding)]
17220                    match tag {
17221                        __FieldTag::__update_mask => {
17222                            if !fields.insert(__FieldTag::__update_mask) {
17223                                return std::result::Result::Err(A::Error::duplicate_field(
17224                                    "multiple values for update_mask",
17225                                ));
17226                            }
17227                            result.update_mask =
17228                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
17229                        }
17230                        __FieldTag::__service => {
17231                            if !fields.insert(__FieldTag::__service) {
17232                                return std::result::Result::Err(A::Error::duplicate_field(
17233                                    "multiple values for service",
17234                                ));
17235                            }
17236                            result.service =
17237                                map.next_value::<std::option::Option<crate::model::Service>>()?;
17238                        }
17239                        __FieldTag::__validate_only => {
17240                            if !fields.insert(__FieldTag::__validate_only) {
17241                                return std::result::Result::Err(A::Error::duplicate_field(
17242                                    "multiple values for validate_only",
17243                                ));
17244                            }
17245                            result.validate_only = map
17246                                .next_value::<std::option::Option<bool>>()?
17247                                .unwrap_or_default();
17248                        }
17249                        __FieldTag::__allow_missing => {
17250                            if !fields.insert(__FieldTag::__allow_missing) {
17251                                return std::result::Result::Err(A::Error::duplicate_field(
17252                                    "multiple values for allow_missing",
17253                                ));
17254                            }
17255                            result.allow_missing = map
17256                                .next_value::<std::option::Option<bool>>()?
17257                                .unwrap_or_default();
17258                        }
17259                        __FieldTag::Unknown(key) => {
17260                            let value = map.next_value::<serde_json::Value>()?;
17261                            result._unknown_fields.insert(key, value);
17262                        }
17263                    }
17264                }
17265                std::result::Result::Ok(result)
17266            }
17267        }
17268        deserializer.deserialize_any(Visitor)
17269    }
17270}
17271
17272#[doc(hidden)]
17273impl serde::ser::Serialize for UpdateServiceRequest {
17274    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17275    where
17276        S: serde::ser::Serializer,
17277    {
17278        use serde::ser::SerializeMap;
17279        #[allow(unused_imports)]
17280        use std::option::Option::Some;
17281        let mut state = serializer.serialize_map(std::option::Option::None)?;
17282        if self.update_mask.is_some() {
17283            state.serialize_entry("updateMask", &self.update_mask)?;
17284        }
17285        if self.service.is_some() {
17286            state.serialize_entry("service", &self.service)?;
17287        }
17288        if !wkt::internal::is_default(&self.validate_only) {
17289            state.serialize_entry("validateOnly", &self.validate_only)?;
17290        }
17291        if !wkt::internal::is_default(&self.allow_missing) {
17292            state.serialize_entry("allowMissing", &self.allow_missing)?;
17293        }
17294        if !self._unknown_fields.is_empty() {
17295            for (key, value) in self._unknown_fields.iter() {
17296                state.serialize_entry(key, &value)?;
17297            }
17298        }
17299        state.end()
17300    }
17301}
17302
17303impl std::fmt::Debug for UpdateServiceRequest {
17304    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17305        let mut debug_struct = f.debug_struct("UpdateServiceRequest");
17306        debug_struct.field("update_mask", &self.update_mask);
17307        debug_struct.field("service", &self.service);
17308        debug_struct.field("validate_only", &self.validate_only);
17309        debug_struct.field("allow_missing", &self.allow_missing);
17310        if !self._unknown_fields.is_empty() {
17311            debug_struct.field("_unknown_fields", &self._unknown_fields);
17312        }
17313        debug_struct.finish()
17314    }
17315}
17316
17317/// Request message for retrieving a list of Services.
17318#[derive(Clone, Default, PartialEq)]
17319#[non_exhaustive]
17320pub struct ListServicesRequest {
17321    /// Required. The location and project to list resources on.
17322    /// Location must be a valid Google Cloud region, and cannot be the "-"
17323    /// wildcard. Format: projects/{project}/locations/{location}, where {project}
17324    /// can be project id or number.
17325    pub parent: std::string::String,
17326
17327    /// Maximum number of Services to return in this call.
17328    pub page_size: i32,
17329
17330    /// A page token received from a previous call to ListServices.
17331    /// All other parameters must match.
17332    pub page_token: std::string::String,
17333
17334    /// If true, returns deleted (but unexpired) resources along with active ones.
17335    pub show_deleted: bool,
17336
17337    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17338}
17339
17340impl ListServicesRequest {
17341    pub fn new() -> Self {
17342        std::default::Default::default()
17343    }
17344
17345    /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
17346    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17347        self.parent = v.into();
17348        self
17349    }
17350
17351    /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
17352    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17353        self.page_size = v.into();
17354        self
17355    }
17356
17357    /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
17358    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17359        self.page_token = v.into();
17360        self
17361    }
17362
17363    /// Sets the value of [show_deleted][crate::model::ListServicesRequest::show_deleted].
17364    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17365        self.show_deleted = v.into();
17366        self
17367    }
17368}
17369
17370impl wkt::message::Message for ListServicesRequest {
17371    fn typename() -> &'static str {
17372        "type.googleapis.com/google.cloud.run.v2.ListServicesRequest"
17373    }
17374}
17375
17376#[doc(hidden)]
17377impl<'de> serde::de::Deserialize<'de> for ListServicesRequest {
17378    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17379    where
17380        D: serde::Deserializer<'de>,
17381    {
17382        #[allow(non_camel_case_types)]
17383        #[doc(hidden)]
17384        #[derive(PartialEq, Eq, Hash)]
17385        enum __FieldTag {
17386            __parent,
17387            __page_size,
17388            __page_token,
17389            __show_deleted,
17390            Unknown(std::string::String),
17391        }
17392        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17393            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17394            where
17395                D: serde::Deserializer<'de>,
17396            {
17397                struct Visitor;
17398                impl<'de> serde::de::Visitor<'de> for Visitor {
17399                    type Value = __FieldTag;
17400                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17401                        formatter.write_str("a field name for ListServicesRequest")
17402                    }
17403                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17404                    where
17405                        E: serde::de::Error,
17406                    {
17407                        use std::result::Result::Ok;
17408                        use std::string::ToString;
17409                        match value {
17410                            "parent" => Ok(__FieldTag::__parent),
17411                            "pageSize" => Ok(__FieldTag::__page_size),
17412                            "page_size" => Ok(__FieldTag::__page_size),
17413                            "pageToken" => Ok(__FieldTag::__page_token),
17414                            "page_token" => Ok(__FieldTag::__page_token),
17415                            "showDeleted" => Ok(__FieldTag::__show_deleted),
17416                            "show_deleted" => Ok(__FieldTag::__show_deleted),
17417                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17418                        }
17419                    }
17420                }
17421                deserializer.deserialize_identifier(Visitor)
17422            }
17423        }
17424        struct Visitor;
17425        impl<'de> serde::de::Visitor<'de> for Visitor {
17426            type Value = ListServicesRequest;
17427            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17428                formatter.write_str("struct ListServicesRequest")
17429            }
17430            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17431            where
17432                A: serde::de::MapAccess<'de>,
17433            {
17434                #[allow(unused_imports)]
17435                use serde::de::Error;
17436                use std::option::Option::Some;
17437                let mut fields = std::collections::HashSet::new();
17438                let mut result = Self::Value::new();
17439                while let Some(tag) = map.next_key::<__FieldTag>()? {
17440                    #[allow(clippy::match_single_binding)]
17441                    match tag {
17442                        __FieldTag::__parent => {
17443                            if !fields.insert(__FieldTag::__parent) {
17444                                return std::result::Result::Err(A::Error::duplicate_field(
17445                                    "multiple values for parent",
17446                                ));
17447                            }
17448                            result.parent = map
17449                                .next_value::<std::option::Option<std::string::String>>()?
17450                                .unwrap_or_default();
17451                        }
17452                        __FieldTag::__page_size => {
17453                            if !fields.insert(__FieldTag::__page_size) {
17454                                return std::result::Result::Err(A::Error::duplicate_field(
17455                                    "multiple values for page_size",
17456                                ));
17457                            }
17458                            struct __With(std::option::Option<i32>);
17459                            impl<'de> serde::de::Deserialize<'de> for __With {
17460                                fn deserialize<D>(
17461                                    deserializer: D,
17462                                ) -> std::result::Result<Self, D::Error>
17463                                where
17464                                    D: serde::de::Deserializer<'de>,
17465                                {
17466                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
17467                                }
17468                            }
17469                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
17470                        }
17471                        __FieldTag::__page_token => {
17472                            if !fields.insert(__FieldTag::__page_token) {
17473                                return std::result::Result::Err(A::Error::duplicate_field(
17474                                    "multiple values for page_token",
17475                                ));
17476                            }
17477                            result.page_token = map
17478                                .next_value::<std::option::Option<std::string::String>>()?
17479                                .unwrap_or_default();
17480                        }
17481                        __FieldTag::__show_deleted => {
17482                            if !fields.insert(__FieldTag::__show_deleted) {
17483                                return std::result::Result::Err(A::Error::duplicate_field(
17484                                    "multiple values for show_deleted",
17485                                ));
17486                            }
17487                            result.show_deleted = map
17488                                .next_value::<std::option::Option<bool>>()?
17489                                .unwrap_or_default();
17490                        }
17491                        __FieldTag::Unknown(key) => {
17492                            let value = map.next_value::<serde_json::Value>()?;
17493                            result._unknown_fields.insert(key, value);
17494                        }
17495                    }
17496                }
17497                std::result::Result::Ok(result)
17498            }
17499        }
17500        deserializer.deserialize_any(Visitor)
17501    }
17502}
17503
17504#[doc(hidden)]
17505impl serde::ser::Serialize for ListServicesRequest {
17506    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17507    where
17508        S: serde::ser::Serializer,
17509    {
17510        use serde::ser::SerializeMap;
17511        #[allow(unused_imports)]
17512        use std::option::Option::Some;
17513        let mut state = serializer.serialize_map(std::option::Option::None)?;
17514        if !self.parent.is_empty() {
17515            state.serialize_entry("parent", &self.parent)?;
17516        }
17517        if !wkt::internal::is_default(&self.page_size) {
17518            struct __With<'a>(&'a i32);
17519            impl<'a> serde::ser::Serialize for __With<'a> {
17520                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17521                where
17522                    S: serde::ser::Serializer,
17523                {
17524                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
17525                }
17526            }
17527            state.serialize_entry("pageSize", &__With(&self.page_size))?;
17528        }
17529        if !self.page_token.is_empty() {
17530            state.serialize_entry("pageToken", &self.page_token)?;
17531        }
17532        if !wkt::internal::is_default(&self.show_deleted) {
17533            state.serialize_entry("showDeleted", &self.show_deleted)?;
17534        }
17535        if !self._unknown_fields.is_empty() {
17536            for (key, value) in self._unknown_fields.iter() {
17537                state.serialize_entry(key, &value)?;
17538            }
17539        }
17540        state.end()
17541    }
17542}
17543
17544impl std::fmt::Debug for ListServicesRequest {
17545    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17546        let mut debug_struct = f.debug_struct("ListServicesRequest");
17547        debug_struct.field("parent", &self.parent);
17548        debug_struct.field("page_size", &self.page_size);
17549        debug_struct.field("page_token", &self.page_token);
17550        debug_struct.field("show_deleted", &self.show_deleted);
17551        if !self._unknown_fields.is_empty() {
17552            debug_struct.field("_unknown_fields", &self._unknown_fields);
17553        }
17554        debug_struct.finish()
17555    }
17556}
17557
17558/// Response message containing a list of Services.
17559#[derive(Clone, Default, PartialEq)]
17560#[non_exhaustive]
17561pub struct ListServicesResponse {
17562    /// The resulting list of Services.
17563    pub services: std::vec::Vec<crate::model::Service>,
17564
17565    /// A token indicating there are more items than page_size. Use it in the next
17566    /// ListServices request to continue.
17567    pub next_page_token: std::string::String,
17568
17569    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17570}
17571
17572impl ListServicesResponse {
17573    pub fn new() -> Self {
17574        std::default::Default::default()
17575    }
17576
17577    /// Sets the value of [services][crate::model::ListServicesResponse::services].
17578    pub fn set_services<T, V>(mut self, v: T) -> Self
17579    where
17580        T: std::iter::IntoIterator<Item = V>,
17581        V: std::convert::Into<crate::model::Service>,
17582    {
17583        use std::iter::Iterator;
17584        self.services = v.into_iter().map(|i| i.into()).collect();
17585        self
17586    }
17587
17588    /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
17589    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17590        self.next_page_token = v.into();
17591        self
17592    }
17593}
17594
17595impl wkt::message::Message for ListServicesResponse {
17596    fn typename() -> &'static str {
17597        "type.googleapis.com/google.cloud.run.v2.ListServicesResponse"
17598    }
17599}
17600
17601#[doc(hidden)]
17602impl gax::paginator::internal::PageableResponse for ListServicesResponse {
17603    type PageItem = crate::model::Service;
17604
17605    fn items(self) -> std::vec::Vec<Self::PageItem> {
17606        self.services
17607    }
17608
17609    fn next_page_token(&self) -> std::string::String {
17610        use std::clone::Clone;
17611        self.next_page_token.clone()
17612    }
17613}
17614
17615#[doc(hidden)]
17616impl<'de> serde::de::Deserialize<'de> for ListServicesResponse {
17617    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17618    where
17619        D: serde::Deserializer<'de>,
17620    {
17621        #[allow(non_camel_case_types)]
17622        #[doc(hidden)]
17623        #[derive(PartialEq, Eq, Hash)]
17624        enum __FieldTag {
17625            __services,
17626            __next_page_token,
17627            Unknown(std::string::String),
17628        }
17629        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17630            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17631            where
17632                D: serde::Deserializer<'de>,
17633            {
17634                struct Visitor;
17635                impl<'de> serde::de::Visitor<'de> for Visitor {
17636                    type Value = __FieldTag;
17637                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17638                        formatter.write_str("a field name for ListServicesResponse")
17639                    }
17640                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17641                    where
17642                        E: serde::de::Error,
17643                    {
17644                        use std::result::Result::Ok;
17645                        use std::string::ToString;
17646                        match value {
17647                            "services" => Ok(__FieldTag::__services),
17648                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
17649                            "next_page_token" => Ok(__FieldTag::__next_page_token),
17650                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17651                        }
17652                    }
17653                }
17654                deserializer.deserialize_identifier(Visitor)
17655            }
17656        }
17657        struct Visitor;
17658        impl<'de> serde::de::Visitor<'de> for Visitor {
17659            type Value = ListServicesResponse;
17660            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17661                formatter.write_str("struct ListServicesResponse")
17662            }
17663            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17664            where
17665                A: serde::de::MapAccess<'de>,
17666            {
17667                #[allow(unused_imports)]
17668                use serde::de::Error;
17669                use std::option::Option::Some;
17670                let mut fields = std::collections::HashSet::new();
17671                let mut result = Self::Value::new();
17672                while let Some(tag) = map.next_key::<__FieldTag>()? {
17673                    #[allow(clippy::match_single_binding)]
17674                    match tag {
17675                        __FieldTag::__services => {
17676                            if !fields.insert(__FieldTag::__services) {
17677                                return std::result::Result::Err(A::Error::duplicate_field(
17678                                    "multiple values for services",
17679                                ));
17680                            }
17681                            result.services = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Service>>>()?.unwrap_or_default();
17682                        }
17683                        __FieldTag::__next_page_token => {
17684                            if !fields.insert(__FieldTag::__next_page_token) {
17685                                return std::result::Result::Err(A::Error::duplicate_field(
17686                                    "multiple values for next_page_token",
17687                                ));
17688                            }
17689                            result.next_page_token = map
17690                                .next_value::<std::option::Option<std::string::String>>()?
17691                                .unwrap_or_default();
17692                        }
17693                        __FieldTag::Unknown(key) => {
17694                            let value = map.next_value::<serde_json::Value>()?;
17695                            result._unknown_fields.insert(key, value);
17696                        }
17697                    }
17698                }
17699                std::result::Result::Ok(result)
17700            }
17701        }
17702        deserializer.deserialize_any(Visitor)
17703    }
17704}
17705
17706#[doc(hidden)]
17707impl serde::ser::Serialize for ListServicesResponse {
17708    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17709    where
17710        S: serde::ser::Serializer,
17711    {
17712        use serde::ser::SerializeMap;
17713        #[allow(unused_imports)]
17714        use std::option::Option::Some;
17715        let mut state = serializer.serialize_map(std::option::Option::None)?;
17716        if !self.services.is_empty() {
17717            state.serialize_entry("services", &self.services)?;
17718        }
17719        if !self.next_page_token.is_empty() {
17720            state.serialize_entry("nextPageToken", &self.next_page_token)?;
17721        }
17722        if !self._unknown_fields.is_empty() {
17723            for (key, value) in self._unknown_fields.iter() {
17724                state.serialize_entry(key, &value)?;
17725            }
17726        }
17727        state.end()
17728    }
17729}
17730
17731impl std::fmt::Debug for ListServicesResponse {
17732    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17733        let mut debug_struct = f.debug_struct("ListServicesResponse");
17734        debug_struct.field("services", &self.services);
17735        debug_struct.field("next_page_token", &self.next_page_token);
17736        if !self._unknown_fields.is_empty() {
17737            debug_struct.field("_unknown_fields", &self._unknown_fields);
17738        }
17739        debug_struct.finish()
17740    }
17741}
17742
17743/// Request message for obtaining a Service by its full name.
17744#[derive(Clone, Default, PartialEq)]
17745#[non_exhaustive]
17746pub struct GetServiceRequest {
17747    /// Required. The full name of the Service.
17748    /// Format: projects/{project}/locations/{location}/services/{service}, where
17749    /// {project} can be project id or number.
17750    pub name: std::string::String,
17751
17752    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17753}
17754
17755impl GetServiceRequest {
17756    pub fn new() -> Self {
17757        std::default::Default::default()
17758    }
17759
17760    /// Sets the value of [name][crate::model::GetServiceRequest::name].
17761    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17762        self.name = v.into();
17763        self
17764    }
17765}
17766
17767impl wkt::message::Message for GetServiceRequest {
17768    fn typename() -> &'static str {
17769        "type.googleapis.com/google.cloud.run.v2.GetServiceRequest"
17770    }
17771}
17772
17773#[doc(hidden)]
17774impl<'de> serde::de::Deserialize<'de> for GetServiceRequest {
17775    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17776    where
17777        D: serde::Deserializer<'de>,
17778    {
17779        #[allow(non_camel_case_types)]
17780        #[doc(hidden)]
17781        #[derive(PartialEq, Eq, Hash)]
17782        enum __FieldTag {
17783            __name,
17784            Unknown(std::string::String),
17785        }
17786        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17787            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17788            where
17789                D: serde::Deserializer<'de>,
17790            {
17791                struct Visitor;
17792                impl<'de> serde::de::Visitor<'de> for Visitor {
17793                    type Value = __FieldTag;
17794                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17795                        formatter.write_str("a field name for GetServiceRequest")
17796                    }
17797                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17798                    where
17799                        E: serde::de::Error,
17800                    {
17801                        use std::result::Result::Ok;
17802                        use std::string::ToString;
17803                        match value {
17804                            "name" => Ok(__FieldTag::__name),
17805                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17806                        }
17807                    }
17808                }
17809                deserializer.deserialize_identifier(Visitor)
17810            }
17811        }
17812        struct Visitor;
17813        impl<'de> serde::de::Visitor<'de> for Visitor {
17814            type Value = GetServiceRequest;
17815            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17816                formatter.write_str("struct GetServiceRequest")
17817            }
17818            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17819            where
17820                A: serde::de::MapAccess<'de>,
17821            {
17822                #[allow(unused_imports)]
17823                use serde::de::Error;
17824                use std::option::Option::Some;
17825                let mut fields = std::collections::HashSet::new();
17826                let mut result = Self::Value::new();
17827                while let Some(tag) = map.next_key::<__FieldTag>()? {
17828                    #[allow(clippy::match_single_binding)]
17829                    match tag {
17830                        __FieldTag::__name => {
17831                            if !fields.insert(__FieldTag::__name) {
17832                                return std::result::Result::Err(A::Error::duplicate_field(
17833                                    "multiple values for name",
17834                                ));
17835                            }
17836                            result.name = map
17837                                .next_value::<std::option::Option<std::string::String>>()?
17838                                .unwrap_or_default();
17839                        }
17840                        __FieldTag::Unknown(key) => {
17841                            let value = map.next_value::<serde_json::Value>()?;
17842                            result._unknown_fields.insert(key, value);
17843                        }
17844                    }
17845                }
17846                std::result::Result::Ok(result)
17847            }
17848        }
17849        deserializer.deserialize_any(Visitor)
17850    }
17851}
17852
17853#[doc(hidden)]
17854impl serde::ser::Serialize for GetServiceRequest {
17855    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17856    where
17857        S: serde::ser::Serializer,
17858    {
17859        use serde::ser::SerializeMap;
17860        #[allow(unused_imports)]
17861        use std::option::Option::Some;
17862        let mut state = serializer.serialize_map(std::option::Option::None)?;
17863        if !self.name.is_empty() {
17864            state.serialize_entry("name", &self.name)?;
17865        }
17866        if !self._unknown_fields.is_empty() {
17867            for (key, value) in self._unknown_fields.iter() {
17868                state.serialize_entry(key, &value)?;
17869            }
17870        }
17871        state.end()
17872    }
17873}
17874
17875impl std::fmt::Debug for GetServiceRequest {
17876    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17877        let mut debug_struct = f.debug_struct("GetServiceRequest");
17878        debug_struct.field("name", &self.name);
17879        if !self._unknown_fields.is_empty() {
17880            debug_struct.field("_unknown_fields", &self._unknown_fields);
17881        }
17882        debug_struct.finish()
17883    }
17884}
17885
17886/// Request message to delete a Service by its full name.
17887#[derive(Clone, Default, PartialEq)]
17888#[non_exhaustive]
17889pub struct DeleteServiceRequest {
17890    /// Required. The full name of the Service.
17891    /// Format: projects/{project}/locations/{location}/services/{service}, where
17892    /// {project} can be project id or number.
17893    pub name: std::string::String,
17894
17895    /// Indicates that the request should be validated without actually
17896    /// deleting any resources.
17897    pub validate_only: bool,
17898
17899    /// A system-generated fingerprint for this version of the
17900    /// resource. May be used to detect modification conflict during updates.
17901    pub etag: std::string::String,
17902
17903    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17904}
17905
17906impl DeleteServiceRequest {
17907    pub fn new() -> Self {
17908        std::default::Default::default()
17909    }
17910
17911    /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
17912    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17913        self.name = v.into();
17914        self
17915    }
17916
17917    /// Sets the value of [validate_only][crate::model::DeleteServiceRequest::validate_only].
17918    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17919        self.validate_only = v.into();
17920        self
17921    }
17922
17923    /// Sets the value of [etag][crate::model::DeleteServiceRequest::etag].
17924    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17925        self.etag = v.into();
17926        self
17927    }
17928}
17929
17930impl wkt::message::Message for DeleteServiceRequest {
17931    fn typename() -> &'static str {
17932        "type.googleapis.com/google.cloud.run.v2.DeleteServiceRequest"
17933    }
17934}
17935
17936#[doc(hidden)]
17937impl<'de> serde::de::Deserialize<'de> for DeleteServiceRequest {
17938    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17939    where
17940        D: serde::Deserializer<'de>,
17941    {
17942        #[allow(non_camel_case_types)]
17943        #[doc(hidden)]
17944        #[derive(PartialEq, Eq, Hash)]
17945        enum __FieldTag {
17946            __name,
17947            __validate_only,
17948            __etag,
17949            Unknown(std::string::String),
17950        }
17951        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17952            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17953            where
17954                D: serde::Deserializer<'de>,
17955            {
17956                struct Visitor;
17957                impl<'de> serde::de::Visitor<'de> for Visitor {
17958                    type Value = __FieldTag;
17959                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17960                        formatter.write_str("a field name for DeleteServiceRequest")
17961                    }
17962                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17963                    where
17964                        E: serde::de::Error,
17965                    {
17966                        use std::result::Result::Ok;
17967                        use std::string::ToString;
17968                        match value {
17969                            "name" => Ok(__FieldTag::__name),
17970                            "validateOnly" => Ok(__FieldTag::__validate_only),
17971                            "validate_only" => Ok(__FieldTag::__validate_only),
17972                            "etag" => Ok(__FieldTag::__etag),
17973                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17974                        }
17975                    }
17976                }
17977                deserializer.deserialize_identifier(Visitor)
17978            }
17979        }
17980        struct Visitor;
17981        impl<'de> serde::de::Visitor<'de> for Visitor {
17982            type Value = DeleteServiceRequest;
17983            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17984                formatter.write_str("struct DeleteServiceRequest")
17985            }
17986            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17987            where
17988                A: serde::de::MapAccess<'de>,
17989            {
17990                #[allow(unused_imports)]
17991                use serde::de::Error;
17992                use std::option::Option::Some;
17993                let mut fields = std::collections::HashSet::new();
17994                let mut result = Self::Value::new();
17995                while let Some(tag) = map.next_key::<__FieldTag>()? {
17996                    #[allow(clippy::match_single_binding)]
17997                    match tag {
17998                        __FieldTag::__name => {
17999                            if !fields.insert(__FieldTag::__name) {
18000                                return std::result::Result::Err(A::Error::duplicate_field(
18001                                    "multiple values for name",
18002                                ));
18003                            }
18004                            result.name = map
18005                                .next_value::<std::option::Option<std::string::String>>()?
18006                                .unwrap_or_default();
18007                        }
18008                        __FieldTag::__validate_only => {
18009                            if !fields.insert(__FieldTag::__validate_only) {
18010                                return std::result::Result::Err(A::Error::duplicate_field(
18011                                    "multiple values for validate_only",
18012                                ));
18013                            }
18014                            result.validate_only = map
18015                                .next_value::<std::option::Option<bool>>()?
18016                                .unwrap_or_default();
18017                        }
18018                        __FieldTag::__etag => {
18019                            if !fields.insert(__FieldTag::__etag) {
18020                                return std::result::Result::Err(A::Error::duplicate_field(
18021                                    "multiple values for etag",
18022                                ));
18023                            }
18024                            result.etag = map
18025                                .next_value::<std::option::Option<std::string::String>>()?
18026                                .unwrap_or_default();
18027                        }
18028                        __FieldTag::Unknown(key) => {
18029                            let value = map.next_value::<serde_json::Value>()?;
18030                            result._unknown_fields.insert(key, value);
18031                        }
18032                    }
18033                }
18034                std::result::Result::Ok(result)
18035            }
18036        }
18037        deserializer.deserialize_any(Visitor)
18038    }
18039}
18040
18041#[doc(hidden)]
18042impl serde::ser::Serialize for DeleteServiceRequest {
18043    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18044    where
18045        S: serde::ser::Serializer,
18046    {
18047        use serde::ser::SerializeMap;
18048        #[allow(unused_imports)]
18049        use std::option::Option::Some;
18050        let mut state = serializer.serialize_map(std::option::Option::None)?;
18051        if !self.name.is_empty() {
18052            state.serialize_entry("name", &self.name)?;
18053        }
18054        if !wkt::internal::is_default(&self.validate_only) {
18055            state.serialize_entry("validateOnly", &self.validate_only)?;
18056        }
18057        if !self.etag.is_empty() {
18058            state.serialize_entry("etag", &self.etag)?;
18059        }
18060        if !self._unknown_fields.is_empty() {
18061            for (key, value) in self._unknown_fields.iter() {
18062                state.serialize_entry(key, &value)?;
18063            }
18064        }
18065        state.end()
18066    }
18067}
18068
18069impl std::fmt::Debug for DeleteServiceRequest {
18070    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18071        let mut debug_struct = f.debug_struct("DeleteServiceRequest");
18072        debug_struct.field("name", &self.name);
18073        debug_struct.field("validate_only", &self.validate_only);
18074        debug_struct.field("etag", &self.etag);
18075        if !self._unknown_fields.is_empty() {
18076            debug_struct.field("_unknown_fields", &self._unknown_fields);
18077        }
18078        debug_struct.finish()
18079    }
18080}
18081
18082/// Service acts as a top-level container that manages a set of
18083/// configurations and revision templates which implement a network service.
18084/// Service exists to provide a singular abstraction which can be access
18085/// controlled, reasoned about, and which encapsulates software lifecycle
18086/// decisions such as rollout policy and team resource ownership.
18087#[derive(Clone, Default, PartialEq)]
18088#[non_exhaustive]
18089pub struct Service {
18090    /// The fully qualified name of this Service. In CreateServiceRequest, this
18091    /// field is ignored, and instead composed from CreateServiceRequest.parent and
18092    /// CreateServiceRequest.service_id.
18093    ///
18094    /// Format:
18095    /// projects/{project}/locations/{location}/services/{service_id}
18096    pub name: std::string::String,
18097
18098    /// User-provided description of the Service. This field currently has a
18099    /// 512-character limit.
18100    pub description: std::string::String,
18101
18102    /// Output only. Server assigned unique identifier for the trigger. The value
18103    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
18104    /// deleted.
18105    pub uid: std::string::String,
18106
18107    /// Output only. A number that monotonically increases every time the user
18108    /// modifies the desired state.
18109    /// Please note that unlike v1, this is an int64 value. As with most Google
18110    /// APIs, its JSON representation will be a `string` instead of an `integer`.
18111    pub generation: i64,
18112
18113    /// Optional. Unstructured key value map that can be used to organize and
18114    /// categorize objects. User-provided labels are shared with Google's billing
18115    /// system, so they can be used to filter, or break down billing charges by
18116    /// team, component, environment, state, etc. For more information, visit
18117    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
18118    /// <https://cloud.google.com/run/docs/configuring/labels>.
18119    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18120
18121    /// Optional. Unstructured key value map that may be set by external tools to
18122    /// store and arbitrary metadata. They are not queryable and should be
18123    /// preserved when modifying objects.
18124    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
18125
18126    /// Output only. The creation time.
18127    pub create_time: std::option::Option<wkt::Timestamp>,
18128
18129    /// Output only. The last-modified time.
18130    pub update_time: std::option::Option<wkt::Timestamp>,
18131
18132    /// Output only. The deletion time. It is only populated as a response to a
18133    /// Delete request.
18134    pub delete_time: std::option::Option<wkt::Timestamp>,
18135
18136    /// Output only. For a deleted resource, the time after which it will be
18137    /// permanently deleted.
18138    pub expire_time: std::option::Option<wkt::Timestamp>,
18139
18140    /// Output only. Email address of the authenticated creator.
18141    pub creator: std::string::String,
18142
18143    /// Output only. Email address of the last authenticated modifier.
18144    pub last_modifier: std::string::String,
18145
18146    /// Arbitrary identifier for the API client.
18147    pub client: std::string::String,
18148
18149    /// Arbitrary version identifier for the API client.
18150    pub client_version: std::string::String,
18151
18152    /// Optional. Provides the ingress settings for this Service. On output,
18153    /// returns the currently observed ingress settings, or
18154    /// INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.
18155    pub ingress: crate::model::IngressTraffic,
18156
18157    /// Optional. The launch stage as defined by [Google Cloud Platform
18158    /// Launch Stages](https://cloud.google.com/terms/launch-stages).
18159    /// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
18160    /// is assumed.
18161    /// Set the launch stage to a preview stage on input to allow use of preview
18162    /// features in that stage. On read (or output), describes whether the resource
18163    /// uses preview features.
18164    ///
18165    /// For example, if ALPHA is provided as input, but only BETA and GA-level
18166    /// features are used, this field will be BETA on output.
18167    pub launch_stage: api::model::LaunchStage,
18168
18169    /// Optional. Settings for the Binary Authorization feature.
18170    pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
18171
18172    /// Required. The template used to create revisions for this Service.
18173    pub template: std::option::Option<crate::model::RevisionTemplate>,
18174
18175    /// Optional. Specifies how to distribute traffic over a collection of
18176    /// Revisions belonging to the Service. If traffic is empty or not provided,
18177    /// defaults to 100% traffic to the latest `Ready` Revision.
18178    pub traffic: std::vec::Vec<crate::model::TrafficTarget>,
18179
18180    /// Optional. Specifies service-level scaling settings
18181    pub scaling: std::option::Option<crate::model::ServiceScaling>,
18182
18183    /// Optional. Disables IAM permission check for run.routes.invoke for callers
18184    /// of this service. This feature is available by invitation only. For more
18185    /// information, visit
18186    /// <https://cloud.google.com/run/docs/securing/managing-access#invoker_check>.
18187    pub invoker_iam_disabled: bool,
18188
18189    /// Optional. Disables public resolution of the default URI of this service.
18190    pub default_uri_disabled: bool,
18191
18192    /// Output only. All URLs serving traffic for this Service.
18193    pub urls: std::vec::Vec<std::string::String>,
18194
18195    /// One or more custom audiences that you want this service to support. Specify
18196    /// each custom audience as the full URL in a string. The custom audiences are
18197    /// encoded in the token and used to authenticate requests. For more
18198    /// information, see
18199    /// <https://cloud.google.com/run/docs/configuring/custom-audiences>.
18200    pub custom_audiences: std::vec::Vec<std::string::String>,
18201
18202    /// Output only. The generation of this Service currently serving traffic. See
18203    /// comments in `reconciling` for additional information on reconciliation
18204    /// process in Cloud Run. Please note that unlike v1, this is an int64 value.
18205    /// As with most Google APIs, its JSON representation will be a `string`
18206    /// instead of an `integer`.
18207    pub observed_generation: i64,
18208
18209    /// Output only. The Condition of this Service, containing its readiness
18210    /// status, and detailed error information in case it did not reach a serving
18211    /// state. See comments in `reconciling` for additional information on
18212    /// reconciliation process in Cloud Run.
18213    pub terminal_condition: std::option::Option<crate::model::Condition>,
18214
18215    /// Output only. The Conditions of all other associated sub-resources. They
18216    /// contain additional diagnostics information in case the Service does not
18217    /// reach its Serving state. See comments in `reconciling` for additional
18218    /// information on reconciliation process in Cloud Run.
18219    pub conditions: std::vec::Vec<crate::model::Condition>,
18220
18221    /// Output only. Name of the latest revision that is serving traffic. See
18222    /// comments in `reconciling` for additional information on reconciliation
18223    /// process in Cloud Run.
18224    pub latest_ready_revision: std::string::String,
18225
18226    /// Output only. Name of the last created revision. See comments in
18227    /// `reconciling` for additional information on reconciliation process in Cloud
18228    /// Run.
18229    pub latest_created_revision: std::string::String,
18230
18231    /// Output only. Detailed status information for corresponding traffic targets.
18232    /// See comments in `reconciling` for additional information on reconciliation
18233    /// process in Cloud Run.
18234    pub traffic_statuses: std::vec::Vec<crate::model::TrafficTargetStatus>,
18235
18236    /// Output only. The main URI in which this Service is serving traffic.
18237    pub uri: std::string::String,
18238
18239    /// Output only. Reserved for future use.
18240    pub satisfies_pzs: bool,
18241
18242    /// Optional. Configuration for building a Cloud Run function.
18243    pub build_config: std::option::Option<crate::model::BuildConfig>,
18244
18245    /// Output only. Returns true if the Service is currently being acted upon by
18246    /// the system to bring it into the desired state.
18247    ///
18248    /// When a new Service is created, or an existing one is updated, Cloud Run
18249    /// will asynchronously perform all necessary steps to bring the Service to the
18250    /// desired serving state. This process is called reconciliation.
18251    /// While reconciliation is in process, `observed_generation`,
18252    /// `latest_ready_revision`, `traffic_statuses`, and `uri` will have transient
18253    /// values that might mismatch the intended state: Once reconciliation is over
18254    /// (and this field is false), there are two possible outcomes: reconciliation
18255    /// succeeded and the serving state matches the Service, or there was an error,
18256    /// and reconciliation failed. This state can be found in
18257    /// `terminal_condition.state`.
18258    ///
18259    /// If reconciliation succeeded, the following fields will match: `traffic` and
18260    /// `traffic_statuses`, `observed_generation` and `generation`,
18261    /// `latest_ready_revision` and `latest_created_revision`.
18262    ///
18263    /// If reconciliation failed, `traffic_statuses`, `observed_generation`, and
18264    /// `latest_ready_revision` will have the state of the last serving revision,
18265    /// or empty for newly created Services. Additional information on the failure
18266    /// can be found in `terminal_condition` and `conditions`.
18267    pub reconciling: bool,
18268
18269    /// Output only. A system-generated fingerprint for this version of the
18270    /// resource. May be used to detect modification conflict during updates.
18271    pub etag: std::string::String,
18272
18273    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18274}
18275
18276impl Service {
18277    pub fn new() -> Self {
18278        std::default::Default::default()
18279    }
18280
18281    /// Sets the value of [name][crate::model::Service::name].
18282    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18283        self.name = v.into();
18284        self
18285    }
18286
18287    /// Sets the value of [description][crate::model::Service::description].
18288    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18289        self.description = v.into();
18290        self
18291    }
18292
18293    /// Sets the value of [uid][crate::model::Service::uid].
18294    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18295        self.uid = v.into();
18296        self
18297    }
18298
18299    /// Sets the value of [generation][crate::model::Service::generation].
18300    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18301        self.generation = v.into();
18302        self
18303    }
18304
18305    /// Sets the value of [labels][crate::model::Service::labels].
18306    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18307    where
18308        T: std::iter::IntoIterator<Item = (K, V)>,
18309        K: std::convert::Into<std::string::String>,
18310        V: std::convert::Into<std::string::String>,
18311    {
18312        use std::iter::Iterator;
18313        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18314        self
18315    }
18316
18317    /// Sets the value of [annotations][crate::model::Service::annotations].
18318    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
18319    where
18320        T: std::iter::IntoIterator<Item = (K, V)>,
18321        K: std::convert::Into<std::string::String>,
18322        V: std::convert::Into<std::string::String>,
18323    {
18324        use std::iter::Iterator;
18325        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18326        self
18327    }
18328
18329    /// Sets the value of [create_time][crate::model::Service::create_time].
18330    pub fn set_create_time<T>(mut self, v: T) -> Self
18331    where
18332        T: std::convert::Into<wkt::Timestamp>,
18333    {
18334        self.create_time = std::option::Option::Some(v.into());
18335        self
18336    }
18337
18338    /// Sets or clears the value of [create_time][crate::model::Service::create_time].
18339    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18340    where
18341        T: std::convert::Into<wkt::Timestamp>,
18342    {
18343        self.create_time = v.map(|x| x.into());
18344        self
18345    }
18346
18347    /// Sets the value of [update_time][crate::model::Service::update_time].
18348    pub fn set_update_time<T>(mut self, v: T) -> Self
18349    where
18350        T: std::convert::Into<wkt::Timestamp>,
18351    {
18352        self.update_time = std::option::Option::Some(v.into());
18353        self
18354    }
18355
18356    /// Sets or clears the value of [update_time][crate::model::Service::update_time].
18357    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18358    where
18359        T: std::convert::Into<wkt::Timestamp>,
18360    {
18361        self.update_time = v.map(|x| x.into());
18362        self
18363    }
18364
18365    /// Sets the value of [delete_time][crate::model::Service::delete_time].
18366    pub fn set_delete_time<T>(mut self, v: T) -> Self
18367    where
18368        T: std::convert::Into<wkt::Timestamp>,
18369    {
18370        self.delete_time = std::option::Option::Some(v.into());
18371        self
18372    }
18373
18374    /// Sets or clears the value of [delete_time][crate::model::Service::delete_time].
18375    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
18376    where
18377        T: std::convert::Into<wkt::Timestamp>,
18378    {
18379        self.delete_time = v.map(|x| x.into());
18380        self
18381    }
18382
18383    /// Sets the value of [expire_time][crate::model::Service::expire_time].
18384    pub fn set_expire_time<T>(mut self, v: T) -> Self
18385    where
18386        T: std::convert::Into<wkt::Timestamp>,
18387    {
18388        self.expire_time = std::option::Option::Some(v.into());
18389        self
18390    }
18391
18392    /// Sets or clears the value of [expire_time][crate::model::Service::expire_time].
18393    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
18394    where
18395        T: std::convert::Into<wkt::Timestamp>,
18396    {
18397        self.expire_time = v.map(|x| x.into());
18398        self
18399    }
18400
18401    /// Sets the value of [creator][crate::model::Service::creator].
18402    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18403        self.creator = v.into();
18404        self
18405    }
18406
18407    /// Sets the value of [last_modifier][crate::model::Service::last_modifier].
18408    pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18409        self.last_modifier = v.into();
18410        self
18411    }
18412
18413    /// Sets the value of [client][crate::model::Service::client].
18414    pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18415        self.client = v.into();
18416        self
18417    }
18418
18419    /// Sets the value of [client_version][crate::model::Service::client_version].
18420    pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18421        self.client_version = v.into();
18422        self
18423    }
18424
18425    /// Sets the value of [ingress][crate::model::Service::ingress].
18426    pub fn set_ingress<T: std::convert::Into<crate::model::IngressTraffic>>(
18427        mut self,
18428        v: T,
18429    ) -> Self {
18430        self.ingress = v.into();
18431        self
18432    }
18433
18434    /// Sets the value of [launch_stage][crate::model::Service::launch_stage].
18435    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
18436        mut self,
18437        v: T,
18438    ) -> Self {
18439        self.launch_stage = v.into();
18440        self
18441    }
18442
18443    /// Sets the value of [binary_authorization][crate::model::Service::binary_authorization].
18444    pub fn set_binary_authorization<T>(mut self, v: T) -> Self
18445    where
18446        T: std::convert::Into<crate::model::BinaryAuthorization>,
18447    {
18448        self.binary_authorization = std::option::Option::Some(v.into());
18449        self
18450    }
18451
18452    /// Sets or clears the value of [binary_authorization][crate::model::Service::binary_authorization].
18453    pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
18454    where
18455        T: std::convert::Into<crate::model::BinaryAuthorization>,
18456    {
18457        self.binary_authorization = v.map(|x| x.into());
18458        self
18459    }
18460
18461    /// Sets the value of [template][crate::model::Service::template].
18462    pub fn set_template<T>(mut self, v: T) -> Self
18463    where
18464        T: std::convert::Into<crate::model::RevisionTemplate>,
18465    {
18466        self.template = std::option::Option::Some(v.into());
18467        self
18468    }
18469
18470    /// Sets or clears the value of [template][crate::model::Service::template].
18471    pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
18472    where
18473        T: std::convert::Into<crate::model::RevisionTemplate>,
18474    {
18475        self.template = v.map(|x| x.into());
18476        self
18477    }
18478
18479    /// Sets the value of [traffic][crate::model::Service::traffic].
18480    pub fn set_traffic<T, V>(mut self, v: T) -> Self
18481    where
18482        T: std::iter::IntoIterator<Item = V>,
18483        V: std::convert::Into<crate::model::TrafficTarget>,
18484    {
18485        use std::iter::Iterator;
18486        self.traffic = v.into_iter().map(|i| i.into()).collect();
18487        self
18488    }
18489
18490    /// Sets the value of [scaling][crate::model::Service::scaling].
18491    pub fn set_scaling<T>(mut self, v: T) -> Self
18492    where
18493        T: std::convert::Into<crate::model::ServiceScaling>,
18494    {
18495        self.scaling = std::option::Option::Some(v.into());
18496        self
18497    }
18498
18499    /// Sets or clears the value of [scaling][crate::model::Service::scaling].
18500    pub fn set_or_clear_scaling<T>(mut self, v: std::option::Option<T>) -> Self
18501    where
18502        T: std::convert::Into<crate::model::ServiceScaling>,
18503    {
18504        self.scaling = v.map(|x| x.into());
18505        self
18506    }
18507
18508    /// Sets the value of [invoker_iam_disabled][crate::model::Service::invoker_iam_disabled].
18509    pub fn set_invoker_iam_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18510        self.invoker_iam_disabled = v.into();
18511        self
18512    }
18513
18514    /// Sets the value of [default_uri_disabled][crate::model::Service::default_uri_disabled].
18515    pub fn set_default_uri_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18516        self.default_uri_disabled = v.into();
18517        self
18518    }
18519
18520    /// Sets the value of [urls][crate::model::Service::urls].
18521    pub fn set_urls<T, V>(mut self, v: T) -> Self
18522    where
18523        T: std::iter::IntoIterator<Item = V>,
18524        V: std::convert::Into<std::string::String>,
18525    {
18526        use std::iter::Iterator;
18527        self.urls = v.into_iter().map(|i| i.into()).collect();
18528        self
18529    }
18530
18531    /// Sets the value of [custom_audiences][crate::model::Service::custom_audiences].
18532    pub fn set_custom_audiences<T, V>(mut self, v: T) -> Self
18533    where
18534        T: std::iter::IntoIterator<Item = V>,
18535        V: std::convert::Into<std::string::String>,
18536    {
18537        use std::iter::Iterator;
18538        self.custom_audiences = v.into_iter().map(|i| i.into()).collect();
18539        self
18540    }
18541
18542    /// Sets the value of [observed_generation][crate::model::Service::observed_generation].
18543    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18544        self.observed_generation = v.into();
18545        self
18546    }
18547
18548    /// Sets the value of [terminal_condition][crate::model::Service::terminal_condition].
18549    pub fn set_terminal_condition<T>(mut self, v: T) -> Self
18550    where
18551        T: std::convert::Into<crate::model::Condition>,
18552    {
18553        self.terminal_condition = std::option::Option::Some(v.into());
18554        self
18555    }
18556
18557    /// Sets or clears the value of [terminal_condition][crate::model::Service::terminal_condition].
18558    pub fn set_or_clear_terminal_condition<T>(mut self, v: std::option::Option<T>) -> Self
18559    where
18560        T: std::convert::Into<crate::model::Condition>,
18561    {
18562        self.terminal_condition = v.map(|x| x.into());
18563        self
18564    }
18565
18566    /// Sets the value of [conditions][crate::model::Service::conditions].
18567    pub fn set_conditions<T, V>(mut self, v: T) -> Self
18568    where
18569        T: std::iter::IntoIterator<Item = V>,
18570        V: std::convert::Into<crate::model::Condition>,
18571    {
18572        use std::iter::Iterator;
18573        self.conditions = v.into_iter().map(|i| i.into()).collect();
18574        self
18575    }
18576
18577    /// Sets the value of [latest_ready_revision][crate::model::Service::latest_ready_revision].
18578    pub fn set_latest_ready_revision<T: std::convert::Into<std::string::String>>(
18579        mut self,
18580        v: T,
18581    ) -> Self {
18582        self.latest_ready_revision = v.into();
18583        self
18584    }
18585
18586    /// Sets the value of [latest_created_revision][crate::model::Service::latest_created_revision].
18587    pub fn set_latest_created_revision<T: std::convert::Into<std::string::String>>(
18588        mut self,
18589        v: T,
18590    ) -> Self {
18591        self.latest_created_revision = v.into();
18592        self
18593    }
18594
18595    /// Sets the value of [traffic_statuses][crate::model::Service::traffic_statuses].
18596    pub fn set_traffic_statuses<T, V>(mut self, v: T) -> Self
18597    where
18598        T: std::iter::IntoIterator<Item = V>,
18599        V: std::convert::Into<crate::model::TrafficTargetStatus>,
18600    {
18601        use std::iter::Iterator;
18602        self.traffic_statuses = v.into_iter().map(|i| i.into()).collect();
18603        self
18604    }
18605
18606    /// Sets the value of [uri][crate::model::Service::uri].
18607    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18608        self.uri = v.into();
18609        self
18610    }
18611
18612    /// Sets the value of [satisfies_pzs][crate::model::Service::satisfies_pzs].
18613    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18614        self.satisfies_pzs = v.into();
18615        self
18616    }
18617
18618    /// Sets the value of [build_config][crate::model::Service::build_config].
18619    pub fn set_build_config<T>(mut self, v: T) -> Self
18620    where
18621        T: std::convert::Into<crate::model::BuildConfig>,
18622    {
18623        self.build_config = std::option::Option::Some(v.into());
18624        self
18625    }
18626
18627    /// Sets or clears the value of [build_config][crate::model::Service::build_config].
18628    pub fn set_or_clear_build_config<T>(mut self, v: std::option::Option<T>) -> Self
18629    where
18630        T: std::convert::Into<crate::model::BuildConfig>,
18631    {
18632        self.build_config = v.map(|x| x.into());
18633        self
18634    }
18635
18636    /// Sets the value of [reconciling][crate::model::Service::reconciling].
18637    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18638        self.reconciling = v.into();
18639        self
18640    }
18641
18642    /// Sets the value of [etag][crate::model::Service::etag].
18643    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18644        self.etag = v.into();
18645        self
18646    }
18647}
18648
18649impl wkt::message::Message for Service {
18650    fn typename() -> &'static str {
18651        "type.googleapis.com/google.cloud.run.v2.Service"
18652    }
18653}
18654
18655#[doc(hidden)]
18656impl<'de> serde::de::Deserialize<'de> for Service {
18657    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18658    where
18659        D: serde::Deserializer<'de>,
18660    {
18661        #[allow(non_camel_case_types)]
18662        #[doc(hidden)]
18663        #[derive(PartialEq, Eq, Hash)]
18664        enum __FieldTag {
18665            __name,
18666            __description,
18667            __uid,
18668            __generation,
18669            __labels,
18670            __annotations,
18671            __create_time,
18672            __update_time,
18673            __delete_time,
18674            __expire_time,
18675            __creator,
18676            __last_modifier,
18677            __client,
18678            __client_version,
18679            __ingress,
18680            __launch_stage,
18681            __binary_authorization,
18682            __template,
18683            __traffic,
18684            __scaling,
18685            __invoker_iam_disabled,
18686            __default_uri_disabled,
18687            __urls,
18688            __custom_audiences,
18689            __observed_generation,
18690            __terminal_condition,
18691            __conditions,
18692            __latest_ready_revision,
18693            __latest_created_revision,
18694            __traffic_statuses,
18695            __uri,
18696            __satisfies_pzs,
18697            __build_config,
18698            __reconciling,
18699            __etag,
18700            Unknown(std::string::String),
18701        }
18702        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18703            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18704            where
18705                D: serde::Deserializer<'de>,
18706            {
18707                struct Visitor;
18708                impl<'de> serde::de::Visitor<'de> for Visitor {
18709                    type Value = __FieldTag;
18710                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18711                        formatter.write_str("a field name for Service")
18712                    }
18713                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18714                    where
18715                        E: serde::de::Error,
18716                    {
18717                        use std::result::Result::Ok;
18718                        use std::string::ToString;
18719                        match value {
18720                            "name" => Ok(__FieldTag::__name),
18721                            "description" => Ok(__FieldTag::__description),
18722                            "uid" => Ok(__FieldTag::__uid),
18723                            "generation" => Ok(__FieldTag::__generation),
18724                            "labels" => Ok(__FieldTag::__labels),
18725                            "annotations" => Ok(__FieldTag::__annotations),
18726                            "createTime" => Ok(__FieldTag::__create_time),
18727                            "create_time" => Ok(__FieldTag::__create_time),
18728                            "updateTime" => Ok(__FieldTag::__update_time),
18729                            "update_time" => Ok(__FieldTag::__update_time),
18730                            "deleteTime" => Ok(__FieldTag::__delete_time),
18731                            "delete_time" => Ok(__FieldTag::__delete_time),
18732                            "expireTime" => Ok(__FieldTag::__expire_time),
18733                            "expire_time" => Ok(__FieldTag::__expire_time),
18734                            "creator" => Ok(__FieldTag::__creator),
18735                            "lastModifier" => Ok(__FieldTag::__last_modifier),
18736                            "last_modifier" => Ok(__FieldTag::__last_modifier),
18737                            "client" => Ok(__FieldTag::__client),
18738                            "clientVersion" => Ok(__FieldTag::__client_version),
18739                            "client_version" => Ok(__FieldTag::__client_version),
18740                            "ingress" => Ok(__FieldTag::__ingress),
18741                            "launchStage" => Ok(__FieldTag::__launch_stage),
18742                            "launch_stage" => Ok(__FieldTag::__launch_stage),
18743                            "binaryAuthorization" => Ok(__FieldTag::__binary_authorization),
18744                            "binary_authorization" => Ok(__FieldTag::__binary_authorization),
18745                            "template" => Ok(__FieldTag::__template),
18746                            "traffic" => Ok(__FieldTag::__traffic),
18747                            "scaling" => Ok(__FieldTag::__scaling),
18748                            "invokerIamDisabled" => Ok(__FieldTag::__invoker_iam_disabled),
18749                            "invoker_iam_disabled" => Ok(__FieldTag::__invoker_iam_disabled),
18750                            "defaultUriDisabled" => Ok(__FieldTag::__default_uri_disabled),
18751                            "default_uri_disabled" => Ok(__FieldTag::__default_uri_disabled),
18752                            "urls" => Ok(__FieldTag::__urls),
18753                            "customAudiences" => Ok(__FieldTag::__custom_audiences),
18754                            "custom_audiences" => Ok(__FieldTag::__custom_audiences),
18755                            "observedGeneration" => Ok(__FieldTag::__observed_generation),
18756                            "observed_generation" => Ok(__FieldTag::__observed_generation),
18757                            "terminalCondition" => Ok(__FieldTag::__terminal_condition),
18758                            "terminal_condition" => Ok(__FieldTag::__terminal_condition),
18759                            "conditions" => Ok(__FieldTag::__conditions),
18760                            "latestReadyRevision" => Ok(__FieldTag::__latest_ready_revision),
18761                            "latest_ready_revision" => Ok(__FieldTag::__latest_ready_revision),
18762                            "latestCreatedRevision" => Ok(__FieldTag::__latest_created_revision),
18763                            "latest_created_revision" => Ok(__FieldTag::__latest_created_revision),
18764                            "trafficStatuses" => Ok(__FieldTag::__traffic_statuses),
18765                            "traffic_statuses" => Ok(__FieldTag::__traffic_statuses),
18766                            "uri" => Ok(__FieldTag::__uri),
18767                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
18768                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
18769                            "buildConfig" => Ok(__FieldTag::__build_config),
18770                            "build_config" => Ok(__FieldTag::__build_config),
18771                            "reconciling" => Ok(__FieldTag::__reconciling),
18772                            "etag" => Ok(__FieldTag::__etag),
18773                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18774                        }
18775                    }
18776                }
18777                deserializer.deserialize_identifier(Visitor)
18778            }
18779        }
18780        struct Visitor;
18781        impl<'de> serde::de::Visitor<'de> for Visitor {
18782            type Value = Service;
18783            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18784                formatter.write_str("struct Service")
18785            }
18786            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18787            where
18788                A: serde::de::MapAccess<'de>,
18789            {
18790                #[allow(unused_imports)]
18791                use serde::de::Error;
18792                use std::option::Option::Some;
18793                let mut fields = std::collections::HashSet::new();
18794                let mut result = Self::Value::new();
18795                while let Some(tag) = map.next_key::<__FieldTag>()? {
18796                    #[allow(clippy::match_single_binding)]
18797                    match tag {
18798                        __FieldTag::__name => {
18799                            if !fields.insert(__FieldTag::__name) {
18800                                return std::result::Result::Err(A::Error::duplicate_field(
18801                                    "multiple values for name",
18802                                ));
18803                            }
18804                            result.name = map
18805                                .next_value::<std::option::Option<std::string::String>>()?
18806                                .unwrap_or_default();
18807                        }
18808                        __FieldTag::__description => {
18809                            if !fields.insert(__FieldTag::__description) {
18810                                return std::result::Result::Err(A::Error::duplicate_field(
18811                                    "multiple values for description",
18812                                ));
18813                            }
18814                            result.description = map
18815                                .next_value::<std::option::Option<std::string::String>>()?
18816                                .unwrap_or_default();
18817                        }
18818                        __FieldTag::__uid => {
18819                            if !fields.insert(__FieldTag::__uid) {
18820                                return std::result::Result::Err(A::Error::duplicate_field(
18821                                    "multiple values for uid",
18822                                ));
18823                            }
18824                            result.uid = map
18825                                .next_value::<std::option::Option<std::string::String>>()?
18826                                .unwrap_or_default();
18827                        }
18828                        __FieldTag::__generation => {
18829                            if !fields.insert(__FieldTag::__generation) {
18830                                return std::result::Result::Err(A::Error::duplicate_field(
18831                                    "multiple values for generation",
18832                                ));
18833                            }
18834                            struct __With(std::option::Option<i64>);
18835                            impl<'de> serde::de::Deserialize<'de> for __With {
18836                                fn deserialize<D>(
18837                                    deserializer: D,
18838                                ) -> std::result::Result<Self, D::Error>
18839                                where
18840                                    D: serde::de::Deserializer<'de>,
18841                                {
18842                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
18843                                }
18844                            }
18845                            result.generation = map.next_value::<__With>()?.0.unwrap_or_default();
18846                        }
18847                        __FieldTag::__labels => {
18848                            if !fields.insert(__FieldTag::__labels) {
18849                                return std::result::Result::Err(A::Error::duplicate_field(
18850                                    "multiple values for labels",
18851                                ));
18852                            }
18853                            result.labels = map
18854                                .next_value::<std::option::Option<
18855                                    std::collections::HashMap<
18856                                        std::string::String,
18857                                        std::string::String,
18858                                    >,
18859                                >>()?
18860                                .unwrap_or_default();
18861                        }
18862                        __FieldTag::__annotations => {
18863                            if !fields.insert(__FieldTag::__annotations) {
18864                                return std::result::Result::Err(A::Error::duplicate_field(
18865                                    "multiple values for annotations",
18866                                ));
18867                            }
18868                            result.annotations = map
18869                                .next_value::<std::option::Option<
18870                                    std::collections::HashMap<
18871                                        std::string::String,
18872                                        std::string::String,
18873                                    >,
18874                                >>()?
18875                                .unwrap_or_default();
18876                        }
18877                        __FieldTag::__create_time => {
18878                            if !fields.insert(__FieldTag::__create_time) {
18879                                return std::result::Result::Err(A::Error::duplicate_field(
18880                                    "multiple values for create_time",
18881                                ));
18882                            }
18883                            result.create_time =
18884                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
18885                        }
18886                        __FieldTag::__update_time => {
18887                            if !fields.insert(__FieldTag::__update_time) {
18888                                return std::result::Result::Err(A::Error::duplicate_field(
18889                                    "multiple values for update_time",
18890                                ));
18891                            }
18892                            result.update_time =
18893                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
18894                        }
18895                        __FieldTag::__delete_time => {
18896                            if !fields.insert(__FieldTag::__delete_time) {
18897                                return std::result::Result::Err(A::Error::duplicate_field(
18898                                    "multiple values for delete_time",
18899                                ));
18900                            }
18901                            result.delete_time =
18902                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
18903                        }
18904                        __FieldTag::__expire_time => {
18905                            if !fields.insert(__FieldTag::__expire_time) {
18906                                return std::result::Result::Err(A::Error::duplicate_field(
18907                                    "multiple values for expire_time",
18908                                ));
18909                            }
18910                            result.expire_time =
18911                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
18912                        }
18913                        __FieldTag::__creator => {
18914                            if !fields.insert(__FieldTag::__creator) {
18915                                return std::result::Result::Err(A::Error::duplicate_field(
18916                                    "multiple values for creator",
18917                                ));
18918                            }
18919                            result.creator = map
18920                                .next_value::<std::option::Option<std::string::String>>()?
18921                                .unwrap_or_default();
18922                        }
18923                        __FieldTag::__last_modifier => {
18924                            if !fields.insert(__FieldTag::__last_modifier) {
18925                                return std::result::Result::Err(A::Error::duplicate_field(
18926                                    "multiple values for last_modifier",
18927                                ));
18928                            }
18929                            result.last_modifier = map
18930                                .next_value::<std::option::Option<std::string::String>>()?
18931                                .unwrap_or_default();
18932                        }
18933                        __FieldTag::__client => {
18934                            if !fields.insert(__FieldTag::__client) {
18935                                return std::result::Result::Err(A::Error::duplicate_field(
18936                                    "multiple values for client",
18937                                ));
18938                            }
18939                            result.client = map
18940                                .next_value::<std::option::Option<std::string::String>>()?
18941                                .unwrap_or_default();
18942                        }
18943                        __FieldTag::__client_version => {
18944                            if !fields.insert(__FieldTag::__client_version) {
18945                                return std::result::Result::Err(A::Error::duplicate_field(
18946                                    "multiple values for client_version",
18947                                ));
18948                            }
18949                            result.client_version = map
18950                                .next_value::<std::option::Option<std::string::String>>()?
18951                                .unwrap_or_default();
18952                        }
18953                        __FieldTag::__ingress => {
18954                            if !fields.insert(__FieldTag::__ingress) {
18955                                return std::result::Result::Err(A::Error::duplicate_field(
18956                                    "multiple values for ingress",
18957                                ));
18958                            }
18959                            result.ingress = map
18960                                .next_value::<std::option::Option<crate::model::IngressTraffic>>()?
18961                                .unwrap_or_default();
18962                        }
18963                        __FieldTag::__launch_stage => {
18964                            if !fields.insert(__FieldTag::__launch_stage) {
18965                                return std::result::Result::Err(A::Error::duplicate_field(
18966                                    "multiple values for launch_stage",
18967                                ));
18968                            }
18969                            result.launch_stage = map
18970                                .next_value::<std::option::Option<api::model::LaunchStage>>()?
18971                                .unwrap_or_default();
18972                        }
18973                        __FieldTag::__binary_authorization => {
18974                            if !fields.insert(__FieldTag::__binary_authorization) {
18975                                return std::result::Result::Err(A::Error::duplicate_field(
18976                                    "multiple values for binary_authorization",
18977                                ));
18978                            }
18979                            result.binary_authorization = map.next_value::<std::option::Option<crate::model::BinaryAuthorization>>()?
18980                                ;
18981                        }
18982                        __FieldTag::__template => {
18983                            if !fields.insert(__FieldTag::__template) {
18984                                return std::result::Result::Err(A::Error::duplicate_field(
18985                                    "multiple values for template",
18986                                ));
18987                            }
18988                            result.template = map
18989                                .next_value::<std::option::Option<crate::model::RevisionTemplate>>(
18990                                )?;
18991                        }
18992                        __FieldTag::__traffic => {
18993                            if !fields.insert(__FieldTag::__traffic) {
18994                                return std::result::Result::Err(A::Error::duplicate_field(
18995                                    "multiple values for traffic",
18996                                ));
18997                            }
18998                            result.traffic = map.next_value::<std::option::Option<std::vec::Vec<crate::model::TrafficTarget>>>()?.unwrap_or_default();
18999                        }
19000                        __FieldTag::__scaling => {
19001                            if !fields.insert(__FieldTag::__scaling) {
19002                                return std::result::Result::Err(A::Error::duplicate_field(
19003                                    "multiple values for scaling",
19004                                ));
19005                            }
19006                            result.scaling = map
19007                                .next_value::<std::option::Option<crate::model::ServiceScaling>>(
19008                                )?;
19009                        }
19010                        __FieldTag::__invoker_iam_disabled => {
19011                            if !fields.insert(__FieldTag::__invoker_iam_disabled) {
19012                                return std::result::Result::Err(A::Error::duplicate_field(
19013                                    "multiple values for invoker_iam_disabled",
19014                                ));
19015                            }
19016                            result.invoker_iam_disabled = map
19017                                .next_value::<std::option::Option<bool>>()?
19018                                .unwrap_or_default();
19019                        }
19020                        __FieldTag::__default_uri_disabled => {
19021                            if !fields.insert(__FieldTag::__default_uri_disabled) {
19022                                return std::result::Result::Err(A::Error::duplicate_field(
19023                                    "multiple values for default_uri_disabled",
19024                                ));
19025                            }
19026                            result.default_uri_disabled = map
19027                                .next_value::<std::option::Option<bool>>()?
19028                                .unwrap_or_default();
19029                        }
19030                        __FieldTag::__urls => {
19031                            if !fields.insert(__FieldTag::__urls) {
19032                                return std::result::Result::Err(A::Error::duplicate_field(
19033                                    "multiple values for urls",
19034                                ));
19035                            }
19036                            result.urls = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
19037                        }
19038                        __FieldTag::__custom_audiences => {
19039                            if !fields.insert(__FieldTag::__custom_audiences) {
19040                                return std::result::Result::Err(A::Error::duplicate_field(
19041                                    "multiple values for custom_audiences",
19042                                ));
19043                            }
19044                            result.custom_audiences = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
19045                        }
19046                        __FieldTag::__observed_generation => {
19047                            if !fields.insert(__FieldTag::__observed_generation) {
19048                                return std::result::Result::Err(A::Error::duplicate_field(
19049                                    "multiple values for observed_generation",
19050                                ));
19051                            }
19052                            struct __With(std::option::Option<i64>);
19053                            impl<'de> serde::de::Deserialize<'de> for __With {
19054                                fn deserialize<D>(
19055                                    deserializer: D,
19056                                ) -> std::result::Result<Self, D::Error>
19057                                where
19058                                    D: serde::de::Deserializer<'de>,
19059                                {
19060                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
19061                                }
19062                            }
19063                            result.observed_generation =
19064                                map.next_value::<__With>()?.0.unwrap_or_default();
19065                        }
19066                        __FieldTag::__terminal_condition => {
19067                            if !fields.insert(__FieldTag::__terminal_condition) {
19068                                return std::result::Result::Err(A::Error::duplicate_field(
19069                                    "multiple values for terminal_condition",
19070                                ));
19071                            }
19072                            result.terminal_condition =
19073                                map.next_value::<std::option::Option<crate::model::Condition>>()?;
19074                        }
19075                        __FieldTag::__conditions => {
19076                            if !fields.insert(__FieldTag::__conditions) {
19077                                return std::result::Result::Err(A::Error::duplicate_field(
19078                                    "multiple values for conditions",
19079                                ));
19080                            }
19081                            result.conditions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Condition>>>()?.unwrap_or_default();
19082                        }
19083                        __FieldTag::__latest_ready_revision => {
19084                            if !fields.insert(__FieldTag::__latest_ready_revision) {
19085                                return std::result::Result::Err(A::Error::duplicate_field(
19086                                    "multiple values for latest_ready_revision",
19087                                ));
19088                            }
19089                            result.latest_ready_revision = map
19090                                .next_value::<std::option::Option<std::string::String>>()?
19091                                .unwrap_or_default();
19092                        }
19093                        __FieldTag::__latest_created_revision => {
19094                            if !fields.insert(__FieldTag::__latest_created_revision) {
19095                                return std::result::Result::Err(A::Error::duplicate_field(
19096                                    "multiple values for latest_created_revision",
19097                                ));
19098                            }
19099                            result.latest_created_revision = map
19100                                .next_value::<std::option::Option<std::string::String>>()?
19101                                .unwrap_or_default();
19102                        }
19103                        __FieldTag::__traffic_statuses => {
19104                            if !fields.insert(__FieldTag::__traffic_statuses) {
19105                                return std::result::Result::Err(A::Error::duplicate_field(
19106                                    "multiple values for traffic_statuses",
19107                                ));
19108                            }
19109                            result.traffic_statuses = map
19110                                .next_value::<std::option::Option<
19111                                    std::vec::Vec<crate::model::TrafficTargetStatus>,
19112                                >>()?
19113                                .unwrap_or_default();
19114                        }
19115                        __FieldTag::__uri => {
19116                            if !fields.insert(__FieldTag::__uri) {
19117                                return std::result::Result::Err(A::Error::duplicate_field(
19118                                    "multiple values for uri",
19119                                ));
19120                            }
19121                            result.uri = map
19122                                .next_value::<std::option::Option<std::string::String>>()?
19123                                .unwrap_or_default();
19124                        }
19125                        __FieldTag::__satisfies_pzs => {
19126                            if !fields.insert(__FieldTag::__satisfies_pzs) {
19127                                return std::result::Result::Err(A::Error::duplicate_field(
19128                                    "multiple values for satisfies_pzs",
19129                                ));
19130                            }
19131                            result.satisfies_pzs = map
19132                                .next_value::<std::option::Option<bool>>()?
19133                                .unwrap_or_default();
19134                        }
19135                        __FieldTag::__build_config => {
19136                            if !fields.insert(__FieldTag::__build_config) {
19137                                return std::result::Result::Err(A::Error::duplicate_field(
19138                                    "multiple values for build_config",
19139                                ));
19140                            }
19141                            result.build_config =
19142                                map.next_value::<std::option::Option<crate::model::BuildConfig>>()?;
19143                        }
19144                        __FieldTag::__reconciling => {
19145                            if !fields.insert(__FieldTag::__reconciling) {
19146                                return std::result::Result::Err(A::Error::duplicate_field(
19147                                    "multiple values for reconciling",
19148                                ));
19149                            }
19150                            result.reconciling = map
19151                                .next_value::<std::option::Option<bool>>()?
19152                                .unwrap_or_default();
19153                        }
19154                        __FieldTag::__etag => {
19155                            if !fields.insert(__FieldTag::__etag) {
19156                                return std::result::Result::Err(A::Error::duplicate_field(
19157                                    "multiple values for etag",
19158                                ));
19159                            }
19160                            result.etag = map
19161                                .next_value::<std::option::Option<std::string::String>>()?
19162                                .unwrap_or_default();
19163                        }
19164                        __FieldTag::Unknown(key) => {
19165                            let value = map.next_value::<serde_json::Value>()?;
19166                            result._unknown_fields.insert(key, value);
19167                        }
19168                    }
19169                }
19170                std::result::Result::Ok(result)
19171            }
19172        }
19173        deserializer.deserialize_any(Visitor)
19174    }
19175}
19176
19177#[doc(hidden)]
19178impl serde::ser::Serialize for Service {
19179    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19180    where
19181        S: serde::ser::Serializer,
19182    {
19183        use serde::ser::SerializeMap;
19184        #[allow(unused_imports)]
19185        use std::option::Option::Some;
19186        let mut state = serializer.serialize_map(std::option::Option::None)?;
19187        if !self.name.is_empty() {
19188            state.serialize_entry("name", &self.name)?;
19189        }
19190        if !self.description.is_empty() {
19191            state.serialize_entry("description", &self.description)?;
19192        }
19193        if !self.uid.is_empty() {
19194            state.serialize_entry("uid", &self.uid)?;
19195        }
19196        if !wkt::internal::is_default(&self.generation) {
19197            struct __With<'a>(&'a i64);
19198            impl<'a> serde::ser::Serialize for __With<'a> {
19199                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19200                where
19201                    S: serde::ser::Serializer,
19202                {
19203                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
19204                }
19205            }
19206            state.serialize_entry("generation", &__With(&self.generation))?;
19207        }
19208        if !self.labels.is_empty() {
19209            state.serialize_entry("labels", &self.labels)?;
19210        }
19211        if !self.annotations.is_empty() {
19212            state.serialize_entry("annotations", &self.annotations)?;
19213        }
19214        if self.create_time.is_some() {
19215            state.serialize_entry("createTime", &self.create_time)?;
19216        }
19217        if self.update_time.is_some() {
19218            state.serialize_entry("updateTime", &self.update_time)?;
19219        }
19220        if self.delete_time.is_some() {
19221            state.serialize_entry("deleteTime", &self.delete_time)?;
19222        }
19223        if self.expire_time.is_some() {
19224            state.serialize_entry("expireTime", &self.expire_time)?;
19225        }
19226        if !self.creator.is_empty() {
19227            state.serialize_entry("creator", &self.creator)?;
19228        }
19229        if !self.last_modifier.is_empty() {
19230            state.serialize_entry("lastModifier", &self.last_modifier)?;
19231        }
19232        if !self.client.is_empty() {
19233            state.serialize_entry("client", &self.client)?;
19234        }
19235        if !self.client_version.is_empty() {
19236            state.serialize_entry("clientVersion", &self.client_version)?;
19237        }
19238        if !wkt::internal::is_default(&self.ingress) {
19239            state.serialize_entry("ingress", &self.ingress)?;
19240        }
19241        if !wkt::internal::is_default(&self.launch_stage) {
19242            state.serialize_entry("launchStage", &self.launch_stage)?;
19243        }
19244        if self.binary_authorization.is_some() {
19245            state.serialize_entry("binaryAuthorization", &self.binary_authorization)?;
19246        }
19247        if self.template.is_some() {
19248            state.serialize_entry("template", &self.template)?;
19249        }
19250        if !self.traffic.is_empty() {
19251            state.serialize_entry("traffic", &self.traffic)?;
19252        }
19253        if self.scaling.is_some() {
19254            state.serialize_entry("scaling", &self.scaling)?;
19255        }
19256        if !wkt::internal::is_default(&self.invoker_iam_disabled) {
19257            state.serialize_entry("invokerIamDisabled", &self.invoker_iam_disabled)?;
19258        }
19259        if !wkt::internal::is_default(&self.default_uri_disabled) {
19260            state.serialize_entry("defaultUriDisabled", &self.default_uri_disabled)?;
19261        }
19262        if !self.urls.is_empty() {
19263            state.serialize_entry("urls", &self.urls)?;
19264        }
19265        if !self.custom_audiences.is_empty() {
19266            state.serialize_entry("customAudiences", &self.custom_audiences)?;
19267        }
19268        if !wkt::internal::is_default(&self.observed_generation) {
19269            struct __With<'a>(&'a i64);
19270            impl<'a> serde::ser::Serialize for __With<'a> {
19271                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19272                where
19273                    S: serde::ser::Serializer,
19274                {
19275                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
19276                }
19277            }
19278            state.serialize_entry("observedGeneration", &__With(&self.observed_generation))?;
19279        }
19280        if self.terminal_condition.is_some() {
19281            state.serialize_entry("terminalCondition", &self.terminal_condition)?;
19282        }
19283        if !self.conditions.is_empty() {
19284            state.serialize_entry("conditions", &self.conditions)?;
19285        }
19286        if !self.latest_ready_revision.is_empty() {
19287            state.serialize_entry("latestReadyRevision", &self.latest_ready_revision)?;
19288        }
19289        if !self.latest_created_revision.is_empty() {
19290            state.serialize_entry("latestCreatedRevision", &self.latest_created_revision)?;
19291        }
19292        if !self.traffic_statuses.is_empty() {
19293            state.serialize_entry("trafficStatuses", &self.traffic_statuses)?;
19294        }
19295        if !self.uri.is_empty() {
19296            state.serialize_entry("uri", &self.uri)?;
19297        }
19298        if !wkt::internal::is_default(&self.satisfies_pzs) {
19299            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
19300        }
19301        if self.build_config.is_some() {
19302            state.serialize_entry("buildConfig", &self.build_config)?;
19303        }
19304        if !wkt::internal::is_default(&self.reconciling) {
19305            state.serialize_entry("reconciling", &self.reconciling)?;
19306        }
19307        if !self.etag.is_empty() {
19308            state.serialize_entry("etag", &self.etag)?;
19309        }
19310        if !self._unknown_fields.is_empty() {
19311            for (key, value) in self._unknown_fields.iter() {
19312                state.serialize_entry(key, &value)?;
19313            }
19314        }
19315        state.end()
19316    }
19317}
19318
19319impl std::fmt::Debug for Service {
19320    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19321        let mut debug_struct = f.debug_struct("Service");
19322        debug_struct.field("name", &self.name);
19323        debug_struct.field("description", &self.description);
19324        debug_struct.field("uid", &self.uid);
19325        debug_struct.field("generation", &self.generation);
19326        debug_struct.field("labels", &self.labels);
19327        debug_struct.field("annotations", &self.annotations);
19328        debug_struct.field("create_time", &self.create_time);
19329        debug_struct.field("update_time", &self.update_time);
19330        debug_struct.field("delete_time", &self.delete_time);
19331        debug_struct.field("expire_time", &self.expire_time);
19332        debug_struct.field("creator", &self.creator);
19333        debug_struct.field("last_modifier", &self.last_modifier);
19334        debug_struct.field("client", &self.client);
19335        debug_struct.field("client_version", &self.client_version);
19336        debug_struct.field("ingress", &self.ingress);
19337        debug_struct.field("launch_stage", &self.launch_stage);
19338        debug_struct.field("binary_authorization", &self.binary_authorization);
19339        debug_struct.field("template", &self.template);
19340        debug_struct.field("traffic", &self.traffic);
19341        debug_struct.field("scaling", &self.scaling);
19342        debug_struct.field("invoker_iam_disabled", &self.invoker_iam_disabled);
19343        debug_struct.field("default_uri_disabled", &self.default_uri_disabled);
19344        debug_struct.field("urls", &self.urls);
19345        debug_struct.field("custom_audiences", &self.custom_audiences);
19346        debug_struct.field("observed_generation", &self.observed_generation);
19347        debug_struct.field("terminal_condition", &self.terminal_condition);
19348        debug_struct.field("conditions", &self.conditions);
19349        debug_struct.field("latest_ready_revision", &self.latest_ready_revision);
19350        debug_struct.field("latest_created_revision", &self.latest_created_revision);
19351        debug_struct.field("traffic_statuses", &self.traffic_statuses);
19352        debug_struct.field("uri", &self.uri);
19353        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
19354        debug_struct.field("build_config", &self.build_config);
19355        debug_struct.field("reconciling", &self.reconciling);
19356        debug_struct.field("etag", &self.etag);
19357        if !self._unknown_fields.is_empty() {
19358            debug_struct.field("_unknown_fields", &self._unknown_fields);
19359        }
19360        debug_struct.finish()
19361    }
19362}
19363
19364/// Effective settings for the current revision
19365#[derive(Clone, Default, PartialEq)]
19366#[non_exhaustive]
19367pub struct RevisionScalingStatus {
19368    /// The current number of min instances provisioned for this revision.
19369    pub desired_min_instance_count: i32,
19370
19371    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19372}
19373
19374impl RevisionScalingStatus {
19375    pub fn new() -> Self {
19376        std::default::Default::default()
19377    }
19378
19379    /// Sets the value of [desired_min_instance_count][crate::model::RevisionScalingStatus::desired_min_instance_count].
19380    pub fn set_desired_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19381        self.desired_min_instance_count = v.into();
19382        self
19383    }
19384}
19385
19386impl wkt::message::Message for RevisionScalingStatus {
19387    fn typename() -> &'static str {
19388        "type.googleapis.com/google.cloud.run.v2.RevisionScalingStatus"
19389    }
19390}
19391
19392#[doc(hidden)]
19393impl<'de> serde::de::Deserialize<'de> for RevisionScalingStatus {
19394    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19395    where
19396        D: serde::Deserializer<'de>,
19397    {
19398        #[allow(non_camel_case_types)]
19399        #[doc(hidden)]
19400        #[derive(PartialEq, Eq, Hash)]
19401        enum __FieldTag {
19402            __desired_min_instance_count,
19403            Unknown(std::string::String),
19404        }
19405        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19406            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19407            where
19408                D: serde::Deserializer<'de>,
19409            {
19410                struct Visitor;
19411                impl<'de> serde::de::Visitor<'de> for Visitor {
19412                    type Value = __FieldTag;
19413                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19414                        formatter.write_str("a field name for RevisionScalingStatus")
19415                    }
19416                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19417                    where
19418                        E: serde::de::Error,
19419                    {
19420                        use std::result::Result::Ok;
19421                        use std::string::ToString;
19422                        match value {
19423                            "desiredMinInstanceCount" => {
19424                                Ok(__FieldTag::__desired_min_instance_count)
19425                            }
19426                            "desired_min_instance_count" => {
19427                                Ok(__FieldTag::__desired_min_instance_count)
19428                            }
19429                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19430                        }
19431                    }
19432                }
19433                deserializer.deserialize_identifier(Visitor)
19434            }
19435        }
19436        struct Visitor;
19437        impl<'de> serde::de::Visitor<'de> for Visitor {
19438            type Value = RevisionScalingStatus;
19439            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19440                formatter.write_str("struct RevisionScalingStatus")
19441            }
19442            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19443            where
19444                A: serde::de::MapAccess<'de>,
19445            {
19446                #[allow(unused_imports)]
19447                use serde::de::Error;
19448                use std::option::Option::Some;
19449                let mut fields = std::collections::HashSet::new();
19450                let mut result = Self::Value::new();
19451                while let Some(tag) = map.next_key::<__FieldTag>()? {
19452                    #[allow(clippy::match_single_binding)]
19453                    match tag {
19454                        __FieldTag::__desired_min_instance_count => {
19455                            if !fields.insert(__FieldTag::__desired_min_instance_count) {
19456                                return std::result::Result::Err(A::Error::duplicate_field(
19457                                    "multiple values for desired_min_instance_count",
19458                                ));
19459                            }
19460                            struct __With(std::option::Option<i32>);
19461                            impl<'de> serde::de::Deserialize<'de> for __With {
19462                                fn deserialize<D>(
19463                                    deserializer: D,
19464                                ) -> std::result::Result<Self, D::Error>
19465                                where
19466                                    D: serde::de::Deserializer<'de>,
19467                                {
19468                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
19469                                }
19470                            }
19471                            result.desired_min_instance_count =
19472                                map.next_value::<__With>()?.0.unwrap_or_default();
19473                        }
19474                        __FieldTag::Unknown(key) => {
19475                            let value = map.next_value::<serde_json::Value>()?;
19476                            result._unknown_fields.insert(key, value);
19477                        }
19478                    }
19479                }
19480                std::result::Result::Ok(result)
19481            }
19482        }
19483        deserializer.deserialize_any(Visitor)
19484    }
19485}
19486
19487#[doc(hidden)]
19488impl serde::ser::Serialize for RevisionScalingStatus {
19489    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19490    where
19491        S: serde::ser::Serializer,
19492    {
19493        use serde::ser::SerializeMap;
19494        #[allow(unused_imports)]
19495        use std::option::Option::Some;
19496        let mut state = serializer.serialize_map(std::option::Option::None)?;
19497        if !wkt::internal::is_default(&self.desired_min_instance_count) {
19498            struct __With<'a>(&'a i32);
19499            impl<'a> serde::ser::Serialize for __With<'a> {
19500                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19501                where
19502                    S: serde::ser::Serializer,
19503                {
19504                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
19505                }
19506            }
19507            state.serialize_entry(
19508                "desiredMinInstanceCount",
19509                &__With(&self.desired_min_instance_count),
19510            )?;
19511        }
19512        if !self._unknown_fields.is_empty() {
19513            for (key, value) in self._unknown_fields.iter() {
19514                state.serialize_entry(key, &value)?;
19515            }
19516        }
19517        state.end()
19518    }
19519}
19520
19521impl std::fmt::Debug for RevisionScalingStatus {
19522    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19523        let mut debug_struct = f.debug_struct("RevisionScalingStatus");
19524        debug_struct.field(
19525            "desired_min_instance_count",
19526            &self.desired_min_instance_count,
19527        );
19528        if !self._unknown_fields.is_empty() {
19529            debug_struct.field("_unknown_fields", &self._unknown_fields);
19530        }
19531        debug_struct.finish()
19532    }
19533}
19534
19535/// Request message for obtaining a Task by its full name.
19536#[derive(Clone, Default, PartialEq)]
19537#[non_exhaustive]
19538pub struct GetTaskRequest {
19539    /// Required. The full name of the Task.
19540    /// Format:
19541    /// projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}
19542    pub name: std::string::String,
19543
19544    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19545}
19546
19547impl GetTaskRequest {
19548    pub fn new() -> Self {
19549        std::default::Default::default()
19550    }
19551
19552    /// Sets the value of [name][crate::model::GetTaskRequest::name].
19553    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19554        self.name = v.into();
19555        self
19556    }
19557}
19558
19559impl wkt::message::Message for GetTaskRequest {
19560    fn typename() -> &'static str {
19561        "type.googleapis.com/google.cloud.run.v2.GetTaskRequest"
19562    }
19563}
19564
19565#[doc(hidden)]
19566impl<'de> serde::de::Deserialize<'de> for GetTaskRequest {
19567    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19568    where
19569        D: serde::Deserializer<'de>,
19570    {
19571        #[allow(non_camel_case_types)]
19572        #[doc(hidden)]
19573        #[derive(PartialEq, Eq, Hash)]
19574        enum __FieldTag {
19575            __name,
19576            Unknown(std::string::String),
19577        }
19578        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19579            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19580            where
19581                D: serde::Deserializer<'de>,
19582            {
19583                struct Visitor;
19584                impl<'de> serde::de::Visitor<'de> for Visitor {
19585                    type Value = __FieldTag;
19586                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19587                        formatter.write_str("a field name for GetTaskRequest")
19588                    }
19589                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19590                    where
19591                        E: serde::de::Error,
19592                    {
19593                        use std::result::Result::Ok;
19594                        use std::string::ToString;
19595                        match value {
19596                            "name" => Ok(__FieldTag::__name),
19597                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19598                        }
19599                    }
19600                }
19601                deserializer.deserialize_identifier(Visitor)
19602            }
19603        }
19604        struct Visitor;
19605        impl<'de> serde::de::Visitor<'de> for Visitor {
19606            type Value = GetTaskRequest;
19607            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19608                formatter.write_str("struct GetTaskRequest")
19609            }
19610            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19611            where
19612                A: serde::de::MapAccess<'de>,
19613            {
19614                #[allow(unused_imports)]
19615                use serde::de::Error;
19616                use std::option::Option::Some;
19617                let mut fields = std::collections::HashSet::new();
19618                let mut result = Self::Value::new();
19619                while let Some(tag) = map.next_key::<__FieldTag>()? {
19620                    #[allow(clippy::match_single_binding)]
19621                    match tag {
19622                        __FieldTag::__name => {
19623                            if !fields.insert(__FieldTag::__name) {
19624                                return std::result::Result::Err(A::Error::duplicate_field(
19625                                    "multiple values for name",
19626                                ));
19627                            }
19628                            result.name = map
19629                                .next_value::<std::option::Option<std::string::String>>()?
19630                                .unwrap_or_default();
19631                        }
19632                        __FieldTag::Unknown(key) => {
19633                            let value = map.next_value::<serde_json::Value>()?;
19634                            result._unknown_fields.insert(key, value);
19635                        }
19636                    }
19637                }
19638                std::result::Result::Ok(result)
19639            }
19640        }
19641        deserializer.deserialize_any(Visitor)
19642    }
19643}
19644
19645#[doc(hidden)]
19646impl serde::ser::Serialize for GetTaskRequest {
19647    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19648    where
19649        S: serde::ser::Serializer,
19650    {
19651        use serde::ser::SerializeMap;
19652        #[allow(unused_imports)]
19653        use std::option::Option::Some;
19654        let mut state = serializer.serialize_map(std::option::Option::None)?;
19655        if !self.name.is_empty() {
19656            state.serialize_entry("name", &self.name)?;
19657        }
19658        if !self._unknown_fields.is_empty() {
19659            for (key, value) in self._unknown_fields.iter() {
19660                state.serialize_entry(key, &value)?;
19661            }
19662        }
19663        state.end()
19664    }
19665}
19666
19667impl std::fmt::Debug for GetTaskRequest {
19668    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19669        let mut debug_struct = f.debug_struct("GetTaskRequest");
19670        debug_struct.field("name", &self.name);
19671        if !self._unknown_fields.is_empty() {
19672            debug_struct.field("_unknown_fields", &self._unknown_fields);
19673        }
19674        debug_struct.finish()
19675    }
19676}
19677
19678/// Request message for retrieving a list of Tasks.
19679#[derive(Clone, Default, PartialEq)]
19680#[non_exhaustive]
19681pub struct ListTasksRequest {
19682    /// Required. The Execution from which the Tasks should be listed.
19683    /// To list all Tasks across Executions of a Job, use "-" instead of Execution
19684    /// name. To list all Tasks across Jobs, use "-" instead of Job name. Format:
19685    /// projects/{project}/locations/{location}/jobs/{job}/executions/{execution}
19686    pub parent: std::string::String,
19687
19688    /// Maximum number of Tasks to return in this call.
19689    pub page_size: i32,
19690
19691    /// A page token received from a previous call to ListTasks.
19692    /// All other parameters must match.
19693    pub page_token: std::string::String,
19694
19695    /// If true, returns deleted (but unexpired) resources along with active ones.
19696    pub show_deleted: bool,
19697
19698    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19699}
19700
19701impl ListTasksRequest {
19702    pub fn new() -> Self {
19703        std::default::Default::default()
19704    }
19705
19706    /// Sets the value of [parent][crate::model::ListTasksRequest::parent].
19707    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19708        self.parent = v.into();
19709        self
19710    }
19711
19712    /// Sets the value of [page_size][crate::model::ListTasksRequest::page_size].
19713    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19714        self.page_size = v.into();
19715        self
19716    }
19717
19718    /// Sets the value of [page_token][crate::model::ListTasksRequest::page_token].
19719    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19720        self.page_token = v.into();
19721        self
19722    }
19723
19724    /// Sets the value of [show_deleted][crate::model::ListTasksRequest::show_deleted].
19725    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19726        self.show_deleted = v.into();
19727        self
19728    }
19729}
19730
19731impl wkt::message::Message for ListTasksRequest {
19732    fn typename() -> &'static str {
19733        "type.googleapis.com/google.cloud.run.v2.ListTasksRequest"
19734    }
19735}
19736
19737#[doc(hidden)]
19738impl<'de> serde::de::Deserialize<'de> for ListTasksRequest {
19739    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19740    where
19741        D: serde::Deserializer<'de>,
19742    {
19743        #[allow(non_camel_case_types)]
19744        #[doc(hidden)]
19745        #[derive(PartialEq, Eq, Hash)]
19746        enum __FieldTag {
19747            __parent,
19748            __page_size,
19749            __page_token,
19750            __show_deleted,
19751            Unknown(std::string::String),
19752        }
19753        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19754            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19755            where
19756                D: serde::Deserializer<'de>,
19757            {
19758                struct Visitor;
19759                impl<'de> serde::de::Visitor<'de> for Visitor {
19760                    type Value = __FieldTag;
19761                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19762                        formatter.write_str("a field name for ListTasksRequest")
19763                    }
19764                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19765                    where
19766                        E: serde::de::Error,
19767                    {
19768                        use std::result::Result::Ok;
19769                        use std::string::ToString;
19770                        match value {
19771                            "parent" => Ok(__FieldTag::__parent),
19772                            "pageSize" => Ok(__FieldTag::__page_size),
19773                            "page_size" => Ok(__FieldTag::__page_size),
19774                            "pageToken" => Ok(__FieldTag::__page_token),
19775                            "page_token" => Ok(__FieldTag::__page_token),
19776                            "showDeleted" => Ok(__FieldTag::__show_deleted),
19777                            "show_deleted" => Ok(__FieldTag::__show_deleted),
19778                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19779                        }
19780                    }
19781                }
19782                deserializer.deserialize_identifier(Visitor)
19783            }
19784        }
19785        struct Visitor;
19786        impl<'de> serde::de::Visitor<'de> for Visitor {
19787            type Value = ListTasksRequest;
19788            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19789                formatter.write_str("struct ListTasksRequest")
19790            }
19791            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19792            where
19793                A: serde::de::MapAccess<'de>,
19794            {
19795                #[allow(unused_imports)]
19796                use serde::de::Error;
19797                use std::option::Option::Some;
19798                let mut fields = std::collections::HashSet::new();
19799                let mut result = Self::Value::new();
19800                while let Some(tag) = map.next_key::<__FieldTag>()? {
19801                    #[allow(clippy::match_single_binding)]
19802                    match tag {
19803                        __FieldTag::__parent => {
19804                            if !fields.insert(__FieldTag::__parent) {
19805                                return std::result::Result::Err(A::Error::duplicate_field(
19806                                    "multiple values for parent",
19807                                ));
19808                            }
19809                            result.parent = map
19810                                .next_value::<std::option::Option<std::string::String>>()?
19811                                .unwrap_or_default();
19812                        }
19813                        __FieldTag::__page_size => {
19814                            if !fields.insert(__FieldTag::__page_size) {
19815                                return std::result::Result::Err(A::Error::duplicate_field(
19816                                    "multiple values for page_size",
19817                                ));
19818                            }
19819                            struct __With(std::option::Option<i32>);
19820                            impl<'de> serde::de::Deserialize<'de> for __With {
19821                                fn deserialize<D>(
19822                                    deserializer: D,
19823                                ) -> std::result::Result<Self, D::Error>
19824                                where
19825                                    D: serde::de::Deserializer<'de>,
19826                                {
19827                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
19828                                }
19829                            }
19830                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
19831                        }
19832                        __FieldTag::__page_token => {
19833                            if !fields.insert(__FieldTag::__page_token) {
19834                                return std::result::Result::Err(A::Error::duplicate_field(
19835                                    "multiple values for page_token",
19836                                ));
19837                            }
19838                            result.page_token = map
19839                                .next_value::<std::option::Option<std::string::String>>()?
19840                                .unwrap_or_default();
19841                        }
19842                        __FieldTag::__show_deleted => {
19843                            if !fields.insert(__FieldTag::__show_deleted) {
19844                                return std::result::Result::Err(A::Error::duplicate_field(
19845                                    "multiple values for show_deleted",
19846                                ));
19847                            }
19848                            result.show_deleted = map
19849                                .next_value::<std::option::Option<bool>>()?
19850                                .unwrap_or_default();
19851                        }
19852                        __FieldTag::Unknown(key) => {
19853                            let value = map.next_value::<serde_json::Value>()?;
19854                            result._unknown_fields.insert(key, value);
19855                        }
19856                    }
19857                }
19858                std::result::Result::Ok(result)
19859            }
19860        }
19861        deserializer.deserialize_any(Visitor)
19862    }
19863}
19864
19865#[doc(hidden)]
19866impl serde::ser::Serialize for ListTasksRequest {
19867    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19868    where
19869        S: serde::ser::Serializer,
19870    {
19871        use serde::ser::SerializeMap;
19872        #[allow(unused_imports)]
19873        use std::option::Option::Some;
19874        let mut state = serializer.serialize_map(std::option::Option::None)?;
19875        if !self.parent.is_empty() {
19876            state.serialize_entry("parent", &self.parent)?;
19877        }
19878        if !wkt::internal::is_default(&self.page_size) {
19879            struct __With<'a>(&'a i32);
19880            impl<'a> serde::ser::Serialize for __With<'a> {
19881                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19882                where
19883                    S: serde::ser::Serializer,
19884                {
19885                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
19886                }
19887            }
19888            state.serialize_entry("pageSize", &__With(&self.page_size))?;
19889        }
19890        if !self.page_token.is_empty() {
19891            state.serialize_entry("pageToken", &self.page_token)?;
19892        }
19893        if !wkt::internal::is_default(&self.show_deleted) {
19894            state.serialize_entry("showDeleted", &self.show_deleted)?;
19895        }
19896        if !self._unknown_fields.is_empty() {
19897            for (key, value) in self._unknown_fields.iter() {
19898                state.serialize_entry(key, &value)?;
19899            }
19900        }
19901        state.end()
19902    }
19903}
19904
19905impl std::fmt::Debug for ListTasksRequest {
19906    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19907        let mut debug_struct = f.debug_struct("ListTasksRequest");
19908        debug_struct.field("parent", &self.parent);
19909        debug_struct.field("page_size", &self.page_size);
19910        debug_struct.field("page_token", &self.page_token);
19911        debug_struct.field("show_deleted", &self.show_deleted);
19912        if !self._unknown_fields.is_empty() {
19913            debug_struct.field("_unknown_fields", &self._unknown_fields);
19914        }
19915        debug_struct.finish()
19916    }
19917}
19918
19919/// Response message containing a list of Tasks.
19920#[derive(Clone, Default, PartialEq)]
19921#[non_exhaustive]
19922pub struct ListTasksResponse {
19923    /// The resulting list of Tasks.
19924    pub tasks: std::vec::Vec<crate::model::Task>,
19925
19926    /// A token indicating there are more items than page_size. Use it in the next
19927    /// ListTasks request to continue.
19928    pub next_page_token: std::string::String,
19929
19930    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19931}
19932
19933impl ListTasksResponse {
19934    pub fn new() -> Self {
19935        std::default::Default::default()
19936    }
19937
19938    /// Sets the value of [tasks][crate::model::ListTasksResponse::tasks].
19939    pub fn set_tasks<T, V>(mut self, v: T) -> Self
19940    where
19941        T: std::iter::IntoIterator<Item = V>,
19942        V: std::convert::Into<crate::model::Task>,
19943    {
19944        use std::iter::Iterator;
19945        self.tasks = v.into_iter().map(|i| i.into()).collect();
19946        self
19947    }
19948
19949    /// Sets the value of [next_page_token][crate::model::ListTasksResponse::next_page_token].
19950    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19951        self.next_page_token = v.into();
19952        self
19953    }
19954}
19955
19956impl wkt::message::Message for ListTasksResponse {
19957    fn typename() -> &'static str {
19958        "type.googleapis.com/google.cloud.run.v2.ListTasksResponse"
19959    }
19960}
19961
19962#[doc(hidden)]
19963impl gax::paginator::internal::PageableResponse for ListTasksResponse {
19964    type PageItem = crate::model::Task;
19965
19966    fn items(self) -> std::vec::Vec<Self::PageItem> {
19967        self.tasks
19968    }
19969
19970    fn next_page_token(&self) -> std::string::String {
19971        use std::clone::Clone;
19972        self.next_page_token.clone()
19973    }
19974}
19975
19976#[doc(hidden)]
19977impl<'de> serde::de::Deserialize<'de> for ListTasksResponse {
19978    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19979    where
19980        D: serde::Deserializer<'de>,
19981    {
19982        #[allow(non_camel_case_types)]
19983        #[doc(hidden)]
19984        #[derive(PartialEq, Eq, Hash)]
19985        enum __FieldTag {
19986            __tasks,
19987            __next_page_token,
19988            Unknown(std::string::String),
19989        }
19990        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19991            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19992            where
19993                D: serde::Deserializer<'de>,
19994            {
19995                struct Visitor;
19996                impl<'de> serde::de::Visitor<'de> for Visitor {
19997                    type Value = __FieldTag;
19998                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19999                        formatter.write_str("a field name for ListTasksResponse")
20000                    }
20001                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20002                    where
20003                        E: serde::de::Error,
20004                    {
20005                        use std::result::Result::Ok;
20006                        use std::string::ToString;
20007                        match value {
20008                            "tasks" => Ok(__FieldTag::__tasks),
20009                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
20010                            "next_page_token" => Ok(__FieldTag::__next_page_token),
20011                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20012                        }
20013                    }
20014                }
20015                deserializer.deserialize_identifier(Visitor)
20016            }
20017        }
20018        struct Visitor;
20019        impl<'de> serde::de::Visitor<'de> for Visitor {
20020            type Value = ListTasksResponse;
20021            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20022                formatter.write_str("struct ListTasksResponse")
20023            }
20024            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20025            where
20026                A: serde::de::MapAccess<'de>,
20027            {
20028                #[allow(unused_imports)]
20029                use serde::de::Error;
20030                use std::option::Option::Some;
20031                let mut fields = std::collections::HashSet::new();
20032                let mut result = Self::Value::new();
20033                while let Some(tag) = map.next_key::<__FieldTag>()? {
20034                    #[allow(clippy::match_single_binding)]
20035                    match tag {
20036                        __FieldTag::__tasks => {
20037                            if !fields.insert(__FieldTag::__tasks) {
20038                                return std::result::Result::Err(A::Error::duplicate_field(
20039                                    "multiple values for tasks",
20040                                ));
20041                            }
20042                            result.tasks = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Task>>>()?.unwrap_or_default();
20043                        }
20044                        __FieldTag::__next_page_token => {
20045                            if !fields.insert(__FieldTag::__next_page_token) {
20046                                return std::result::Result::Err(A::Error::duplicate_field(
20047                                    "multiple values for next_page_token",
20048                                ));
20049                            }
20050                            result.next_page_token = map
20051                                .next_value::<std::option::Option<std::string::String>>()?
20052                                .unwrap_or_default();
20053                        }
20054                        __FieldTag::Unknown(key) => {
20055                            let value = map.next_value::<serde_json::Value>()?;
20056                            result._unknown_fields.insert(key, value);
20057                        }
20058                    }
20059                }
20060                std::result::Result::Ok(result)
20061            }
20062        }
20063        deserializer.deserialize_any(Visitor)
20064    }
20065}
20066
20067#[doc(hidden)]
20068impl serde::ser::Serialize for ListTasksResponse {
20069    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20070    where
20071        S: serde::ser::Serializer,
20072    {
20073        use serde::ser::SerializeMap;
20074        #[allow(unused_imports)]
20075        use std::option::Option::Some;
20076        let mut state = serializer.serialize_map(std::option::Option::None)?;
20077        if !self.tasks.is_empty() {
20078            state.serialize_entry("tasks", &self.tasks)?;
20079        }
20080        if !self.next_page_token.is_empty() {
20081            state.serialize_entry("nextPageToken", &self.next_page_token)?;
20082        }
20083        if !self._unknown_fields.is_empty() {
20084            for (key, value) in self._unknown_fields.iter() {
20085                state.serialize_entry(key, &value)?;
20086            }
20087        }
20088        state.end()
20089    }
20090}
20091
20092impl std::fmt::Debug for ListTasksResponse {
20093    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20094        let mut debug_struct = f.debug_struct("ListTasksResponse");
20095        debug_struct.field("tasks", &self.tasks);
20096        debug_struct.field("next_page_token", &self.next_page_token);
20097        if !self._unknown_fields.is_empty() {
20098            debug_struct.field("_unknown_fields", &self._unknown_fields);
20099        }
20100        debug_struct.finish()
20101    }
20102}
20103
20104/// Task represents a single run of a container to completion.
20105#[derive(Clone, Default, PartialEq)]
20106#[non_exhaustive]
20107pub struct Task {
20108    /// Output only. The unique name of this Task.
20109    pub name: std::string::String,
20110
20111    /// Output only. Server assigned unique identifier for the Task. The value is a
20112    /// UUID4 string and guaranteed to remain unchanged until the resource is
20113    /// deleted.
20114    pub uid: std::string::String,
20115
20116    /// Output only. A number that monotonically increases every time the user
20117    /// modifies the desired state.
20118    pub generation: i64,
20119
20120    /// Output only. Unstructured key value map that can be used to organize and
20121    /// categorize objects. User-provided labels are shared with Google's billing
20122    /// system, so they can be used to filter, or break down billing charges by
20123    /// team, component, environment, state, etc. For more information, visit
20124    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
20125    /// <https://cloud.google.com/run/docs/configuring/labels>
20126    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
20127
20128    /// Output only. Unstructured key value map that may
20129    /// be set by external tools to store and arbitrary metadata.
20130    /// They are not queryable and should be preserved
20131    /// when modifying objects.
20132    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
20133
20134    /// Output only. Represents time when the task was created by the system.
20135    /// It is not guaranteed to be set in happens-before order across separate
20136    /// operations.
20137    pub create_time: std::option::Option<wkt::Timestamp>,
20138
20139    /// Output only. Represents time when the task was scheduled to run by the
20140    /// system. It is not guaranteed to be set in happens-before order across
20141    /// separate operations.
20142    pub scheduled_time: std::option::Option<wkt::Timestamp>,
20143
20144    /// Output only. Represents time when the task started to run.
20145    /// It is not guaranteed to be set in happens-before order across separate
20146    /// operations.
20147    pub start_time: std::option::Option<wkt::Timestamp>,
20148
20149    /// Output only. Represents time when the Task was completed. It is not
20150    /// guaranteed to be set in happens-before order across separate operations.
20151    pub completion_time: std::option::Option<wkt::Timestamp>,
20152
20153    /// Output only. The last-modified time.
20154    pub update_time: std::option::Option<wkt::Timestamp>,
20155
20156    /// Output only. For a deleted resource, the deletion time. It is only
20157    /// populated as a response to a Delete request.
20158    pub delete_time: std::option::Option<wkt::Timestamp>,
20159
20160    /// Output only. For a deleted resource, the time after which it will be
20161    /// permamently deleted. It is only populated as a response to a Delete
20162    /// request.
20163    pub expire_time: std::option::Option<wkt::Timestamp>,
20164
20165    /// Output only. The name of the parent Job.
20166    pub job: std::string::String,
20167
20168    /// Output only. The name of the parent Execution.
20169    pub execution: std::string::String,
20170
20171    /// Holds the single container that defines the unit of execution for this
20172    /// task.
20173    pub containers: std::vec::Vec<crate::model::Container>,
20174
20175    /// A list of Volumes to make available to containers.
20176    pub volumes: std::vec::Vec<crate::model::Volume>,
20177
20178    /// Number of retries allowed per Task, before marking this Task failed.
20179    pub max_retries: i32,
20180
20181    /// Max allowed time duration the Task may be active before the system will
20182    /// actively try to mark it failed and kill associated containers. This applies
20183    /// per attempt of a task, meaning each retry can run for the full timeout.
20184    pub timeout: std::option::Option<wkt::Duration>,
20185
20186    /// Email address of the IAM service account associated with the Task of a
20187    /// Job. The service account represents the identity of the
20188    /// running task, and determines what permissions the task has. If
20189    /// not provided, the task will use the project's default service account.
20190    pub service_account: std::string::String,
20191
20192    /// The execution environment being used to host this Task.
20193    pub execution_environment: crate::model::ExecutionEnvironment,
20194
20195    /// Output only. Indicates whether the resource's reconciliation is still in
20196    /// progress. See comments in `Job.reconciling` for additional information on
20197    /// reconciliation process in Cloud Run.
20198    pub reconciling: bool,
20199
20200    /// Output only. The Condition of this Task, containing its readiness status,
20201    /// and detailed error information in case it did not reach the desired state.
20202    pub conditions: std::vec::Vec<crate::model::Condition>,
20203
20204    /// Output only. The generation of this Task. See comments in `Job.reconciling`
20205    /// for additional information on reconciliation process in Cloud Run.
20206    pub observed_generation: i64,
20207
20208    /// Output only. Index of the Task, unique per execution, and beginning at 0.
20209    pub index: i32,
20210
20211    /// Output only. The number of times this Task was retried.
20212    /// Tasks are retried when they fail up to the maxRetries limit.
20213    pub retried: i32,
20214
20215    /// Output only. Result of the last attempt of this Task.
20216    pub last_attempt_result: std::option::Option<crate::model::TaskAttemptResult>,
20217
20218    /// Output only. A reference to a customer managed encryption key (CMEK) to use
20219    /// to encrypt this container image. For more information, go to
20220    /// <https://cloud.google.com/run/docs/securing/using-cmek>
20221    pub encryption_key: std::string::String,
20222
20223    /// Output only. VPC Access configuration to use for this Task. For more
20224    /// information, visit
20225    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
20226    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
20227
20228    /// Output only. URI where logs for this execution can be found in Cloud
20229    /// Console.
20230    pub log_uri: std::string::String,
20231
20232    /// Output only. Reserved for future use.
20233    pub satisfies_pzs: bool,
20234
20235    /// Output only. The node selector for the task.
20236    pub node_selector: std::option::Option<crate::model::NodeSelector>,
20237
20238    /// Optional. Output only. True if GPU zonal redundancy is disabled on this
20239    /// task.
20240    pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
20241
20242    /// Output only. A system-generated fingerprint for this version of the
20243    /// resource. May be used to detect modification conflict during updates.
20244    pub etag: std::string::String,
20245
20246    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20247}
20248
20249impl Task {
20250    pub fn new() -> Self {
20251        std::default::Default::default()
20252    }
20253
20254    /// Sets the value of [name][crate::model::Task::name].
20255    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20256        self.name = v.into();
20257        self
20258    }
20259
20260    /// Sets the value of [uid][crate::model::Task::uid].
20261    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20262        self.uid = v.into();
20263        self
20264    }
20265
20266    /// Sets the value of [generation][crate::model::Task::generation].
20267    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20268        self.generation = v.into();
20269        self
20270    }
20271
20272    /// Sets the value of [labels][crate::model::Task::labels].
20273    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20274    where
20275        T: std::iter::IntoIterator<Item = (K, V)>,
20276        K: std::convert::Into<std::string::String>,
20277        V: std::convert::Into<std::string::String>,
20278    {
20279        use std::iter::Iterator;
20280        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20281        self
20282    }
20283
20284    /// Sets the value of [annotations][crate::model::Task::annotations].
20285    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
20286    where
20287        T: std::iter::IntoIterator<Item = (K, V)>,
20288        K: std::convert::Into<std::string::String>,
20289        V: std::convert::Into<std::string::String>,
20290    {
20291        use std::iter::Iterator;
20292        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20293        self
20294    }
20295
20296    /// Sets the value of [create_time][crate::model::Task::create_time].
20297    pub fn set_create_time<T>(mut self, v: T) -> Self
20298    where
20299        T: std::convert::Into<wkt::Timestamp>,
20300    {
20301        self.create_time = std::option::Option::Some(v.into());
20302        self
20303    }
20304
20305    /// Sets or clears the value of [create_time][crate::model::Task::create_time].
20306    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20307    where
20308        T: std::convert::Into<wkt::Timestamp>,
20309    {
20310        self.create_time = v.map(|x| x.into());
20311        self
20312    }
20313
20314    /// Sets the value of [scheduled_time][crate::model::Task::scheduled_time].
20315    pub fn set_scheduled_time<T>(mut self, v: T) -> Self
20316    where
20317        T: std::convert::Into<wkt::Timestamp>,
20318    {
20319        self.scheduled_time = std::option::Option::Some(v.into());
20320        self
20321    }
20322
20323    /// Sets or clears the value of [scheduled_time][crate::model::Task::scheduled_time].
20324    pub fn set_or_clear_scheduled_time<T>(mut self, v: std::option::Option<T>) -> Self
20325    where
20326        T: std::convert::Into<wkt::Timestamp>,
20327    {
20328        self.scheduled_time = v.map(|x| x.into());
20329        self
20330    }
20331
20332    /// Sets the value of [start_time][crate::model::Task::start_time].
20333    pub fn set_start_time<T>(mut self, v: T) -> Self
20334    where
20335        T: std::convert::Into<wkt::Timestamp>,
20336    {
20337        self.start_time = std::option::Option::Some(v.into());
20338        self
20339    }
20340
20341    /// Sets or clears the value of [start_time][crate::model::Task::start_time].
20342    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
20343    where
20344        T: std::convert::Into<wkt::Timestamp>,
20345    {
20346        self.start_time = v.map(|x| x.into());
20347        self
20348    }
20349
20350    /// Sets the value of [completion_time][crate::model::Task::completion_time].
20351    pub fn set_completion_time<T>(mut self, v: T) -> Self
20352    where
20353        T: std::convert::Into<wkt::Timestamp>,
20354    {
20355        self.completion_time = std::option::Option::Some(v.into());
20356        self
20357    }
20358
20359    /// Sets or clears the value of [completion_time][crate::model::Task::completion_time].
20360    pub fn set_or_clear_completion_time<T>(mut self, v: std::option::Option<T>) -> Self
20361    where
20362        T: std::convert::Into<wkt::Timestamp>,
20363    {
20364        self.completion_time = v.map(|x| x.into());
20365        self
20366    }
20367
20368    /// Sets the value of [update_time][crate::model::Task::update_time].
20369    pub fn set_update_time<T>(mut self, v: T) -> Self
20370    where
20371        T: std::convert::Into<wkt::Timestamp>,
20372    {
20373        self.update_time = std::option::Option::Some(v.into());
20374        self
20375    }
20376
20377    /// Sets or clears the value of [update_time][crate::model::Task::update_time].
20378    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20379    where
20380        T: std::convert::Into<wkt::Timestamp>,
20381    {
20382        self.update_time = v.map(|x| x.into());
20383        self
20384    }
20385
20386    /// Sets the value of [delete_time][crate::model::Task::delete_time].
20387    pub fn set_delete_time<T>(mut self, v: T) -> Self
20388    where
20389        T: std::convert::Into<wkt::Timestamp>,
20390    {
20391        self.delete_time = std::option::Option::Some(v.into());
20392        self
20393    }
20394
20395    /// Sets or clears the value of [delete_time][crate::model::Task::delete_time].
20396    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
20397    where
20398        T: std::convert::Into<wkt::Timestamp>,
20399    {
20400        self.delete_time = v.map(|x| x.into());
20401        self
20402    }
20403
20404    /// Sets the value of [expire_time][crate::model::Task::expire_time].
20405    pub fn set_expire_time<T>(mut self, v: T) -> Self
20406    where
20407        T: std::convert::Into<wkt::Timestamp>,
20408    {
20409        self.expire_time = std::option::Option::Some(v.into());
20410        self
20411    }
20412
20413    /// Sets or clears the value of [expire_time][crate::model::Task::expire_time].
20414    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
20415    where
20416        T: std::convert::Into<wkt::Timestamp>,
20417    {
20418        self.expire_time = v.map(|x| x.into());
20419        self
20420    }
20421
20422    /// Sets the value of [job][crate::model::Task::job].
20423    pub fn set_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20424        self.job = v.into();
20425        self
20426    }
20427
20428    /// Sets the value of [execution][crate::model::Task::execution].
20429    pub fn set_execution<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20430        self.execution = v.into();
20431        self
20432    }
20433
20434    /// Sets the value of [containers][crate::model::Task::containers].
20435    pub fn set_containers<T, V>(mut self, v: T) -> Self
20436    where
20437        T: std::iter::IntoIterator<Item = V>,
20438        V: std::convert::Into<crate::model::Container>,
20439    {
20440        use std::iter::Iterator;
20441        self.containers = v.into_iter().map(|i| i.into()).collect();
20442        self
20443    }
20444
20445    /// Sets the value of [volumes][crate::model::Task::volumes].
20446    pub fn set_volumes<T, V>(mut self, v: T) -> Self
20447    where
20448        T: std::iter::IntoIterator<Item = V>,
20449        V: std::convert::Into<crate::model::Volume>,
20450    {
20451        use std::iter::Iterator;
20452        self.volumes = v.into_iter().map(|i| i.into()).collect();
20453        self
20454    }
20455
20456    /// Sets the value of [max_retries][crate::model::Task::max_retries].
20457    pub fn set_max_retries<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20458        self.max_retries = v.into();
20459        self
20460    }
20461
20462    /// Sets the value of [timeout][crate::model::Task::timeout].
20463    pub fn set_timeout<T>(mut self, v: T) -> Self
20464    where
20465        T: std::convert::Into<wkt::Duration>,
20466    {
20467        self.timeout = std::option::Option::Some(v.into());
20468        self
20469    }
20470
20471    /// Sets or clears the value of [timeout][crate::model::Task::timeout].
20472    pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
20473    where
20474        T: std::convert::Into<wkt::Duration>,
20475    {
20476        self.timeout = v.map(|x| x.into());
20477        self
20478    }
20479
20480    /// Sets the value of [service_account][crate::model::Task::service_account].
20481    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20482        self.service_account = v.into();
20483        self
20484    }
20485
20486    /// Sets the value of [execution_environment][crate::model::Task::execution_environment].
20487    pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
20488        mut self,
20489        v: T,
20490    ) -> Self {
20491        self.execution_environment = v.into();
20492        self
20493    }
20494
20495    /// Sets the value of [reconciling][crate::model::Task::reconciling].
20496    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20497        self.reconciling = v.into();
20498        self
20499    }
20500
20501    /// Sets the value of [conditions][crate::model::Task::conditions].
20502    pub fn set_conditions<T, V>(mut self, v: T) -> Self
20503    where
20504        T: std::iter::IntoIterator<Item = V>,
20505        V: std::convert::Into<crate::model::Condition>,
20506    {
20507        use std::iter::Iterator;
20508        self.conditions = v.into_iter().map(|i| i.into()).collect();
20509        self
20510    }
20511
20512    /// Sets the value of [observed_generation][crate::model::Task::observed_generation].
20513    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20514        self.observed_generation = v.into();
20515        self
20516    }
20517
20518    /// Sets the value of [index][crate::model::Task::index].
20519    pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20520        self.index = v.into();
20521        self
20522    }
20523
20524    /// Sets the value of [retried][crate::model::Task::retried].
20525    pub fn set_retried<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20526        self.retried = v.into();
20527        self
20528    }
20529
20530    /// Sets the value of [last_attempt_result][crate::model::Task::last_attempt_result].
20531    pub fn set_last_attempt_result<T>(mut self, v: T) -> Self
20532    where
20533        T: std::convert::Into<crate::model::TaskAttemptResult>,
20534    {
20535        self.last_attempt_result = std::option::Option::Some(v.into());
20536        self
20537    }
20538
20539    /// Sets or clears the value of [last_attempt_result][crate::model::Task::last_attempt_result].
20540    pub fn set_or_clear_last_attempt_result<T>(mut self, v: std::option::Option<T>) -> Self
20541    where
20542        T: std::convert::Into<crate::model::TaskAttemptResult>,
20543    {
20544        self.last_attempt_result = v.map(|x| x.into());
20545        self
20546    }
20547
20548    /// Sets the value of [encryption_key][crate::model::Task::encryption_key].
20549    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20550        self.encryption_key = v.into();
20551        self
20552    }
20553
20554    /// Sets the value of [vpc_access][crate::model::Task::vpc_access].
20555    pub fn set_vpc_access<T>(mut self, v: T) -> Self
20556    where
20557        T: std::convert::Into<crate::model::VpcAccess>,
20558    {
20559        self.vpc_access = std::option::Option::Some(v.into());
20560        self
20561    }
20562
20563    /// Sets or clears the value of [vpc_access][crate::model::Task::vpc_access].
20564    pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
20565    where
20566        T: std::convert::Into<crate::model::VpcAccess>,
20567    {
20568        self.vpc_access = v.map(|x| x.into());
20569        self
20570    }
20571
20572    /// Sets the value of [log_uri][crate::model::Task::log_uri].
20573    pub fn set_log_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20574        self.log_uri = v.into();
20575        self
20576    }
20577
20578    /// Sets the value of [satisfies_pzs][crate::model::Task::satisfies_pzs].
20579    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
20580        self.satisfies_pzs = v.into();
20581        self
20582    }
20583
20584    /// Sets the value of [node_selector][crate::model::Task::node_selector].
20585    pub fn set_node_selector<T>(mut self, v: T) -> Self
20586    where
20587        T: std::convert::Into<crate::model::NodeSelector>,
20588    {
20589        self.node_selector = std::option::Option::Some(v.into());
20590        self
20591    }
20592
20593    /// Sets or clears the value of [node_selector][crate::model::Task::node_selector].
20594    pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
20595    where
20596        T: std::convert::Into<crate::model::NodeSelector>,
20597    {
20598        self.node_selector = v.map(|x| x.into());
20599        self
20600    }
20601
20602    /// Sets the value of [gpu_zonal_redundancy_disabled][crate::model::Task::gpu_zonal_redundancy_disabled].
20603    pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
20604    where
20605        T: std::convert::Into<bool>,
20606    {
20607        self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
20608        self
20609    }
20610
20611    /// Sets or clears the value of [gpu_zonal_redundancy_disabled][crate::model::Task::gpu_zonal_redundancy_disabled].
20612    pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
20613        mut self,
20614        v: std::option::Option<T>,
20615    ) -> Self
20616    where
20617        T: std::convert::Into<bool>,
20618    {
20619        self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
20620        self
20621    }
20622
20623    /// Sets the value of [etag][crate::model::Task::etag].
20624    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20625        self.etag = v.into();
20626        self
20627    }
20628}
20629
20630impl wkt::message::Message for Task {
20631    fn typename() -> &'static str {
20632        "type.googleapis.com/google.cloud.run.v2.Task"
20633    }
20634}
20635
20636#[doc(hidden)]
20637impl<'de> serde::de::Deserialize<'de> for Task {
20638    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20639    where
20640        D: serde::Deserializer<'de>,
20641    {
20642        #[allow(non_camel_case_types)]
20643        #[doc(hidden)]
20644        #[derive(PartialEq, Eq, Hash)]
20645        enum __FieldTag {
20646            __name,
20647            __uid,
20648            __generation,
20649            __labels,
20650            __annotations,
20651            __create_time,
20652            __scheduled_time,
20653            __start_time,
20654            __completion_time,
20655            __update_time,
20656            __delete_time,
20657            __expire_time,
20658            __job,
20659            __execution,
20660            __containers,
20661            __volumes,
20662            __max_retries,
20663            __timeout,
20664            __service_account,
20665            __execution_environment,
20666            __reconciling,
20667            __conditions,
20668            __observed_generation,
20669            __index,
20670            __retried,
20671            __last_attempt_result,
20672            __encryption_key,
20673            __vpc_access,
20674            __log_uri,
20675            __satisfies_pzs,
20676            __node_selector,
20677            __gpu_zonal_redundancy_disabled,
20678            __etag,
20679            Unknown(std::string::String),
20680        }
20681        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
20682            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20683            where
20684                D: serde::Deserializer<'de>,
20685            {
20686                struct Visitor;
20687                impl<'de> serde::de::Visitor<'de> for Visitor {
20688                    type Value = __FieldTag;
20689                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20690                        formatter.write_str("a field name for Task")
20691                    }
20692                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
20693                    where
20694                        E: serde::de::Error,
20695                    {
20696                        use std::result::Result::Ok;
20697                        use std::string::ToString;
20698                        match value {
20699                            "name" => Ok(__FieldTag::__name),
20700                            "uid" => Ok(__FieldTag::__uid),
20701                            "generation" => Ok(__FieldTag::__generation),
20702                            "labels" => Ok(__FieldTag::__labels),
20703                            "annotations" => Ok(__FieldTag::__annotations),
20704                            "createTime" => Ok(__FieldTag::__create_time),
20705                            "create_time" => Ok(__FieldTag::__create_time),
20706                            "scheduledTime" => Ok(__FieldTag::__scheduled_time),
20707                            "scheduled_time" => Ok(__FieldTag::__scheduled_time),
20708                            "startTime" => Ok(__FieldTag::__start_time),
20709                            "start_time" => Ok(__FieldTag::__start_time),
20710                            "completionTime" => Ok(__FieldTag::__completion_time),
20711                            "completion_time" => Ok(__FieldTag::__completion_time),
20712                            "updateTime" => Ok(__FieldTag::__update_time),
20713                            "update_time" => Ok(__FieldTag::__update_time),
20714                            "deleteTime" => Ok(__FieldTag::__delete_time),
20715                            "delete_time" => Ok(__FieldTag::__delete_time),
20716                            "expireTime" => Ok(__FieldTag::__expire_time),
20717                            "expire_time" => Ok(__FieldTag::__expire_time),
20718                            "job" => Ok(__FieldTag::__job),
20719                            "execution" => Ok(__FieldTag::__execution),
20720                            "containers" => Ok(__FieldTag::__containers),
20721                            "volumes" => Ok(__FieldTag::__volumes),
20722                            "maxRetries" => Ok(__FieldTag::__max_retries),
20723                            "max_retries" => Ok(__FieldTag::__max_retries),
20724                            "timeout" => Ok(__FieldTag::__timeout),
20725                            "serviceAccount" => Ok(__FieldTag::__service_account),
20726                            "service_account" => Ok(__FieldTag::__service_account),
20727                            "executionEnvironment" => Ok(__FieldTag::__execution_environment),
20728                            "execution_environment" => Ok(__FieldTag::__execution_environment),
20729                            "reconciling" => Ok(__FieldTag::__reconciling),
20730                            "conditions" => Ok(__FieldTag::__conditions),
20731                            "observedGeneration" => Ok(__FieldTag::__observed_generation),
20732                            "observed_generation" => Ok(__FieldTag::__observed_generation),
20733                            "index" => Ok(__FieldTag::__index),
20734                            "retried" => Ok(__FieldTag::__retried),
20735                            "lastAttemptResult" => Ok(__FieldTag::__last_attempt_result),
20736                            "last_attempt_result" => Ok(__FieldTag::__last_attempt_result),
20737                            "encryptionKey" => Ok(__FieldTag::__encryption_key),
20738                            "encryption_key" => Ok(__FieldTag::__encryption_key),
20739                            "vpcAccess" => Ok(__FieldTag::__vpc_access),
20740                            "vpc_access" => Ok(__FieldTag::__vpc_access),
20741                            "logUri" => Ok(__FieldTag::__log_uri),
20742                            "log_uri" => Ok(__FieldTag::__log_uri),
20743                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
20744                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
20745                            "nodeSelector" => Ok(__FieldTag::__node_selector),
20746                            "node_selector" => Ok(__FieldTag::__node_selector),
20747                            "gpuZonalRedundancyDisabled" => {
20748                                Ok(__FieldTag::__gpu_zonal_redundancy_disabled)
20749                            }
20750                            "gpu_zonal_redundancy_disabled" => {
20751                                Ok(__FieldTag::__gpu_zonal_redundancy_disabled)
20752                            }
20753                            "etag" => Ok(__FieldTag::__etag),
20754                            _ => Ok(__FieldTag::Unknown(value.to_string())),
20755                        }
20756                    }
20757                }
20758                deserializer.deserialize_identifier(Visitor)
20759            }
20760        }
20761        struct Visitor;
20762        impl<'de> serde::de::Visitor<'de> for Visitor {
20763            type Value = Task;
20764            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
20765                formatter.write_str("struct Task")
20766            }
20767            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
20768            where
20769                A: serde::de::MapAccess<'de>,
20770            {
20771                #[allow(unused_imports)]
20772                use serde::de::Error;
20773                use std::option::Option::Some;
20774                let mut fields = std::collections::HashSet::new();
20775                let mut result = Self::Value::new();
20776                while let Some(tag) = map.next_key::<__FieldTag>()? {
20777                    #[allow(clippy::match_single_binding)]
20778                    match tag {
20779                        __FieldTag::__name => {
20780                            if !fields.insert(__FieldTag::__name) {
20781                                return std::result::Result::Err(A::Error::duplicate_field(
20782                                    "multiple values for name",
20783                                ));
20784                            }
20785                            result.name = map
20786                                .next_value::<std::option::Option<std::string::String>>()?
20787                                .unwrap_or_default();
20788                        }
20789                        __FieldTag::__uid => {
20790                            if !fields.insert(__FieldTag::__uid) {
20791                                return std::result::Result::Err(A::Error::duplicate_field(
20792                                    "multiple values for uid",
20793                                ));
20794                            }
20795                            result.uid = map
20796                                .next_value::<std::option::Option<std::string::String>>()?
20797                                .unwrap_or_default();
20798                        }
20799                        __FieldTag::__generation => {
20800                            if !fields.insert(__FieldTag::__generation) {
20801                                return std::result::Result::Err(A::Error::duplicate_field(
20802                                    "multiple values for generation",
20803                                ));
20804                            }
20805                            struct __With(std::option::Option<i64>);
20806                            impl<'de> serde::de::Deserialize<'de> for __With {
20807                                fn deserialize<D>(
20808                                    deserializer: D,
20809                                ) -> std::result::Result<Self, D::Error>
20810                                where
20811                                    D: serde::de::Deserializer<'de>,
20812                                {
20813                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
20814                                }
20815                            }
20816                            result.generation = map.next_value::<__With>()?.0.unwrap_or_default();
20817                        }
20818                        __FieldTag::__labels => {
20819                            if !fields.insert(__FieldTag::__labels) {
20820                                return std::result::Result::Err(A::Error::duplicate_field(
20821                                    "multiple values for labels",
20822                                ));
20823                            }
20824                            result.labels = map
20825                                .next_value::<std::option::Option<
20826                                    std::collections::HashMap<
20827                                        std::string::String,
20828                                        std::string::String,
20829                                    >,
20830                                >>()?
20831                                .unwrap_or_default();
20832                        }
20833                        __FieldTag::__annotations => {
20834                            if !fields.insert(__FieldTag::__annotations) {
20835                                return std::result::Result::Err(A::Error::duplicate_field(
20836                                    "multiple values for annotations",
20837                                ));
20838                            }
20839                            result.annotations = map
20840                                .next_value::<std::option::Option<
20841                                    std::collections::HashMap<
20842                                        std::string::String,
20843                                        std::string::String,
20844                                    >,
20845                                >>()?
20846                                .unwrap_or_default();
20847                        }
20848                        __FieldTag::__create_time => {
20849                            if !fields.insert(__FieldTag::__create_time) {
20850                                return std::result::Result::Err(A::Error::duplicate_field(
20851                                    "multiple values for create_time",
20852                                ));
20853                            }
20854                            result.create_time =
20855                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
20856                        }
20857                        __FieldTag::__scheduled_time => {
20858                            if !fields.insert(__FieldTag::__scheduled_time) {
20859                                return std::result::Result::Err(A::Error::duplicate_field(
20860                                    "multiple values for scheduled_time",
20861                                ));
20862                            }
20863                            result.scheduled_time =
20864                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
20865                        }
20866                        __FieldTag::__start_time => {
20867                            if !fields.insert(__FieldTag::__start_time) {
20868                                return std::result::Result::Err(A::Error::duplicate_field(
20869                                    "multiple values for start_time",
20870                                ));
20871                            }
20872                            result.start_time =
20873                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
20874                        }
20875                        __FieldTag::__completion_time => {
20876                            if !fields.insert(__FieldTag::__completion_time) {
20877                                return std::result::Result::Err(A::Error::duplicate_field(
20878                                    "multiple values for completion_time",
20879                                ));
20880                            }
20881                            result.completion_time =
20882                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
20883                        }
20884                        __FieldTag::__update_time => {
20885                            if !fields.insert(__FieldTag::__update_time) {
20886                                return std::result::Result::Err(A::Error::duplicate_field(
20887                                    "multiple values for update_time",
20888                                ));
20889                            }
20890                            result.update_time =
20891                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
20892                        }
20893                        __FieldTag::__delete_time => {
20894                            if !fields.insert(__FieldTag::__delete_time) {
20895                                return std::result::Result::Err(A::Error::duplicate_field(
20896                                    "multiple values for delete_time",
20897                                ));
20898                            }
20899                            result.delete_time =
20900                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
20901                        }
20902                        __FieldTag::__expire_time => {
20903                            if !fields.insert(__FieldTag::__expire_time) {
20904                                return std::result::Result::Err(A::Error::duplicate_field(
20905                                    "multiple values for expire_time",
20906                                ));
20907                            }
20908                            result.expire_time =
20909                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
20910                        }
20911                        __FieldTag::__job => {
20912                            if !fields.insert(__FieldTag::__job) {
20913                                return std::result::Result::Err(A::Error::duplicate_field(
20914                                    "multiple values for job",
20915                                ));
20916                            }
20917                            result.job = map
20918                                .next_value::<std::option::Option<std::string::String>>()?
20919                                .unwrap_or_default();
20920                        }
20921                        __FieldTag::__execution => {
20922                            if !fields.insert(__FieldTag::__execution) {
20923                                return std::result::Result::Err(A::Error::duplicate_field(
20924                                    "multiple values for execution",
20925                                ));
20926                            }
20927                            result.execution = map
20928                                .next_value::<std::option::Option<std::string::String>>()?
20929                                .unwrap_or_default();
20930                        }
20931                        __FieldTag::__containers => {
20932                            if !fields.insert(__FieldTag::__containers) {
20933                                return std::result::Result::Err(A::Error::duplicate_field(
20934                                    "multiple values for containers",
20935                                ));
20936                            }
20937                            result.containers = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Container>>>()?.unwrap_or_default();
20938                        }
20939                        __FieldTag::__volumes => {
20940                            if !fields.insert(__FieldTag::__volumes) {
20941                                return std::result::Result::Err(A::Error::duplicate_field(
20942                                    "multiple values for volumes",
20943                                ));
20944                            }
20945                            result.volumes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Volume>>>()?.unwrap_or_default();
20946                        }
20947                        __FieldTag::__max_retries => {
20948                            if !fields.insert(__FieldTag::__max_retries) {
20949                                return std::result::Result::Err(A::Error::duplicate_field(
20950                                    "multiple values for max_retries",
20951                                ));
20952                            }
20953                            struct __With(std::option::Option<i32>);
20954                            impl<'de> serde::de::Deserialize<'de> for __With {
20955                                fn deserialize<D>(
20956                                    deserializer: D,
20957                                ) -> std::result::Result<Self, D::Error>
20958                                where
20959                                    D: serde::de::Deserializer<'de>,
20960                                {
20961                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
20962                                }
20963                            }
20964                            result.max_retries = map.next_value::<__With>()?.0.unwrap_or_default();
20965                        }
20966                        __FieldTag::__timeout => {
20967                            if !fields.insert(__FieldTag::__timeout) {
20968                                return std::result::Result::Err(A::Error::duplicate_field(
20969                                    "multiple values for timeout",
20970                                ));
20971                            }
20972                            result.timeout =
20973                                map.next_value::<std::option::Option<wkt::Duration>>()?;
20974                        }
20975                        __FieldTag::__service_account => {
20976                            if !fields.insert(__FieldTag::__service_account) {
20977                                return std::result::Result::Err(A::Error::duplicate_field(
20978                                    "multiple values for service_account",
20979                                ));
20980                            }
20981                            result.service_account = map
20982                                .next_value::<std::option::Option<std::string::String>>()?
20983                                .unwrap_or_default();
20984                        }
20985                        __FieldTag::__execution_environment => {
20986                            if !fields.insert(__FieldTag::__execution_environment) {
20987                                return std::result::Result::Err(A::Error::duplicate_field(
20988                                    "multiple values for execution_environment",
20989                                ));
20990                            }
20991                            result.execution_environment = map.next_value::<std::option::Option<crate::model::ExecutionEnvironment>>()?.unwrap_or_default();
20992                        }
20993                        __FieldTag::__reconciling => {
20994                            if !fields.insert(__FieldTag::__reconciling) {
20995                                return std::result::Result::Err(A::Error::duplicate_field(
20996                                    "multiple values for reconciling",
20997                                ));
20998                            }
20999                            result.reconciling = map
21000                                .next_value::<std::option::Option<bool>>()?
21001                                .unwrap_or_default();
21002                        }
21003                        __FieldTag::__conditions => {
21004                            if !fields.insert(__FieldTag::__conditions) {
21005                                return std::result::Result::Err(A::Error::duplicate_field(
21006                                    "multiple values for conditions",
21007                                ));
21008                            }
21009                            result.conditions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Condition>>>()?.unwrap_or_default();
21010                        }
21011                        __FieldTag::__observed_generation => {
21012                            if !fields.insert(__FieldTag::__observed_generation) {
21013                                return std::result::Result::Err(A::Error::duplicate_field(
21014                                    "multiple values for observed_generation",
21015                                ));
21016                            }
21017                            struct __With(std::option::Option<i64>);
21018                            impl<'de> serde::de::Deserialize<'de> for __With {
21019                                fn deserialize<D>(
21020                                    deserializer: D,
21021                                ) -> std::result::Result<Self, D::Error>
21022                                where
21023                                    D: serde::de::Deserializer<'de>,
21024                                {
21025                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
21026                                }
21027                            }
21028                            result.observed_generation =
21029                                map.next_value::<__With>()?.0.unwrap_or_default();
21030                        }
21031                        __FieldTag::__index => {
21032                            if !fields.insert(__FieldTag::__index) {
21033                                return std::result::Result::Err(A::Error::duplicate_field(
21034                                    "multiple values for index",
21035                                ));
21036                            }
21037                            struct __With(std::option::Option<i32>);
21038                            impl<'de> serde::de::Deserialize<'de> for __With {
21039                                fn deserialize<D>(
21040                                    deserializer: D,
21041                                ) -> std::result::Result<Self, D::Error>
21042                                where
21043                                    D: serde::de::Deserializer<'de>,
21044                                {
21045                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
21046                                }
21047                            }
21048                            result.index = map.next_value::<__With>()?.0.unwrap_or_default();
21049                        }
21050                        __FieldTag::__retried => {
21051                            if !fields.insert(__FieldTag::__retried) {
21052                                return std::result::Result::Err(A::Error::duplicate_field(
21053                                    "multiple values for retried",
21054                                ));
21055                            }
21056                            struct __With(std::option::Option<i32>);
21057                            impl<'de> serde::de::Deserialize<'de> for __With {
21058                                fn deserialize<D>(
21059                                    deserializer: D,
21060                                ) -> std::result::Result<Self, D::Error>
21061                                where
21062                                    D: serde::de::Deserializer<'de>,
21063                                {
21064                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
21065                                }
21066                            }
21067                            result.retried = map.next_value::<__With>()?.0.unwrap_or_default();
21068                        }
21069                        __FieldTag::__last_attempt_result => {
21070                            if !fields.insert(__FieldTag::__last_attempt_result) {
21071                                return std::result::Result::Err(A::Error::duplicate_field(
21072                                    "multiple values for last_attempt_result",
21073                                ));
21074                            }
21075                            result.last_attempt_result = map
21076                                .next_value::<std::option::Option<crate::model::TaskAttemptResult>>(
21077                                )?;
21078                        }
21079                        __FieldTag::__encryption_key => {
21080                            if !fields.insert(__FieldTag::__encryption_key) {
21081                                return std::result::Result::Err(A::Error::duplicate_field(
21082                                    "multiple values for encryption_key",
21083                                ));
21084                            }
21085                            result.encryption_key = map
21086                                .next_value::<std::option::Option<std::string::String>>()?
21087                                .unwrap_or_default();
21088                        }
21089                        __FieldTag::__vpc_access => {
21090                            if !fields.insert(__FieldTag::__vpc_access) {
21091                                return std::result::Result::Err(A::Error::duplicate_field(
21092                                    "multiple values for vpc_access",
21093                                ));
21094                            }
21095                            result.vpc_access =
21096                                map.next_value::<std::option::Option<crate::model::VpcAccess>>()?;
21097                        }
21098                        __FieldTag::__log_uri => {
21099                            if !fields.insert(__FieldTag::__log_uri) {
21100                                return std::result::Result::Err(A::Error::duplicate_field(
21101                                    "multiple values for log_uri",
21102                                ));
21103                            }
21104                            result.log_uri = map
21105                                .next_value::<std::option::Option<std::string::String>>()?
21106                                .unwrap_or_default();
21107                        }
21108                        __FieldTag::__satisfies_pzs => {
21109                            if !fields.insert(__FieldTag::__satisfies_pzs) {
21110                                return std::result::Result::Err(A::Error::duplicate_field(
21111                                    "multiple values for satisfies_pzs",
21112                                ));
21113                            }
21114                            result.satisfies_pzs = map
21115                                .next_value::<std::option::Option<bool>>()?
21116                                .unwrap_or_default();
21117                        }
21118                        __FieldTag::__node_selector => {
21119                            if !fields.insert(__FieldTag::__node_selector) {
21120                                return std::result::Result::Err(A::Error::duplicate_field(
21121                                    "multiple values for node_selector",
21122                                ));
21123                            }
21124                            result.node_selector = map
21125                                .next_value::<std::option::Option<crate::model::NodeSelector>>()?;
21126                        }
21127                        __FieldTag::__gpu_zonal_redundancy_disabled => {
21128                            if !fields.insert(__FieldTag::__gpu_zonal_redundancy_disabled) {
21129                                return std::result::Result::Err(A::Error::duplicate_field(
21130                                    "multiple values for gpu_zonal_redundancy_disabled",
21131                                ));
21132                            }
21133                            result.gpu_zonal_redundancy_disabled =
21134                                map.next_value::<std::option::Option<bool>>()?;
21135                        }
21136                        __FieldTag::__etag => {
21137                            if !fields.insert(__FieldTag::__etag) {
21138                                return std::result::Result::Err(A::Error::duplicate_field(
21139                                    "multiple values for etag",
21140                                ));
21141                            }
21142                            result.etag = map
21143                                .next_value::<std::option::Option<std::string::String>>()?
21144                                .unwrap_or_default();
21145                        }
21146                        __FieldTag::Unknown(key) => {
21147                            let value = map.next_value::<serde_json::Value>()?;
21148                            result._unknown_fields.insert(key, value);
21149                        }
21150                    }
21151                }
21152                std::result::Result::Ok(result)
21153            }
21154        }
21155        deserializer.deserialize_any(Visitor)
21156    }
21157}
21158
21159#[doc(hidden)]
21160impl serde::ser::Serialize for Task {
21161    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21162    where
21163        S: serde::ser::Serializer,
21164    {
21165        use serde::ser::SerializeMap;
21166        #[allow(unused_imports)]
21167        use std::option::Option::Some;
21168        let mut state = serializer.serialize_map(std::option::Option::None)?;
21169        if !self.name.is_empty() {
21170            state.serialize_entry("name", &self.name)?;
21171        }
21172        if !self.uid.is_empty() {
21173            state.serialize_entry("uid", &self.uid)?;
21174        }
21175        if !wkt::internal::is_default(&self.generation) {
21176            struct __With<'a>(&'a i64);
21177            impl<'a> serde::ser::Serialize for __With<'a> {
21178                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21179                where
21180                    S: serde::ser::Serializer,
21181                {
21182                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
21183                }
21184            }
21185            state.serialize_entry("generation", &__With(&self.generation))?;
21186        }
21187        if !self.labels.is_empty() {
21188            state.serialize_entry("labels", &self.labels)?;
21189        }
21190        if !self.annotations.is_empty() {
21191            state.serialize_entry("annotations", &self.annotations)?;
21192        }
21193        if self.create_time.is_some() {
21194            state.serialize_entry("createTime", &self.create_time)?;
21195        }
21196        if self.scheduled_time.is_some() {
21197            state.serialize_entry("scheduledTime", &self.scheduled_time)?;
21198        }
21199        if self.start_time.is_some() {
21200            state.serialize_entry("startTime", &self.start_time)?;
21201        }
21202        if self.completion_time.is_some() {
21203            state.serialize_entry("completionTime", &self.completion_time)?;
21204        }
21205        if self.update_time.is_some() {
21206            state.serialize_entry("updateTime", &self.update_time)?;
21207        }
21208        if self.delete_time.is_some() {
21209            state.serialize_entry("deleteTime", &self.delete_time)?;
21210        }
21211        if self.expire_time.is_some() {
21212            state.serialize_entry("expireTime", &self.expire_time)?;
21213        }
21214        if !self.job.is_empty() {
21215            state.serialize_entry("job", &self.job)?;
21216        }
21217        if !self.execution.is_empty() {
21218            state.serialize_entry("execution", &self.execution)?;
21219        }
21220        if !self.containers.is_empty() {
21221            state.serialize_entry("containers", &self.containers)?;
21222        }
21223        if !self.volumes.is_empty() {
21224            state.serialize_entry("volumes", &self.volumes)?;
21225        }
21226        if !wkt::internal::is_default(&self.max_retries) {
21227            struct __With<'a>(&'a i32);
21228            impl<'a> serde::ser::Serialize for __With<'a> {
21229                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21230                where
21231                    S: serde::ser::Serializer,
21232                {
21233                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
21234                }
21235            }
21236            state.serialize_entry("maxRetries", &__With(&self.max_retries))?;
21237        }
21238        if self.timeout.is_some() {
21239            state.serialize_entry("timeout", &self.timeout)?;
21240        }
21241        if !self.service_account.is_empty() {
21242            state.serialize_entry("serviceAccount", &self.service_account)?;
21243        }
21244        if !wkt::internal::is_default(&self.execution_environment) {
21245            state.serialize_entry("executionEnvironment", &self.execution_environment)?;
21246        }
21247        if !wkt::internal::is_default(&self.reconciling) {
21248            state.serialize_entry("reconciling", &self.reconciling)?;
21249        }
21250        if !self.conditions.is_empty() {
21251            state.serialize_entry("conditions", &self.conditions)?;
21252        }
21253        if !wkt::internal::is_default(&self.observed_generation) {
21254            struct __With<'a>(&'a i64);
21255            impl<'a> serde::ser::Serialize for __With<'a> {
21256                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21257                where
21258                    S: serde::ser::Serializer,
21259                {
21260                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
21261                }
21262            }
21263            state.serialize_entry("observedGeneration", &__With(&self.observed_generation))?;
21264        }
21265        if !wkt::internal::is_default(&self.index) {
21266            struct __With<'a>(&'a i32);
21267            impl<'a> serde::ser::Serialize for __With<'a> {
21268                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21269                where
21270                    S: serde::ser::Serializer,
21271                {
21272                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
21273                }
21274            }
21275            state.serialize_entry("index", &__With(&self.index))?;
21276        }
21277        if !wkt::internal::is_default(&self.retried) {
21278            struct __With<'a>(&'a i32);
21279            impl<'a> serde::ser::Serialize for __With<'a> {
21280                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21281                where
21282                    S: serde::ser::Serializer,
21283                {
21284                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
21285                }
21286            }
21287            state.serialize_entry("retried", &__With(&self.retried))?;
21288        }
21289        if self.last_attempt_result.is_some() {
21290            state.serialize_entry("lastAttemptResult", &self.last_attempt_result)?;
21291        }
21292        if !self.encryption_key.is_empty() {
21293            state.serialize_entry("encryptionKey", &self.encryption_key)?;
21294        }
21295        if self.vpc_access.is_some() {
21296            state.serialize_entry("vpcAccess", &self.vpc_access)?;
21297        }
21298        if !self.log_uri.is_empty() {
21299            state.serialize_entry("logUri", &self.log_uri)?;
21300        }
21301        if !wkt::internal::is_default(&self.satisfies_pzs) {
21302            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
21303        }
21304        if self.node_selector.is_some() {
21305            state.serialize_entry("nodeSelector", &self.node_selector)?;
21306        }
21307        if self.gpu_zonal_redundancy_disabled.is_some() {
21308            state.serialize_entry(
21309                "gpuZonalRedundancyDisabled",
21310                &self.gpu_zonal_redundancy_disabled,
21311            )?;
21312        }
21313        if !self.etag.is_empty() {
21314            state.serialize_entry("etag", &self.etag)?;
21315        }
21316        if !self._unknown_fields.is_empty() {
21317            for (key, value) in self._unknown_fields.iter() {
21318                state.serialize_entry(key, &value)?;
21319            }
21320        }
21321        state.end()
21322    }
21323}
21324
21325impl std::fmt::Debug for Task {
21326    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21327        let mut debug_struct = f.debug_struct("Task");
21328        debug_struct.field("name", &self.name);
21329        debug_struct.field("uid", &self.uid);
21330        debug_struct.field("generation", &self.generation);
21331        debug_struct.field("labels", &self.labels);
21332        debug_struct.field("annotations", &self.annotations);
21333        debug_struct.field("create_time", &self.create_time);
21334        debug_struct.field("scheduled_time", &self.scheduled_time);
21335        debug_struct.field("start_time", &self.start_time);
21336        debug_struct.field("completion_time", &self.completion_time);
21337        debug_struct.field("update_time", &self.update_time);
21338        debug_struct.field("delete_time", &self.delete_time);
21339        debug_struct.field("expire_time", &self.expire_time);
21340        debug_struct.field("job", &self.job);
21341        debug_struct.field("execution", &self.execution);
21342        debug_struct.field("containers", &self.containers);
21343        debug_struct.field("volumes", &self.volumes);
21344        debug_struct.field("max_retries", &self.max_retries);
21345        debug_struct.field("timeout", &self.timeout);
21346        debug_struct.field("service_account", &self.service_account);
21347        debug_struct.field("execution_environment", &self.execution_environment);
21348        debug_struct.field("reconciling", &self.reconciling);
21349        debug_struct.field("conditions", &self.conditions);
21350        debug_struct.field("observed_generation", &self.observed_generation);
21351        debug_struct.field("index", &self.index);
21352        debug_struct.field("retried", &self.retried);
21353        debug_struct.field("last_attempt_result", &self.last_attempt_result);
21354        debug_struct.field("encryption_key", &self.encryption_key);
21355        debug_struct.field("vpc_access", &self.vpc_access);
21356        debug_struct.field("log_uri", &self.log_uri);
21357        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
21358        debug_struct.field("node_selector", &self.node_selector);
21359        debug_struct.field(
21360            "gpu_zonal_redundancy_disabled",
21361            &self.gpu_zonal_redundancy_disabled,
21362        );
21363        debug_struct.field("etag", &self.etag);
21364        if !self._unknown_fields.is_empty() {
21365            debug_struct.field("_unknown_fields", &self._unknown_fields);
21366        }
21367        debug_struct.finish()
21368    }
21369}
21370
21371/// Result of a task attempt.
21372#[derive(Clone, Default, PartialEq)]
21373#[non_exhaustive]
21374pub struct TaskAttemptResult {
21375    /// Output only. The status of this attempt.
21376    /// If the status code is OK, then the attempt succeeded.
21377    pub status: std::option::Option<rpc::model::Status>,
21378
21379    /// Output only. The exit code of this attempt.
21380    /// This may be unset if the container was unable to exit cleanly with a code
21381    /// due to some other failure.
21382    /// See status field for possible failure details.
21383    ///
21384    /// At most one of exit_code or term_signal will be set.
21385    pub exit_code: i32,
21386
21387    /// Output only. Termination signal of the container. This is set to non-zero
21388    /// if the container is terminated by the system.
21389    ///
21390    /// At most one of exit_code or term_signal will be set.
21391    pub term_signal: i32,
21392
21393    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21394}
21395
21396impl TaskAttemptResult {
21397    pub fn new() -> Self {
21398        std::default::Default::default()
21399    }
21400
21401    /// Sets the value of [status][crate::model::TaskAttemptResult::status].
21402    pub fn set_status<T>(mut self, v: T) -> Self
21403    where
21404        T: std::convert::Into<rpc::model::Status>,
21405    {
21406        self.status = std::option::Option::Some(v.into());
21407        self
21408    }
21409
21410    /// Sets or clears the value of [status][crate::model::TaskAttemptResult::status].
21411    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
21412    where
21413        T: std::convert::Into<rpc::model::Status>,
21414    {
21415        self.status = v.map(|x| x.into());
21416        self
21417    }
21418
21419    /// Sets the value of [exit_code][crate::model::TaskAttemptResult::exit_code].
21420    pub fn set_exit_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21421        self.exit_code = v.into();
21422        self
21423    }
21424
21425    /// Sets the value of [term_signal][crate::model::TaskAttemptResult::term_signal].
21426    pub fn set_term_signal<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21427        self.term_signal = v.into();
21428        self
21429    }
21430}
21431
21432impl wkt::message::Message for TaskAttemptResult {
21433    fn typename() -> &'static str {
21434        "type.googleapis.com/google.cloud.run.v2.TaskAttemptResult"
21435    }
21436}
21437
21438#[doc(hidden)]
21439impl<'de> serde::de::Deserialize<'de> for TaskAttemptResult {
21440    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21441    where
21442        D: serde::Deserializer<'de>,
21443    {
21444        #[allow(non_camel_case_types)]
21445        #[doc(hidden)]
21446        #[derive(PartialEq, Eq, Hash)]
21447        enum __FieldTag {
21448            __status,
21449            __exit_code,
21450            __term_signal,
21451            Unknown(std::string::String),
21452        }
21453        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21454            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21455            where
21456                D: serde::Deserializer<'de>,
21457            {
21458                struct Visitor;
21459                impl<'de> serde::de::Visitor<'de> for Visitor {
21460                    type Value = __FieldTag;
21461                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21462                        formatter.write_str("a field name for TaskAttemptResult")
21463                    }
21464                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21465                    where
21466                        E: serde::de::Error,
21467                    {
21468                        use std::result::Result::Ok;
21469                        use std::string::ToString;
21470                        match value {
21471                            "status" => Ok(__FieldTag::__status),
21472                            "exitCode" => Ok(__FieldTag::__exit_code),
21473                            "exit_code" => Ok(__FieldTag::__exit_code),
21474                            "termSignal" => Ok(__FieldTag::__term_signal),
21475                            "term_signal" => Ok(__FieldTag::__term_signal),
21476                            _ => Ok(__FieldTag::Unknown(value.to_string())),
21477                        }
21478                    }
21479                }
21480                deserializer.deserialize_identifier(Visitor)
21481            }
21482        }
21483        struct Visitor;
21484        impl<'de> serde::de::Visitor<'de> for Visitor {
21485            type Value = TaskAttemptResult;
21486            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21487                formatter.write_str("struct TaskAttemptResult")
21488            }
21489            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21490            where
21491                A: serde::de::MapAccess<'de>,
21492            {
21493                #[allow(unused_imports)]
21494                use serde::de::Error;
21495                use std::option::Option::Some;
21496                let mut fields = std::collections::HashSet::new();
21497                let mut result = Self::Value::new();
21498                while let Some(tag) = map.next_key::<__FieldTag>()? {
21499                    #[allow(clippy::match_single_binding)]
21500                    match tag {
21501                        __FieldTag::__status => {
21502                            if !fields.insert(__FieldTag::__status) {
21503                                return std::result::Result::Err(A::Error::duplicate_field(
21504                                    "multiple values for status",
21505                                ));
21506                            }
21507                            result.status =
21508                                map.next_value::<std::option::Option<rpc::model::Status>>()?;
21509                        }
21510                        __FieldTag::__exit_code => {
21511                            if !fields.insert(__FieldTag::__exit_code) {
21512                                return std::result::Result::Err(A::Error::duplicate_field(
21513                                    "multiple values for exit_code",
21514                                ));
21515                            }
21516                            struct __With(std::option::Option<i32>);
21517                            impl<'de> serde::de::Deserialize<'de> for __With {
21518                                fn deserialize<D>(
21519                                    deserializer: D,
21520                                ) -> std::result::Result<Self, D::Error>
21521                                where
21522                                    D: serde::de::Deserializer<'de>,
21523                                {
21524                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
21525                                }
21526                            }
21527                            result.exit_code = map.next_value::<__With>()?.0.unwrap_or_default();
21528                        }
21529                        __FieldTag::__term_signal => {
21530                            if !fields.insert(__FieldTag::__term_signal) {
21531                                return std::result::Result::Err(A::Error::duplicate_field(
21532                                    "multiple values for term_signal",
21533                                ));
21534                            }
21535                            struct __With(std::option::Option<i32>);
21536                            impl<'de> serde::de::Deserialize<'de> for __With {
21537                                fn deserialize<D>(
21538                                    deserializer: D,
21539                                ) -> std::result::Result<Self, D::Error>
21540                                where
21541                                    D: serde::de::Deserializer<'de>,
21542                                {
21543                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
21544                                }
21545                            }
21546                            result.term_signal = map.next_value::<__With>()?.0.unwrap_or_default();
21547                        }
21548                        __FieldTag::Unknown(key) => {
21549                            let value = map.next_value::<serde_json::Value>()?;
21550                            result._unknown_fields.insert(key, value);
21551                        }
21552                    }
21553                }
21554                std::result::Result::Ok(result)
21555            }
21556        }
21557        deserializer.deserialize_any(Visitor)
21558    }
21559}
21560
21561#[doc(hidden)]
21562impl serde::ser::Serialize for TaskAttemptResult {
21563    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21564    where
21565        S: serde::ser::Serializer,
21566    {
21567        use serde::ser::SerializeMap;
21568        #[allow(unused_imports)]
21569        use std::option::Option::Some;
21570        let mut state = serializer.serialize_map(std::option::Option::None)?;
21571        if self.status.is_some() {
21572            state.serialize_entry("status", &self.status)?;
21573        }
21574        if !wkt::internal::is_default(&self.exit_code) {
21575            struct __With<'a>(&'a i32);
21576            impl<'a> serde::ser::Serialize for __With<'a> {
21577                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21578                where
21579                    S: serde::ser::Serializer,
21580                {
21581                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
21582                }
21583            }
21584            state.serialize_entry("exitCode", &__With(&self.exit_code))?;
21585        }
21586        if !wkt::internal::is_default(&self.term_signal) {
21587            struct __With<'a>(&'a i32);
21588            impl<'a> serde::ser::Serialize for __With<'a> {
21589                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21590                where
21591                    S: serde::ser::Serializer,
21592                {
21593                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
21594                }
21595            }
21596            state.serialize_entry("termSignal", &__With(&self.term_signal))?;
21597        }
21598        if !self._unknown_fields.is_empty() {
21599            for (key, value) in self._unknown_fields.iter() {
21600                state.serialize_entry(key, &value)?;
21601            }
21602        }
21603        state.end()
21604    }
21605}
21606
21607impl std::fmt::Debug for TaskAttemptResult {
21608    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21609        let mut debug_struct = f.debug_struct("TaskAttemptResult");
21610        debug_struct.field("status", &self.status);
21611        debug_struct.field("exit_code", &self.exit_code);
21612        debug_struct.field("term_signal", &self.term_signal);
21613        if !self._unknown_fields.is_empty() {
21614            debug_struct.field("_unknown_fields", &self._unknown_fields);
21615        }
21616        debug_struct.finish()
21617    }
21618}
21619
21620/// TaskTemplate describes the data a task should have when created
21621/// from a template.
21622#[derive(Clone, Default, PartialEq)]
21623#[non_exhaustive]
21624pub struct TaskTemplate {
21625    /// Holds the single container that defines the unit of execution for this
21626    /// task.
21627    pub containers: std::vec::Vec<crate::model::Container>,
21628
21629    /// Optional. A list of Volumes to make available to containers.
21630    pub volumes: std::vec::Vec<crate::model::Volume>,
21631
21632    /// Optional. Max allowed time duration the Task may be active before the
21633    /// system will actively try to mark it failed and kill associated containers.
21634    /// This applies per attempt of a task, meaning each retry can run for the full
21635    /// timeout. Defaults to 600 seconds.
21636    pub timeout: std::option::Option<wkt::Duration>,
21637
21638    /// Optional. Email address of the IAM service account associated with the Task
21639    /// of a Job. The service account represents the identity of the running task,
21640    /// and determines what permissions the task has. If not provided, the task
21641    /// will use the project's default service account.
21642    pub service_account: std::string::String,
21643
21644    /// Optional. The execution environment being used to host this Task.
21645    pub execution_environment: crate::model::ExecutionEnvironment,
21646
21647    /// A reference to a customer managed encryption key (CMEK) to use to encrypt
21648    /// this container image. For more information, go to
21649    /// <https://cloud.google.com/run/docs/securing/using-cmek>
21650    pub encryption_key: std::string::String,
21651
21652    /// Optional. VPC Access configuration to use for this Task. For more
21653    /// information, visit
21654    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
21655    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
21656
21657    /// Optional. The node selector for the task template.
21658    pub node_selector: std::option::Option<crate::model::NodeSelector>,
21659
21660    /// Optional. True if GPU zonal redundancy is disabled on this task template.
21661    pub gpu_zonal_redundancy_disabled: std::option::Option<bool>,
21662
21663    pub retries: std::option::Option<crate::model::task_template::Retries>,
21664
21665    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21666}
21667
21668impl TaskTemplate {
21669    pub fn new() -> Self {
21670        std::default::Default::default()
21671    }
21672
21673    /// Sets the value of [containers][crate::model::TaskTemplate::containers].
21674    pub fn set_containers<T, V>(mut self, v: T) -> Self
21675    where
21676        T: std::iter::IntoIterator<Item = V>,
21677        V: std::convert::Into<crate::model::Container>,
21678    {
21679        use std::iter::Iterator;
21680        self.containers = v.into_iter().map(|i| i.into()).collect();
21681        self
21682    }
21683
21684    /// Sets the value of [volumes][crate::model::TaskTemplate::volumes].
21685    pub fn set_volumes<T, V>(mut self, v: T) -> Self
21686    where
21687        T: std::iter::IntoIterator<Item = V>,
21688        V: std::convert::Into<crate::model::Volume>,
21689    {
21690        use std::iter::Iterator;
21691        self.volumes = v.into_iter().map(|i| i.into()).collect();
21692        self
21693    }
21694
21695    /// Sets the value of [timeout][crate::model::TaskTemplate::timeout].
21696    pub fn set_timeout<T>(mut self, v: T) -> Self
21697    where
21698        T: std::convert::Into<wkt::Duration>,
21699    {
21700        self.timeout = std::option::Option::Some(v.into());
21701        self
21702    }
21703
21704    /// Sets or clears the value of [timeout][crate::model::TaskTemplate::timeout].
21705    pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
21706    where
21707        T: std::convert::Into<wkt::Duration>,
21708    {
21709        self.timeout = v.map(|x| x.into());
21710        self
21711    }
21712
21713    /// Sets the value of [service_account][crate::model::TaskTemplate::service_account].
21714    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21715        self.service_account = v.into();
21716        self
21717    }
21718
21719    /// Sets the value of [execution_environment][crate::model::TaskTemplate::execution_environment].
21720    pub fn set_execution_environment<T: std::convert::Into<crate::model::ExecutionEnvironment>>(
21721        mut self,
21722        v: T,
21723    ) -> Self {
21724        self.execution_environment = v.into();
21725        self
21726    }
21727
21728    /// Sets the value of [encryption_key][crate::model::TaskTemplate::encryption_key].
21729    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21730        self.encryption_key = v.into();
21731        self
21732    }
21733
21734    /// Sets the value of [vpc_access][crate::model::TaskTemplate::vpc_access].
21735    pub fn set_vpc_access<T>(mut self, v: T) -> Self
21736    where
21737        T: std::convert::Into<crate::model::VpcAccess>,
21738    {
21739        self.vpc_access = std::option::Option::Some(v.into());
21740        self
21741    }
21742
21743    /// Sets or clears the value of [vpc_access][crate::model::TaskTemplate::vpc_access].
21744    pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
21745    where
21746        T: std::convert::Into<crate::model::VpcAccess>,
21747    {
21748        self.vpc_access = v.map(|x| x.into());
21749        self
21750    }
21751
21752    /// Sets the value of [node_selector][crate::model::TaskTemplate::node_selector].
21753    pub fn set_node_selector<T>(mut self, v: T) -> Self
21754    where
21755        T: std::convert::Into<crate::model::NodeSelector>,
21756    {
21757        self.node_selector = std::option::Option::Some(v.into());
21758        self
21759    }
21760
21761    /// Sets or clears the value of [node_selector][crate::model::TaskTemplate::node_selector].
21762    pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
21763    where
21764        T: std::convert::Into<crate::model::NodeSelector>,
21765    {
21766        self.node_selector = v.map(|x| x.into());
21767        self
21768    }
21769
21770    /// Sets the value of [gpu_zonal_redundancy_disabled][crate::model::TaskTemplate::gpu_zonal_redundancy_disabled].
21771    pub fn set_gpu_zonal_redundancy_disabled<T>(mut self, v: T) -> Self
21772    where
21773        T: std::convert::Into<bool>,
21774    {
21775        self.gpu_zonal_redundancy_disabled = std::option::Option::Some(v.into());
21776        self
21777    }
21778
21779    /// Sets or clears the value of [gpu_zonal_redundancy_disabled][crate::model::TaskTemplate::gpu_zonal_redundancy_disabled].
21780    pub fn set_or_clear_gpu_zonal_redundancy_disabled<T>(
21781        mut self,
21782        v: std::option::Option<T>,
21783    ) -> Self
21784    where
21785        T: std::convert::Into<bool>,
21786    {
21787        self.gpu_zonal_redundancy_disabled = v.map(|x| x.into());
21788        self
21789    }
21790
21791    /// Sets the value of [retries][crate::model::TaskTemplate::retries].
21792    ///
21793    /// Note that all the setters affecting `retries` are mutually
21794    /// exclusive.
21795    pub fn set_retries<
21796        T: std::convert::Into<std::option::Option<crate::model::task_template::Retries>>,
21797    >(
21798        mut self,
21799        v: T,
21800    ) -> Self {
21801        self.retries = v.into();
21802        self
21803    }
21804
21805    /// The value of [retries][crate::model::TaskTemplate::retries]
21806    /// if it holds a `MaxRetries`, `None` if the field is not set or
21807    /// holds a different branch.
21808    pub fn max_retries(&self) -> std::option::Option<&i32> {
21809        #[allow(unreachable_patterns)]
21810        self.retries.as_ref().and_then(|v| match v {
21811            crate::model::task_template::Retries::MaxRetries(v) => std::option::Option::Some(v),
21812            _ => std::option::Option::None,
21813        })
21814    }
21815
21816    /// Sets the value of [retries][crate::model::TaskTemplate::retries]
21817    /// to hold a `MaxRetries`.
21818    ///
21819    /// Note that all the setters affecting `retries` are
21820    /// mutually exclusive.
21821    pub fn set_max_retries<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21822        self.retries =
21823            std::option::Option::Some(crate::model::task_template::Retries::MaxRetries(v.into()));
21824        self
21825    }
21826}
21827
21828impl wkt::message::Message for TaskTemplate {
21829    fn typename() -> &'static str {
21830        "type.googleapis.com/google.cloud.run.v2.TaskTemplate"
21831    }
21832}
21833
21834#[doc(hidden)]
21835impl<'de> serde::de::Deserialize<'de> for TaskTemplate {
21836    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21837    where
21838        D: serde::Deserializer<'de>,
21839    {
21840        #[allow(non_camel_case_types)]
21841        #[doc(hidden)]
21842        #[derive(PartialEq, Eq, Hash)]
21843        enum __FieldTag {
21844            __containers,
21845            __volumes,
21846            __max_retries,
21847            __timeout,
21848            __service_account,
21849            __execution_environment,
21850            __encryption_key,
21851            __vpc_access,
21852            __node_selector,
21853            __gpu_zonal_redundancy_disabled,
21854            Unknown(std::string::String),
21855        }
21856        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
21857            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21858            where
21859                D: serde::Deserializer<'de>,
21860            {
21861                struct Visitor;
21862                impl<'de> serde::de::Visitor<'de> for Visitor {
21863                    type Value = __FieldTag;
21864                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21865                        formatter.write_str("a field name for TaskTemplate")
21866                    }
21867                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
21868                    where
21869                        E: serde::de::Error,
21870                    {
21871                        use std::result::Result::Ok;
21872                        use std::string::ToString;
21873                        match value {
21874                            "containers" => Ok(__FieldTag::__containers),
21875                            "volumes" => Ok(__FieldTag::__volumes),
21876                            "maxRetries" => Ok(__FieldTag::__max_retries),
21877                            "max_retries" => Ok(__FieldTag::__max_retries),
21878                            "timeout" => Ok(__FieldTag::__timeout),
21879                            "serviceAccount" => Ok(__FieldTag::__service_account),
21880                            "service_account" => Ok(__FieldTag::__service_account),
21881                            "executionEnvironment" => Ok(__FieldTag::__execution_environment),
21882                            "execution_environment" => Ok(__FieldTag::__execution_environment),
21883                            "encryptionKey" => Ok(__FieldTag::__encryption_key),
21884                            "encryption_key" => Ok(__FieldTag::__encryption_key),
21885                            "vpcAccess" => Ok(__FieldTag::__vpc_access),
21886                            "vpc_access" => Ok(__FieldTag::__vpc_access),
21887                            "nodeSelector" => Ok(__FieldTag::__node_selector),
21888                            "node_selector" => Ok(__FieldTag::__node_selector),
21889                            "gpuZonalRedundancyDisabled" => {
21890                                Ok(__FieldTag::__gpu_zonal_redundancy_disabled)
21891                            }
21892                            "gpu_zonal_redundancy_disabled" => {
21893                                Ok(__FieldTag::__gpu_zonal_redundancy_disabled)
21894                            }
21895                            _ => Ok(__FieldTag::Unknown(value.to_string())),
21896                        }
21897                    }
21898                }
21899                deserializer.deserialize_identifier(Visitor)
21900            }
21901        }
21902        struct Visitor;
21903        impl<'de> serde::de::Visitor<'de> for Visitor {
21904            type Value = TaskTemplate;
21905            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
21906                formatter.write_str("struct TaskTemplate")
21907            }
21908            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
21909            where
21910                A: serde::de::MapAccess<'de>,
21911            {
21912                #[allow(unused_imports)]
21913                use serde::de::Error;
21914                use std::option::Option::Some;
21915                let mut fields = std::collections::HashSet::new();
21916                let mut result = Self::Value::new();
21917                while let Some(tag) = map.next_key::<__FieldTag>()? {
21918                    #[allow(clippy::match_single_binding)]
21919                    match tag {
21920                        __FieldTag::__containers => {
21921                            if !fields.insert(__FieldTag::__containers) {
21922                                return std::result::Result::Err(A::Error::duplicate_field(
21923                                    "multiple values for containers",
21924                                ));
21925                            }
21926                            result.containers = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Container>>>()?.unwrap_or_default();
21927                        }
21928                        __FieldTag::__volumes => {
21929                            if !fields.insert(__FieldTag::__volumes) {
21930                                return std::result::Result::Err(A::Error::duplicate_field(
21931                                    "multiple values for volumes",
21932                                ));
21933                            }
21934                            result.volumes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Volume>>>()?.unwrap_or_default();
21935                        }
21936                        __FieldTag::__max_retries => {
21937                            if !fields.insert(__FieldTag::__max_retries) {
21938                                return std::result::Result::Err(A::Error::duplicate_field(
21939                                    "multiple values for max_retries",
21940                                ));
21941                            }
21942                            struct __With(std::option::Option<i32>);
21943                            impl<'de> serde::de::Deserialize<'de> for __With {
21944                                fn deserialize<D>(
21945                                    deserializer: D,
21946                                ) -> std::result::Result<Self, D::Error>
21947                                where
21948                                    D: serde::de::Deserializer<'de>,
21949                                {
21950                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
21951                                }
21952                            }
21953                            if result.retries.is_some() {
21954                                return std::result::Result::Err(A::Error::duplicate_field(
21955                                    "multiple values for `retries`, a oneof with full ID .google.cloud.run.v2.TaskTemplate.max_retries, latest field was maxRetries",
21956                                ));
21957                            }
21958                            result.retries = std::option::Option::Some(
21959                                crate::model::task_template::Retries::MaxRetries(
21960                                    map.next_value::<__With>()?.0.unwrap_or_default(),
21961                                ),
21962                            );
21963                        }
21964                        __FieldTag::__timeout => {
21965                            if !fields.insert(__FieldTag::__timeout) {
21966                                return std::result::Result::Err(A::Error::duplicate_field(
21967                                    "multiple values for timeout",
21968                                ));
21969                            }
21970                            result.timeout =
21971                                map.next_value::<std::option::Option<wkt::Duration>>()?;
21972                        }
21973                        __FieldTag::__service_account => {
21974                            if !fields.insert(__FieldTag::__service_account) {
21975                                return std::result::Result::Err(A::Error::duplicate_field(
21976                                    "multiple values for service_account",
21977                                ));
21978                            }
21979                            result.service_account = map
21980                                .next_value::<std::option::Option<std::string::String>>()?
21981                                .unwrap_or_default();
21982                        }
21983                        __FieldTag::__execution_environment => {
21984                            if !fields.insert(__FieldTag::__execution_environment) {
21985                                return std::result::Result::Err(A::Error::duplicate_field(
21986                                    "multiple values for execution_environment",
21987                                ));
21988                            }
21989                            result.execution_environment = map.next_value::<std::option::Option<crate::model::ExecutionEnvironment>>()?.unwrap_or_default();
21990                        }
21991                        __FieldTag::__encryption_key => {
21992                            if !fields.insert(__FieldTag::__encryption_key) {
21993                                return std::result::Result::Err(A::Error::duplicate_field(
21994                                    "multiple values for encryption_key",
21995                                ));
21996                            }
21997                            result.encryption_key = map
21998                                .next_value::<std::option::Option<std::string::String>>()?
21999                                .unwrap_or_default();
22000                        }
22001                        __FieldTag::__vpc_access => {
22002                            if !fields.insert(__FieldTag::__vpc_access) {
22003                                return std::result::Result::Err(A::Error::duplicate_field(
22004                                    "multiple values for vpc_access",
22005                                ));
22006                            }
22007                            result.vpc_access =
22008                                map.next_value::<std::option::Option<crate::model::VpcAccess>>()?;
22009                        }
22010                        __FieldTag::__node_selector => {
22011                            if !fields.insert(__FieldTag::__node_selector) {
22012                                return std::result::Result::Err(A::Error::duplicate_field(
22013                                    "multiple values for node_selector",
22014                                ));
22015                            }
22016                            result.node_selector = map
22017                                .next_value::<std::option::Option<crate::model::NodeSelector>>()?;
22018                        }
22019                        __FieldTag::__gpu_zonal_redundancy_disabled => {
22020                            if !fields.insert(__FieldTag::__gpu_zonal_redundancy_disabled) {
22021                                return std::result::Result::Err(A::Error::duplicate_field(
22022                                    "multiple values for gpu_zonal_redundancy_disabled",
22023                                ));
22024                            }
22025                            result.gpu_zonal_redundancy_disabled =
22026                                map.next_value::<std::option::Option<bool>>()?;
22027                        }
22028                        __FieldTag::Unknown(key) => {
22029                            let value = map.next_value::<serde_json::Value>()?;
22030                            result._unknown_fields.insert(key, value);
22031                        }
22032                    }
22033                }
22034                std::result::Result::Ok(result)
22035            }
22036        }
22037        deserializer.deserialize_any(Visitor)
22038    }
22039}
22040
22041#[doc(hidden)]
22042impl serde::ser::Serialize for TaskTemplate {
22043    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22044    where
22045        S: serde::ser::Serializer,
22046    {
22047        use serde::ser::SerializeMap;
22048        #[allow(unused_imports)]
22049        use std::option::Option::Some;
22050        let mut state = serializer.serialize_map(std::option::Option::None)?;
22051        if !self.containers.is_empty() {
22052            state.serialize_entry("containers", &self.containers)?;
22053        }
22054        if !self.volumes.is_empty() {
22055            state.serialize_entry("volumes", &self.volumes)?;
22056        }
22057        if let Some(value) = self.max_retries() {
22058            struct __With<'a>(&'a i32);
22059            impl<'a> serde::ser::Serialize for __With<'a> {
22060                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22061                where
22062                    S: serde::ser::Serializer,
22063                {
22064                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
22065                }
22066            }
22067            state.serialize_entry("maxRetries", &__With(value))?;
22068        }
22069        if self.timeout.is_some() {
22070            state.serialize_entry("timeout", &self.timeout)?;
22071        }
22072        if !self.service_account.is_empty() {
22073            state.serialize_entry("serviceAccount", &self.service_account)?;
22074        }
22075        if !wkt::internal::is_default(&self.execution_environment) {
22076            state.serialize_entry("executionEnvironment", &self.execution_environment)?;
22077        }
22078        if !self.encryption_key.is_empty() {
22079            state.serialize_entry("encryptionKey", &self.encryption_key)?;
22080        }
22081        if self.vpc_access.is_some() {
22082            state.serialize_entry("vpcAccess", &self.vpc_access)?;
22083        }
22084        if self.node_selector.is_some() {
22085            state.serialize_entry("nodeSelector", &self.node_selector)?;
22086        }
22087        if self.gpu_zonal_redundancy_disabled.is_some() {
22088            state.serialize_entry(
22089                "gpuZonalRedundancyDisabled",
22090                &self.gpu_zonal_redundancy_disabled,
22091            )?;
22092        }
22093        if !self._unknown_fields.is_empty() {
22094            for (key, value) in self._unknown_fields.iter() {
22095                state.serialize_entry(key, &value)?;
22096            }
22097        }
22098        state.end()
22099    }
22100}
22101
22102impl std::fmt::Debug for TaskTemplate {
22103    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22104        let mut debug_struct = f.debug_struct("TaskTemplate");
22105        debug_struct.field("containers", &self.containers);
22106        debug_struct.field("volumes", &self.volumes);
22107        debug_struct.field("timeout", &self.timeout);
22108        debug_struct.field("service_account", &self.service_account);
22109        debug_struct.field("execution_environment", &self.execution_environment);
22110        debug_struct.field("encryption_key", &self.encryption_key);
22111        debug_struct.field("vpc_access", &self.vpc_access);
22112        debug_struct.field("node_selector", &self.node_selector);
22113        debug_struct.field(
22114            "gpu_zonal_redundancy_disabled",
22115            &self.gpu_zonal_redundancy_disabled,
22116        );
22117        debug_struct.field("retries", &self.retries);
22118        if !self._unknown_fields.is_empty() {
22119            debug_struct.field("_unknown_fields", &self._unknown_fields);
22120        }
22121        debug_struct.finish()
22122    }
22123}
22124
22125/// Defines additional types related to [TaskTemplate].
22126pub mod task_template {
22127    #[allow(unused_imports)]
22128    use super::*;
22129
22130    #[derive(Clone, Debug, PartialEq)]
22131    #[non_exhaustive]
22132    pub enum Retries {
22133        /// Number of retries allowed per Task, before marking this Task failed.
22134        /// Defaults to 3.
22135        MaxRetries(i32),
22136    }
22137}
22138
22139/// Holds a single traffic routing entry for the Service. Allocations can be done
22140/// to a specific Revision name, or pointing to the latest Ready Revision.
22141#[derive(Clone, Default, PartialEq)]
22142#[non_exhaustive]
22143pub struct TrafficTarget {
22144    /// The allocation type for this traffic target.
22145    pub r#type: crate::model::TrafficTargetAllocationType,
22146
22147    /// Revision to which to send this portion of traffic, if traffic allocation is
22148    /// by revision.
22149    pub revision: std::string::String,
22150
22151    /// Specifies percent of the traffic to this Revision.
22152    /// This defaults to zero if unspecified.
22153    pub percent: i32,
22154
22155    /// Indicates a string to be part of the URI to exclusively reference this
22156    /// target.
22157    pub tag: std::string::String,
22158
22159    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22160}
22161
22162impl TrafficTarget {
22163    pub fn new() -> Self {
22164        std::default::Default::default()
22165    }
22166
22167    /// Sets the value of [r#type][crate::model::TrafficTarget::type].
22168    pub fn set_type<T: std::convert::Into<crate::model::TrafficTargetAllocationType>>(
22169        mut self,
22170        v: T,
22171    ) -> Self {
22172        self.r#type = v.into();
22173        self
22174    }
22175
22176    /// Sets the value of [revision][crate::model::TrafficTarget::revision].
22177    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22178        self.revision = v.into();
22179        self
22180    }
22181
22182    /// Sets the value of [percent][crate::model::TrafficTarget::percent].
22183    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22184        self.percent = v.into();
22185        self
22186    }
22187
22188    /// Sets the value of [tag][crate::model::TrafficTarget::tag].
22189    pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22190        self.tag = v.into();
22191        self
22192    }
22193}
22194
22195impl wkt::message::Message for TrafficTarget {
22196    fn typename() -> &'static str {
22197        "type.googleapis.com/google.cloud.run.v2.TrafficTarget"
22198    }
22199}
22200
22201#[doc(hidden)]
22202impl<'de> serde::de::Deserialize<'de> for TrafficTarget {
22203    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22204    where
22205        D: serde::Deserializer<'de>,
22206    {
22207        #[allow(non_camel_case_types)]
22208        #[doc(hidden)]
22209        #[derive(PartialEq, Eq, Hash)]
22210        enum __FieldTag {
22211            __type,
22212            __revision,
22213            __percent,
22214            __tag,
22215            Unknown(std::string::String),
22216        }
22217        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22218            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22219            where
22220                D: serde::Deserializer<'de>,
22221            {
22222                struct Visitor;
22223                impl<'de> serde::de::Visitor<'de> for Visitor {
22224                    type Value = __FieldTag;
22225                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22226                        formatter.write_str("a field name for TrafficTarget")
22227                    }
22228                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22229                    where
22230                        E: serde::de::Error,
22231                    {
22232                        use std::result::Result::Ok;
22233                        use std::string::ToString;
22234                        match value {
22235                            "type" => Ok(__FieldTag::__type),
22236                            "revision" => Ok(__FieldTag::__revision),
22237                            "percent" => Ok(__FieldTag::__percent),
22238                            "tag" => Ok(__FieldTag::__tag),
22239                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22240                        }
22241                    }
22242                }
22243                deserializer.deserialize_identifier(Visitor)
22244            }
22245        }
22246        struct Visitor;
22247        impl<'de> serde::de::Visitor<'de> for Visitor {
22248            type Value = TrafficTarget;
22249            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22250                formatter.write_str("struct TrafficTarget")
22251            }
22252            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22253            where
22254                A: serde::de::MapAccess<'de>,
22255            {
22256                #[allow(unused_imports)]
22257                use serde::de::Error;
22258                use std::option::Option::Some;
22259                let mut fields = std::collections::HashSet::new();
22260                let mut result = Self::Value::new();
22261                while let Some(tag) = map.next_key::<__FieldTag>()? {
22262                    #[allow(clippy::match_single_binding)]
22263                    match tag {
22264                        __FieldTag::__type => {
22265                            if !fields.insert(__FieldTag::__type) {
22266                                return std::result::Result::Err(A::Error::duplicate_field(
22267                                    "multiple values for type",
22268                                ));
22269                            }
22270                            result.r#type = map.next_value::<std::option::Option<crate::model::TrafficTargetAllocationType>>()?.unwrap_or_default();
22271                        }
22272                        __FieldTag::__revision => {
22273                            if !fields.insert(__FieldTag::__revision) {
22274                                return std::result::Result::Err(A::Error::duplicate_field(
22275                                    "multiple values for revision",
22276                                ));
22277                            }
22278                            result.revision = map
22279                                .next_value::<std::option::Option<std::string::String>>()?
22280                                .unwrap_or_default();
22281                        }
22282                        __FieldTag::__percent => {
22283                            if !fields.insert(__FieldTag::__percent) {
22284                                return std::result::Result::Err(A::Error::duplicate_field(
22285                                    "multiple values for percent",
22286                                ));
22287                            }
22288                            struct __With(std::option::Option<i32>);
22289                            impl<'de> serde::de::Deserialize<'de> for __With {
22290                                fn deserialize<D>(
22291                                    deserializer: D,
22292                                ) -> std::result::Result<Self, D::Error>
22293                                where
22294                                    D: serde::de::Deserializer<'de>,
22295                                {
22296                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
22297                                }
22298                            }
22299                            result.percent = map.next_value::<__With>()?.0.unwrap_or_default();
22300                        }
22301                        __FieldTag::__tag => {
22302                            if !fields.insert(__FieldTag::__tag) {
22303                                return std::result::Result::Err(A::Error::duplicate_field(
22304                                    "multiple values for tag",
22305                                ));
22306                            }
22307                            result.tag = map
22308                                .next_value::<std::option::Option<std::string::String>>()?
22309                                .unwrap_or_default();
22310                        }
22311                        __FieldTag::Unknown(key) => {
22312                            let value = map.next_value::<serde_json::Value>()?;
22313                            result._unknown_fields.insert(key, value);
22314                        }
22315                    }
22316                }
22317                std::result::Result::Ok(result)
22318            }
22319        }
22320        deserializer.deserialize_any(Visitor)
22321    }
22322}
22323
22324#[doc(hidden)]
22325impl serde::ser::Serialize for TrafficTarget {
22326    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22327    where
22328        S: serde::ser::Serializer,
22329    {
22330        use serde::ser::SerializeMap;
22331        #[allow(unused_imports)]
22332        use std::option::Option::Some;
22333        let mut state = serializer.serialize_map(std::option::Option::None)?;
22334        if !wkt::internal::is_default(&self.r#type) {
22335            state.serialize_entry("type", &self.r#type)?;
22336        }
22337        if !self.revision.is_empty() {
22338            state.serialize_entry("revision", &self.revision)?;
22339        }
22340        if !wkt::internal::is_default(&self.percent) {
22341            struct __With<'a>(&'a i32);
22342            impl<'a> serde::ser::Serialize for __With<'a> {
22343                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22344                where
22345                    S: serde::ser::Serializer,
22346                {
22347                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
22348                }
22349            }
22350            state.serialize_entry("percent", &__With(&self.percent))?;
22351        }
22352        if !self.tag.is_empty() {
22353            state.serialize_entry("tag", &self.tag)?;
22354        }
22355        if !self._unknown_fields.is_empty() {
22356            for (key, value) in self._unknown_fields.iter() {
22357                state.serialize_entry(key, &value)?;
22358            }
22359        }
22360        state.end()
22361    }
22362}
22363
22364impl std::fmt::Debug for TrafficTarget {
22365    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22366        let mut debug_struct = f.debug_struct("TrafficTarget");
22367        debug_struct.field("r#type", &self.r#type);
22368        debug_struct.field("revision", &self.revision);
22369        debug_struct.field("percent", &self.percent);
22370        debug_struct.field("tag", &self.tag);
22371        if !self._unknown_fields.is_empty() {
22372            debug_struct.field("_unknown_fields", &self._unknown_fields);
22373        }
22374        debug_struct.finish()
22375    }
22376}
22377
22378/// Represents the observed state of a single `TrafficTarget` entry.
22379#[derive(Clone, Default, PartialEq)]
22380#[non_exhaustive]
22381pub struct TrafficTargetStatus {
22382    /// The allocation type for this traffic target.
22383    pub r#type: crate::model::TrafficTargetAllocationType,
22384
22385    /// Revision to which this traffic is sent.
22386    pub revision: std::string::String,
22387
22388    /// Specifies percent of the traffic to this Revision.
22389    pub percent: i32,
22390
22391    /// Indicates the string used in the URI to exclusively reference this target.
22392    pub tag: std::string::String,
22393
22394    /// Displays the target URI.
22395    pub uri: std::string::String,
22396
22397    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22398}
22399
22400impl TrafficTargetStatus {
22401    pub fn new() -> Self {
22402        std::default::Default::default()
22403    }
22404
22405    /// Sets the value of [r#type][crate::model::TrafficTargetStatus::type].
22406    pub fn set_type<T: std::convert::Into<crate::model::TrafficTargetAllocationType>>(
22407        mut self,
22408        v: T,
22409    ) -> Self {
22410        self.r#type = v.into();
22411        self
22412    }
22413
22414    /// Sets the value of [revision][crate::model::TrafficTargetStatus::revision].
22415    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22416        self.revision = v.into();
22417        self
22418    }
22419
22420    /// Sets the value of [percent][crate::model::TrafficTargetStatus::percent].
22421    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
22422        self.percent = v.into();
22423        self
22424    }
22425
22426    /// Sets the value of [tag][crate::model::TrafficTargetStatus::tag].
22427    pub fn set_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22428        self.tag = v.into();
22429        self
22430    }
22431
22432    /// Sets the value of [uri][crate::model::TrafficTargetStatus::uri].
22433    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22434        self.uri = v.into();
22435        self
22436    }
22437}
22438
22439impl wkt::message::Message for TrafficTargetStatus {
22440    fn typename() -> &'static str {
22441        "type.googleapis.com/google.cloud.run.v2.TrafficTargetStatus"
22442    }
22443}
22444
22445#[doc(hidden)]
22446impl<'de> serde::de::Deserialize<'de> for TrafficTargetStatus {
22447    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22448    where
22449        D: serde::Deserializer<'de>,
22450    {
22451        #[allow(non_camel_case_types)]
22452        #[doc(hidden)]
22453        #[derive(PartialEq, Eq, Hash)]
22454        enum __FieldTag {
22455            __type,
22456            __revision,
22457            __percent,
22458            __tag,
22459            __uri,
22460            Unknown(std::string::String),
22461        }
22462        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22463            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22464            where
22465                D: serde::Deserializer<'de>,
22466            {
22467                struct Visitor;
22468                impl<'de> serde::de::Visitor<'de> for Visitor {
22469                    type Value = __FieldTag;
22470                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22471                        formatter.write_str("a field name for TrafficTargetStatus")
22472                    }
22473                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22474                    where
22475                        E: serde::de::Error,
22476                    {
22477                        use std::result::Result::Ok;
22478                        use std::string::ToString;
22479                        match value {
22480                            "type" => Ok(__FieldTag::__type),
22481                            "revision" => Ok(__FieldTag::__revision),
22482                            "percent" => Ok(__FieldTag::__percent),
22483                            "tag" => Ok(__FieldTag::__tag),
22484                            "uri" => Ok(__FieldTag::__uri),
22485                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22486                        }
22487                    }
22488                }
22489                deserializer.deserialize_identifier(Visitor)
22490            }
22491        }
22492        struct Visitor;
22493        impl<'de> serde::de::Visitor<'de> for Visitor {
22494            type Value = TrafficTargetStatus;
22495            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22496                formatter.write_str("struct TrafficTargetStatus")
22497            }
22498            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22499            where
22500                A: serde::de::MapAccess<'de>,
22501            {
22502                #[allow(unused_imports)]
22503                use serde::de::Error;
22504                use std::option::Option::Some;
22505                let mut fields = std::collections::HashSet::new();
22506                let mut result = Self::Value::new();
22507                while let Some(tag) = map.next_key::<__FieldTag>()? {
22508                    #[allow(clippy::match_single_binding)]
22509                    match tag {
22510                        __FieldTag::__type => {
22511                            if !fields.insert(__FieldTag::__type) {
22512                                return std::result::Result::Err(A::Error::duplicate_field(
22513                                    "multiple values for type",
22514                                ));
22515                            }
22516                            result.r#type = map.next_value::<std::option::Option<crate::model::TrafficTargetAllocationType>>()?.unwrap_or_default();
22517                        }
22518                        __FieldTag::__revision => {
22519                            if !fields.insert(__FieldTag::__revision) {
22520                                return std::result::Result::Err(A::Error::duplicate_field(
22521                                    "multiple values for revision",
22522                                ));
22523                            }
22524                            result.revision = map
22525                                .next_value::<std::option::Option<std::string::String>>()?
22526                                .unwrap_or_default();
22527                        }
22528                        __FieldTag::__percent => {
22529                            if !fields.insert(__FieldTag::__percent) {
22530                                return std::result::Result::Err(A::Error::duplicate_field(
22531                                    "multiple values for percent",
22532                                ));
22533                            }
22534                            struct __With(std::option::Option<i32>);
22535                            impl<'de> serde::de::Deserialize<'de> for __With {
22536                                fn deserialize<D>(
22537                                    deserializer: D,
22538                                ) -> std::result::Result<Self, D::Error>
22539                                where
22540                                    D: serde::de::Deserializer<'de>,
22541                                {
22542                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
22543                                }
22544                            }
22545                            result.percent = map.next_value::<__With>()?.0.unwrap_or_default();
22546                        }
22547                        __FieldTag::__tag => {
22548                            if !fields.insert(__FieldTag::__tag) {
22549                                return std::result::Result::Err(A::Error::duplicate_field(
22550                                    "multiple values for tag",
22551                                ));
22552                            }
22553                            result.tag = map
22554                                .next_value::<std::option::Option<std::string::String>>()?
22555                                .unwrap_or_default();
22556                        }
22557                        __FieldTag::__uri => {
22558                            if !fields.insert(__FieldTag::__uri) {
22559                                return std::result::Result::Err(A::Error::duplicate_field(
22560                                    "multiple values for uri",
22561                                ));
22562                            }
22563                            result.uri = map
22564                                .next_value::<std::option::Option<std::string::String>>()?
22565                                .unwrap_or_default();
22566                        }
22567                        __FieldTag::Unknown(key) => {
22568                            let value = map.next_value::<serde_json::Value>()?;
22569                            result._unknown_fields.insert(key, value);
22570                        }
22571                    }
22572                }
22573                std::result::Result::Ok(result)
22574            }
22575        }
22576        deserializer.deserialize_any(Visitor)
22577    }
22578}
22579
22580#[doc(hidden)]
22581impl serde::ser::Serialize for TrafficTargetStatus {
22582    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22583    where
22584        S: serde::ser::Serializer,
22585    {
22586        use serde::ser::SerializeMap;
22587        #[allow(unused_imports)]
22588        use std::option::Option::Some;
22589        let mut state = serializer.serialize_map(std::option::Option::None)?;
22590        if !wkt::internal::is_default(&self.r#type) {
22591            state.serialize_entry("type", &self.r#type)?;
22592        }
22593        if !self.revision.is_empty() {
22594            state.serialize_entry("revision", &self.revision)?;
22595        }
22596        if !wkt::internal::is_default(&self.percent) {
22597            struct __With<'a>(&'a i32);
22598            impl<'a> serde::ser::Serialize for __With<'a> {
22599                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22600                where
22601                    S: serde::ser::Serializer,
22602                {
22603                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
22604                }
22605            }
22606            state.serialize_entry("percent", &__With(&self.percent))?;
22607        }
22608        if !self.tag.is_empty() {
22609            state.serialize_entry("tag", &self.tag)?;
22610        }
22611        if !self.uri.is_empty() {
22612            state.serialize_entry("uri", &self.uri)?;
22613        }
22614        if !self._unknown_fields.is_empty() {
22615            for (key, value) in self._unknown_fields.iter() {
22616                state.serialize_entry(key, &value)?;
22617            }
22618        }
22619        state.end()
22620    }
22621}
22622
22623impl std::fmt::Debug for TrafficTargetStatus {
22624    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22625        let mut debug_struct = f.debug_struct("TrafficTargetStatus");
22626        debug_struct.field("r#type", &self.r#type);
22627        debug_struct.field("revision", &self.revision);
22628        debug_struct.field("percent", &self.percent);
22629        debug_struct.field("tag", &self.tag);
22630        debug_struct.field("uri", &self.uri);
22631        if !self._unknown_fields.is_empty() {
22632            debug_struct.field("_unknown_fields", &self._unknown_fields);
22633        }
22634        debug_struct.finish()
22635    }
22636}
22637
22638/// VPC Access settings. For more information on sending traffic to a VPC
22639/// network, visit <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
22640#[derive(Clone, Default, PartialEq)]
22641#[non_exhaustive]
22642pub struct VpcAccess {
22643    /// VPC Access connector name.
22644    /// Format: `projects/{project}/locations/{location}/connectors/{connector}`,
22645    /// where `{project}` can be project id or number.
22646    /// For more information on sending traffic to a VPC network via a connector,
22647    /// visit <https://cloud.google.com/run/docs/configuring/vpc-connectors>.
22648    pub connector: std::string::String,
22649
22650    /// Optional. Traffic VPC egress settings. If not provided, it defaults to
22651    /// PRIVATE_RANGES_ONLY.
22652    pub egress: crate::model::vpc_access::VpcEgress,
22653
22654    /// Optional. Direct VPC egress settings. Currently only single network
22655    /// interface is supported.
22656    pub network_interfaces: std::vec::Vec<crate::model::vpc_access::NetworkInterface>,
22657
22658    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22659}
22660
22661impl VpcAccess {
22662    pub fn new() -> Self {
22663        std::default::Default::default()
22664    }
22665
22666    /// Sets the value of [connector][crate::model::VpcAccess::connector].
22667    pub fn set_connector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22668        self.connector = v.into();
22669        self
22670    }
22671
22672    /// Sets the value of [egress][crate::model::VpcAccess::egress].
22673    pub fn set_egress<T: std::convert::Into<crate::model::vpc_access::VpcEgress>>(
22674        mut self,
22675        v: T,
22676    ) -> Self {
22677        self.egress = v.into();
22678        self
22679    }
22680
22681    /// Sets the value of [network_interfaces][crate::model::VpcAccess::network_interfaces].
22682    pub fn set_network_interfaces<T, V>(mut self, v: T) -> Self
22683    where
22684        T: std::iter::IntoIterator<Item = V>,
22685        V: std::convert::Into<crate::model::vpc_access::NetworkInterface>,
22686    {
22687        use std::iter::Iterator;
22688        self.network_interfaces = v.into_iter().map(|i| i.into()).collect();
22689        self
22690    }
22691}
22692
22693impl wkt::message::Message for VpcAccess {
22694    fn typename() -> &'static str {
22695        "type.googleapis.com/google.cloud.run.v2.VpcAccess"
22696    }
22697}
22698
22699#[doc(hidden)]
22700impl<'de> serde::de::Deserialize<'de> for VpcAccess {
22701    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22702    where
22703        D: serde::Deserializer<'de>,
22704    {
22705        #[allow(non_camel_case_types)]
22706        #[doc(hidden)]
22707        #[derive(PartialEq, Eq, Hash)]
22708        enum __FieldTag {
22709            __connector,
22710            __egress,
22711            __network_interfaces,
22712            Unknown(std::string::String),
22713        }
22714        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22715            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22716            where
22717                D: serde::Deserializer<'de>,
22718            {
22719                struct Visitor;
22720                impl<'de> serde::de::Visitor<'de> for Visitor {
22721                    type Value = __FieldTag;
22722                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22723                        formatter.write_str("a field name for VpcAccess")
22724                    }
22725                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22726                    where
22727                        E: serde::de::Error,
22728                    {
22729                        use std::result::Result::Ok;
22730                        use std::string::ToString;
22731                        match value {
22732                            "connector" => Ok(__FieldTag::__connector),
22733                            "egress" => Ok(__FieldTag::__egress),
22734                            "networkInterfaces" => Ok(__FieldTag::__network_interfaces),
22735                            "network_interfaces" => Ok(__FieldTag::__network_interfaces),
22736                            _ => Ok(__FieldTag::Unknown(value.to_string())),
22737                        }
22738                    }
22739                }
22740                deserializer.deserialize_identifier(Visitor)
22741            }
22742        }
22743        struct Visitor;
22744        impl<'de> serde::de::Visitor<'de> for Visitor {
22745            type Value = VpcAccess;
22746            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22747                formatter.write_str("struct VpcAccess")
22748            }
22749            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22750            where
22751                A: serde::de::MapAccess<'de>,
22752            {
22753                #[allow(unused_imports)]
22754                use serde::de::Error;
22755                use std::option::Option::Some;
22756                let mut fields = std::collections::HashSet::new();
22757                let mut result = Self::Value::new();
22758                while let Some(tag) = map.next_key::<__FieldTag>()? {
22759                    #[allow(clippy::match_single_binding)]
22760                    match tag {
22761                        __FieldTag::__connector => {
22762                            if !fields.insert(__FieldTag::__connector) {
22763                                return std::result::Result::Err(A::Error::duplicate_field(
22764                                    "multiple values for connector",
22765                                ));
22766                            }
22767                            result.connector = map
22768                                .next_value::<std::option::Option<std::string::String>>()?
22769                                .unwrap_or_default();
22770                        }
22771                        __FieldTag::__egress => {
22772                            if !fields.insert(__FieldTag::__egress) {
22773                                return std::result::Result::Err(A::Error::duplicate_field(
22774                                    "multiple values for egress",
22775                                ));
22776                            }
22777                            result.egress = map.next_value::<std::option::Option<crate::model::vpc_access::VpcEgress>>()?.unwrap_or_default();
22778                        }
22779                        __FieldTag::__network_interfaces => {
22780                            if !fields.insert(__FieldTag::__network_interfaces) {
22781                                return std::result::Result::Err(A::Error::duplicate_field(
22782                                    "multiple values for network_interfaces",
22783                                ));
22784                            }
22785                            result.network_interfaces = map
22786                                .next_value::<std::option::Option<
22787                                    std::vec::Vec<crate::model::vpc_access::NetworkInterface>,
22788                                >>()?
22789                                .unwrap_or_default();
22790                        }
22791                        __FieldTag::Unknown(key) => {
22792                            let value = map.next_value::<serde_json::Value>()?;
22793                            result._unknown_fields.insert(key, value);
22794                        }
22795                    }
22796                }
22797                std::result::Result::Ok(result)
22798            }
22799        }
22800        deserializer.deserialize_any(Visitor)
22801    }
22802}
22803
22804#[doc(hidden)]
22805impl serde::ser::Serialize for VpcAccess {
22806    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22807    where
22808        S: serde::ser::Serializer,
22809    {
22810        use serde::ser::SerializeMap;
22811        #[allow(unused_imports)]
22812        use std::option::Option::Some;
22813        let mut state = serializer.serialize_map(std::option::Option::None)?;
22814        if !self.connector.is_empty() {
22815            state.serialize_entry("connector", &self.connector)?;
22816        }
22817        if !wkt::internal::is_default(&self.egress) {
22818            state.serialize_entry("egress", &self.egress)?;
22819        }
22820        if !self.network_interfaces.is_empty() {
22821            state.serialize_entry("networkInterfaces", &self.network_interfaces)?;
22822        }
22823        if !self._unknown_fields.is_empty() {
22824            for (key, value) in self._unknown_fields.iter() {
22825                state.serialize_entry(key, &value)?;
22826            }
22827        }
22828        state.end()
22829    }
22830}
22831
22832impl std::fmt::Debug for VpcAccess {
22833    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22834        let mut debug_struct = f.debug_struct("VpcAccess");
22835        debug_struct.field("connector", &self.connector);
22836        debug_struct.field("egress", &self.egress);
22837        debug_struct.field("network_interfaces", &self.network_interfaces);
22838        if !self._unknown_fields.is_empty() {
22839            debug_struct.field("_unknown_fields", &self._unknown_fields);
22840        }
22841        debug_struct.finish()
22842    }
22843}
22844
22845/// Defines additional types related to [VpcAccess].
22846pub mod vpc_access {
22847    #[allow(unused_imports)]
22848    use super::*;
22849
22850    /// Direct VPC egress settings.
22851    #[derive(Clone, Default, PartialEq)]
22852    #[non_exhaustive]
22853    pub struct NetworkInterface {
22854        /// Optional. The VPC network that the Cloud Run resource will be able to
22855        /// send traffic to. At least one of network or subnetwork must be specified.
22856        /// If both network and subnetwork are specified, the given VPC subnetwork
22857        /// must belong to the given VPC network. If network is not specified, it
22858        /// will be looked up from the subnetwork.
22859        pub network: std::string::String,
22860
22861        /// Optional. The VPC subnetwork that the Cloud Run resource will get IPs
22862        /// from. At least one of network or subnetwork must be specified. If both
22863        /// network and subnetwork are specified, the given VPC subnetwork must
22864        /// belong to the given VPC network. If subnetwork is not specified, the
22865        /// subnetwork with the same name with the network will be used.
22866        pub subnetwork: std::string::String,
22867
22868        /// Optional. Network tags applied to this Cloud Run resource.
22869        pub tags: std::vec::Vec<std::string::String>,
22870
22871        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22872    }
22873
22874    impl NetworkInterface {
22875        pub fn new() -> Self {
22876            std::default::Default::default()
22877        }
22878
22879        /// Sets the value of [network][crate::model::vpc_access::NetworkInterface::network].
22880        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22881            self.network = v.into();
22882            self
22883        }
22884
22885        /// Sets the value of [subnetwork][crate::model::vpc_access::NetworkInterface::subnetwork].
22886        pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22887            self.subnetwork = v.into();
22888            self
22889        }
22890
22891        /// Sets the value of [tags][crate::model::vpc_access::NetworkInterface::tags].
22892        pub fn set_tags<T, V>(mut self, v: T) -> Self
22893        where
22894            T: std::iter::IntoIterator<Item = V>,
22895            V: std::convert::Into<std::string::String>,
22896        {
22897            use std::iter::Iterator;
22898            self.tags = v.into_iter().map(|i| i.into()).collect();
22899            self
22900        }
22901    }
22902
22903    impl wkt::message::Message for NetworkInterface {
22904        fn typename() -> &'static str {
22905            "type.googleapis.com/google.cloud.run.v2.VpcAccess.NetworkInterface"
22906        }
22907    }
22908
22909    #[doc(hidden)]
22910    impl<'de> serde::de::Deserialize<'de> for NetworkInterface {
22911        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22912        where
22913            D: serde::Deserializer<'de>,
22914        {
22915            #[allow(non_camel_case_types)]
22916            #[doc(hidden)]
22917            #[derive(PartialEq, Eq, Hash)]
22918            enum __FieldTag {
22919                __network,
22920                __subnetwork,
22921                __tags,
22922                Unknown(std::string::String),
22923            }
22924            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
22925                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22926                where
22927                    D: serde::Deserializer<'de>,
22928                {
22929                    struct Visitor;
22930                    impl<'de> serde::de::Visitor<'de> for Visitor {
22931                        type Value = __FieldTag;
22932                        fn expecting(
22933                            &self,
22934                            formatter: &mut std::fmt::Formatter,
22935                        ) -> std::fmt::Result {
22936                            formatter.write_str("a field name for NetworkInterface")
22937                        }
22938                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
22939                        where
22940                            E: serde::de::Error,
22941                        {
22942                            use std::result::Result::Ok;
22943                            use std::string::ToString;
22944                            match value {
22945                                "network" => Ok(__FieldTag::__network),
22946                                "subnetwork" => Ok(__FieldTag::__subnetwork),
22947                                "tags" => Ok(__FieldTag::__tags),
22948                                _ => Ok(__FieldTag::Unknown(value.to_string())),
22949                            }
22950                        }
22951                    }
22952                    deserializer.deserialize_identifier(Visitor)
22953                }
22954            }
22955            struct Visitor;
22956            impl<'de> serde::de::Visitor<'de> for Visitor {
22957                type Value = NetworkInterface;
22958                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
22959                    formatter.write_str("struct NetworkInterface")
22960                }
22961                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
22962                where
22963                    A: serde::de::MapAccess<'de>,
22964                {
22965                    #[allow(unused_imports)]
22966                    use serde::de::Error;
22967                    use std::option::Option::Some;
22968                    let mut fields = std::collections::HashSet::new();
22969                    let mut result = Self::Value::new();
22970                    while let Some(tag) = map.next_key::<__FieldTag>()? {
22971                        #[allow(clippy::match_single_binding)]
22972                        match tag {
22973                            __FieldTag::__network => {
22974                                if !fields.insert(__FieldTag::__network) {
22975                                    return std::result::Result::Err(A::Error::duplicate_field(
22976                                        "multiple values for network",
22977                                    ));
22978                                }
22979                                result.network = map
22980                                    .next_value::<std::option::Option<std::string::String>>()?
22981                                    .unwrap_or_default();
22982                            }
22983                            __FieldTag::__subnetwork => {
22984                                if !fields.insert(__FieldTag::__subnetwork) {
22985                                    return std::result::Result::Err(A::Error::duplicate_field(
22986                                        "multiple values for subnetwork",
22987                                    ));
22988                                }
22989                                result.subnetwork = map
22990                                    .next_value::<std::option::Option<std::string::String>>()?
22991                                    .unwrap_or_default();
22992                            }
22993                            __FieldTag::__tags => {
22994                                if !fields.insert(__FieldTag::__tags) {
22995                                    return std::result::Result::Err(A::Error::duplicate_field(
22996                                        "multiple values for tags",
22997                                    ));
22998                                }
22999                                result.tags = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
23000                            }
23001                            __FieldTag::Unknown(key) => {
23002                                let value = map.next_value::<serde_json::Value>()?;
23003                                result._unknown_fields.insert(key, value);
23004                            }
23005                        }
23006                    }
23007                    std::result::Result::Ok(result)
23008                }
23009            }
23010            deserializer.deserialize_any(Visitor)
23011        }
23012    }
23013
23014    #[doc(hidden)]
23015    impl serde::ser::Serialize for NetworkInterface {
23016        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23017        where
23018            S: serde::ser::Serializer,
23019        {
23020            use serde::ser::SerializeMap;
23021            #[allow(unused_imports)]
23022            use std::option::Option::Some;
23023            let mut state = serializer.serialize_map(std::option::Option::None)?;
23024            if !self.network.is_empty() {
23025                state.serialize_entry("network", &self.network)?;
23026            }
23027            if !self.subnetwork.is_empty() {
23028                state.serialize_entry("subnetwork", &self.subnetwork)?;
23029            }
23030            if !self.tags.is_empty() {
23031                state.serialize_entry("tags", &self.tags)?;
23032            }
23033            if !self._unknown_fields.is_empty() {
23034                for (key, value) in self._unknown_fields.iter() {
23035                    state.serialize_entry(key, &value)?;
23036                }
23037            }
23038            state.end()
23039        }
23040    }
23041
23042    impl std::fmt::Debug for NetworkInterface {
23043        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23044            let mut debug_struct = f.debug_struct("NetworkInterface");
23045            debug_struct.field("network", &self.network);
23046            debug_struct.field("subnetwork", &self.subnetwork);
23047            debug_struct.field("tags", &self.tags);
23048            if !self._unknown_fields.is_empty() {
23049                debug_struct.field("_unknown_fields", &self._unknown_fields);
23050            }
23051            debug_struct.finish()
23052        }
23053    }
23054
23055    /// Egress options for VPC access.
23056    ///
23057    /// # Working with unknown values
23058    ///
23059    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23060    /// additional enum variants at any time. Adding new variants is not considered
23061    /// a breaking change. Applications should write their code in anticipation of:
23062    ///
23063    /// - New values appearing in future releases of the client library, **and**
23064    /// - New values received dynamically, without application changes.
23065    ///
23066    /// Please consult the [Working with enums] section in the user guide for some
23067    /// guidelines.
23068    ///
23069    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23070    #[derive(Clone, Debug, PartialEq)]
23071    #[non_exhaustive]
23072    pub enum VpcEgress {
23073        /// Unspecified
23074        Unspecified,
23075        /// All outbound traffic is routed through the VPC connector.
23076        AllTraffic,
23077        /// Only private IP ranges are routed through the VPC connector.
23078        PrivateRangesOnly,
23079        /// If set, the enum was initialized with an unknown value.
23080        ///
23081        /// Applications can examine the value using [VpcEgress::value] or
23082        /// [VpcEgress::name].
23083        UnknownValue(vpc_egress::UnknownValue),
23084    }
23085
23086    #[doc(hidden)]
23087    pub mod vpc_egress {
23088        #[allow(unused_imports)]
23089        use super::*;
23090        #[derive(Clone, Debug, PartialEq)]
23091        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23092    }
23093
23094    impl VpcEgress {
23095        /// Gets the enum value.
23096        ///
23097        /// Returns `None` if the enum contains an unknown value deserialized from
23098        /// the string representation of enums.
23099        pub fn value(&self) -> std::option::Option<i32> {
23100            match self {
23101                Self::Unspecified => std::option::Option::Some(0),
23102                Self::AllTraffic => std::option::Option::Some(1),
23103                Self::PrivateRangesOnly => std::option::Option::Some(2),
23104                Self::UnknownValue(u) => u.0.value(),
23105            }
23106        }
23107
23108        /// Gets the enum value as a string.
23109        ///
23110        /// Returns `None` if the enum contains an unknown value deserialized from
23111        /// the integer representation of enums.
23112        pub fn name(&self) -> std::option::Option<&str> {
23113            match self {
23114                Self::Unspecified => std::option::Option::Some("VPC_EGRESS_UNSPECIFIED"),
23115                Self::AllTraffic => std::option::Option::Some("ALL_TRAFFIC"),
23116                Self::PrivateRangesOnly => std::option::Option::Some("PRIVATE_RANGES_ONLY"),
23117                Self::UnknownValue(u) => u.0.name(),
23118            }
23119        }
23120    }
23121
23122    impl std::default::Default for VpcEgress {
23123        fn default() -> Self {
23124            use std::convert::From;
23125            Self::from(0)
23126        }
23127    }
23128
23129    impl std::fmt::Display for VpcEgress {
23130        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23131            wkt::internal::display_enum(f, self.name(), self.value())
23132        }
23133    }
23134
23135    impl std::convert::From<i32> for VpcEgress {
23136        fn from(value: i32) -> Self {
23137            match value {
23138                0 => Self::Unspecified,
23139                1 => Self::AllTraffic,
23140                2 => Self::PrivateRangesOnly,
23141                _ => Self::UnknownValue(vpc_egress::UnknownValue(
23142                    wkt::internal::UnknownEnumValue::Integer(value),
23143                )),
23144            }
23145        }
23146    }
23147
23148    impl std::convert::From<&str> for VpcEgress {
23149        fn from(value: &str) -> Self {
23150            use std::string::ToString;
23151            match value {
23152                "VPC_EGRESS_UNSPECIFIED" => Self::Unspecified,
23153                "ALL_TRAFFIC" => Self::AllTraffic,
23154                "PRIVATE_RANGES_ONLY" => Self::PrivateRangesOnly,
23155                _ => Self::UnknownValue(vpc_egress::UnknownValue(
23156                    wkt::internal::UnknownEnumValue::String(value.to_string()),
23157                )),
23158            }
23159        }
23160    }
23161
23162    impl serde::ser::Serialize for VpcEgress {
23163        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23164        where
23165            S: serde::Serializer,
23166        {
23167            match self {
23168                Self::Unspecified => serializer.serialize_i32(0),
23169                Self::AllTraffic => serializer.serialize_i32(1),
23170                Self::PrivateRangesOnly => serializer.serialize_i32(2),
23171                Self::UnknownValue(u) => u.0.serialize(serializer),
23172            }
23173        }
23174    }
23175
23176    impl<'de> serde::de::Deserialize<'de> for VpcEgress {
23177        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23178        where
23179            D: serde::Deserializer<'de>,
23180        {
23181            deserializer.deserialize_any(wkt::internal::EnumVisitor::<VpcEgress>::new(
23182                ".google.cloud.run.v2.VpcAccess.VpcEgress",
23183            ))
23184        }
23185    }
23186}
23187
23188/// Settings for Binary Authorization feature.
23189#[derive(Clone, Default, PartialEq)]
23190#[non_exhaustive]
23191pub struct BinaryAuthorization {
23192    /// Optional. If present, indicates to use Breakglass using this justification.
23193    /// If use_default is False, then it must be empty.
23194    /// For more information on breakglass, see
23195    /// <https://cloud.google.com/binary-authorization/docs/using-breakglass>
23196    pub breakglass_justification: std::string::String,
23197
23198    pub binauthz_method: std::option::Option<crate::model::binary_authorization::BinauthzMethod>,
23199
23200    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23201}
23202
23203impl BinaryAuthorization {
23204    pub fn new() -> Self {
23205        std::default::Default::default()
23206    }
23207
23208    /// Sets the value of [breakglass_justification][crate::model::BinaryAuthorization::breakglass_justification].
23209    pub fn set_breakglass_justification<T: std::convert::Into<std::string::String>>(
23210        mut self,
23211        v: T,
23212    ) -> Self {
23213        self.breakglass_justification = v.into();
23214        self
23215    }
23216
23217    /// Sets the value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method].
23218    ///
23219    /// Note that all the setters affecting `binauthz_method` are mutually
23220    /// exclusive.
23221    pub fn set_binauthz_method<
23222        T: std::convert::Into<std::option::Option<crate::model::binary_authorization::BinauthzMethod>>,
23223    >(
23224        mut self,
23225        v: T,
23226    ) -> Self {
23227        self.binauthz_method = v.into();
23228        self
23229    }
23230
23231    /// The value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method]
23232    /// if it holds a `UseDefault`, `None` if the field is not set or
23233    /// holds a different branch.
23234    pub fn use_default(&self) -> std::option::Option<&bool> {
23235        #[allow(unreachable_patterns)]
23236        self.binauthz_method.as_ref().and_then(|v| match v {
23237            crate::model::binary_authorization::BinauthzMethod::UseDefault(v) => {
23238                std::option::Option::Some(v)
23239            }
23240            _ => std::option::Option::None,
23241        })
23242    }
23243
23244    /// Sets the value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method]
23245    /// to hold a `UseDefault`.
23246    ///
23247    /// Note that all the setters affecting `binauthz_method` are
23248    /// mutually exclusive.
23249    pub fn set_use_default<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23250        self.binauthz_method = std::option::Option::Some(
23251            crate::model::binary_authorization::BinauthzMethod::UseDefault(v.into()),
23252        );
23253        self
23254    }
23255
23256    /// The value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method]
23257    /// if it holds a `Policy`, `None` if the field is not set or
23258    /// holds a different branch.
23259    pub fn policy(&self) -> std::option::Option<&std::string::String> {
23260        #[allow(unreachable_patterns)]
23261        self.binauthz_method.as_ref().and_then(|v| match v {
23262            crate::model::binary_authorization::BinauthzMethod::Policy(v) => {
23263                std::option::Option::Some(v)
23264            }
23265            _ => std::option::Option::None,
23266        })
23267    }
23268
23269    /// Sets the value of [binauthz_method][crate::model::BinaryAuthorization::binauthz_method]
23270    /// to hold a `Policy`.
23271    ///
23272    /// Note that all the setters affecting `binauthz_method` are
23273    /// mutually exclusive.
23274    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23275        self.binauthz_method = std::option::Option::Some(
23276            crate::model::binary_authorization::BinauthzMethod::Policy(v.into()),
23277        );
23278        self
23279    }
23280}
23281
23282impl wkt::message::Message for BinaryAuthorization {
23283    fn typename() -> &'static str {
23284        "type.googleapis.com/google.cloud.run.v2.BinaryAuthorization"
23285    }
23286}
23287
23288#[doc(hidden)]
23289impl<'de> serde::de::Deserialize<'de> for BinaryAuthorization {
23290    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23291    where
23292        D: serde::Deserializer<'de>,
23293    {
23294        #[allow(non_camel_case_types)]
23295        #[doc(hidden)]
23296        #[derive(PartialEq, Eq, Hash)]
23297        enum __FieldTag {
23298            __use_default,
23299            __policy,
23300            __breakglass_justification,
23301            Unknown(std::string::String),
23302        }
23303        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23304            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23305            where
23306                D: serde::Deserializer<'de>,
23307            {
23308                struct Visitor;
23309                impl<'de> serde::de::Visitor<'de> for Visitor {
23310                    type Value = __FieldTag;
23311                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23312                        formatter.write_str("a field name for BinaryAuthorization")
23313                    }
23314                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23315                    where
23316                        E: serde::de::Error,
23317                    {
23318                        use std::result::Result::Ok;
23319                        use std::string::ToString;
23320                        match value {
23321                            "useDefault" => Ok(__FieldTag::__use_default),
23322                            "use_default" => Ok(__FieldTag::__use_default),
23323                            "policy" => Ok(__FieldTag::__policy),
23324                            "breakglassJustification" => Ok(__FieldTag::__breakglass_justification),
23325                            "breakglass_justification" => {
23326                                Ok(__FieldTag::__breakglass_justification)
23327                            }
23328                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23329                        }
23330                    }
23331                }
23332                deserializer.deserialize_identifier(Visitor)
23333            }
23334        }
23335        struct Visitor;
23336        impl<'de> serde::de::Visitor<'de> for Visitor {
23337            type Value = BinaryAuthorization;
23338            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23339                formatter.write_str("struct BinaryAuthorization")
23340            }
23341            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23342            where
23343                A: serde::de::MapAccess<'de>,
23344            {
23345                #[allow(unused_imports)]
23346                use serde::de::Error;
23347                use std::option::Option::Some;
23348                let mut fields = std::collections::HashSet::new();
23349                let mut result = Self::Value::new();
23350                while let Some(tag) = map.next_key::<__FieldTag>()? {
23351                    #[allow(clippy::match_single_binding)]
23352                    match tag {
23353                        __FieldTag::__use_default => {
23354                            if !fields.insert(__FieldTag::__use_default) {
23355                                return std::result::Result::Err(A::Error::duplicate_field(
23356                                    "multiple values for use_default",
23357                                ));
23358                            }
23359                            if result.binauthz_method.is_some() {
23360                                return std::result::Result::Err(A::Error::duplicate_field(
23361                                    "multiple values for `binauthz_method`, a oneof with full ID .google.cloud.run.v2.BinaryAuthorization.use_default, latest field was useDefault",
23362                                ));
23363                            }
23364                            result.binauthz_method = std::option::Option::Some(
23365                                crate::model::binary_authorization::BinauthzMethod::UseDefault(
23366                                    map.next_value::<std::option::Option<bool>>()?
23367                                        .unwrap_or_default(),
23368                                ),
23369                            );
23370                        }
23371                        __FieldTag::__policy => {
23372                            if !fields.insert(__FieldTag::__policy) {
23373                                return std::result::Result::Err(A::Error::duplicate_field(
23374                                    "multiple values for policy",
23375                                ));
23376                            }
23377                            if result.binauthz_method.is_some() {
23378                                return std::result::Result::Err(A::Error::duplicate_field(
23379                                    "multiple values for `binauthz_method`, a oneof with full ID .google.cloud.run.v2.BinaryAuthorization.policy, latest field was policy",
23380                                ));
23381                            }
23382                            result.binauthz_method = std::option::Option::Some(
23383                                crate::model::binary_authorization::BinauthzMethod::Policy(
23384                                    map.next_value::<std::option::Option<std::string::String>>()?
23385                                        .unwrap_or_default(),
23386                                ),
23387                            );
23388                        }
23389                        __FieldTag::__breakglass_justification => {
23390                            if !fields.insert(__FieldTag::__breakglass_justification) {
23391                                return std::result::Result::Err(A::Error::duplicate_field(
23392                                    "multiple values for breakglass_justification",
23393                                ));
23394                            }
23395                            result.breakglass_justification = map
23396                                .next_value::<std::option::Option<std::string::String>>()?
23397                                .unwrap_or_default();
23398                        }
23399                        __FieldTag::Unknown(key) => {
23400                            let value = map.next_value::<serde_json::Value>()?;
23401                            result._unknown_fields.insert(key, value);
23402                        }
23403                    }
23404                }
23405                std::result::Result::Ok(result)
23406            }
23407        }
23408        deserializer.deserialize_any(Visitor)
23409    }
23410}
23411
23412#[doc(hidden)]
23413impl serde::ser::Serialize for BinaryAuthorization {
23414    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23415    where
23416        S: serde::ser::Serializer,
23417    {
23418        use serde::ser::SerializeMap;
23419        #[allow(unused_imports)]
23420        use std::option::Option::Some;
23421        let mut state = serializer.serialize_map(std::option::Option::None)?;
23422        if let Some(value) = self.use_default() {
23423            state.serialize_entry("useDefault", value)?;
23424        }
23425        if let Some(value) = self.policy() {
23426            state.serialize_entry("policy", value)?;
23427        }
23428        if !self.breakglass_justification.is_empty() {
23429            state.serialize_entry("breakglassJustification", &self.breakglass_justification)?;
23430        }
23431        if !self._unknown_fields.is_empty() {
23432            for (key, value) in self._unknown_fields.iter() {
23433                state.serialize_entry(key, &value)?;
23434            }
23435        }
23436        state.end()
23437    }
23438}
23439
23440impl std::fmt::Debug for BinaryAuthorization {
23441    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23442        let mut debug_struct = f.debug_struct("BinaryAuthorization");
23443        debug_struct.field("breakglass_justification", &self.breakglass_justification);
23444        debug_struct.field("binauthz_method", &self.binauthz_method);
23445        if !self._unknown_fields.is_empty() {
23446            debug_struct.field("_unknown_fields", &self._unknown_fields);
23447        }
23448        debug_struct.finish()
23449    }
23450}
23451
23452/// Defines additional types related to [BinaryAuthorization].
23453pub mod binary_authorization {
23454    #[allow(unused_imports)]
23455    use super::*;
23456
23457    #[derive(Clone, Debug, PartialEq)]
23458    #[non_exhaustive]
23459    pub enum BinauthzMethod {
23460        /// Optional. If True, indicates to use the default project's binary
23461        /// authorization policy. If False, binary authorization will be disabled.
23462        UseDefault(bool),
23463        /// Optional. The path to a binary authorization policy.
23464        /// Format: `projects/{project}/platforms/cloudRun/{policy-name}`
23465        Policy(std::string::String),
23466    }
23467}
23468
23469/// Settings for revision-level scaling settings.
23470#[derive(Clone, Default, PartialEq)]
23471#[non_exhaustive]
23472pub struct RevisionScaling {
23473    /// Optional. Minimum number of serving instances that this resource should
23474    /// have.
23475    pub min_instance_count: i32,
23476
23477    /// Optional. Maximum number of serving instances that this resource should
23478    /// have. When unspecified, the field is set to the server default value of
23479    /// 100. For more information see
23480    /// <https://cloud.google.com/run/docs/configuring/max-instances>
23481    pub max_instance_count: i32,
23482
23483    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23484}
23485
23486impl RevisionScaling {
23487    pub fn new() -> Self {
23488        std::default::Default::default()
23489    }
23490
23491    /// Sets the value of [min_instance_count][crate::model::RevisionScaling::min_instance_count].
23492    pub fn set_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
23493        self.min_instance_count = v.into();
23494        self
23495    }
23496
23497    /// Sets the value of [max_instance_count][crate::model::RevisionScaling::max_instance_count].
23498    pub fn set_max_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
23499        self.max_instance_count = v.into();
23500        self
23501    }
23502}
23503
23504impl wkt::message::Message for RevisionScaling {
23505    fn typename() -> &'static str {
23506        "type.googleapis.com/google.cloud.run.v2.RevisionScaling"
23507    }
23508}
23509
23510#[doc(hidden)]
23511impl<'de> serde::de::Deserialize<'de> for RevisionScaling {
23512    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23513    where
23514        D: serde::Deserializer<'de>,
23515    {
23516        #[allow(non_camel_case_types)]
23517        #[doc(hidden)]
23518        #[derive(PartialEq, Eq, Hash)]
23519        enum __FieldTag {
23520            __min_instance_count,
23521            __max_instance_count,
23522            Unknown(std::string::String),
23523        }
23524        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23525            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23526            where
23527                D: serde::Deserializer<'de>,
23528            {
23529                struct Visitor;
23530                impl<'de> serde::de::Visitor<'de> for Visitor {
23531                    type Value = __FieldTag;
23532                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23533                        formatter.write_str("a field name for RevisionScaling")
23534                    }
23535                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23536                    where
23537                        E: serde::de::Error,
23538                    {
23539                        use std::result::Result::Ok;
23540                        use std::string::ToString;
23541                        match value {
23542                            "minInstanceCount" => Ok(__FieldTag::__min_instance_count),
23543                            "min_instance_count" => Ok(__FieldTag::__min_instance_count),
23544                            "maxInstanceCount" => Ok(__FieldTag::__max_instance_count),
23545                            "max_instance_count" => Ok(__FieldTag::__max_instance_count),
23546                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23547                        }
23548                    }
23549                }
23550                deserializer.deserialize_identifier(Visitor)
23551            }
23552        }
23553        struct Visitor;
23554        impl<'de> serde::de::Visitor<'de> for Visitor {
23555            type Value = RevisionScaling;
23556            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23557                formatter.write_str("struct RevisionScaling")
23558            }
23559            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23560            where
23561                A: serde::de::MapAccess<'de>,
23562            {
23563                #[allow(unused_imports)]
23564                use serde::de::Error;
23565                use std::option::Option::Some;
23566                let mut fields = std::collections::HashSet::new();
23567                let mut result = Self::Value::new();
23568                while let Some(tag) = map.next_key::<__FieldTag>()? {
23569                    #[allow(clippy::match_single_binding)]
23570                    match tag {
23571                        __FieldTag::__min_instance_count => {
23572                            if !fields.insert(__FieldTag::__min_instance_count) {
23573                                return std::result::Result::Err(A::Error::duplicate_field(
23574                                    "multiple values for min_instance_count",
23575                                ));
23576                            }
23577                            struct __With(std::option::Option<i32>);
23578                            impl<'de> serde::de::Deserialize<'de> for __With {
23579                                fn deserialize<D>(
23580                                    deserializer: D,
23581                                ) -> std::result::Result<Self, D::Error>
23582                                where
23583                                    D: serde::de::Deserializer<'de>,
23584                                {
23585                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
23586                                }
23587                            }
23588                            result.min_instance_count =
23589                                map.next_value::<__With>()?.0.unwrap_or_default();
23590                        }
23591                        __FieldTag::__max_instance_count => {
23592                            if !fields.insert(__FieldTag::__max_instance_count) {
23593                                return std::result::Result::Err(A::Error::duplicate_field(
23594                                    "multiple values for max_instance_count",
23595                                ));
23596                            }
23597                            struct __With(std::option::Option<i32>);
23598                            impl<'de> serde::de::Deserialize<'de> for __With {
23599                                fn deserialize<D>(
23600                                    deserializer: D,
23601                                ) -> std::result::Result<Self, D::Error>
23602                                where
23603                                    D: serde::de::Deserializer<'de>,
23604                                {
23605                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
23606                                }
23607                            }
23608                            result.max_instance_count =
23609                                map.next_value::<__With>()?.0.unwrap_or_default();
23610                        }
23611                        __FieldTag::Unknown(key) => {
23612                            let value = map.next_value::<serde_json::Value>()?;
23613                            result._unknown_fields.insert(key, value);
23614                        }
23615                    }
23616                }
23617                std::result::Result::Ok(result)
23618            }
23619        }
23620        deserializer.deserialize_any(Visitor)
23621    }
23622}
23623
23624#[doc(hidden)]
23625impl serde::ser::Serialize for RevisionScaling {
23626    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23627    where
23628        S: serde::ser::Serializer,
23629    {
23630        use serde::ser::SerializeMap;
23631        #[allow(unused_imports)]
23632        use std::option::Option::Some;
23633        let mut state = serializer.serialize_map(std::option::Option::None)?;
23634        if !wkt::internal::is_default(&self.min_instance_count) {
23635            struct __With<'a>(&'a i32);
23636            impl<'a> serde::ser::Serialize for __With<'a> {
23637                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23638                where
23639                    S: serde::ser::Serializer,
23640                {
23641                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
23642                }
23643            }
23644            state.serialize_entry("minInstanceCount", &__With(&self.min_instance_count))?;
23645        }
23646        if !wkt::internal::is_default(&self.max_instance_count) {
23647            struct __With<'a>(&'a i32);
23648            impl<'a> serde::ser::Serialize for __With<'a> {
23649                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23650                where
23651                    S: serde::ser::Serializer,
23652                {
23653                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
23654                }
23655            }
23656            state.serialize_entry("maxInstanceCount", &__With(&self.max_instance_count))?;
23657        }
23658        if !self._unknown_fields.is_empty() {
23659            for (key, value) in self._unknown_fields.iter() {
23660                state.serialize_entry(key, &value)?;
23661            }
23662        }
23663        state.end()
23664    }
23665}
23666
23667impl std::fmt::Debug for RevisionScaling {
23668    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23669        let mut debug_struct = f.debug_struct("RevisionScaling");
23670        debug_struct.field("min_instance_count", &self.min_instance_count);
23671        debug_struct.field("max_instance_count", &self.max_instance_count);
23672        if !self._unknown_fields.is_empty() {
23673            debug_struct.field("_unknown_fields", &self._unknown_fields);
23674        }
23675        debug_struct.finish()
23676    }
23677}
23678
23679/// Settings for Cloud Service Mesh. For more information see
23680/// <https://cloud.google.com/service-mesh/docs/overview>.
23681#[derive(Clone, Default, PartialEq)]
23682#[non_exhaustive]
23683pub struct ServiceMesh {
23684    /// The Mesh resource name. Format:
23685    /// `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can
23686    /// be project id or number.
23687    pub mesh: std::string::String,
23688
23689    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23690}
23691
23692impl ServiceMesh {
23693    pub fn new() -> Self {
23694        std::default::Default::default()
23695    }
23696
23697    /// Sets the value of [mesh][crate::model::ServiceMesh::mesh].
23698    pub fn set_mesh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23699        self.mesh = v.into();
23700        self
23701    }
23702}
23703
23704impl wkt::message::Message for ServiceMesh {
23705    fn typename() -> &'static str {
23706        "type.googleapis.com/google.cloud.run.v2.ServiceMesh"
23707    }
23708}
23709
23710#[doc(hidden)]
23711impl<'de> serde::de::Deserialize<'de> for ServiceMesh {
23712    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23713    where
23714        D: serde::Deserializer<'de>,
23715    {
23716        #[allow(non_camel_case_types)]
23717        #[doc(hidden)]
23718        #[derive(PartialEq, Eq, Hash)]
23719        enum __FieldTag {
23720            __mesh,
23721            Unknown(std::string::String),
23722        }
23723        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23724            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23725            where
23726                D: serde::Deserializer<'de>,
23727            {
23728                struct Visitor;
23729                impl<'de> serde::de::Visitor<'de> for Visitor {
23730                    type Value = __FieldTag;
23731                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23732                        formatter.write_str("a field name for ServiceMesh")
23733                    }
23734                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23735                    where
23736                        E: serde::de::Error,
23737                    {
23738                        use std::result::Result::Ok;
23739                        use std::string::ToString;
23740                        match value {
23741                            "mesh" => Ok(__FieldTag::__mesh),
23742                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23743                        }
23744                    }
23745                }
23746                deserializer.deserialize_identifier(Visitor)
23747            }
23748        }
23749        struct Visitor;
23750        impl<'de> serde::de::Visitor<'de> for Visitor {
23751            type Value = ServiceMesh;
23752            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23753                formatter.write_str("struct ServiceMesh")
23754            }
23755            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23756            where
23757                A: serde::de::MapAccess<'de>,
23758            {
23759                #[allow(unused_imports)]
23760                use serde::de::Error;
23761                use std::option::Option::Some;
23762                let mut fields = std::collections::HashSet::new();
23763                let mut result = Self::Value::new();
23764                while let Some(tag) = map.next_key::<__FieldTag>()? {
23765                    #[allow(clippy::match_single_binding)]
23766                    match tag {
23767                        __FieldTag::__mesh => {
23768                            if !fields.insert(__FieldTag::__mesh) {
23769                                return std::result::Result::Err(A::Error::duplicate_field(
23770                                    "multiple values for mesh",
23771                                ));
23772                            }
23773                            result.mesh = map
23774                                .next_value::<std::option::Option<std::string::String>>()?
23775                                .unwrap_or_default();
23776                        }
23777                        __FieldTag::Unknown(key) => {
23778                            let value = map.next_value::<serde_json::Value>()?;
23779                            result._unknown_fields.insert(key, value);
23780                        }
23781                    }
23782                }
23783                std::result::Result::Ok(result)
23784            }
23785        }
23786        deserializer.deserialize_any(Visitor)
23787    }
23788}
23789
23790#[doc(hidden)]
23791impl serde::ser::Serialize for ServiceMesh {
23792    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23793    where
23794        S: serde::ser::Serializer,
23795    {
23796        use serde::ser::SerializeMap;
23797        #[allow(unused_imports)]
23798        use std::option::Option::Some;
23799        let mut state = serializer.serialize_map(std::option::Option::None)?;
23800        if !self.mesh.is_empty() {
23801            state.serialize_entry("mesh", &self.mesh)?;
23802        }
23803        if !self._unknown_fields.is_empty() {
23804            for (key, value) in self._unknown_fields.iter() {
23805                state.serialize_entry(key, &value)?;
23806            }
23807        }
23808        state.end()
23809    }
23810}
23811
23812impl std::fmt::Debug for ServiceMesh {
23813    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23814        let mut debug_struct = f.debug_struct("ServiceMesh");
23815        debug_struct.field("mesh", &self.mesh);
23816        if !self._unknown_fields.is_empty() {
23817            debug_struct.field("_unknown_fields", &self._unknown_fields);
23818        }
23819        debug_struct.finish()
23820    }
23821}
23822
23823/// Scaling settings applied at the service level rather than
23824/// at the revision level.
23825#[derive(Clone, Default, PartialEq)]
23826#[non_exhaustive]
23827pub struct ServiceScaling {
23828    /// Optional. total min instances for the service. This number of instances is
23829    /// divided among all revisions with specified traffic based on the percent
23830    /// of traffic they are receiving.
23831    pub min_instance_count: i32,
23832
23833    /// Optional. The scaling mode for the service.
23834    pub scaling_mode: crate::model::service_scaling::ScalingMode,
23835
23836    /// Optional. total instance count for the service in manual scaling mode. This
23837    /// number of instances is divided among all revisions with specified traffic
23838    /// based on the percent of traffic they are receiving.
23839    pub manual_instance_count: std::option::Option<i32>,
23840
23841    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23842}
23843
23844impl ServiceScaling {
23845    pub fn new() -> Self {
23846        std::default::Default::default()
23847    }
23848
23849    /// Sets the value of [min_instance_count][crate::model::ServiceScaling::min_instance_count].
23850    pub fn set_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
23851        self.min_instance_count = v.into();
23852        self
23853    }
23854
23855    /// Sets the value of [scaling_mode][crate::model::ServiceScaling::scaling_mode].
23856    pub fn set_scaling_mode<T: std::convert::Into<crate::model::service_scaling::ScalingMode>>(
23857        mut self,
23858        v: T,
23859    ) -> Self {
23860        self.scaling_mode = v.into();
23861        self
23862    }
23863
23864    /// Sets the value of [manual_instance_count][crate::model::ServiceScaling::manual_instance_count].
23865    pub fn set_manual_instance_count<T>(mut self, v: T) -> Self
23866    where
23867        T: std::convert::Into<i32>,
23868    {
23869        self.manual_instance_count = std::option::Option::Some(v.into());
23870        self
23871    }
23872
23873    /// Sets or clears the value of [manual_instance_count][crate::model::ServiceScaling::manual_instance_count].
23874    pub fn set_or_clear_manual_instance_count<T>(mut self, v: std::option::Option<T>) -> Self
23875    where
23876        T: std::convert::Into<i32>,
23877    {
23878        self.manual_instance_count = v.map(|x| x.into());
23879        self
23880    }
23881}
23882
23883impl wkt::message::Message for ServiceScaling {
23884    fn typename() -> &'static str {
23885        "type.googleapis.com/google.cloud.run.v2.ServiceScaling"
23886    }
23887}
23888
23889#[doc(hidden)]
23890impl<'de> serde::de::Deserialize<'de> for ServiceScaling {
23891    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23892    where
23893        D: serde::Deserializer<'de>,
23894    {
23895        #[allow(non_camel_case_types)]
23896        #[doc(hidden)]
23897        #[derive(PartialEq, Eq, Hash)]
23898        enum __FieldTag {
23899            __min_instance_count,
23900            __scaling_mode,
23901            __manual_instance_count,
23902            Unknown(std::string::String),
23903        }
23904        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
23905            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23906            where
23907                D: serde::Deserializer<'de>,
23908            {
23909                struct Visitor;
23910                impl<'de> serde::de::Visitor<'de> for Visitor {
23911                    type Value = __FieldTag;
23912                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23913                        formatter.write_str("a field name for ServiceScaling")
23914                    }
23915                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
23916                    where
23917                        E: serde::de::Error,
23918                    {
23919                        use std::result::Result::Ok;
23920                        use std::string::ToString;
23921                        match value {
23922                            "minInstanceCount" => Ok(__FieldTag::__min_instance_count),
23923                            "min_instance_count" => Ok(__FieldTag::__min_instance_count),
23924                            "scalingMode" => Ok(__FieldTag::__scaling_mode),
23925                            "scaling_mode" => Ok(__FieldTag::__scaling_mode),
23926                            "manualInstanceCount" => Ok(__FieldTag::__manual_instance_count),
23927                            "manual_instance_count" => Ok(__FieldTag::__manual_instance_count),
23928                            _ => Ok(__FieldTag::Unknown(value.to_string())),
23929                        }
23930                    }
23931                }
23932                deserializer.deserialize_identifier(Visitor)
23933            }
23934        }
23935        struct Visitor;
23936        impl<'de> serde::de::Visitor<'de> for Visitor {
23937            type Value = ServiceScaling;
23938            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
23939                formatter.write_str("struct ServiceScaling")
23940            }
23941            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
23942            where
23943                A: serde::de::MapAccess<'de>,
23944            {
23945                #[allow(unused_imports)]
23946                use serde::de::Error;
23947                use std::option::Option::Some;
23948                let mut fields = std::collections::HashSet::new();
23949                let mut result = Self::Value::new();
23950                while let Some(tag) = map.next_key::<__FieldTag>()? {
23951                    #[allow(clippy::match_single_binding)]
23952                    match tag {
23953                        __FieldTag::__min_instance_count => {
23954                            if !fields.insert(__FieldTag::__min_instance_count) {
23955                                return std::result::Result::Err(A::Error::duplicate_field(
23956                                    "multiple values for min_instance_count",
23957                                ));
23958                            }
23959                            struct __With(std::option::Option<i32>);
23960                            impl<'de> serde::de::Deserialize<'de> for __With {
23961                                fn deserialize<D>(
23962                                    deserializer: D,
23963                                ) -> std::result::Result<Self, D::Error>
23964                                where
23965                                    D: serde::de::Deserializer<'de>,
23966                                {
23967                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
23968                                }
23969                            }
23970                            result.min_instance_count =
23971                                map.next_value::<__With>()?.0.unwrap_or_default();
23972                        }
23973                        __FieldTag::__scaling_mode => {
23974                            if !fields.insert(__FieldTag::__scaling_mode) {
23975                                return std::result::Result::Err(A::Error::duplicate_field(
23976                                    "multiple values for scaling_mode",
23977                                ));
23978                            }
23979                            result.scaling_mode = map.next_value::<std::option::Option<crate::model::service_scaling::ScalingMode>>()?.unwrap_or_default();
23980                        }
23981                        __FieldTag::__manual_instance_count => {
23982                            if !fields.insert(__FieldTag::__manual_instance_count) {
23983                                return std::result::Result::Err(A::Error::duplicate_field(
23984                                    "multiple values for manual_instance_count",
23985                                ));
23986                            }
23987                            struct __With(std::option::Option<i32>);
23988                            impl<'de> serde::de::Deserialize<'de> for __With {
23989                                fn deserialize<D>(
23990                                    deserializer: D,
23991                                ) -> std::result::Result<Self, D::Error>
23992                                where
23993                                    D: serde::de::Deserializer<'de>,
23994                                {
23995                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
23996                                }
23997                            }
23998                            result.manual_instance_count = map.next_value::<__With>()?.0;
23999                        }
24000                        __FieldTag::Unknown(key) => {
24001                            let value = map.next_value::<serde_json::Value>()?;
24002                            result._unknown_fields.insert(key, value);
24003                        }
24004                    }
24005                }
24006                std::result::Result::Ok(result)
24007            }
24008        }
24009        deserializer.deserialize_any(Visitor)
24010    }
24011}
24012
24013#[doc(hidden)]
24014impl serde::ser::Serialize for ServiceScaling {
24015    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24016    where
24017        S: serde::ser::Serializer,
24018    {
24019        use serde::ser::SerializeMap;
24020        #[allow(unused_imports)]
24021        use std::option::Option::Some;
24022        let mut state = serializer.serialize_map(std::option::Option::None)?;
24023        if !wkt::internal::is_default(&self.min_instance_count) {
24024            struct __With<'a>(&'a i32);
24025            impl<'a> serde::ser::Serialize for __With<'a> {
24026                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24027                where
24028                    S: serde::ser::Serializer,
24029                {
24030                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
24031                }
24032            }
24033            state.serialize_entry("minInstanceCount", &__With(&self.min_instance_count))?;
24034        }
24035        if !wkt::internal::is_default(&self.scaling_mode) {
24036            state.serialize_entry("scalingMode", &self.scaling_mode)?;
24037        }
24038        if self.manual_instance_count.is_some() {
24039            struct __With<'a>(&'a std::option::Option<i32>);
24040            impl<'a> serde::ser::Serialize for __With<'a> {
24041                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24042                where
24043                    S: serde::ser::Serializer,
24044                {
24045                    serde_with::As::<std::option::Option<wkt::internal::I32>>::serialize(
24046                        self.0, serializer,
24047                    )
24048                }
24049            }
24050            state.serialize_entry("manualInstanceCount", &__With(&self.manual_instance_count))?;
24051        }
24052        if !self._unknown_fields.is_empty() {
24053            for (key, value) in self._unknown_fields.iter() {
24054                state.serialize_entry(key, &value)?;
24055            }
24056        }
24057        state.end()
24058    }
24059}
24060
24061impl std::fmt::Debug for ServiceScaling {
24062    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24063        let mut debug_struct = f.debug_struct("ServiceScaling");
24064        debug_struct.field("min_instance_count", &self.min_instance_count);
24065        debug_struct.field("scaling_mode", &self.scaling_mode);
24066        debug_struct.field("manual_instance_count", &self.manual_instance_count);
24067        if !self._unknown_fields.is_empty() {
24068            debug_struct.field("_unknown_fields", &self._unknown_fields);
24069        }
24070        debug_struct.finish()
24071    }
24072}
24073
24074/// Defines additional types related to [ServiceScaling].
24075pub mod service_scaling {
24076    #[allow(unused_imports)]
24077    use super::*;
24078
24079    /// The scaling mode for the service. If not provided, it defaults to
24080    /// AUTOMATIC.
24081    ///
24082    /// # Working with unknown values
24083    ///
24084    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24085    /// additional enum variants at any time. Adding new variants is not considered
24086    /// a breaking change. Applications should write their code in anticipation of:
24087    ///
24088    /// - New values appearing in future releases of the client library, **and**
24089    /// - New values received dynamically, without application changes.
24090    ///
24091    /// Please consult the [Working with enums] section in the user guide for some
24092    /// guidelines.
24093    ///
24094    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24095    #[derive(Clone, Debug, PartialEq)]
24096    #[non_exhaustive]
24097    pub enum ScalingMode {
24098        /// Unspecified.
24099        Unspecified,
24100        /// Scale based on traffic between min and max instances.
24101        Automatic,
24102        /// Scale to exactly min instances and ignore max instances.
24103        Manual,
24104        /// If set, the enum was initialized with an unknown value.
24105        ///
24106        /// Applications can examine the value using [ScalingMode::value] or
24107        /// [ScalingMode::name].
24108        UnknownValue(scaling_mode::UnknownValue),
24109    }
24110
24111    #[doc(hidden)]
24112    pub mod scaling_mode {
24113        #[allow(unused_imports)]
24114        use super::*;
24115        #[derive(Clone, Debug, PartialEq)]
24116        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24117    }
24118
24119    impl ScalingMode {
24120        /// Gets the enum value.
24121        ///
24122        /// Returns `None` if the enum contains an unknown value deserialized from
24123        /// the string representation of enums.
24124        pub fn value(&self) -> std::option::Option<i32> {
24125            match self {
24126                Self::Unspecified => std::option::Option::Some(0),
24127                Self::Automatic => std::option::Option::Some(1),
24128                Self::Manual => std::option::Option::Some(2),
24129                Self::UnknownValue(u) => u.0.value(),
24130            }
24131        }
24132
24133        /// Gets the enum value as a string.
24134        ///
24135        /// Returns `None` if the enum contains an unknown value deserialized from
24136        /// the integer representation of enums.
24137        pub fn name(&self) -> std::option::Option<&str> {
24138            match self {
24139                Self::Unspecified => std::option::Option::Some("SCALING_MODE_UNSPECIFIED"),
24140                Self::Automatic => std::option::Option::Some("AUTOMATIC"),
24141                Self::Manual => std::option::Option::Some("MANUAL"),
24142                Self::UnknownValue(u) => u.0.name(),
24143            }
24144        }
24145    }
24146
24147    impl std::default::Default for ScalingMode {
24148        fn default() -> Self {
24149            use std::convert::From;
24150            Self::from(0)
24151        }
24152    }
24153
24154    impl std::fmt::Display for ScalingMode {
24155        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24156            wkt::internal::display_enum(f, self.name(), self.value())
24157        }
24158    }
24159
24160    impl std::convert::From<i32> for ScalingMode {
24161        fn from(value: i32) -> Self {
24162            match value {
24163                0 => Self::Unspecified,
24164                1 => Self::Automatic,
24165                2 => Self::Manual,
24166                _ => Self::UnknownValue(scaling_mode::UnknownValue(
24167                    wkt::internal::UnknownEnumValue::Integer(value),
24168                )),
24169            }
24170        }
24171    }
24172
24173    impl std::convert::From<&str> for ScalingMode {
24174        fn from(value: &str) -> Self {
24175            use std::string::ToString;
24176            match value {
24177                "SCALING_MODE_UNSPECIFIED" => Self::Unspecified,
24178                "AUTOMATIC" => Self::Automatic,
24179                "MANUAL" => Self::Manual,
24180                _ => Self::UnknownValue(scaling_mode::UnknownValue(
24181                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24182                )),
24183            }
24184        }
24185    }
24186
24187    impl serde::ser::Serialize for ScalingMode {
24188        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24189        where
24190            S: serde::Serializer,
24191        {
24192            match self {
24193                Self::Unspecified => serializer.serialize_i32(0),
24194                Self::Automatic => serializer.serialize_i32(1),
24195                Self::Manual => serializer.serialize_i32(2),
24196                Self::UnknownValue(u) => u.0.serialize(serializer),
24197            }
24198        }
24199    }
24200
24201    impl<'de> serde::de::Deserialize<'de> for ScalingMode {
24202        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24203        where
24204            D: serde::Deserializer<'de>,
24205        {
24206            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ScalingMode>::new(
24207                ".google.cloud.run.v2.ServiceScaling.ScalingMode",
24208            ))
24209        }
24210    }
24211}
24212
24213/// Worker pool scaling settings.
24214#[derive(Clone, Default, PartialEq)]
24215#[non_exhaustive]
24216pub struct WorkerPoolScaling {
24217    /// Optional. The total number of instances in manual scaling mode.
24218    pub manual_instance_count: std::option::Option<i32>,
24219
24220    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24221}
24222
24223impl WorkerPoolScaling {
24224    pub fn new() -> Self {
24225        std::default::Default::default()
24226    }
24227
24228    /// Sets the value of [manual_instance_count][crate::model::WorkerPoolScaling::manual_instance_count].
24229    pub fn set_manual_instance_count<T>(mut self, v: T) -> Self
24230    where
24231        T: std::convert::Into<i32>,
24232    {
24233        self.manual_instance_count = std::option::Option::Some(v.into());
24234        self
24235    }
24236
24237    /// Sets or clears the value of [manual_instance_count][crate::model::WorkerPoolScaling::manual_instance_count].
24238    pub fn set_or_clear_manual_instance_count<T>(mut self, v: std::option::Option<T>) -> Self
24239    where
24240        T: std::convert::Into<i32>,
24241    {
24242        self.manual_instance_count = v.map(|x| x.into());
24243        self
24244    }
24245}
24246
24247impl wkt::message::Message for WorkerPoolScaling {
24248    fn typename() -> &'static str {
24249        "type.googleapis.com/google.cloud.run.v2.WorkerPoolScaling"
24250    }
24251}
24252
24253#[doc(hidden)]
24254impl<'de> serde::de::Deserialize<'de> for WorkerPoolScaling {
24255    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24256    where
24257        D: serde::Deserializer<'de>,
24258    {
24259        #[allow(non_camel_case_types)]
24260        #[doc(hidden)]
24261        #[derive(PartialEq, Eq, Hash)]
24262        enum __FieldTag {
24263            __manual_instance_count,
24264            Unknown(std::string::String),
24265        }
24266        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24267            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24268            where
24269                D: serde::Deserializer<'de>,
24270            {
24271                struct Visitor;
24272                impl<'de> serde::de::Visitor<'de> for Visitor {
24273                    type Value = __FieldTag;
24274                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24275                        formatter.write_str("a field name for WorkerPoolScaling")
24276                    }
24277                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24278                    where
24279                        E: serde::de::Error,
24280                    {
24281                        use std::result::Result::Ok;
24282                        use std::string::ToString;
24283                        match value {
24284                            "manualInstanceCount" => Ok(__FieldTag::__manual_instance_count),
24285                            "manual_instance_count" => Ok(__FieldTag::__manual_instance_count),
24286                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24287                        }
24288                    }
24289                }
24290                deserializer.deserialize_identifier(Visitor)
24291            }
24292        }
24293        struct Visitor;
24294        impl<'de> serde::de::Visitor<'de> for Visitor {
24295            type Value = WorkerPoolScaling;
24296            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24297                formatter.write_str("struct WorkerPoolScaling")
24298            }
24299            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24300            where
24301                A: serde::de::MapAccess<'de>,
24302            {
24303                #[allow(unused_imports)]
24304                use serde::de::Error;
24305                use std::option::Option::Some;
24306                let mut fields = std::collections::HashSet::new();
24307                let mut result = Self::Value::new();
24308                while let Some(tag) = map.next_key::<__FieldTag>()? {
24309                    #[allow(clippy::match_single_binding)]
24310                    match tag {
24311                        __FieldTag::__manual_instance_count => {
24312                            if !fields.insert(__FieldTag::__manual_instance_count) {
24313                                return std::result::Result::Err(A::Error::duplicate_field(
24314                                    "multiple values for manual_instance_count",
24315                                ));
24316                            }
24317                            struct __With(std::option::Option<i32>);
24318                            impl<'de> serde::de::Deserialize<'de> for __With {
24319                                fn deserialize<D>(
24320                                    deserializer: D,
24321                                ) -> std::result::Result<Self, D::Error>
24322                                where
24323                                    D: serde::de::Deserializer<'de>,
24324                                {
24325                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
24326                                }
24327                            }
24328                            result.manual_instance_count = map.next_value::<__With>()?.0;
24329                        }
24330                        __FieldTag::Unknown(key) => {
24331                            let value = map.next_value::<serde_json::Value>()?;
24332                            result._unknown_fields.insert(key, value);
24333                        }
24334                    }
24335                }
24336                std::result::Result::Ok(result)
24337            }
24338        }
24339        deserializer.deserialize_any(Visitor)
24340    }
24341}
24342
24343#[doc(hidden)]
24344impl serde::ser::Serialize for WorkerPoolScaling {
24345    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24346    where
24347        S: serde::ser::Serializer,
24348    {
24349        use serde::ser::SerializeMap;
24350        #[allow(unused_imports)]
24351        use std::option::Option::Some;
24352        let mut state = serializer.serialize_map(std::option::Option::None)?;
24353        if self.manual_instance_count.is_some() {
24354            struct __With<'a>(&'a std::option::Option<i32>);
24355            impl<'a> serde::ser::Serialize for __With<'a> {
24356                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24357                where
24358                    S: serde::ser::Serializer,
24359                {
24360                    serde_with::As::<std::option::Option<wkt::internal::I32>>::serialize(
24361                        self.0, serializer,
24362                    )
24363                }
24364            }
24365            state.serialize_entry("manualInstanceCount", &__With(&self.manual_instance_count))?;
24366        }
24367        if !self._unknown_fields.is_empty() {
24368            for (key, value) in self._unknown_fields.iter() {
24369                state.serialize_entry(key, &value)?;
24370            }
24371        }
24372        state.end()
24373    }
24374}
24375
24376impl std::fmt::Debug for WorkerPoolScaling {
24377    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24378        let mut debug_struct = f.debug_struct("WorkerPoolScaling");
24379        debug_struct.field("manual_instance_count", &self.manual_instance_count);
24380        if !self._unknown_fields.is_empty() {
24381            debug_struct.field("_unknown_fields", &self._unknown_fields);
24382        }
24383        debug_struct.finish()
24384    }
24385}
24386
24387/// Hardware constraints configuration.
24388#[derive(Clone, Default, PartialEq)]
24389#[non_exhaustive]
24390pub struct NodeSelector {
24391    /// Required. GPU accelerator type to attach to an instance.
24392    pub accelerator: std::string::String,
24393
24394    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24395}
24396
24397impl NodeSelector {
24398    pub fn new() -> Self {
24399        std::default::Default::default()
24400    }
24401
24402    /// Sets the value of [accelerator][crate::model::NodeSelector::accelerator].
24403    pub fn set_accelerator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24404        self.accelerator = v.into();
24405        self
24406    }
24407}
24408
24409impl wkt::message::Message for NodeSelector {
24410    fn typename() -> &'static str {
24411        "type.googleapis.com/google.cloud.run.v2.NodeSelector"
24412    }
24413}
24414
24415#[doc(hidden)]
24416impl<'de> serde::de::Deserialize<'de> for NodeSelector {
24417    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24418    where
24419        D: serde::Deserializer<'de>,
24420    {
24421        #[allow(non_camel_case_types)]
24422        #[doc(hidden)]
24423        #[derive(PartialEq, Eq, Hash)]
24424        enum __FieldTag {
24425            __accelerator,
24426            Unknown(std::string::String),
24427        }
24428        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24429            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24430            where
24431                D: serde::Deserializer<'de>,
24432            {
24433                struct Visitor;
24434                impl<'de> serde::de::Visitor<'de> for Visitor {
24435                    type Value = __FieldTag;
24436                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24437                        formatter.write_str("a field name for NodeSelector")
24438                    }
24439                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24440                    where
24441                        E: serde::de::Error,
24442                    {
24443                        use std::result::Result::Ok;
24444                        use std::string::ToString;
24445                        match value {
24446                            "accelerator" => Ok(__FieldTag::__accelerator),
24447                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24448                        }
24449                    }
24450                }
24451                deserializer.deserialize_identifier(Visitor)
24452            }
24453        }
24454        struct Visitor;
24455        impl<'de> serde::de::Visitor<'de> for Visitor {
24456            type Value = NodeSelector;
24457            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24458                formatter.write_str("struct NodeSelector")
24459            }
24460            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24461            where
24462                A: serde::de::MapAccess<'de>,
24463            {
24464                #[allow(unused_imports)]
24465                use serde::de::Error;
24466                use std::option::Option::Some;
24467                let mut fields = std::collections::HashSet::new();
24468                let mut result = Self::Value::new();
24469                while let Some(tag) = map.next_key::<__FieldTag>()? {
24470                    #[allow(clippy::match_single_binding)]
24471                    match tag {
24472                        __FieldTag::__accelerator => {
24473                            if !fields.insert(__FieldTag::__accelerator) {
24474                                return std::result::Result::Err(A::Error::duplicate_field(
24475                                    "multiple values for accelerator",
24476                                ));
24477                            }
24478                            result.accelerator = map
24479                                .next_value::<std::option::Option<std::string::String>>()?
24480                                .unwrap_or_default();
24481                        }
24482                        __FieldTag::Unknown(key) => {
24483                            let value = map.next_value::<serde_json::Value>()?;
24484                            result._unknown_fields.insert(key, value);
24485                        }
24486                    }
24487                }
24488                std::result::Result::Ok(result)
24489            }
24490        }
24491        deserializer.deserialize_any(Visitor)
24492    }
24493}
24494
24495#[doc(hidden)]
24496impl serde::ser::Serialize for NodeSelector {
24497    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24498    where
24499        S: serde::ser::Serializer,
24500    {
24501        use serde::ser::SerializeMap;
24502        #[allow(unused_imports)]
24503        use std::option::Option::Some;
24504        let mut state = serializer.serialize_map(std::option::Option::None)?;
24505        if !self.accelerator.is_empty() {
24506            state.serialize_entry("accelerator", &self.accelerator)?;
24507        }
24508        if !self._unknown_fields.is_empty() {
24509            for (key, value) in self._unknown_fields.iter() {
24510                state.serialize_entry(key, &value)?;
24511            }
24512        }
24513        state.end()
24514    }
24515}
24516
24517impl std::fmt::Debug for NodeSelector {
24518    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24519        let mut debug_struct = f.debug_struct("NodeSelector");
24520        debug_struct.field("accelerator", &self.accelerator);
24521        if !self._unknown_fields.is_empty() {
24522            debug_struct.field("_unknown_fields", &self._unknown_fields);
24523        }
24524        debug_struct.finish()
24525    }
24526}
24527
24528/// Describes the Build step of the function that builds a container from the
24529/// given source.
24530#[derive(Clone, Default, PartialEq)]
24531#[non_exhaustive]
24532pub struct BuildConfig {
24533    /// Output only. The Cloud Build name of the latest successful deployment of
24534    /// the function.
24535    pub name: std::string::String,
24536
24537    /// The Cloud Storage bucket URI where the function source code is located.
24538    pub source_location: std::string::String,
24539
24540    /// Optional. The name of the function (as defined in source code) that will be
24541    /// executed. Defaults to the resource name suffix, if not specified. For
24542    /// backward compatibility, if function with given name is not found, then the
24543    /// system will try to use function named "function".
24544    pub function_target: std::string::String,
24545
24546    /// Optional. Artifact Registry URI to store the built image.
24547    pub image_uri: std::string::String,
24548
24549    /// Optional. The base image used to build the function.
24550    pub base_image: std::string::String,
24551
24552    /// Optional. Sets whether the function will receive automatic base image
24553    /// updates.
24554    pub enable_automatic_updates: bool,
24555
24556    /// Optional. Name of the Cloud Build Custom Worker Pool that should be used to
24557    /// build the Cloud Run function. The format of this field is
24558    /// `projects/{project}/locations/{region}/workerPools/{workerPool}` where
24559    /// `{project}` and `{region}` are the project id and region respectively where
24560    /// the worker pool is defined and `{workerPool}` is the short name of the
24561    /// worker pool.
24562    pub worker_pool: std::string::String,
24563
24564    /// Optional. User-provided build-time environment variables for the function
24565    pub environment_variables: std::collections::HashMap<std::string::String, std::string::String>,
24566
24567    /// Optional. Service account to be used for building the container. The format
24568    /// of this field is
24569    /// `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`.
24570    pub service_account: std::string::String,
24571
24572    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24573}
24574
24575impl BuildConfig {
24576    pub fn new() -> Self {
24577        std::default::Default::default()
24578    }
24579
24580    /// Sets the value of [name][crate::model::BuildConfig::name].
24581    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24582        self.name = v.into();
24583        self
24584    }
24585
24586    /// Sets the value of [source_location][crate::model::BuildConfig::source_location].
24587    pub fn set_source_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24588        self.source_location = v.into();
24589        self
24590    }
24591
24592    /// Sets the value of [function_target][crate::model::BuildConfig::function_target].
24593    pub fn set_function_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24594        self.function_target = v.into();
24595        self
24596    }
24597
24598    /// Sets the value of [image_uri][crate::model::BuildConfig::image_uri].
24599    pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24600        self.image_uri = v.into();
24601        self
24602    }
24603
24604    /// Sets the value of [base_image][crate::model::BuildConfig::base_image].
24605    pub fn set_base_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24606        self.base_image = v.into();
24607        self
24608    }
24609
24610    /// Sets the value of [enable_automatic_updates][crate::model::BuildConfig::enable_automatic_updates].
24611    pub fn set_enable_automatic_updates<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24612        self.enable_automatic_updates = v.into();
24613        self
24614    }
24615
24616    /// Sets the value of [worker_pool][crate::model::BuildConfig::worker_pool].
24617    pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24618        self.worker_pool = v.into();
24619        self
24620    }
24621
24622    /// Sets the value of [environment_variables][crate::model::BuildConfig::environment_variables].
24623    pub fn set_environment_variables<T, K, V>(mut self, v: T) -> Self
24624    where
24625        T: std::iter::IntoIterator<Item = (K, V)>,
24626        K: std::convert::Into<std::string::String>,
24627        V: std::convert::Into<std::string::String>,
24628    {
24629        use std::iter::Iterator;
24630        self.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
24631        self
24632    }
24633
24634    /// Sets the value of [service_account][crate::model::BuildConfig::service_account].
24635    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24636        self.service_account = v.into();
24637        self
24638    }
24639}
24640
24641impl wkt::message::Message for BuildConfig {
24642    fn typename() -> &'static str {
24643        "type.googleapis.com/google.cloud.run.v2.BuildConfig"
24644    }
24645}
24646
24647#[doc(hidden)]
24648impl<'de> serde::de::Deserialize<'de> for BuildConfig {
24649    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24650    where
24651        D: serde::Deserializer<'de>,
24652    {
24653        #[allow(non_camel_case_types)]
24654        #[doc(hidden)]
24655        #[derive(PartialEq, Eq, Hash)]
24656        enum __FieldTag {
24657            __name,
24658            __source_location,
24659            __function_target,
24660            __image_uri,
24661            __base_image,
24662            __enable_automatic_updates,
24663            __worker_pool,
24664            __environment_variables,
24665            __service_account,
24666            Unknown(std::string::String),
24667        }
24668        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24669            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24670            where
24671                D: serde::Deserializer<'de>,
24672            {
24673                struct Visitor;
24674                impl<'de> serde::de::Visitor<'de> for Visitor {
24675                    type Value = __FieldTag;
24676                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24677                        formatter.write_str("a field name for BuildConfig")
24678                    }
24679                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
24680                    where
24681                        E: serde::de::Error,
24682                    {
24683                        use std::result::Result::Ok;
24684                        use std::string::ToString;
24685                        match value {
24686                            "name" => Ok(__FieldTag::__name),
24687                            "sourceLocation" => Ok(__FieldTag::__source_location),
24688                            "source_location" => Ok(__FieldTag::__source_location),
24689                            "functionTarget" => Ok(__FieldTag::__function_target),
24690                            "function_target" => Ok(__FieldTag::__function_target),
24691                            "imageUri" => Ok(__FieldTag::__image_uri),
24692                            "image_uri" => Ok(__FieldTag::__image_uri),
24693                            "baseImage" => Ok(__FieldTag::__base_image),
24694                            "base_image" => Ok(__FieldTag::__base_image),
24695                            "enableAutomaticUpdates" => Ok(__FieldTag::__enable_automatic_updates),
24696                            "enable_automatic_updates" => {
24697                                Ok(__FieldTag::__enable_automatic_updates)
24698                            }
24699                            "workerPool" => Ok(__FieldTag::__worker_pool),
24700                            "worker_pool" => Ok(__FieldTag::__worker_pool),
24701                            "environmentVariables" => Ok(__FieldTag::__environment_variables),
24702                            "environment_variables" => Ok(__FieldTag::__environment_variables),
24703                            "serviceAccount" => Ok(__FieldTag::__service_account),
24704                            "service_account" => Ok(__FieldTag::__service_account),
24705                            _ => Ok(__FieldTag::Unknown(value.to_string())),
24706                        }
24707                    }
24708                }
24709                deserializer.deserialize_identifier(Visitor)
24710            }
24711        }
24712        struct Visitor;
24713        impl<'de> serde::de::Visitor<'de> for Visitor {
24714            type Value = BuildConfig;
24715            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
24716                formatter.write_str("struct BuildConfig")
24717            }
24718            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
24719            where
24720                A: serde::de::MapAccess<'de>,
24721            {
24722                #[allow(unused_imports)]
24723                use serde::de::Error;
24724                use std::option::Option::Some;
24725                let mut fields = std::collections::HashSet::new();
24726                let mut result = Self::Value::new();
24727                while let Some(tag) = map.next_key::<__FieldTag>()? {
24728                    #[allow(clippy::match_single_binding)]
24729                    match tag {
24730                        __FieldTag::__name => {
24731                            if !fields.insert(__FieldTag::__name) {
24732                                return std::result::Result::Err(A::Error::duplicate_field(
24733                                    "multiple values for name",
24734                                ));
24735                            }
24736                            result.name = map
24737                                .next_value::<std::option::Option<std::string::String>>()?
24738                                .unwrap_or_default();
24739                        }
24740                        __FieldTag::__source_location => {
24741                            if !fields.insert(__FieldTag::__source_location) {
24742                                return std::result::Result::Err(A::Error::duplicate_field(
24743                                    "multiple values for source_location",
24744                                ));
24745                            }
24746                            result.source_location = map
24747                                .next_value::<std::option::Option<std::string::String>>()?
24748                                .unwrap_or_default();
24749                        }
24750                        __FieldTag::__function_target => {
24751                            if !fields.insert(__FieldTag::__function_target) {
24752                                return std::result::Result::Err(A::Error::duplicate_field(
24753                                    "multiple values for function_target",
24754                                ));
24755                            }
24756                            result.function_target = map
24757                                .next_value::<std::option::Option<std::string::String>>()?
24758                                .unwrap_or_default();
24759                        }
24760                        __FieldTag::__image_uri => {
24761                            if !fields.insert(__FieldTag::__image_uri) {
24762                                return std::result::Result::Err(A::Error::duplicate_field(
24763                                    "multiple values for image_uri",
24764                                ));
24765                            }
24766                            result.image_uri = map
24767                                .next_value::<std::option::Option<std::string::String>>()?
24768                                .unwrap_or_default();
24769                        }
24770                        __FieldTag::__base_image => {
24771                            if !fields.insert(__FieldTag::__base_image) {
24772                                return std::result::Result::Err(A::Error::duplicate_field(
24773                                    "multiple values for base_image",
24774                                ));
24775                            }
24776                            result.base_image = map
24777                                .next_value::<std::option::Option<std::string::String>>()?
24778                                .unwrap_or_default();
24779                        }
24780                        __FieldTag::__enable_automatic_updates => {
24781                            if !fields.insert(__FieldTag::__enable_automatic_updates) {
24782                                return std::result::Result::Err(A::Error::duplicate_field(
24783                                    "multiple values for enable_automatic_updates",
24784                                ));
24785                            }
24786                            result.enable_automatic_updates = map
24787                                .next_value::<std::option::Option<bool>>()?
24788                                .unwrap_or_default();
24789                        }
24790                        __FieldTag::__worker_pool => {
24791                            if !fields.insert(__FieldTag::__worker_pool) {
24792                                return std::result::Result::Err(A::Error::duplicate_field(
24793                                    "multiple values for worker_pool",
24794                                ));
24795                            }
24796                            result.worker_pool = map
24797                                .next_value::<std::option::Option<std::string::String>>()?
24798                                .unwrap_or_default();
24799                        }
24800                        __FieldTag::__environment_variables => {
24801                            if !fields.insert(__FieldTag::__environment_variables) {
24802                                return std::result::Result::Err(A::Error::duplicate_field(
24803                                    "multiple values for environment_variables",
24804                                ));
24805                            }
24806                            result.environment_variables = map
24807                                .next_value::<std::option::Option<
24808                                    std::collections::HashMap<
24809                                        std::string::String,
24810                                        std::string::String,
24811                                    >,
24812                                >>()?
24813                                .unwrap_or_default();
24814                        }
24815                        __FieldTag::__service_account => {
24816                            if !fields.insert(__FieldTag::__service_account) {
24817                                return std::result::Result::Err(A::Error::duplicate_field(
24818                                    "multiple values for service_account",
24819                                ));
24820                            }
24821                            result.service_account = map
24822                                .next_value::<std::option::Option<std::string::String>>()?
24823                                .unwrap_or_default();
24824                        }
24825                        __FieldTag::Unknown(key) => {
24826                            let value = map.next_value::<serde_json::Value>()?;
24827                            result._unknown_fields.insert(key, value);
24828                        }
24829                    }
24830                }
24831                std::result::Result::Ok(result)
24832            }
24833        }
24834        deserializer.deserialize_any(Visitor)
24835    }
24836}
24837
24838#[doc(hidden)]
24839impl serde::ser::Serialize for BuildConfig {
24840    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24841    where
24842        S: serde::ser::Serializer,
24843    {
24844        use serde::ser::SerializeMap;
24845        #[allow(unused_imports)]
24846        use std::option::Option::Some;
24847        let mut state = serializer.serialize_map(std::option::Option::None)?;
24848        if !self.name.is_empty() {
24849            state.serialize_entry("name", &self.name)?;
24850        }
24851        if !self.source_location.is_empty() {
24852            state.serialize_entry("sourceLocation", &self.source_location)?;
24853        }
24854        if !self.function_target.is_empty() {
24855            state.serialize_entry("functionTarget", &self.function_target)?;
24856        }
24857        if !self.image_uri.is_empty() {
24858            state.serialize_entry("imageUri", &self.image_uri)?;
24859        }
24860        if !self.base_image.is_empty() {
24861            state.serialize_entry("baseImage", &self.base_image)?;
24862        }
24863        if !wkt::internal::is_default(&self.enable_automatic_updates) {
24864            state.serialize_entry("enableAutomaticUpdates", &self.enable_automatic_updates)?;
24865        }
24866        if !self.worker_pool.is_empty() {
24867            state.serialize_entry("workerPool", &self.worker_pool)?;
24868        }
24869        if !self.environment_variables.is_empty() {
24870            state.serialize_entry("environmentVariables", &self.environment_variables)?;
24871        }
24872        if !self.service_account.is_empty() {
24873            state.serialize_entry("serviceAccount", &self.service_account)?;
24874        }
24875        if !self._unknown_fields.is_empty() {
24876            for (key, value) in self._unknown_fields.iter() {
24877                state.serialize_entry(key, &value)?;
24878            }
24879        }
24880        state.end()
24881    }
24882}
24883
24884impl std::fmt::Debug for BuildConfig {
24885    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24886        let mut debug_struct = f.debug_struct("BuildConfig");
24887        debug_struct.field("name", &self.name);
24888        debug_struct.field("source_location", &self.source_location);
24889        debug_struct.field("function_target", &self.function_target);
24890        debug_struct.field("image_uri", &self.image_uri);
24891        debug_struct.field("base_image", &self.base_image);
24892        debug_struct.field("enable_automatic_updates", &self.enable_automatic_updates);
24893        debug_struct.field("worker_pool", &self.worker_pool);
24894        debug_struct.field("environment_variables", &self.environment_variables);
24895        debug_struct.field("service_account", &self.service_account);
24896        if !self._unknown_fields.is_empty() {
24897            debug_struct.field("_unknown_fields", &self._unknown_fields);
24898        }
24899        debug_struct.finish()
24900    }
24901}
24902
24903/// Request message for creating a WorkerPool.
24904#[derive(Clone, Default, PartialEq)]
24905#[non_exhaustive]
24906pub struct CreateWorkerPoolRequest {
24907    /// Required. The location and project in which this worker pool should be
24908    /// created. Format: `projects/{project}/locations/{location}`, where
24909    /// `{project}` can be project id or number. Only lowercase characters, digits,
24910    /// and hyphens.
24911    pub parent: std::string::String,
24912
24913    /// Required. The WorkerPool instance to create.
24914    pub worker_pool: std::option::Option<crate::model::WorkerPool>,
24915
24916    /// Required. The unique identifier for the WorkerPool. It must begin with
24917    /// letter, and cannot end with hyphen; must contain fewer than 50 characters.
24918    /// The name of the worker pool becomes
24919    /// `{parent}/workerPools/{worker_pool_id}`.
24920    pub worker_pool_id: std::string::String,
24921
24922    /// Optional. Indicates that the request should be validated and default values
24923    /// populated, without persisting the request or creating any resources.
24924    pub validate_only: bool,
24925
24926    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24927}
24928
24929impl CreateWorkerPoolRequest {
24930    pub fn new() -> Self {
24931        std::default::Default::default()
24932    }
24933
24934    /// Sets the value of [parent][crate::model::CreateWorkerPoolRequest::parent].
24935    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24936        self.parent = v.into();
24937        self
24938    }
24939
24940    /// Sets the value of [worker_pool][crate::model::CreateWorkerPoolRequest::worker_pool].
24941    pub fn set_worker_pool<T>(mut self, v: T) -> Self
24942    where
24943        T: std::convert::Into<crate::model::WorkerPool>,
24944    {
24945        self.worker_pool = std::option::Option::Some(v.into());
24946        self
24947    }
24948
24949    /// Sets or clears the value of [worker_pool][crate::model::CreateWorkerPoolRequest::worker_pool].
24950    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
24951    where
24952        T: std::convert::Into<crate::model::WorkerPool>,
24953    {
24954        self.worker_pool = v.map(|x| x.into());
24955        self
24956    }
24957
24958    /// Sets the value of [worker_pool_id][crate::model::CreateWorkerPoolRequest::worker_pool_id].
24959    pub fn set_worker_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24960        self.worker_pool_id = v.into();
24961        self
24962    }
24963
24964    /// Sets the value of [validate_only][crate::model::CreateWorkerPoolRequest::validate_only].
24965    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24966        self.validate_only = v.into();
24967        self
24968    }
24969}
24970
24971impl wkt::message::Message for CreateWorkerPoolRequest {
24972    fn typename() -> &'static str {
24973        "type.googleapis.com/google.cloud.run.v2.CreateWorkerPoolRequest"
24974    }
24975}
24976
24977#[doc(hidden)]
24978impl<'de> serde::de::Deserialize<'de> for CreateWorkerPoolRequest {
24979    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24980    where
24981        D: serde::Deserializer<'de>,
24982    {
24983        #[allow(non_camel_case_types)]
24984        #[doc(hidden)]
24985        #[derive(PartialEq, Eq, Hash)]
24986        enum __FieldTag {
24987            __parent,
24988            __worker_pool,
24989            __worker_pool_id,
24990            __validate_only,
24991            Unknown(std::string::String),
24992        }
24993        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
24994            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24995            where
24996                D: serde::Deserializer<'de>,
24997            {
24998                struct Visitor;
24999                impl<'de> serde::de::Visitor<'de> for Visitor {
25000                    type Value = __FieldTag;
25001                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25002                        formatter.write_str("a field name for CreateWorkerPoolRequest")
25003                    }
25004                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25005                    where
25006                        E: serde::de::Error,
25007                    {
25008                        use std::result::Result::Ok;
25009                        use std::string::ToString;
25010                        match value {
25011                            "parent" => Ok(__FieldTag::__parent),
25012                            "workerPool" => Ok(__FieldTag::__worker_pool),
25013                            "worker_pool" => Ok(__FieldTag::__worker_pool),
25014                            "workerPoolId" => Ok(__FieldTag::__worker_pool_id),
25015                            "worker_pool_id" => Ok(__FieldTag::__worker_pool_id),
25016                            "validateOnly" => Ok(__FieldTag::__validate_only),
25017                            "validate_only" => Ok(__FieldTag::__validate_only),
25018                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25019                        }
25020                    }
25021                }
25022                deserializer.deserialize_identifier(Visitor)
25023            }
25024        }
25025        struct Visitor;
25026        impl<'de> serde::de::Visitor<'de> for Visitor {
25027            type Value = CreateWorkerPoolRequest;
25028            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25029                formatter.write_str("struct CreateWorkerPoolRequest")
25030            }
25031            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25032            where
25033                A: serde::de::MapAccess<'de>,
25034            {
25035                #[allow(unused_imports)]
25036                use serde::de::Error;
25037                use std::option::Option::Some;
25038                let mut fields = std::collections::HashSet::new();
25039                let mut result = Self::Value::new();
25040                while let Some(tag) = map.next_key::<__FieldTag>()? {
25041                    #[allow(clippy::match_single_binding)]
25042                    match tag {
25043                        __FieldTag::__parent => {
25044                            if !fields.insert(__FieldTag::__parent) {
25045                                return std::result::Result::Err(A::Error::duplicate_field(
25046                                    "multiple values for parent",
25047                                ));
25048                            }
25049                            result.parent = map
25050                                .next_value::<std::option::Option<std::string::String>>()?
25051                                .unwrap_or_default();
25052                        }
25053                        __FieldTag::__worker_pool => {
25054                            if !fields.insert(__FieldTag::__worker_pool) {
25055                                return std::result::Result::Err(A::Error::duplicate_field(
25056                                    "multiple values for worker_pool",
25057                                ));
25058                            }
25059                            result.worker_pool =
25060                                map.next_value::<std::option::Option<crate::model::WorkerPool>>()?;
25061                        }
25062                        __FieldTag::__worker_pool_id => {
25063                            if !fields.insert(__FieldTag::__worker_pool_id) {
25064                                return std::result::Result::Err(A::Error::duplicate_field(
25065                                    "multiple values for worker_pool_id",
25066                                ));
25067                            }
25068                            result.worker_pool_id = map
25069                                .next_value::<std::option::Option<std::string::String>>()?
25070                                .unwrap_or_default();
25071                        }
25072                        __FieldTag::__validate_only => {
25073                            if !fields.insert(__FieldTag::__validate_only) {
25074                                return std::result::Result::Err(A::Error::duplicate_field(
25075                                    "multiple values for validate_only",
25076                                ));
25077                            }
25078                            result.validate_only = map
25079                                .next_value::<std::option::Option<bool>>()?
25080                                .unwrap_or_default();
25081                        }
25082                        __FieldTag::Unknown(key) => {
25083                            let value = map.next_value::<serde_json::Value>()?;
25084                            result._unknown_fields.insert(key, value);
25085                        }
25086                    }
25087                }
25088                std::result::Result::Ok(result)
25089            }
25090        }
25091        deserializer.deserialize_any(Visitor)
25092    }
25093}
25094
25095#[doc(hidden)]
25096impl serde::ser::Serialize for CreateWorkerPoolRequest {
25097    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25098    where
25099        S: serde::ser::Serializer,
25100    {
25101        use serde::ser::SerializeMap;
25102        #[allow(unused_imports)]
25103        use std::option::Option::Some;
25104        let mut state = serializer.serialize_map(std::option::Option::None)?;
25105        if !self.parent.is_empty() {
25106            state.serialize_entry("parent", &self.parent)?;
25107        }
25108        if self.worker_pool.is_some() {
25109            state.serialize_entry("workerPool", &self.worker_pool)?;
25110        }
25111        if !self.worker_pool_id.is_empty() {
25112            state.serialize_entry("workerPoolId", &self.worker_pool_id)?;
25113        }
25114        if !wkt::internal::is_default(&self.validate_only) {
25115            state.serialize_entry("validateOnly", &self.validate_only)?;
25116        }
25117        if !self._unknown_fields.is_empty() {
25118            for (key, value) in self._unknown_fields.iter() {
25119                state.serialize_entry(key, &value)?;
25120            }
25121        }
25122        state.end()
25123    }
25124}
25125
25126impl std::fmt::Debug for CreateWorkerPoolRequest {
25127    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25128        let mut debug_struct = f.debug_struct("CreateWorkerPoolRequest");
25129        debug_struct.field("parent", &self.parent);
25130        debug_struct.field("worker_pool", &self.worker_pool);
25131        debug_struct.field("worker_pool_id", &self.worker_pool_id);
25132        debug_struct.field("validate_only", &self.validate_only);
25133        if !self._unknown_fields.is_empty() {
25134            debug_struct.field("_unknown_fields", &self._unknown_fields);
25135        }
25136        debug_struct.finish()
25137    }
25138}
25139
25140/// Request message for updating a worker pool.
25141#[derive(Clone, Default, PartialEq)]
25142#[non_exhaustive]
25143pub struct UpdateWorkerPoolRequest {
25144    /// Optional. The list of fields to be updated.
25145    pub update_mask: std::option::Option<wkt::FieldMask>,
25146
25147    /// Required. The WorkerPool to be updated.
25148    pub worker_pool: std::option::Option<crate::model::WorkerPool>,
25149
25150    /// Optional. Indicates that the request should be validated and default values
25151    /// populated, without persisting the request or updating any resources.
25152    pub validate_only: bool,
25153
25154    /// Optional. If set to true, and if the WorkerPool does not exist, it will
25155    /// create a new one. The caller must have 'run.workerpools.create' permissions
25156    /// if this is set to true and the WorkerPool does not exist.
25157    pub allow_missing: bool,
25158
25159    /// Optional. If set to true, a new revision will be created from the template
25160    /// even if the system doesn't detect any changes from the previously deployed
25161    /// revision.
25162    ///
25163    /// This may be useful for cases where the underlying resources need to be
25164    /// recreated or reinitialized. For example if the image is specified by label,
25165    /// but the underlying image digest has changed) or if the container performs
25166    /// deployment initialization work that needs to be performed again.
25167    pub force_new_revision: bool,
25168
25169    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25170}
25171
25172impl UpdateWorkerPoolRequest {
25173    pub fn new() -> Self {
25174        std::default::Default::default()
25175    }
25176
25177    /// Sets the value of [update_mask][crate::model::UpdateWorkerPoolRequest::update_mask].
25178    pub fn set_update_mask<T>(mut self, v: T) -> Self
25179    where
25180        T: std::convert::Into<wkt::FieldMask>,
25181    {
25182        self.update_mask = std::option::Option::Some(v.into());
25183        self
25184    }
25185
25186    /// Sets or clears the value of [update_mask][crate::model::UpdateWorkerPoolRequest::update_mask].
25187    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
25188    where
25189        T: std::convert::Into<wkt::FieldMask>,
25190    {
25191        self.update_mask = v.map(|x| x.into());
25192        self
25193    }
25194
25195    /// Sets the value of [worker_pool][crate::model::UpdateWorkerPoolRequest::worker_pool].
25196    pub fn set_worker_pool<T>(mut self, v: T) -> Self
25197    where
25198        T: std::convert::Into<crate::model::WorkerPool>,
25199    {
25200        self.worker_pool = std::option::Option::Some(v.into());
25201        self
25202    }
25203
25204    /// Sets or clears the value of [worker_pool][crate::model::UpdateWorkerPoolRequest::worker_pool].
25205    pub fn set_or_clear_worker_pool<T>(mut self, v: std::option::Option<T>) -> Self
25206    where
25207        T: std::convert::Into<crate::model::WorkerPool>,
25208    {
25209        self.worker_pool = v.map(|x| x.into());
25210        self
25211    }
25212
25213    /// Sets the value of [validate_only][crate::model::UpdateWorkerPoolRequest::validate_only].
25214    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25215        self.validate_only = v.into();
25216        self
25217    }
25218
25219    /// Sets the value of [allow_missing][crate::model::UpdateWorkerPoolRequest::allow_missing].
25220    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25221        self.allow_missing = v.into();
25222        self
25223    }
25224
25225    /// Sets the value of [force_new_revision][crate::model::UpdateWorkerPoolRequest::force_new_revision].
25226    pub fn set_force_new_revision<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25227        self.force_new_revision = v.into();
25228        self
25229    }
25230}
25231
25232impl wkt::message::Message for UpdateWorkerPoolRequest {
25233    fn typename() -> &'static str {
25234        "type.googleapis.com/google.cloud.run.v2.UpdateWorkerPoolRequest"
25235    }
25236}
25237
25238#[doc(hidden)]
25239impl<'de> serde::de::Deserialize<'de> for UpdateWorkerPoolRequest {
25240    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25241    where
25242        D: serde::Deserializer<'de>,
25243    {
25244        #[allow(non_camel_case_types)]
25245        #[doc(hidden)]
25246        #[derive(PartialEq, Eq, Hash)]
25247        enum __FieldTag {
25248            __update_mask,
25249            __worker_pool,
25250            __validate_only,
25251            __allow_missing,
25252            __force_new_revision,
25253            Unknown(std::string::String),
25254        }
25255        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25256            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25257            where
25258                D: serde::Deserializer<'de>,
25259            {
25260                struct Visitor;
25261                impl<'de> serde::de::Visitor<'de> for Visitor {
25262                    type Value = __FieldTag;
25263                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25264                        formatter.write_str("a field name for UpdateWorkerPoolRequest")
25265                    }
25266                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25267                    where
25268                        E: serde::de::Error,
25269                    {
25270                        use std::result::Result::Ok;
25271                        use std::string::ToString;
25272                        match value {
25273                            "updateMask" => Ok(__FieldTag::__update_mask),
25274                            "update_mask" => Ok(__FieldTag::__update_mask),
25275                            "workerPool" => Ok(__FieldTag::__worker_pool),
25276                            "worker_pool" => Ok(__FieldTag::__worker_pool),
25277                            "validateOnly" => Ok(__FieldTag::__validate_only),
25278                            "validate_only" => Ok(__FieldTag::__validate_only),
25279                            "allowMissing" => Ok(__FieldTag::__allow_missing),
25280                            "allow_missing" => Ok(__FieldTag::__allow_missing),
25281                            "forceNewRevision" => Ok(__FieldTag::__force_new_revision),
25282                            "force_new_revision" => Ok(__FieldTag::__force_new_revision),
25283                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25284                        }
25285                    }
25286                }
25287                deserializer.deserialize_identifier(Visitor)
25288            }
25289        }
25290        struct Visitor;
25291        impl<'de> serde::de::Visitor<'de> for Visitor {
25292            type Value = UpdateWorkerPoolRequest;
25293            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25294                formatter.write_str("struct UpdateWorkerPoolRequest")
25295            }
25296            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25297            where
25298                A: serde::de::MapAccess<'de>,
25299            {
25300                #[allow(unused_imports)]
25301                use serde::de::Error;
25302                use std::option::Option::Some;
25303                let mut fields = std::collections::HashSet::new();
25304                let mut result = Self::Value::new();
25305                while let Some(tag) = map.next_key::<__FieldTag>()? {
25306                    #[allow(clippy::match_single_binding)]
25307                    match tag {
25308                        __FieldTag::__update_mask => {
25309                            if !fields.insert(__FieldTag::__update_mask) {
25310                                return std::result::Result::Err(A::Error::duplicate_field(
25311                                    "multiple values for update_mask",
25312                                ));
25313                            }
25314                            result.update_mask =
25315                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
25316                        }
25317                        __FieldTag::__worker_pool => {
25318                            if !fields.insert(__FieldTag::__worker_pool) {
25319                                return std::result::Result::Err(A::Error::duplicate_field(
25320                                    "multiple values for worker_pool",
25321                                ));
25322                            }
25323                            result.worker_pool =
25324                                map.next_value::<std::option::Option<crate::model::WorkerPool>>()?;
25325                        }
25326                        __FieldTag::__validate_only => {
25327                            if !fields.insert(__FieldTag::__validate_only) {
25328                                return std::result::Result::Err(A::Error::duplicate_field(
25329                                    "multiple values for validate_only",
25330                                ));
25331                            }
25332                            result.validate_only = map
25333                                .next_value::<std::option::Option<bool>>()?
25334                                .unwrap_or_default();
25335                        }
25336                        __FieldTag::__allow_missing => {
25337                            if !fields.insert(__FieldTag::__allow_missing) {
25338                                return std::result::Result::Err(A::Error::duplicate_field(
25339                                    "multiple values for allow_missing",
25340                                ));
25341                            }
25342                            result.allow_missing = map
25343                                .next_value::<std::option::Option<bool>>()?
25344                                .unwrap_or_default();
25345                        }
25346                        __FieldTag::__force_new_revision => {
25347                            if !fields.insert(__FieldTag::__force_new_revision) {
25348                                return std::result::Result::Err(A::Error::duplicate_field(
25349                                    "multiple values for force_new_revision",
25350                                ));
25351                            }
25352                            result.force_new_revision = map
25353                                .next_value::<std::option::Option<bool>>()?
25354                                .unwrap_or_default();
25355                        }
25356                        __FieldTag::Unknown(key) => {
25357                            let value = map.next_value::<serde_json::Value>()?;
25358                            result._unknown_fields.insert(key, value);
25359                        }
25360                    }
25361                }
25362                std::result::Result::Ok(result)
25363            }
25364        }
25365        deserializer.deserialize_any(Visitor)
25366    }
25367}
25368
25369#[doc(hidden)]
25370impl serde::ser::Serialize for UpdateWorkerPoolRequest {
25371    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25372    where
25373        S: serde::ser::Serializer,
25374    {
25375        use serde::ser::SerializeMap;
25376        #[allow(unused_imports)]
25377        use std::option::Option::Some;
25378        let mut state = serializer.serialize_map(std::option::Option::None)?;
25379        if self.update_mask.is_some() {
25380            state.serialize_entry("updateMask", &self.update_mask)?;
25381        }
25382        if self.worker_pool.is_some() {
25383            state.serialize_entry("workerPool", &self.worker_pool)?;
25384        }
25385        if !wkt::internal::is_default(&self.validate_only) {
25386            state.serialize_entry("validateOnly", &self.validate_only)?;
25387        }
25388        if !wkt::internal::is_default(&self.allow_missing) {
25389            state.serialize_entry("allowMissing", &self.allow_missing)?;
25390        }
25391        if !wkt::internal::is_default(&self.force_new_revision) {
25392            state.serialize_entry("forceNewRevision", &self.force_new_revision)?;
25393        }
25394        if !self._unknown_fields.is_empty() {
25395            for (key, value) in self._unknown_fields.iter() {
25396                state.serialize_entry(key, &value)?;
25397            }
25398        }
25399        state.end()
25400    }
25401}
25402
25403impl std::fmt::Debug for UpdateWorkerPoolRequest {
25404    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25405        let mut debug_struct = f.debug_struct("UpdateWorkerPoolRequest");
25406        debug_struct.field("update_mask", &self.update_mask);
25407        debug_struct.field("worker_pool", &self.worker_pool);
25408        debug_struct.field("validate_only", &self.validate_only);
25409        debug_struct.field("allow_missing", &self.allow_missing);
25410        debug_struct.field("force_new_revision", &self.force_new_revision);
25411        if !self._unknown_fields.is_empty() {
25412            debug_struct.field("_unknown_fields", &self._unknown_fields);
25413        }
25414        debug_struct.finish()
25415    }
25416}
25417
25418/// Request message for retrieving a list of WorkerPools.
25419#[derive(Clone, Default, PartialEq)]
25420#[non_exhaustive]
25421pub struct ListWorkerPoolsRequest {
25422    /// Required. The location and project to list resources on.
25423    /// Location must be a valid Google Cloud region, and cannot be the "-"
25424    /// wildcard. Format: `projects/{project}/locations/{location}`, where
25425    /// `{project}` can be project id or number.
25426    pub parent: std::string::String,
25427
25428    /// Maximum number of WorkerPools to return in this call.
25429    pub page_size: i32,
25430
25431    /// A page token received from a previous call to ListWorkerPools.
25432    /// All other parameters must match.
25433    pub page_token: std::string::String,
25434
25435    /// If true, returns deleted (but unexpired) resources along with active ones.
25436    pub show_deleted: bool,
25437
25438    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25439}
25440
25441impl ListWorkerPoolsRequest {
25442    pub fn new() -> Self {
25443        std::default::Default::default()
25444    }
25445
25446    /// Sets the value of [parent][crate::model::ListWorkerPoolsRequest::parent].
25447    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25448        self.parent = v.into();
25449        self
25450    }
25451
25452    /// Sets the value of [page_size][crate::model::ListWorkerPoolsRequest::page_size].
25453    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25454        self.page_size = v.into();
25455        self
25456    }
25457
25458    /// Sets the value of [page_token][crate::model::ListWorkerPoolsRequest::page_token].
25459    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25460        self.page_token = v.into();
25461        self
25462    }
25463
25464    /// Sets the value of [show_deleted][crate::model::ListWorkerPoolsRequest::show_deleted].
25465    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25466        self.show_deleted = v.into();
25467        self
25468    }
25469}
25470
25471impl wkt::message::Message for ListWorkerPoolsRequest {
25472    fn typename() -> &'static str {
25473        "type.googleapis.com/google.cloud.run.v2.ListWorkerPoolsRequest"
25474    }
25475}
25476
25477#[doc(hidden)]
25478impl<'de> serde::de::Deserialize<'de> for ListWorkerPoolsRequest {
25479    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25480    where
25481        D: serde::Deserializer<'de>,
25482    {
25483        #[allow(non_camel_case_types)]
25484        #[doc(hidden)]
25485        #[derive(PartialEq, Eq, Hash)]
25486        enum __FieldTag {
25487            __parent,
25488            __page_size,
25489            __page_token,
25490            __show_deleted,
25491            Unknown(std::string::String),
25492        }
25493        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25494            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25495            where
25496                D: serde::Deserializer<'de>,
25497            {
25498                struct Visitor;
25499                impl<'de> serde::de::Visitor<'de> for Visitor {
25500                    type Value = __FieldTag;
25501                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25502                        formatter.write_str("a field name for ListWorkerPoolsRequest")
25503                    }
25504                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25505                    where
25506                        E: serde::de::Error,
25507                    {
25508                        use std::result::Result::Ok;
25509                        use std::string::ToString;
25510                        match value {
25511                            "parent" => Ok(__FieldTag::__parent),
25512                            "pageSize" => Ok(__FieldTag::__page_size),
25513                            "page_size" => Ok(__FieldTag::__page_size),
25514                            "pageToken" => Ok(__FieldTag::__page_token),
25515                            "page_token" => Ok(__FieldTag::__page_token),
25516                            "showDeleted" => Ok(__FieldTag::__show_deleted),
25517                            "show_deleted" => Ok(__FieldTag::__show_deleted),
25518                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25519                        }
25520                    }
25521                }
25522                deserializer.deserialize_identifier(Visitor)
25523            }
25524        }
25525        struct Visitor;
25526        impl<'de> serde::de::Visitor<'de> for Visitor {
25527            type Value = ListWorkerPoolsRequest;
25528            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25529                formatter.write_str("struct ListWorkerPoolsRequest")
25530            }
25531            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25532            where
25533                A: serde::de::MapAccess<'de>,
25534            {
25535                #[allow(unused_imports)]
25536                use serde::de::Error;
25537                use std::option::Option::Some;
25538                let mut fields = std::collections::HashSet::new();
25539                let mut result = Self::Value::new();
25540                while let Some(tag) = map.next_key::<__FieldTag>()? {
25541                    #[allow(clippy::match_single_binding)]
25542                    match tag {
25543                        __FieldTag::__parent => {
25544                            if !fields.insert(__FieldTag::__parent) {
25545                                return std::result::Result::Err(A::Error::duplicate_field(
25546                                    "multiple values for parent",
25547                                ));
25548                            }
25549                            result.parent = map
25550                                .next_value::<std::option::Option<std::string::String>>()?
25551                                .unwrap_or_default();
25552                        }
25553                        __FieldTag::__page_size => {
25554                            if !fields.insert(__FieldTag::__page_size) {
25555                                return std::result::Result::Err(A::Error::duplicate_field(
25556                                    "multiple values for page_size",
25557                                ));
25558                            }
25559                            struct __With(std::option::Option<i32>);
25560                            impl<'de> serde::de::Deserialize<'de> for __With {
25561                                fn deserialize<D>(
25562                                    deserializer: D,
25563                                ) -> std::result::Result<Self, D::Error>
25564                                where
25565                                    D: serde::de::Deserializer<'de>,
25566                                {
25567                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
25568                                }
25569                            }
25570                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
25571                        }
25572                        __FieldTag::__page_token => {
25573                            if !fields.insert(__FieldTag::__page_token) {
25574                                return std::result::Result::Err(A::Error::duplicate_field(
25575                                    "multiple values for page_token",
25576                                ));
25577                            }
25578                            result.page_token = map
25579                                .next_value::<std::option::Option<std::string::String>>()?
25580                                .unwrap_or_default();
25581                        }
25582                        __FieldTag::__show_deleted => {
25583                            if !fields.insert(__FieldTag::__show_deleted) {
25584                                return std::result::Result::Err(A::Error::duplicate_field(
25585                                    "multiple values for show_deleted",
25586                                ));
25587                            }
25588                            result.show_deleted = map
25589                                .next_value::<std::option::Option<bool>>()?
25590                                .unwrap_or_default();
25591                        }
25592                        __FieldTag::Unknown(key) => {
25593                            let value = map.next_value::<serde_json::Value>()?;
25594                            result._unknown_fields.insert(key, value);
25595                        }
25596                    }
25597                }
25598                std::result::Result::Ok(result)
25599            }
25600        }
25601        deserializer.deserialize_any(Visitor)
25602    }
25603}
25604
25605#[doc(hidden)]
25606impl serde::ser::Serialize for ListWorkerPoolsRequest {
25607    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25608    where
25609        S: serde::ser::Serializer,
25610    {
25611        use serde::ser::SerializeMap;
25612        #[allow(unused_imports)]
25613        use std::option::Option::Some;
25614        let mut state = serializer.serialize_map(std::option::Option::None)?;
25615        if !self.parent.is_empty() {
25616            state.serialize_entry("parent", &self.parent)?;
25617        }
25618        if !wkt::internal::is_default(&self.page_size) {
25619            struct __With<'a>(&'a i32);
25620            impl<'a> serde::ser::Serialize for __With<'a> {
25621                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25622                where
25623                    S: serde::ser::Serializer,
25624                {
25625                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
25626                }
25627            }
25628            state.serialize_entry("pageSize", &__With(&self.page_size))?;
25629        }
25630        if !self.page_token.is_empty() {
25631            state.serialize_entry("pageToken", &self.page_token)?;
25632        }
25633        if !wkt::internal::is_default(&self.show_deleted) {
25634            state.serialize_entry("showDeleted", &self.show_deleted)?;
25635        }
25636        if !self._unknown_fields.is_empty() {
25637            for (key, value) in self._unknown_fields.iter() {
25638                state.serialize_entry(key, &value)?;
25639            }
25640        }
25641        state.end()
25642    }
25643}
25644
25645impl std::fmt::Debug for ListWorkerPoolsRequest {
25646    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25647        let mut debug_struct = f.debug_struct("ListWorkerPoolsRequest");
25648        debug_struct.field("parent", &self.parent);
25649        debug_struct.field("page_size", &self.page_size);
25650        debug_struct.field("page_token", &self.page_token);
25651        debug_struct.field("show_deleted", &self.show_deleted);
25652        if !self._unknown_fields.is_empty() {
25653            debug_struct.field("_unknown_fields", &self._unknown_fields);
25654        }
25655        debug_struct.finish()
25656    }
25657}
25658
25659/// Response message containing a list of WorkerPools.
25660#[derive(Clone, Default, PartialEq)]
25661#[non_exhaustive]
25662pub struct ListWorkerPoolsResponse {
25663    /// The resulting list of WorkerPools.
25664    pub worker_pools: std::vec::Vec<crate::model::WorkerPool>,
25665
25666    /// A token indicating there are more items than page_size. Use it in the next
25667    /// ListWorkerPools request to continue.
25668    pub next_page_token: std::string::String,
25669
25670    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25671}
25672
25673impl ListWorkerPoolsResponse {
25674    pub fn new() -> Self {
25675        std::default::Default::default()
25676    }
25677
25678    /// Sets the value of [worker_pools][crate::model::ListWorkerPoolsResponse::worker_pools].
25679    pub fn set_worker_pools<T, V>(mut self, v: T) -> Self
25680    where
25681        T: std::iter::IntoIterator<Item = V>,
25682        V: std::convert::Into<crate::model::WorkerPool>,
25683    {
25684        use std::iter::Iterator;
25685        self.worker_pools = v.into_iter().map(|i| i.into()).collect();
25686        self
25687    }
25688
25689    /// Sets the value of [next_page_token][crate::model::ListWorkerPoolsResponse::next_page_token].
25690    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25691        self.next_page_token = v.into();
25692        self
25693    }
25694}
25695
25696impl wkt::message::Message for ListWorkerPoolsResponse {
25697    fn typename() -> &'static str {
25698        "type.googleapis.com/google.cloud.run.v2.ListWorkerPoolsResponse"
25699    }
25700}
25701
25702#[doc(hidden)]
25703impl gax::paginator::internal::PageableResponse for ListWorkerPoolsResponse {
25704    type PageItem = crate::model::WorkerPool;
25705
25706    fn items(self) -> std::vec::Vec<Self::PageItem> {
25707        self.worker_pools
25708    }
25709
25710    fn next_page_token(&self) -> std::string::String {
25711        use std::clone::Clone;
25712        self.next_page_token.clone()
25713    }
25714}
25715
25716#[doc(hidden)]
25717impl<'de> serde::de::Deserialize<'de> for ListWorkerPoolsResponse {
25718    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25719    where
25720        D: serde::Deserializer<'de>,
25721    {
25722        #[allow(non_camel_case_types)]
25723        #[doc(hidden)]
25724        #[derive(PartialEq, Eq, Hash)]
25725        enum __FieldTag {
25726            __worker_pools,
25727            __next_page_token,
25728            Unknown(std::string::String),
25729        }
25730        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25731            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25732            where
25733                D: serde::Deserializer<'de>,
25734            {
25735                struct Visitor;
25736                impl<'de> serde::de::Visitor<'de> for Visitor {
25737                    type Value = __FieldTag;
25738                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25739                        formatter.write_str("a field name for ListWorkerPoolsResponse")
25740                    }
25741                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25742                    where
25743                        E: serde::de::Error,
25744                    {
25745                        use std::result::Result::Ok;
25746                        use std::string::ToString;
25747                        match value {
25748                            "workerPools" => Ok(__FieldTag::__worker_pools),
25749                            "worker_pools" => Ok(__FieldTag::__worker_pools),
25750                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
25751                            "next_page_token" => Ok(__FieldTag::__next_page_token),
25752                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25753                        }
25754                    }
25755                }
25756                deserializer.deserialize_identifier(Visitor)
25757            }
25758        }
25759        struct Visitor;
25760        impl<'de> serde::de::Visitor<'de> for Visitor {
25761            type Value = ListWorkerPoolsResponse;
25762            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25763                formatter.write_str("struct ListWorkerPoolsResponse")
25764            }
25765            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25766            where
25767                A: serde::de::MapAccess<'de>,
25768            {
25769                #[allow(unused_imports)]
25770                use serde::de::Error;
25771                use std::option::Option::Some;
25772                let mut fields = std::collections::HashSet::new();
25773                let mut result = Self::Value::new();
25774                while let Some(tag) = map.next_key::<__FieldTag>()? {
25775                    #[allow(clippy::match_single_binding)]
25776                    match tag {
25777                        __FieldTag::__worker_pools => {
25778                            if !fields.insert(__FieldTag::__worker_pools) {
25779                                return std::result::Result::Err(A::Error::duplicate_field(
25780                                    "multiple values for worker_pools",
25781                                ));
25782                            }
25783                            result.worker_pools = map.next_value::<std::option::Option<std::vec::Vec<crate::model::WorkerPool>>>()?.unwrap_or_default();
25784                        }
25785                        __FieldTag::__next_page_token => {
25786                            if !fields.insert(__FieldTag::__next_page_token) {
25787                                return std::result::Result::Err(A::Error::duplicate_field(
25788                                    "multiple values for next_page_token",
25789                                ));
25790                            }
25791                            result.next_page_token = map
25792                                .next_value::<std::option::Option<std::string::String>>()?
25793                                .unwrap_or_default();
25794                        }
25795                        __FieldTag::Unknown(key) => {
25796                            let value = map.next_value::<serde_json::Value>()?;
25797                            result._unknown_fields.insert(key, value);
25798                        }
25799                    }
25800                }
25801                std::result::Result::Ok(result)
25802            }
25803        }
25804        deserializer.deserialize_any(Visitor)
25805    }
25806}
25807
25808#[doc(hidden)]
25809impl serde::ser::Serialize for ListWorkerPoolsResponse {
25810    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25811    where
25812        S: serde::ser::Serializer,
25813    {
25814        use serde::ser::SerializeMap;
25815        #[allow(unused_imports)]
25816        use std::option::Option::Some;
25817        let mut state = serializer.serialize_map(std::option::Option::None)?;
25818        if !self.worker_pools.is_empty() {
25819            state.serialize_entry("workerPools", &self.worker_pools)?;
25820        }
25821        if !self.next_page_token.is_empty() {
25822            state.serialize_entry("nextPageToken", &self.next_page_token)?;
25823        }
25824        if !self._unknown_fields.is_empty() {
25825            for (key, value) in self._unknown_fields.iter() {
25826                state.serialize_entry(key, &value)?;
25827            }
25828        }
25829        state.end()
25830    }
25831}
25832
25833impl std::fmt::Debug for ListWorkerPoolsResponse {
25834    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25835        let mut debug_struct = f.debug_struct("ListWorkerPoolsResponse");
25836        debug_struct.field("worker_pools", &self.worker_pools);
25837        debug_struct.field("next_page_token", &self.next_page_token);
25838        if !self._unknown_fields.is_empty() {
25839            debug_struct.field("_unknown_fields", &self._unknown_fields);
25840        }
25841        debug_struct.finish()
25842    }
25843}
25844
25845/// Request message for obtaining a WorkerPool by its full name.
25846#[derive(Clone, Default, PartialEq)]
25847#[non_exhaustive]
25848pub struct GetWorkerPoolRequest {
25849    /// Required. The full name of the WorkerPool.
25850    /// Format:
25851    /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where
25852    /// `{project}` can be project id or number.
25853    pub name: std::string::String,
25854
25855    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25856}
25857
25858impl GetWorkerPoolRequest {
25859    pub fn new() -> Self {
25860        std::default::Default::default()
25861    }
25862
25863    /// Sets the value of [name][crate::model::GetWorkerPoolRequest::name].
25864    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25865        self.name = v.into();
25866        self
25867    }
25868}
25869
25870impl wkt::message::Message for GetWorkerPoolRequest {
25871    fn typename() -> &'static str {
25872        "type.googleapis.com/google.cloud.run.v2.GetWorkerPoolRequest"
25873    }
25874}
25875
25876#[doc(hidden)]
25877impl<'de> serde::de::Deserialize<'de> for GetWorkerPoolRequest {
25878    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25879    where
25880        D: serde::Deserializer<'de>,
25881    {
25882        #[allow(non_camel_case_types)]
25883        #[doc(hidden)]
25884        #[derive(PartialEq, Eq, Hash)]
25885        enum __FieldTag {
25886            __name,
25887            Unknown(std::string::String),
25888        }
25889        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
25890            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25891            where
25892                D: serde::Deserializer<'de>,
25893            {
25894                struct Visitor;
25895                impl<'de> serde::de::Visitor<'de> for Visitor {
25896                    type Value = __FieldTag;
25897                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25898                        formatter.write_str("a field name for GetWorkerPoolRequest")
25899                    }
25900                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
25901                    where
25902                        E: serde::de::Error,
25903                    {
25904                        use std::result::Result::Ok;
25905                        use std::string::ToString;
25906                        match value {
25907                            "name" => Ok(__FieldTag::__name),
25908                            _ => Ok(__FieldTag::Unknown(value.to_string())),
25909                        }
25910                    }
25911                }
25912                deserializer.deserialize_identifier(Visitor)
25913            }
25914        }
25915        struct Visitor;
25916        impl<'de> serde::de::Visitor<'de> for Visitor {
25917            type Value = GetWorkerPoolRequest;
25918            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
25919                formatter.write_str("struct GetWorkerPoolRequest")
25920            }
25921            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
25922            where
25923                A: serde::de::MapAccess<'de>,
25924            {
25925                #[allow(unused_imports)]
25926                use serde::de::Error;
25927                use std::option::Option::Some;
25928                let mut fields = std::collections::HashSet::new();
25929                let mut result = Self::Value::new();
25930                while let Some(tag) = map.next_key::<__FieldTag>()? {
25931                    #[allow(clippy::match_single_binding)]
25932                    match tag {
25933                        __FieldTag::__name => {
25934                            if !fields.insert(__FieldTag::__name) {
25935                                return std::result::Result::Err(A::Error::duplicate_field(
25936                                    "multiple values for name",
25937                                ));
25938                            }
25939                            result.name = map
25940                                .next_value::<std::option::Option<std::string::String>>()?
25941                                .unwrap_or_default();
25942                        }
25943                        __FieldTag::Unknown(key) => {
25944                            let value = map.next_value::<serde_json::Value>()?;
25945                            result._unknown_fields.insert(key, value);
25946                        }
25947                    }
25948                }
25949                std::result::Result::Ok(result)
25950            }
25951        }
25952        deserializer.deserialize_any(Visitor)
25953    }
25954}
25955
25956#[doc(hidden)]
25957impl serde::ser::Serialize for GetWorkerPoolRequest {
25958    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25959    where
25960        S: serde::ser::Serializer,
25961    {
25962        use serde::ser::SerializeMap;
25963        #[allow(unused_imports)]
25964        use std::option::Option::Some;
25965        let mut state = serializer.serialize_map(std::option::Option::None)?;
25966        if !self.name.is_empty() {
25967            state.serialize_entry("name", &self.name)?;
25968        }
25969        if !self._unknown_fields.is_empty() {
25970            for (key, value) in self._unknown_fields.iter() {
25971                state.serialize_entry(key, &value)?;
25972            }
25973        }
25974        state.end()
25975    }
25976}
25977
25978impl std::fmt::Debug for GetWorkerPoolRequest {
25979    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
25980        let mut debug_struct = f.debug_struct("GetWorkerPoolRequest");
25981        debug_struct.field("name", &self.name);
25982        if !self._unknown_fields.is_empty() {
25983            debug_struct.field("_unknown_fields", &self._unknown_fields);
25984        }
25985        debug_struct.finish()
25986    }
25987}
25988
25989/// Request message to delete a WorkerPool by its full name.
25990#[derive(Clone, Default, PartialEq)]
25991#[non_exhaustive]
25992pub struct DeleteWorkerPoolRequest {
25993    /// Required. The full name of the WorkerPool.
25994    /// Format:
25995    /// `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where
25996    /// `{project}` can be project id or number.
25997    pub name: std::string::String,
25998
25999    /// Optional. Indicates that the request should be validated without actually
26000    /// deleting any resources.
26001    pub validate_only: bool,
26002
26003    /// A system-generated fingerprint for this version of the
26004    /// resource. May be used to detect modification conflict during updates.
26005    pub etag: std::string::String,
26006
26007    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26008}
26009
26010impl DeleteWorkerPoolRequest {
26011    pub fn new() -> Self {
26012        std::default::Default::default()
26013    }
26014
26015    /// Sets the value of [name][crate::model::DeleteWorkerPoolRequest::name].
26016    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26017        self.name = v.into();
26018        self
26019    }
26020
26021    /// Sets the value of [validate_only][crate::model::DeleteWorkerPoolRequest::validate_only].
26022    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26023        self.validate_only = v.into();
26024        self
26025    }
26026
26027    /// Sets the value of [etag][crate::model::DeleteWorkerPoolRequest::etag].
26028    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26029        self.etag = v.into();
26030        self
26031    }
26032}
26033
26034impl wkt::message::Message for DeleteWorkerPoolRequest {
26035    fn typename() -> &'static str {
26036        "type.googleapis.com/google.cloud.run.v2.DeleteWorkerPoolRequest"
26037    }
26038}
26039
26040#[doc(hidden)]
26041impl<'de> serde::de::Deserialize<'de> for DeleteWorkerPoolRequest {
26042    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26043    where
26044        D: serde::Deserializer<'de>,
26045    {
26046        #[allow(non_camel_case_types)]
26047        #[doc(hidden)]
26048        #[derive(PartialEq, Eq, Hash)]
26049        enum __FieldTag {
26050            __name,
26051            __validate_only,
26052            __etag,
26053            Unknown(std::string::String),
26054        }
26055        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
26056            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26057            where
26058                D: serde::Deserializer<'de>,
26059            {
26060                struct Visitor;
26061                impl<'de> serde::de::Visitor<'de> for Visitor {
26062                    type Value = __FieldTag;
26063                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26064                        formatter.write_str("a field name for DeleteWorkerPoolRequest")
26065                    }
26066                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
26067                    where
26068                        E: serde::de::Error,
26069                    {
26070                        use std::result::Result::Ok;
26071                        use std::string::ToString;
26072                        match value {
26073                            "name" => Ok(__FieldTag::__name),
26074                            "validateOnly" => Ok(__FieldTag::__validate_only),
26075                            "validate_only" => Ok(__FieldTag::__validate_only),
26076                            "etag" => Ok(__FieldTag::__etag),
26077                            _ => Ok(__FieldTag::Unknown(value.to_string())),
26078                        }
26079                    }
26080                }
26081                deserializer.deserialize_identifier(Visitor)
26082            }
26083        }
26084        struct Visitor;
26085        impl<'de> serde::de::Visitor<'de> for Visitor {
26086            type Value = DeleteWorkerPoolRequest;
26087            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26088                formatter.write_str("struct DeleteWorkerPoolRequest")
26089            }
26090            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
26091            where
26092                A: serde::de::MapAccess<'de>,
26093            {
26094                #[allow(unused_imports)]
26095                use serde::de::Error;
26096                use std::option::Option::Some;
26097                let mut fields = std::collections::HashSet::new();
26098                let mut result = Self::Value::new();
26099                while let Some(tag) = map.next_key::<__FieldTag>()? {
26100                    #[allow(clippy::match_single_binding)]
26101                    match tag {
26102                        __FieldTag::__name => {
26103                            if !fields.insert(__FieldTag::__name) {
26104                                return std::result::Result::Err(A::Error::duplicate_field(
26105                                    "multiple values for name",
26106                                ));
26107                            }
26108                            result.name = map
26109                                .next_value::<std::option::Option<std::string::String>>()?
26110                                .unwrap_or_default();
26111                        }
26112                        __FieldTag::__validate_only => {
26113                            if !fields.insert(__FieldTag::__validate_only) {
26114                                return std::result::Result::Err(A::Error::duplicate_field(
26115                                    "multiple values for validate_only",
26116                                ));
26117                            }
26118                            result.validate_only = map
26119                                .next_value::<std::option::Option<bool>>()?
26120                                .unwrap_or_default();
26121                        }
26122                        __FieldTag::__etag => {
26123                            if !fields.insert(__FieldTag::__etag) {
26124                                return std::result::Result::Err(A::Error::duplicate_field(
26125                                    "multiple values for etag",
26126                                ));
26127                            }
26128                            result.etag = map
26129                                .next_value::<std::option::Option<std::string::String>>()?
26130                                .unwrap_or_default();
26131                        }
26132                        __FieldTag::Unknown(key) => {
26133                            let value = map.next_value::<serde_json::Value>()?;
26134                            result._unknown_fields.insert(key, value);
26135                        }
26136                    }
26137                }
26138                std::result::Result::Ok(result)
26139            }
26140        }
26141        deserializer.deserialize_any(Visitor)
26142    }
26143}
26144
26145#[doc(hidden)]
26146impl serde::ser::Serialize for DeleteWorkerPoolRequest {
26147    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26148    where
26149        S: serde::ser::Serializer,
26150    {
26151        use serde::ser::SerializeMap;
26152        #[allow(unused_imports)]
26153        use std::option::Option::Some;
26154        let mut state = serializer.serialize_map(std::option::Option::None)?;
26155        if !self.name.is_empty() {
26156            state.serialize_entry("name", &self.name)?;
26157        }
26158        if !wkt::internal::is_default(&self.validate_only) {
26159            state.serialize_entry("validateOnly", &self.validate_only)?;
26160        }
26161        if !self.etag.is_empty() {
26162            state.serialize_entry("etag", &self.etag)?;
26163        }
26164        if !self._unknown_fields.is_empty() {
26165            for (key, value) in self._unknown_fields.iter() {
26166                state.serialize_entry(key, &value)?;
26167            }
26168        }
26169        state.end()
26170    }
26171}
26172
26173impl std::fmt::Debug for DeleteWorkerPoolRequest {
26174    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26175        let mut debug_struct = f.debug_struct("DeleteWorkerPoolRequest");
26176        debug_struct.field("name", &self.name);
26177        debug_struct.field("validate_only", &self.validate_only);
26178        debug_struct.field("etag", &self.etag);
26179        if !self._unknown_fields.is_empty() {
26180            debug_struct.field("_unknown_fields", &self._unknown_fields);
26181        }
26182        debug_struct.finish()
26183    }
26184}
26185
26186/// WorkerPool acts as a top-level container that manages a set of
26187/// configurations and revision templates which implement a pull-based workload.
26188/// WorkerPool exists to provide a singular abstraction which can be access
26189/// controlled, reasoned about, and which encapsulates software lifecycle
26190/// decisions such as rollout policy and team resource ownership.
26191#[derive(Clone, Default, PartialEq)]
26192#[non_exhaustive]
26193pub struct WorkerPool {
26194    /// The fully qualified name of this WorkerPool. In CreateWorkerPoolRequest,
26195    /// this field is ignored, and instead composed from
26196    /// CreateWorkerPoolRequest.parent and CreateWorkerPoolRequest.worker_id.
26197    ///
26198    /// Format:
26199    /// `projects/{project}/locations/{location}/workerPools/{worker_id}`
26200    pub name: std::string::String,
26201
26202    /// User-provided description of the WorkerPool. This field currently has a
26203    /// 512-character limit.
26204    pub description: std::string::String,
26205
26206    /// Output only. Server assigned unique identifier for the trigger. The value
26207    /// is a UUID4 string and guaranteed to remain unchanged until the resource is
26208    /// deleted.
26209    pub uid: std::string::String,
26210
26211    /// Output only. A number that monotonically increases every time the user
26212    /// modifies the desired state.
26213    /// Please note that unlike v1, this is an int64 value. As with most Google
26214    /// APIs, its JSON representation will be a `string` instead of an `integer`.
26215    pub generation: i64,
26216
26217    /// Optional. Unstructured key value map that can be used to organize and
26218    /// categorize objects. User-provided labels are shared with Google's billing
26219    /// system, so they can be used to filter, or break down billing charges by
26220    /// team, component, environment, state, etc. For more information, visit
26221    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
26222    /// <https://cloud.google.com/run/docs/configuring/labels>.
26223    ///
26224    /// Cloud Run API v2 does not support labels with  `run.googleapis.com`,
26225    /// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
26226    /// namespaces, and they will be rejected. All system labels in v1 now have a
26227    /// corresponding field in v2 WorkerPool.
26228    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
26229
26230    /// Optional. Unstructured key value map that may be set by external tools to
26231    /// store and arbitrary metadata. They are not queryable and should be
26232    /// preserved when modifying objects.
26233    ///
26234    /// Cloud Run API v2 does not support annotations with `run.googleapis.com`,
26235    /// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
26236    /// namespaces, and they will be rejected in new resources. All system
26237    /// annotations in v1 now have a corresponding field in v2 WorkerPool.
26238    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
26239
26240    /// Output only. The creation time.
26241    pub create_time: std::option::Option<wkt::Timestamp>,
26242
26243    /// Output only. The last-modified time.
26244    pub update_time: std::option::Option<wkt::Timestamp>,
26245
26246    /// Output only. The deletion time. It is only populated as a response to a
26247    /// Delete request.
26248    pub delete_time: std::option::Option<wkt::Timestamp>,
26249
26250    /// Output only. For a deleted resource, the time after which it will be
26251    /// permamently deleted.
26252    pub expire_time: std::option::Option<wkt::Timestamp>,
26253
26254    /// Output only. Email address of the authenticated creator.
26255    pub creator: std::string::String,
26256
26257    /// Output only. Email address of the last authenticated modifier.
26258    pub last_modifier: std::string::String,
26259
26260    /// Arbitrary identifier for the API client.
26261    pub client: std::string::String,
26262
26263    /// Arbitrary version identifier for the API client.
26264    pub client_version: std::string::String,
26265
26266    /// Optional. The launch stage as defined by [Google Cloud Platform
26267    /// Launch Stages](https://cloud.google.com/terms/launch-stages).
26268    /// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
26269    /// is assumed.
26270    /// Set the launch stage to a preview stage on input to allow use of preview
26271    /// features in that stage. On read (or output), describes whether the
26272    /// resource uses preview features.
26273    ///
26274    /// For example, if ALPHA is provided as input, but only BETA and GA-level
26275    /// features are used, this field will be BETA on output.
26276    pub launch_stage: api::model::LaunchStage,
26277
26278    /// Optional. Settings for the Binary Authorization feature.
26279    pub binary_authorization: std::option::Option<crate::model::BinaryAuthorization>,
26280
26281    /// Required. The template used to create revisions for this WorkerPool.
26282    pub template: std::option::Option<crate::model::WorkerPoolRevisionTemplate>,
26283
26284    /// Optional. Specifies how to distribute instances over a collection of
26285    /// Revisions belonging to the WorkerPool. If instance split is empty or not
26286    /// provided, defaults to 100% instances assigned to the latest `Ready`
26287    /// Revision.
26288    pub instance_splits: std::vec::Vec<crate::model::InstanceSplit>,
26289
26290    /// Optional. Specifies worker-pool-level scaling settings
26291    pub scaling: std::option::Option<crate::model::WorkerPoolScaling>,
26292
26293    /// Output only. The generation of this WorkerPool currently serving traffic.
26294    /// See comments in `reconciling` for additional information on reconciliation
26295    /// process in Cloud Run. Please note that unlike v1, this is an int64 value.
26296    /// As with most Google APIs, its JSON representation will be a `string`
26297    /// instead of an `integer`.
26298    pub observed_generation: i64,
26299
26300    /// Output only. The Condition of this WorkerPool, containing its readiness
26301    /// status, and detailed error information in case it did not reach a serving
26302    /// state. See comments in `reconciling` for additional information on
26303    /// reconciliation process in Cloud Run.
26304    pub terminal_condition: std::option::Option<crate::model::Condition>,
26305
26306    /// Output only. The Conditions of all other associated sub-resources. They
26307    /// contain additional diagnostics information in case the WorkerPool does not
26308    /// reach its Serving state. See comments in `reconciling` for additional
26309    /// information on reconciliation process in Cloud Run.
26310    pub conditions: std::vec::Vec<crate::model::Condition>,
26311
26312    /// Output only. Name of the latest revision that is serving traffic. See
26313    /// comments in `reconciling` for additional information on reconciliation
26314    /// process in Cloud Run.
26315    pub latest_ready_revision: std::string::String,
26316
26317    /// Output only. Name of the last created revision. See comments in
26318    /// `reconciling` for additional information on reconciliation process in Cloud
26319    /// Run.
26320    pub latest_created_revision: std::string::String,
26321
26322    /// Output only. Detailed status information for corresponding instance splits.
26323    /// See comments in `reconciling` for additional information on reconciliation
26324    /// process in Cloud Run.
26325    pub instance_split_statuses: std::vec::Vec<crate::model::InstanceSplitStatus>,
26326
26327    /// One or more custom audiences that you want this worker pool to support.
26328    /// Specify each custom audience as the full URL in a string. The custom
26329    /// audiences are encoded in the token and used to authenticate requests. For
26330    /// more information, see
26331    /// <https://cloud.google.com/run/docs/configuring/custom-audiences>.
26332    pub custom_audiences: std::vec::Vec<std::string::String>,
26333
26334    /// Output only. Reserved for future use.
26335    pub satisfies_pzs: bool,
26336
26337    /// Output only. Returns true if the WorkerPool is currently being acted upon
26338    /// by the system to bring it into the desired state.
26339    ///
26340    /// When a new WorkerPool is created, or an existing one is updated, Cloud Run
26341    /// will asynchronously perform all necessary steps to bring the WorkerPool to
26342    /// the desired serving state. This process is called reconciliation. While
26343    /// reconciliation is in process, `observed_generation`,
26344    /// `latest_ready_revison`, `traffic_statuses`, and `uri` will have transient
26345    /// values that might mismatch the intended state: Once reconciliation is over
26346    /// (and this field is false), there are two possible outcomes: reconciliation
26347    /// succeeded and the serving state matches the WorkerPool, or there was an
26348    /// error, and reconciliation failed. This state can be found in
26349    /// `terminal_condition.state`.
26350    ///
26351    /// If reconciliation succeeded, the following fields will match: `traffic` and
26352    /// `traffic_statuses`, `observed_generation` and `generation`,
26353    /// `latest_ready_revision` and `latest_created_revision`.
26354    ///
26355    /// If reconciliation failed, `traffic_statuses`, `observed_generation`, and
26356    /// `latest_ready_revision` will have the state of the last serving revision,
26357    /// or empty for newly created WorkerPools. Additional information on the
26358    /// failure can be found in `terminal_condition` and `conditions`.
26359    pub reconciling: bool,
26360
26361    /// Output only. A system-generated fingerprint for this version of the
26362    /// resource. May be used to detect modification conflict during updates.
26363    pub etag: std::string::String,
26364
26365    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26366}
26367
26368impl WorkerPool {
26369    pub fn new() -> Self {
26370        std::default::Default::default()
26371    }
26372
26373    /// Sets the value of [name][crate::model::WorkerPool::name].
26374    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26375        self.name = v.into();
26376        self
26377    }
26378
26379    /// Sets the value of [description][crate::model::WorkerPool::description].
26380    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26381        self.description = v.into();
26382        self
26383    }
26384
26385    /// Sets the value of [uid][crate::model::WorkerPool::uid].
26386    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26387        self.uid = v.into();
26388        self
26389    }
26390
26391    /// Sets the value of [generation][crate::model::WorkerPool::generation].
26392    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
26393        self.generation = v.into();
26394        self
26395    }
26396
26397    /// Sets the value of [labels][crate::model::WorkerPool::labels].
26398    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
26399    where
26400        T: std::iter::IntoIterator<Item = (K, V)>,
26401        K: std::convert::Into<std::string::String>,
26402        V: std::convert::Into<std::string::String>,
26403    {
26404        use std::iter::Iterator;
26405        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26406        self
26407    }
26408
26409    /// Sets the value of [annotations][crate::model::WorkerPool::annotations].
26410    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
26411    where
26412        T: std::iter::IntoIterator<Item = (K, V)>,
26413        K: std::convert::Into<std::string::String>,
26414        V: std::convert::Into<std::string::String>,
26415    {
26416        use std::iter::Iterator;
26417        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26418        self
26419    }
26420
26421    /// Sets the value of [create_time][crate::model::WorkerPool::create_time].
26422    pub fn set_create_time<T>(mut self, v: T) -> Self
26423    where
26424        T: std::convert::Into<wkt::Timestamp>,
26425    {
26426        self.create_time = std::option::Option::Some(v.into());
26427        self
26428    }
26429
26430    /// Sets or clears the value of [create_time][crate::model::WorkerPool::create_time].
26431    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
26432    where
26433        T: std::convert::Into<wkt::Timestamp>,
26434    {
26435        self.create_time = v.map(|x| x.into());
26436        self
26437    }
26438
26439    /// Sets the value of [update_time][crate::model::WorkerPool::update_time].
26440    pub fn set_update_time<T>(mut self, v: T) -> Self
26441    where
26442        T: std::convert::Into<wkt::Timestamp>,
26443    {
26444        self.update_time = std::option::Option::Some(v.into());
26445        self
26446    }
26447
26448    /// Sets or clears the value of [update_time][crate::model::WorkerPool::update_time].
26449    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
26450    where
26451        T: std::convert::Into<wkt::Timestamp>,
26452    {
26453        self.update_time = v.map(|x| x.into());
26454        self
26455    }
26456
26457    /// Sets the value of [delete_time][crate::model::WorkerPool::delete_time].
26458    pub fn set_delete_time<T>(mut self, v: T) -> Self
26459    where
26460        T: std::convert::Into<wkt::Timestamp>,
26461    {
26462        self.delete_time = std::option::Option::Some(v.into());
26463        self
26464    }
26465
26466    /// Sets or clears the value of [delete_time][crate::model::WorkerPool::delete_time].
26467    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
26468    where
26469        T: std::convert::Into<wkt::Timestamp>,
26470    {
26471        self.delete_time = v.map(|x| x.into());
26472        self
26473    }
26474
26475    /// Sets the value of [expire_time][crate::model::WorkerPool::expire_time].
26476    pub fn set_expire_time<T>(mut self, v: T) -> Self
26477    where
26478        T: std::convert::Into<wkt::Timestamp>,
26479    {
26480        self.expire_time = std::option::Option::Some(v.into());
26481        self
26482    }
26483
26484    /// Sets or clears the value of [expire_time][crate::model::WorkerPool::expire_time].
26485    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
26486    where
26487        T: std::convert::Into<wkt::Timestamp>,
26488    {
26489        self.expire_time = v.map(|x| x.into());
26490        self
26491    }
26492
26493    /// Sets the value of [creator][crate::model::WorkerPool::creator].
26494    pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26495        self.creator = v.into();
26496        self
26497    }
26498
26499    /// Sets the value of [last_modifier][crate::model::WorkerPool::last_modifier].
26500    pub fn set_last_modifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26501        self.last_modifier = v.into();
26502        self
26503    }
26504
26505    /// Sets the value of [client][crate::model::WorkerPool::client].
26506    pub fn set_client<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26507        self.client = v.into();
26508        self
26509    }
26510
26511    /// Sets the value of [client_version][crate::model::WorkerPool::client_version].
26512    pub fn set_client_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26513        self.client_version = v.into();
26514        self
26515    }
26516
26517    /// Sets the value of [launch_stage][crate::model::WorkerPool::launch_stage].
26518    pub fn set_launch_stage<T: std::convert::Into<api::model::LaunchStage>>(
26519        mut self,
26520        v: T,
26521    ) -> Self {
26522        self.launch_stage = v.into();
26523        self
26524    }
26525
26526    /// Sets the value of [binary_authorization][crate::model::WorkerPool::binary_authorization].
26527    pub fn set_binary_authorization<T>(mut self, v: T) -> Self
26528    where
26529        T: std::convert::Into<crate::model::BinaryAuthorization>,
26530    {
26531        self.binary_authorization = std::option::Option::Some(v.into());
26532        self
26533    }
26534
26535    /// Sets or clears the value of [binary_authorization][crate::model::WorkerPool::binary_authorization].
26536    pub fn set_or_clear_binary_authorization<T>(mut self, v: std::option::Option<T>) -> Self
26537    where
26538        T: std::convert::Into<crate::model::BinaryAuthorization>,
26539    {
26540        self.binary_authorization = v.map(|x| x.into());
26541        self
26542    }
26543
26544    /// Sets the value of [template][crate::model::WorkerPool::template].
26545    pub fn set_template<T>(mut self, v: T) -> Self
26546    where
26547        T: std::convert::Into<crate::model::WorkerPoolRevisionTemplate>,
26548    {
26549        self.template = std::option::Option::Some(v.into());
26550        self
26551    }
26552
26553    /// Sets or clears the value of [template][crate::model::WorkerPool::template].
26554    pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
26555    where
26556        T: std::convert::Into<crate::model::WorkerPoolRevisionTemplate>,
26557    {
26558        self.template = v.map(|x| x.into());
26559        self
26560    }
26561
26562    /// Sets the value of [instance_splits][crate::model::WorkerPool::instance_splits].
26563    pub fn set_instance_splits<T, V>(mut self, v: T) -> Self
26564    where
26565        T: std::iter::IntoIterator<Item = V>,
26566        V: std::convert::Into<crate::model::InstanceSplit>,
26567    {
26568        use std::iter::Iterator;
26569        self.instance_splits = v.into_iter().map(|i| i.into()).collect();
26570        self
26571    }
26572
26573    /// Sets the value of [scaling][crate::model::WorkerPool::scaling].
26574    pub fn set_scaling<T>(mut self, v: T) -> Self
26575    where
26576        T: std::convert::Into<crate::model::WorkerPoolScaling>,
26577    {
26578        self.scaling = std::option::Option::Some(v.into());
26579        self
26580    }
26581
26582    /// Sets or clears the value of [scaling][crate::model::WorkerPool::scaling].
26583    pub fn set_or_clear_scaling<T>(mut self, v: std::option::Option<T>) -> Self
26584    where
26585        T: std::convert::Into<crate::model::WorkerPoolScaling>,
26586    {
26587        self.scaling = v.map(|x| x.into());
26588        self
26589    }
26590
26591    /// Sets the value of [observed_generation][crate::model::WorkerPool::observed_generation].
26592    pub fn set_observed_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
26593        self.observed_generation = v.into();
26594        self
26595    }
26596
26597    /// Sets the value of [terminal_condition][crate::model::WorkerPool::terminal_condition].
26598    pub fn set_terminal_condition<T>(mut self, v: T) -> Self
26599    where
26600        T: std::convert::Into<crate::model::Condition>,
26601    {
26602        self.terminal_condition = std::option::Option::Some(v.into());
26603        self
26604    }
26605
26606    /// Sets or clears the value of [terminal_condition][crate::model::WorkerPool::terminal_condition].
26607    pub fn set_or_clear_terminal_condition<T>(mut self, v: std::option::Option<T>) -> Self
26608    where
26609        T: std::convert::Into<crate::model::Condition>,
26610    {
26611        self.terminal_condition = v.map(|x| x.into());
26612        self
26613    }
26614
26615    /// Sets the value of [conditions][crate::model::WorkerPool::conditions].
26616    pub fn set_conditions<T, V>(mut self, v: T) -> Self
26617    where
26618        T: std::iter::IntoIterator<Item = V>,
26619        V: std::convert::Into<crate::model::Condition>,
26620    {
26621        use std::iter::Iterator;
26622        self.conditions = v.into_iter().map(|i| i.into()).collect();
26623        self
26624    }
26625
26626    /// Sets the value of [latest_ready_revision][crate::model::WorkerPool::latest_ready_revision].
26627    pub fn set_latest_ready_revision<T: std::convert::Into<std::string::String>>(
26628        mut self,
26629        v: T,
26630    ) -> Self {
26631        self.latest_ready_revision = v.into();
26632        self
26633    }
26634
26635    /// Sets the value of [latest_created_revision][crate::model::WorkerPool::latest_created_revision].
26636    pub fn set_latest_created_revision<T: std::convert::Into<std::string::String>>(
26637        mut self,
26638        v: T,
26639    ) -> Self {
26640        self.latest_created_revision = v.into();
26641        self
26642    }
26643
26644    /// Sets the value of [instance_split_statuses][crate::model::WorkerPool::instance_split_statuses].
26645    pub fn set_instance_split_statuses<T, V>(mut self, v: T) -> Self
26646    where
26647        T: std::iter::IntoIterator<Item = V>,
26648        V: std::convert::Into<crate::model::InstanceSplitStatus>,
26649    {
26650        use std::iter::Iterator;
26651        self.instance_split_statuses = v.into_iter().map(|i| i.into()).collect();
26652        self
26653    }
26654
26655    /// Sets the value of [custom_audiences][crate::model::WorkerPool::custom_audiences].
26656    pub fn set_custom_audiences<T, V>(mut self, v: T) -> Self
26657    where
26658        T: std::iter::IntoIterator<Item = V>,
26659        V: std::convert::Into<std::string::String>,
26660    {
26661        use std::iter::Iterator;
26662        self.custom_audiences = v.into_iter().map(|i| i.into()).collect();
26663        self
26664    }
26665
26666    /// Sets the value of [satisfies_pzs][crate::model::WorkerPool::satisfies_pzs].
26667    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26668        self.satisfies_pzs = v.into();
26669        self
26670    }
26671
26672    /// Sets the value of [reconciling][crate::model::WorkerPool::reconciling].
26673    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26674        self.reconciling = v.into();
26675        self
26676    }
26677
26678    /// Sets the value of [etag][crate::model::WorkerPool::etag].
26679    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26680        self.etag = v.into();
26681        self
26682    }
26683}
26684
26685impl wkt::message::Message for WorkerPool {
26686    fn typename() -> &'static str {
26687        "type.googleapis.com/google.cloud.run.v2.WorkerPool"
26688    }
26689}
26690
26691#[doc(hidden)]
26692impl<'de> serde::de::Deserialize<'de> for WorkerPool {
26693    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26694    where
26695        D: serde::Deserializer<'de>,
26696    {
26697        #[allow(non_camel_case_types)]
26698        #[doc(hidden)]
26699        #[derive(PartialEq, Eq, Hash)]
26700        enum __FieldTag {
26701            __name,
26702            __description,
26703            __uid,
26704            __generation,
26705            __labels,
26706            __annotations,
26707            __create_time,
26708            __update_time,
26709            __delete_time,
26710            __expire_time,
26711            __creator,
26712            __last_modifier,
26713            __client,
26714            __client_version,
26715            __launch_stage,
26716            __binary_authorization,
26717            __template,
26718            __instance_splits,
26719            __scaling,
26720            __observed_generation,
26721            __terminal_condition,
26722            __conditions,
26723            __latest_ready_revision,
26724            __latest_created_revision,
26725            __instance_split_statuses,
26726            __custom_audiences,
26727            __satisfies_pzs,
26728            __reconciling,
26729            __etag,
26730            Unknown(std::string::String),
26731        }
26732        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
26733            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26734            where
26735                D: serde::Deserializer<'de>,
26736            {
26737                struct Visitor;
26738                impl<'de> serde::de::Visitor<'de> for Visitor {
26739                    type Value = __FieldTag;
26740                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26741                        formatter.write_str("a field name for WorkerPool")
26742                    }
26743                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
26744                    where
26745                        E: serde::de::Error,
26746                    {
26747                        use std::result::Result::Ok;
26748                        use std::string::ToString;
26749                        match value {
26750                            "name" => Ok(__FieldTag::__name),
26751                            "description" => Ok(__FieldTag::__description),
26752                            "uid" => Ok(__FieldTag::__uid),
26753                            "generation" => Ok(__FieldTag::__generation),
26754                            "labels" => Ok(__FieldTag::__labels),
26755                            "annotations" => Ok(__FieldTag::__annotations),
26756                            "createTime" => Ok(__FieldTag::__create_time),
26757                            "create_time" => Ok(__FieldTag::__create_time),
26758                            "updateTime" => Ok(__FieldTag::__update_time),
26759                            "update_time" => Ok(__FieldTag::__update_time),
26760                            "deleteTime" => Ok(__FieldTag::__delete_time),
26761                            "delete_time" => Ok(__FieldTag::__delete_time),
26762                            "expireTime" => Ok(__FieldTag::__expire_time),
26763                            "expire_time" => Ok(__FieldTag::__expire_time),
26764                            "creator" => Ok(__FieldTag::__creator),
26765                            "lastModifier" => Ok(__FieldTag::__last_modifier),
26766                            "last_modifier" => Ok(__FieldTag::__last_modifier),
26767                            "client" => Ok(__FieldTag::__client),
26768                            "clientVersion" => Ok(__FieldTag::__client_version),
26769                            "client_version" => Ok(__FieldTag::__client_version),
26770                            "launchStage" => Ok(__FieldTag::__launch_stage),
26771                            "launch_stage" => Ok(__FieldTag::__launch_stage),
26772                            "binaryAuthorization" => Ok(__FieldTag::__binary_authorization),
26773                            "binary_authorization" => Ok(__FieldTag::__binary_authorization),
26774                            "template" => Ok(__FieldTag::__template),
26775                            "instanceSplits" => Ok(__FieldTag::__instance_splits),
26776                            "instance_splits" => Ok(__FieldTag::__instance_splits),
26777                            "scaling" => Ok(__FieldTag::__scaling),
26778                            "observedGeneration" => Ok(__FieldTag::__observed_generation),
26779                            "observed_generation" => Ok(__FieldTag::__observed_generation),
26780                            "terminalCondition" => Ok(__FieldTag::__terminal_condition),
26781                            "terminal_condition" => Ok(__FieldTag::__terminal_condition),
26782                            "conditions" => Ok(__FieldTag::__conditions),
26783                            "latestReadyRevision" => Ok(__FieldTag::__latest_ready_revision),
26784                            "latest_ready_revision" => Ok(__FieldTag::__latest_ready_revision),
26785                            "latestCreatedRevision" => Ok(__FieldTag::__latest_created_revision),
26786                            "latest_created_revision" => Ok(__FieldTag::__latest_created_revision),
26787                            "instanceSplitStatuses" => Ok(__FieldTag::__instance_split_statuses),
26788                            "instance_split_statuses" => Ok(__FieldTag::__instance_split_statuses),
26789                            "customAudiences" => Ok(__FieldTag::__custom_audiences),
26790                            "custom_audiences" => Ok(__FieldTag::__custom_audiences),
26791                            "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
26792                            "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
26793                            "reconciling" => Ok(__FieldTag::__reconciling),
26794                            "etag" => Ok(__FieldTag::__etag),
26795                            _ => Ok(__FieldTag::Unknown(value.to_string())),
26796                        }
26797                    }
26798                }
26799                deserializer.deserialize_identifier(Visitor)
26800            }
26801        }
26802        struct Visitor;
26803        impl<'de> serde::de::Visitor<'de> for Visitor {
26804            type Value = WorkerPool;
26805            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
26806                formatter.write_str("struct WorkerPool")
26807            }
26808            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
26809            where
26810                A: serde::de::MapAccess<'de>,
26811            {
26812                #[allow(unused_imports)]
26813                use serde::de::Error;
26814                use std::option::Option::Some;
26815                let mut fields = std::collections::HashSet::new();
26816                let mut result = Self::Value::new();
26817                while let Some(tag) = map.next_key::<__FieldTag>()? {
26818                    #[allow(clippy::match_single_binding)]
26819                    match tag {
26820                        __FieldTag::__name => {
26821                            if !fields.insert(__FieldTag::__name) {
26822                                return std::result::Result::Err(A::Error::duplicate_field(
26823                                    "multiple values for name",
26824                                ));
26825                            }
26826                            result.name = map
26827                                .next_value::<std::option::Option<std::string::String>>()?
26828                                .unwrap_or_default();
26829                        }
26830                        __FieldTag::__description => {
26831                            if !fields.insert(__FieldTag::__description) {
26832                                return std::result::Result::Err(A::Error::duplicate_field(
26833                                    "multiple values for description",
26834                                ));
26835                            }
26836                            result.description = map
26837                                .next_value::<std::option::Option<std::string::String>>()?
26838                                .unwrap_or_default();
26839                        }
26840                        __FieldTag::__uid => {
26841                            if !fields.insert(__FieldTag::__uid) {
26842                                return std::result::Result::Err(A::Error::duplicate_field(
26843                                    "multiple values for uid",
26844                                ));
26845                            }
26846                            result.uid = map
26847                                .next_value::<std::option::Option<std::string::String>>()?
26848                                .unwrap_or_default();
26849                        }
26850                        __FieldTag::__generation => {
26851                            if !fields.insert(__FieldTag::__generation) {
26852                                return std::result::Result::Err(A::Error::duplicate_field(
26853                                    "multiple values for generation",
26854                                ));
26855                            }
26856                            struct __With(std::option::Option<i64>);
26857                            impl<'de> serde::de::Deserialize<'de> for __With {
26858                                fn deserialize<D>(
26859                                    deserializer: D,
26860                                ) -> std::result::Result<Self, D::Error>
26861                                where
26862                                    D: serde::de::Deserializer<'de>,
26863                                {
26864                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
26865                                }
26866                            }
26867                            result.generation = map.next_value::<__With>()?.0.unwrap_or_default();
26868                        }
26869                        __FieldTag::__labels => {
26870                            if !fields.insert(__FieldTag::__labels) {
26871                                return std::result::Result::Err(A::Error::duplicate_field(
26872                                    "multiple values for labels",
26873                                ));
26874                            }
26875                            result.labels = map
26876                                .next_value::<std::option::Option<
26877                                    std::collections::HashMap<
26878                                        std::string::String,
26879                                        std::string::String,
26880                                    >,
26881                                >>()?
26882                                .unwrap_or_default();
26883                        }
26884                        __FieldTag::__annotations => {
26885                            if !fields.insert(__FieldTag::__annotations) {
26886                                return std::result::Result::Err(A::Error::duplicate_field(
26887                                    "multiple values for annotations",
26888                                ));
26889                            }
26890                            result.annotations = map
26891                                .next_value::<std::option::Option<
26892                                    std::collections::HashMap<
26893                                        std::string::String,
26894                                        std::string::String,
26895                                    >,
26896                                >>()?
26897                                .unwrap_or_default();
26898                        }
26899                        __FieldTag::__create_time => {
26900                            if !fields.insert(__FieldTag::__create_time) {
26901                                return std::result::Result::Err(A::Error::duplicate_field(
26902                                    "multiple values for create_time",
26903                                ));
26904                            }
26905                            result.create_time =
26906                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
26907                        }
26908                        __FieldTag::__update_time => {
26909                            if !fields.insert(__FieldTag::__update_time) {
26910                                return std::result::Result::Err(A::Error::duplicate_field(
26911                                    "multiple values for update_time",
26912                                ));
26913                            }
26914                            result.update_time =
26915                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
26916                        }
26917                        __FieldTag::__delete_time => {
26918                            if !fields.insert(__FieldTag::__delete_time) {
26919                                return std::result::Result::Err(A::Error::duplicate_field(
26920                                    "multiple values for delete_time",
26921                                ));
26922                            }
26923                            result.delete_time =
26924                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
26925                        }
26926                        __FieldTag::__expire_time => {
26927                            if !fields.insert(__FieldTag::__expire_time) {
26928                                return std::result::Result::Err(A::Error::duplicate_field(
26929                                    "multiple values for expire_time",
26930                                ));
26931                            }
26932                            result.expire_time =
26933                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
26934                        }
26935                        __FieldTag::__creator => {
26936                            if !fields.insert(__FieldTag::__creator) {
26937                                return std::result::Result::Err(A::Error::duplicate_field(
26938                                    "multiple values for creator",
26939                                ));
26940                            }
26941                            result.creator = map
26942                                .next_value::<std::option::Option<std::string::String>>()?
26943                                .unwrap_or_default();
26944                        }
26945                        __FieldTag::__last_modifier => {
26946                            if !fields.insert(__FieldTag::__last_modifier) {
26947                                return std::result::Result::Err(A::Error::duplicate_field(
26948                                    "multiple values for last_modifier",
26949                                ));
26950                            }
26951                            result.last_modifier = map
26952                                .next_value::<std::option::Option<std::string::String>>()?
26953                                .unwrap_or_default();
26954                        }
26955                        __FieldTag::__client => {
26956                            if !fields.insert(__FieldTag::__client) {
26957                                return std::result::Result::Err(A::Error::duplicate_field(
26958                                    "multiple values for client",
26959                                ));
26960                            }
26961                            result.client = map
26962                                .next_value::<std::option::Option<std::string::String>>()?
26963                                .unwrap_or_default();
26964                        }
26965                        __FieldTag::__client_version => {
26966                            if !fields.insert(__FieldTag::__client_version) {
26967                                return std::result::Result::Err(A::Error::duplicate_field(
26968                                    "multiple values for client_version",
26969                                ));
26970                            }
26971                            result.client_version = map
26972                                .next_value::<std::option::Option<std::string::String>>()?
26973                                .unwrap_or_default();
26974                        }
26975                        __FieldTag::__launch_stage => {
26976                            if !fields.insert(__FieldTag::__launch_stage) {
26977                                return std::result::Result::Err(A::Error::duplicate_field(
26978                                    "multiple values for launch_stage",
26979                                ));
26980                            }
26981                            result.launch_stage = map
26982                                .next_value::<std::option::Option<api::model::LaunchStage>>()?
26983                                .unwrap_or_default();
26984                        }
26985                        __FieldTag::__binary_authorization => {
26986                            if !fields.insert(__FieldTag::__binary_authorization) {
26987                                return std::result::Result::Err(A::Error::duplicate_field(
26988                                    "multiple values for binary_authorization",
26989                                ));
26990                            }
26991                            result.binary_authorization = map.next_value::<std::option::Option<crate::model::BinaryAuthorization>>()?
26992                                ;
26993                        }
26994                        __FieldTag::__template => {
26995                            if !fields.insert(__FieldTag::__template) {
26996                                return std::result::Result::Err(A::Error::duplicate_field(
26997                                    "multiple values for template",
26998                                ));
26999                            }
27000                            result.template = map.next_value::<std::option::Option<crate::model::WorkerPoolRevisionTemplate>>()?
27001                                ;
27002                        }
27003                        __FieldTag::__instance_splits => {
27004                            if !fields.insert(__FieldTag::__instance_splits) {
27005                                return std::result::Result::Err(A::Error::duplicate_field(
27006                                    "multiple values for instance_splits",
27007                                ));
27008                            }
27009                            result.instance_splits = map.next_value::<std::option::Option<std::vec::Vec<crate::model::InstanceSplit>>>()?.unwrap_or_default();
27010                        }
27011                        __FieldTag::__scaling => {
27012                            if !fields.insert(__FieldTag::__scaling) {
27013                                return std::result::Result::Err(A::Error::duplicate_field(
27014                                    "multiple values for scaling",
27015                                ));
27016                            }
27017                            result.scaling = map
27018                                .next_value::<std::option::Option<crate::model::WorkerPoolScaling>>(
27019                                )?;
27020                        }
27021                        __FieldTag::__observed_generation => {
27022                            if !fields.insert(__FieldTag::__observed_generation) {
27023                                return std::result::Result::Err(A::Error::duplicate_field(
27024                                    "multiple values for observed_generation",
27025                                ));
27026                            }
27027                            struct __With(std::option::Option<i64>);
27028                            impl<'de> serde::de::Deserialize<'de> for __With {
27029                                fn deserialize<D>(
27030                                    deserializer: D,
27031                                ) -> std::result::Result<Self, D::Error>
27032                                where
27033                                    D: serde::de::Deserializer<'de>,
27034                                {
27035                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
27036                                }
27037                            }
27038                            result.observed_generation =
27039                                map.next_value::<__With>()?.0.unwrap_or_default();
27040                        }
27041                        __FieldTag::__terminal_condition => {
27042                            if !fields.insert(__FieldTag::__terminal_condition) {
27043                                return std::result::Result::Err(A::Error::duplicate_field(
27044                                    "multiple values for terminal_condition",
27045                                ));
27046                            }
27047                            result.terminal_condition =
27048                                map.next_value::<std::option::Option<crate::model::Condition>>()?;
27049                        }
27050                        __FieldTag::__conditions => {
27051                            if !fields.insert(__FieldTag::__conditions) {
27052                                return std::result::Result::Err(A::Error::duplicate_field(
27053                                    "multiple values for conditions",
27054                                ));
27055                            }
27056                            result.conditions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Condition>>>()?.unwrap_or_default();
27057                        }
27058                        __FieldTag::__latest_ready_revision => {
27059                            if !fields.insert(__FieldTag::__latest_ready_revision) {
27060                                return std::result::Result::Err(A::Error::duplicate_field(
27061                                    "multiple values for latest_ready_revision",
27062                                ));
27063                            }
27064                            result.latest_ready_revision = map
27065                                .next_value::<std::option::Option<std::string::String>>()?
27066                                .unwrap_or_default();
27067                        }
27068                        __FieldTag::__latest_created_revision => {
27069                            if !fields.insert(__FieldTag::__latest_created_revision) {
27070                                return std::result::Result::Err(A::Error::duplicate_field(
27071                                    "multiple values for latest_created_revision",
27072                                ));
27073                            }
27074                            result.latest_created_revision = map
27075                                .next_value::<std::option::Option<std::string::String>>()?
27076                                .unwrap_or_default();
27077                        }
27078                        __FieldTag::__instance_split_statuses => {
27079                            if !fields.insert(__FieldTag::__instance_split_statuses) {
27080                                return std::result::Result::Err(A::Error::duplicate_field(
27081                                    "multiple values for instance_split_statuses",
27082                                ));
27083                            }
27084                            result.instance_split_statuses = map
27085                                .next_value::<std::option::Option<
27086                                    std::vec::Vec<crate::model::InstanceSplitStatus>,
27087                                >>()?
27088                                .unwrap_or_default();
27089                        }
27090                        __FieldTag::__custom_audiences => {
27091                            if !fields.insert(__FieldTag::__custom_audiences) {
27092                                return std::result::Result::Err(A::Error::duplicate_field(
27093                                    "multiple values for custom_audiences",
27094                                ));
27095                            }
27096                            result.custom_audiences = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
27097                        }
27098                        __FieldTag::__satisfies_pzs => {
27099                            if !fields.insert(__FieldTag::__satisfies_pzs) {
27100                                return std::result::Result::Err(A::Error::duplicate_field(
27101                                    "multiple values for satisfies_pzs",
27102                                ));
27103                            }
27104                            result.satisfies_pzs = map
27105                                .next_value::<std::option::Option<bool>>()?
27106                                .unwrap_or_default();
27107                        }
27108                        __FieldTag::__reconciling => {
27109                            if !fields.insert(__FieldTag::__reconciling) {
27110                                return std::result::Result::Err(A::Error::duplicate_field(
27111                                    "multiple values for reconciling",
27112                                ));
27113                            }
27114                            result.reconciling = map
27115                                .next_value::<std::option::Option<bool>>()?
27116                                .unwrap_or_default();
27117                        }
27118                        __FieldTag::__etag => {
27119                            if !fields.insert(__FieldTag::__etag) {
27120                                return std::result::Result::Err(A::Error::duplicate_field(
27121                                    "multiple values for etag",
27122                                ));
27123                            }
27124                            result.etag = map
27125                                .next_value::<std::option::Option<std::string::String>>()?
27126                                .unwrap_or_default();
27127                        }
27128                        __FieldTag::Unknown(key) => {
27129                            let value = map.next_value::<serde_json::Value>()?;
27130                            result._unknown_fields.insert(key, value);
27131                        }
27132                    }
27133                }
27134                std::result::Result::Ok(result)
27135            }
27136        }
27137        deserializer.deserialize_any(Visitor)
27138    }
27139}
27140
27141#[doc(hidden)]
27142impl serde::ser::Serialize for WorkerPool {
27143    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27144    where
27145        S: serde::ser::Serializer,
27146    {
27147        use serde::ser::SerializeMap;
27148        #[allow(unused_imports)]
27149        use std::option::Option::Some;
27150        let mut state = serializer.serialize_map(std::option::Option::None)?;
27151        if !self.name.is_empty() {
27152            state.serialize_entry("name", &self.name)?;
27153        }
27154        if !self.description.is_empty() {
27155            state.serialize_entry("description", &self.description)?;
27156        }
27157        if !self.uid.is_empty() {
27158            state.serialize_entry("uid", &self.uid)?;
27159        }
27160        if !wkt::internal::is_default(&self.generation) {
27161            struct __With<'a>(&'a i64);
27162            impl<'a> serde::ser::Serialize for __With<'a> {
27163                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27164                where
27165                    S: serde::ser::Serializer,
27166                {
27167                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
27168                }
27169            }
27170            state.serialize_entry("generation", &__With(&self.generation))?;
27171        }
27172        if !self.labels.is_empty() {
27173            state.serialize_entry("labels", &self.labels)?;
27174        }
27175        if !self.annotations.is_empty() {
27176            state.serialize_entry("annotations", &self.annotations)?;
27177        }
27178        if self.create_time.is_some() {
27179            state.serialize_entry("createTime", &self.create_time)?;
27180        }
27181        if self.update_time.is_some() {
27182            state.serialize_entry("updateTime", &self.update_time)?;
27183        }
27184        if self.delete_time.is_some() {
27185            state.serialize_entry("deleteTime", &self.delete_time)?;
27186        }
27187        if self.expire_time.is_some() {
27188            state.serialize_entry("expireTime", &self.expire_time)?;
27189        }
27190        if !self.creator.is_empty() {
27191            state.serialize_entry("creator", &self.creator)?;
27192        }
27193        if !self.last_modifier.is_empty() {
27194            state.serialize_entry("lastModifier", &self.last_modifier)?;
27195        }
27196        if !self.client.is_empty() {
27197            state.serialize_entry("client", &self.client)?;
27198        }
27199        if !self.client_version.is_empty() {
27200            state.serialize_entry("clientVersion", &self.client_version)?;
27201        }
27202        if !wkt::internal::is_default(&self.launch_stage) {
27203            state.serialize_entry("launchStage", &self.launch_stage)?;
27204        }
27205        if self.binary_authorization.is_some() {
27206            state.serialize_entry("binaryAuthorization", &self.binary_authorization)?;
27207        }
27208        if self.template.is_some() {
27209            state.serialize_entry("template", &self.template)?;
27210        }
27211        if !self.instance_splits.is_empty() {
27212            state.serialize_entry("instanceSplits", &self.instance_splits)?;
27213        }
27214        if self.scaling.is_some() {
27215            state.serialize_entry("scaling", &self.scaling)?;
27216        }
27217        if !wkt::internal::is_default(&self.observed_generation) {
27218            struct __With<'a>(&'a i64);
27219            impl<'a> serde::ser::Serialize for __With<'a> {
27220                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27221                where
27222                    S: serde::ser::Serializer,
27223                {
27224                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
27225                }
27226            }
27227            state.serialize_entry("observedGeneration", &__With(&self.observed_generation))?;
27228        }
27229        if self.terminal_condition.is_some() {
27230            state.serialize_entry("terminalCondition", &self.terminal_condition)?;
27231        }
27232        if !self.conditions.is_empty() {
27233            state.serialize_entry("conditions", &self.conditions)?;
27234        }
27235        if !self.latest_ready_revision.is_empty() {
27236            state.serialize_entry("latestReadyRevision", &self.latest_ready_revision)?;
27237        }
27238        if !self.latest_created_revision.is_empty() {
27239            state.serialize_entry("latestCreatedRevision", &self.latest_created_revision)?;
27240        }
27241        if !self.instance_split_statuses.is_empty() {
27242            state.serialize_entry("instanceSplitStatuses", &self.instance_split_statuses)?;
27243        }
27244        if !self.custom_audiences.is_empty() {
27245            state.serialize_entry("customAudiences", &self.custom_audiences)?;
27246        }
27247        if !wkt::internal::is_default(&self.satisfies_pzs) {
27248            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
27249        }
27250        if !wkt::internal::is_default(&self.reconciling) {
27251            state.serialize_entry("reconciling", &self.reconciling)?;
27252        }
27253        if !self.etag.is_empty() {
27254            state.serialize_entry("etag", &self.etag)?;
27255        }
27256        if !self._unknown_fields.is_empty() {
27257            for (key, value) in self._unknown_fields.iter() {
27258                state.serialize_entry(key, &value)?;
27259            }
27260        }
27261        state.end()
27262    }
27263}
27264
27265impl std::fmt::Debug for WorkerPool {
27266    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27267        let mut debug_struct = f.debug_struct("WorkerPool");
27268        debug_struct.field("name", &self.name);
27269        debug_struct.field("description", &self.description);
27270        debug_struct.field("uid", &self.uid);
27271        debug_struct.field("generation", &self.generation);
27272        debug_struct.field("labels", &self.labels);
27273        debug_struct.field("annotations", &self.annotations);
27274        debug_struct.field("create_time", &self.create_time);
27275        debug_struct.field("update_time", &self.update_time);
27276        debug_struct.field("delete_time", &self.delete_time);
27277        debug_struct.field("expire_time", &self.expire_time);
27278        debug_struct.field("creator", &self.creator);
27279        debug_struct.field("last_modifier", &self.last_modifier);
27280        debug_struct.field("client", &self.client);
27281        debug_struct.field("client_version", &self.client_version);
27282        debug_struct.field("launch_stage", &self.launch_stage);
27283        debug_struct.field("binary_authorization", &self.binary_authorization);
27284        debug_struct.field("template", &self.template);
27285        debug_struct.field("instance_splits", &self.instance_splits);
27286        debug_struct.field("scaling", &self.scaling);
27287        debug_struct.field("observed_generation", &self.observed_generation);
27288        debug_struct.field("terminal_condition", &self.terminal_condition);
27289        debug_struct.field("conditions", &self.conditions);
27290        debug_struct.field("latest_ready_revision", &self.latest_ready_revision);
27291        debug_struct.field("latest_created_revision", &self.latest_created_revision);
27292        debug_struct.field("instance_split_statuses", &self.instance_split_statuses);
27293        debug_struct.field("custom_audiences", &self.custom_audiences);
27294        debug_struct.field("satisfies_pzs", &self.satisfies_pzs);
27295        debug_struct.field("reconciling", &self.reconciling);
27296        debug_struct.field("etag", &self.etag);
27297        if !self._unknown_fields.is_empty() {
27298            debug_struct.field("_unknown_fields", &self._unknown_fields);
27299        }
27300        debug_struct.finish()
27301    }
27302}
27303
27304/// WorkerPoolRevisionTemplate describes the data a worker pool revision should
27305/// have when created from a template.
27306#[derive(Clone, Default, PartialEq)]
27307#[non_exhaustive]
27308pub struct WorkerPoolRevisionTemplate {
27309    /// Optional. The unique name for the revision. If this field is omitted, it
27310    /// will be automatically generated based on the WorkerPool name.
27311    pub revision: std::string::String,
27312
27313    /// Optional. Unstructured key value map that can be used to organize and
27314    /// categorize objects. User-provided labels are shared with Google's billing
27315    /// system, so they can be used to filter, or break down billing charges by
27316    /// team, component, environment, state, etc. For more information, visit
27317    /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
27318    /// <https://cloud.google.com/run/docs/configuring/labels>.
27319    ///
27320    /// Cloud Run API v2 does not support labels with `run.googleapis.com`,
27321    /// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
27322    /// namespaces, and they will be rejected. All system labels in v1 now have a
27323    /// corresponding field in v2 WorkerPoolRevisionTemplate.
27324    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
27325
27326    /// Optional. Unstructured key value map that may be set by external tools to
27327    /// store and arbitrary metadata. They are not queryable and should be
27328    /// preserved when modifying objects.
27329    ///
27330    /// Cloud Run API v2 does not support annotations with `run.googleapis.com`,
27331    /// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
27332    /// namespaces, and they will be rejected. All system annotations in v1 now
27333    /// have a corresponding field in v2 WorkerPoolRevisionTemplate.
27334    ///
27335    /// This field follows Kubernetes annotations' namespacing, limits, and
27336    /// rules.
27337    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
27338
27339    /// Optional. VPC Access configuration to use for this Revision. For more
27340    /// information, visit
27341    /// <https://cloud.google.com/run/docs/configuring/connecting-vpc>.
27342    pub vpc_access: std::option::Option<crate::model::VpcAccess>,
27343
27344    /// Optional. Email address of the IAM service account associated with the
27345    /// revision of the service. The service account represents the identity of the
27346    /// running revision, and determines what permissions the revision has. If not
27347    /// provided, the revision will use the project's default service account.
27348    pub service_account: std::string::String,
27349
27350    /// Holds list of the containers that defines the unit of execution for this
27351    /// Revision.
27352    pub containers: std::vec::Vec<crate::model::Container>,
27353
27354    /// Optional. A list of Volumes to make available to containers.
27355    pub volumes: std::vec::Vec<crate::model::Volume>,
27356
27357    /// A reference to a customer managed encryption key (CMEK) to use to encrypt
27358    /// this container image. For more information, go to
27359    /// <https://cloud.google.com/run/docs/securing/using-cmek>
27360    pub encryption_key: std::string::String,
27361
27362    /// Optional. Enables service mesh connectivity.
27363    pub service_mesh: std::option::Option<crate::model::ServiceMesh>,
27364
27365    /// Optional. The action to take if the encryption key is revoked.
27366    pub encryption_key_revocation_action: crate::model::EncryptionKeyRevocationAction,
27367
27368    /// Optional. If encryption_key_revocation_action is SHUTDOWN, the duration
27369    /// before shutting down all instances. The minimum increment is 1 hour.
27370    pub encryption_key_shutdown_duration: std::option::Option<wkt::Duration>,
27371
27372    /// Optional. The node selector for the revision template.
27373    pub node_selector: std::option::Option<crate::model::NodeSelector>,
27374
27375    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27376}
27377
27378impl WorkerPoolRevisionTemplate {
27379    pub fn new() -> Self {
27380        std::default::Default::default()
27381    }
27382
27383    /// Sets the value of [revision][crate::model::WorkerPoolRevisionTemplate::revision].
27384    pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27385        self.revision = v.into();
27386        self
27387    }
27388
27389    /// Sets the value of [labels][crate::model::WorkerPoolRevisionTemplate::labels].
27390    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
27391    where
27392        T: std::iter::IntoIterator<Item = (K, V)>,
27393        K: std::convert::Into<std::string::String>,
27394        V: std::convert::Into<std::string::String>,
27395    {
27396        use std::iter::Iterator;
27397        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
27398        self
27399    }
27400
27401    /// Sets the value of [annotations][crate::model::WorkerPoolRevisionTemplate::annotations].
27402    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
27403    where
27404        T: std::iter::IntoIterator<Item = (K, V)>,
27405        K: std::convert::Into<std::string::String>,
27406        V: std::convert::Into<std::string::String>,
27407    {
27408        use std::iter::Iterator;
27409        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
27410        self
27411    }
27412
27413    /// Sets the value of [vpc_access][crate::model::WorkerPoolRevisionTemplate::vpc_access].
27414    pub fn set_vpc_access<T>(mut self, v: T) -> Self
27415    where
27416        T: std::convert::Into<crate::model::VpcAccess>,
27417    {
27418        self.vpc_access = std::option::Option::Some(v.into());
27419        self
27420    }
27421
27422    /// Sets or clears the value of [vpc_access][crate::model::WorkerPoolRevisionTemplate::vpc_access].
27423    pub fn set_or_clear_vpc_access<T>(mut self, v: std::option::Option<T>) -> Self
27424    where
27425        T: std::convert::Into<crate::model::VpcAccess>,
27426    {
27427        self.vpc_access = v.map(|x| x.into());
27428        self
27429    }
27430
27431    /// Sets the value of [service_account][crate::model::WorkerPoolRevisionTemplate::service_account].
27432    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27433        self.service_account = v.into();
27434        self
27435    }
27436
27437    /// Sets the value of [containers][crate::model::WorkerPoolRevisionTemplate::containers].
27438    pub fn set_containers<T, V>(mut self, v: T) -> Self
27439    where
27440        T: std::iter::IntoIterator<Item = V>,
27441        V: std::convert::Into<crate::model::Container>,
27442    {
27443        use std::iter::Iterator;
27444        self.containers = v.into_iter().map(|i| i.into()).collect();
27445        self
27446    }
27447
27448    /// Sets the value of [volumes][crate::model::WorkerPoolRevisionTemplate::volumes].
27449    pub fn set_volumes<T, V>(mut self, v: T) -> Self
27450    where
27451        T: std::iter::IntoIterator<Item = V>,
27452        V: std::convert::Into<crate::model::Volume>,
27453    {
27454        use std::iter::Iterator;
27455        self.volumes = v.into_iter().map(|i| i.into()).collect();
27456        self
27457    }
27458
27459    /// Sets the value of [encryption_key][crate::model::WorkerPoolRevisionTemplate::encryption_key].
27460    pub fn set_encryption_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27461        self.encryption_key = v.into();
27462        self
27463    }
27464
27465    /// Sets the value of [service_mesh][crate::model::WorkerPoolRevisionTemplate::service_mesh].
27466    pub fn set_service_mesh<T>(mut self, v: T) -> Self
27467    where
27468        T: std::convert::Into<crate::model::ServiceMesh>,
27469    {
27470        self.service_mesh = std::option::Option::Some(v.into());
27471        self
27472    }
27473
27474    /// Sets or clears the value of [service_mesh][crate::model::WorkerPoolRevisionTemplate::service_mesh].
27475    pub fn set_or_clear_service_mesh<T>(mut self, v: std::option::Option<T>) -> Self
27476    where
27477        T: std::convert::Into<crate::model::ServiceMesh>,
27478    {
27479        self.service_mesh = v.map(|x| x.into());
27480        self
27481    }
27482
27483    /// Sets the value of [encryption_key_revocation_action][crate::model::WorkerPoolRevisionTemplate::encryption_key_revocation_action].
27484    pub fn set_encryption_key_revocation_action<
27485        T: std::convert::Into<crate::model::EncryptionKeyRevocationAction>,
27486    >(
27487        mut self,
27488        v: T,
27489    ) -> Self {
27490        self.encryption_key_revocation_action = v.into();
27491        self
27492    }
27493
27494    /// Sets the value of [encryption_key_shutdown_duration][crate::model::WorkerPoolRevisionTemplate::encryption_key_shutdown_duration].
27495    pub fn set_encryption_key_shutdown_duration<T>(mut self, v: T) -> Self
27496    where
27497        T: std::convert::Into<wkt::Duration>,
27498    {
27499        self.encryption_key_shutdown_duration = std::option::Option::Some(v.into());
27500        self
27501    }
27502
27503    /// Sets or clears the value of [encryption_key_shutdown_duration][crate::model::WorkerPoolRevisionTemplate::encryption_key_shutdown_duration].
27504    pub fn set_or_clear_encryption_key_shutdown_duration<T>(
27505        mut self,
27506        v: std::option::Option<T>,
27507    ) -> Self
27508    where
27509        T: std::convert::Into<wkt::Duration>,
27510    {
27511        self.encryption_key_shutdown_duration = v.map(|x| x.into());
27512        self
27513    }
27514
27515    /// Sets the value of [node_selector][crate::model::WorkerPoolRevisionTemplate::node_selector].
27516    pub fn set_node_selector<T>(mut self, v: T) -> Self
27517    where
27518        T: std::convert::Into<crate::model::NodeSelector>,
27519    {
27520        self.node_selector = std::option::Option::Some(v.into());
27521        self
27522    }
27523
27524    /// Sets or clears the value of [node_selector][crate::model::WorkerPoolRevisionTemplate::node_selector].
27525    pub fn set_or_clear_node_selector<T>(mut self, v: std::option::Option<T>) -> Self
27526    where
27527        T: std::convert::Into<crate::model::NodeSelector>,
27528    {
27529        self.node_selector = v.map(|x| x.into());
27530        self
27531    }
27532}
27533
27534impl wkt::message::Message for WorkerPoolRevisionTemplate {
27535    fn typename() -> &'static str {
27536        "type.googleapis.com/google.cloud.run.v2.WorkerPoolRevisionTemplate"
27537    }
27538}
27539
27540#[doc(hidden)]
27541impl<'de> serde::de::Deserialize<'de> for WorkerPoolRevisionTemplate {
27542    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27543    where
27544        D: serde::Deserializer<'de>,
27545    {
27546        #[allow(non_camel_case_types)]
27547        #[doc(hidden)]
27548        #[derive(PartialEq, Eq, Hash)]
27549        enum __FieldTag {
27550            __revision,
27551            __labels,
27552            __annotations,
27553            __vpc_access,
27554            __service_account,
27555            __containers,
27556            __volumes,
27557            __encryption_key,
27558            __service_mesh,
27559            __encryption_key_revocation_action,
27560            __encryption_key_shutdown_duration,
27561            __node_selector,
27562            Unknown(std::string::String),
27563        }
27564        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
27565            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27566            where
27567                D: serde::Deserializer<'de>,
27568            {
27569                struct Visitor;
27570                impl<'de> serde::de::Visitor<'de> for Visitor {
27571                    type Value = __FieldTag;
27572                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27573                        formatter.write_str("a field name for WorkerPoolRevisionTemplate")
27574                    }
27575                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
27576                    where
27577                        E: serde::de::Error,
27578                    {
27579                        use std::result::Result::Ok;
27580                        use std::string::ToString;
27581                        match value {
27582                            "revision" => Ok(__FieldTag::__revision),
27583                            "labels" => Ok(__FieldTag::__labels),
27584                            "annotations" => Ok(__FieldTag::__annotations),
27585                            "vpcAccess" => Ok(__FieldTag::__vpc_access),
27586                            "vpc_access" => Ok(__FieldTag::__vpc_access),
27587                            "serviceAccount" => Ok(__FieldTag::__service_account),
27588                            "service_account" => Ok(__FieldTag::__service_account),
27589                            "containers" => Ok(__FieldTag::__containers),
27590                            "volumes" => Ok(__FieldTag::__volumes),
27591                            "encryptionKey" => Ok(__FieldTag::__encryption_key),
27592                            "encryption_key" => Ok(__FieldTag::__encryption_key),
27593                            "serviceMesh" => Ok(__FieldTag::__service_mesh),
27594                            "service_mesh" => Ok(__FieldTag::__service_mesh),
27595                            "encryptionKeyRevocationAction" => {
27596                                Ok(__FieldTag::__encryption_key_revocation_action)
27597                            }
27598                            "encryption_key_revocation_action" => {
27599                                Ok(__FieldTag::__encryption_key_revocation_action)
27600                            }
27601                            "encryptionKeyShutdownDuration" => {
27602                                Ok(__FieldTag::__encryption_key_shutdown_duration)
27603                            }
27604                            "encryption_key_shutdown_duration" => {
27605                                Ok(__FieldTag::__encryption_key_shutdown_duration)
27606                            }
27607                            "nodeSelector" => Ok(__FieldTag::__node_selector),
27608                            "node_selector" => Ok(__FieldTag::__node_selector),
27609                            _ => Ok(__FieldTag::Unknown(value.to_string())),
27610                        }
27611                    }
27612                }
27613                deserializer.deserialize_identifier(Visitor)
27614            }
27615        }
27616        struct Visitor;
27617        impl<'de> serde::de::Visitor<'de> for Visitor {
27618            type Value = WorkerPoolRevisionTemplate;
27619            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
27620                formatter.write_str("struct WorkerPoolRevisionTemplate")
27621            }
27622            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
27623            where
27624                A: serde::de::MapAccess<'de>,
27625            {
27626                #[allow(unused_imports)]
27627                use serde::de::Error;
27628                use std::option::Option::Some;
27629                let mut fields = std::collections::HashSet::new();
27630                let mut result = Self::Value::new();
27631                while let Some(tag) = map.next_key::<__FieldTag>()? {
27632                    #[allow(clippy::match_single_binding)]
27633                    match tag {
27634                        __FieldTag::__revision => {
27635                            if !fields.insert(__FieldTag::__revision) {
27636                                return std::result::Result::Err(A::Error::duplicate_field(
27637                                    "multiple values for revision",
27638                                ));
27639                            }
27640                            result.revision = map
27641                                .next_value::<std::option::Option<std::string::String>>()?
27642                                .unwrap_or_default();
27643                        }
27644                        __FieldTag::__labels => {
27645                            if !fields.insert(__FieldTag::__labels) {
27646                                return std::result::Result::Err(A::Error::duplicate_field(
27647                                    "multiple values for labels",
27648                                ));
27649                            }
27650                            result.labels = map
27651                                .next_value::<std::option::Option<
27652                                    std::collections::HashMap<
27653                                        std::string::String,
27654                                        std::string::String,
27655                                    >,
27656                                >>()?
27657                                .unwrap_or_default();
27658                        }
27659                        __FieldTag::__annotations => {
27660                            if !fields.insert(__FieldTag::__annotations) {
27661                                return std::result::Result::Err(A::Error::duplicate_field(
27662                                    "multiple values for annotations",
27663                                ));
27664                            }
27665                            result.annotations = map
27666                                .next_value::<std::option::Option<
27667                                    std::collections::HashMap<
27668                                        std::string::String,
27669                                        std::string::String,
27670                                    >,
27671                                >>()?
27672                                .unwrap_or_default();
27673                        }
27674                        __FieldTag::__vpc_access => {
27675                            if !fields.insert(__FieldTag::__vpc_access) {
27676                                return std::result::Result::Err(A::Error::duplicate_field(
27677                                    "multiple values for vpc_access",
27678                                ));
27679                            }
27680                            result.vpc_access =
27681                                map.next_value::<std::option::Option<crate::model::VpcAccess>>()?;
27682                        }
27683                        __FieldTag::__service_account => {
27684                            if !fields.insert(__FieldTag::__service_account) {
27685                                return std::result::Result::Err(A::Error::duplicate_field(
27686                                    "multiple values for service_account",
27687                                ));
27688                            }
27689                            result.service_account = map
27690                                .next_value::<std::option::Option<std::string::String>>()?
27691                                .unwrap_or_default();
27692                        }
27693                        __FieldTag::__containers => {
27694                            if !fields.insert(__FieldTag::__containers) {
27695                                return std::result::Result::Err(A::Error::duplicate_field(
27696                                    "multiple values for containers",
27697                                ));
27698                            }
27699                            result.containers = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Container>>>()?.unwrap_or_default();
27700                        }
27701                        __FieldTag::__volumes => {
27702                            if !fields.insert(__FieldTag::__volumes) {
27703                                return std::result::Result::Err(A::Error::duplicate_field(
27704                                    "multiple values for volumes",
27705                                ));
27706                            }
27707                            result.volumes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Volume>>>()?.unwrap_or_default();
27708                        }
27709                        __FieldTag::__encryption_key => {
27710                            if !fields.insert(__FieldTag::__encryption_key) {
27711                                return std::result::Result::Err(A::Error::duplicate_field(
27712                                    "multiple values for encryption_key",
27713                                ));
27714                            }
27715                            result.encryption_key = map
27716                                .next_value::<std::option::Option<std::string::String>>()?
27717                                .unwrap_or_default();
27718                        }
27719                        __FieldTag::__service_mesh => {
27720                            if !fields.insert(__FieldTag::__service_mesh) {
27721                                return std::result::Result::Err(A::Error::duplicate_field(
27722                                    "multiple values for service_mesh",
27723                                ));
27724                            }
27725                            result.service_mesh =
27726                                map.next_value::<std::option::Option<crate::model::ServiceMesh>>()?;
27727                        }
27728                        __FieldTag::__encryption_key_revocation_action => {
27729                            if !fields.insert(__FieldTag::__encryption_key_revocation_action) {
27730                                return std::result::Result::Err(A::Error::duplicate_field(
27731                                    "multiple values for encryption_key_revocation_action",
27732                                ));
27733                            }
27734                            result.encryption_key_revocation_action =
27735                                map.next_value::<std::option::Option<
27736                                    crate::model::EncryptionKeyRevocationAction,
27737                                >>()?
27738                                .unwrap_or_default();
27739                        }
27740                        __FieldTag::__encryption_key_shutdown_duration => {
27741                            if !fields.insert(__FieldTag::__encryption_key_shutdown_duration) {
27742                                return std::result::Result::Err(A::Error::duplicate_field(
27743                                    "multiple values for encryption_key_shutdown_duration",
27744                                ));
27745                            }
27746                            result.encryption_key_shutdown_duration =
27747                                map.next_value::<std::option::Option<wkt::Duration>>()?;
27748                        }
27749                        __FieldTag::__node_selector => {
27750                            if !fields.insert(__FieldTag::__node_selector) {
27751                                return std::result::Result::Err(A::Error::duplicate_field(
27752                                    "multiple values for node_selector",
27753                                ));
27754                            }
27755                            result.node_selector = map
27756                                .next_value::<std::option::Option<crate::model::NodeSelector>>()?;
27757                        }
27758                        __FieldTag::Unknown(key) => {
27759                            let value = map.next_value::<serde_json::Value>()?;
27760                            result._unknown_fields.insert(key, value);
27761                        }
27762                    }
27763                }
27764                std::result::Result::Ok(result)
27765            }
27766        }
27767        deserializer.deserialize_any(Visitor)
27768    }
27769}
27770
27771#[doc(hidden)]
27772impl serde::ser::Serialize for WorkerPoolRevisionTemplate {
27773    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27774    where
27775        S: serde::ser::Serializer,
27776    {
27777        use serde::ser::SerializeMap;
27778        #[allow(unused_imports)]
27779        use std::option::Option::Some;
27780        let mut state = serializer.serialize_map(std::option::Option::None)?;
27781        if !self.revision.is_empty() {
27782            state.serialize_entry("revision", &self.revision)?;
27783        }
27784        if !self.labels.is_empty() {
27785            state.serialize_entry("labels", &self.labels)?;
27786        }
27787        if !self.annotations.is_empty() {
27788            state.serialize_entry("annotations", &self.annotations)?;
27789        }
27790        if self.vpc_access.is_some() {
27791            state.serialize_entry("vpcAccess", &self.vpc_access)?;
27792        }
27793        if !self.service_account.is_empty() {
27794            state.serialize_entry("serviceAccount", &self.service_account)?;
27795        }
27796        if !self.containers.is_empty() {
27797            state.serialize_entry("containers", &self.containers)?;
27798        }
27799        if !self.volumes.is_empty() {
27800            state.serialize_entry("volumes", &self.volumes)?;
27801        }
27802        if !self.encryption_key.is_empty() {
27803            state.serialize_entry("encryptionKey", &self.encryption_key)?;
27804        }
27805        if self.service_mesh.is_some() {
27806            state.serialize_entry("serviceMesh", &self.service_mesh)?;
27807        }
27808        if !wkt::internal::is_default(&self.encryption_key_revocation_action) {
27809            state.serialize_entry(
27810                "encryptionKeyRevocationAction",
27811                &self.encryption_key_revocation_action,
27812            )?;
27813        }
27814        if self.encryption_key_shutdown_duration.is_some() {
27815            state.serialize_entry(
27816                "encryptionKeyShutdownDuration",
27817                &self.encryption_key_shutdown_duration,
27818            )?;
27819        }
27820        if self.node_selector.is_some() {
27821            state.serialize_entry("nodeSelector", &self.node_selector)?;
27822        }
27823        if !self._unknown_fields.is_empty() {
27824            for (key, value) in self._unknown_fields.iter() {
27825                state.serialize_entry(key, &value)?;
27826            }
27827        }
27828        state.end()
27829    }
27830}
27831
27832impl std::fmt::Debug for WorkerPoolRevisionTemplate {
27833    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27834        let mut debug_struct = f.debug_struct("WorkerPoolRevisionTemplate");
27835        debug_struct.field("revision", &self.revision);
27836        debug_struct.field("labels", &self.labels);
27837        debug_struct.field("annotations", &self.annotations);
27838        debug_struct.field("vpc_access", &self.vpc_access);
27839        debug_struct.field("service_account", &self.service_account);
27840        debug_struct.field("containers", &self.containers);
27841        debug_struct.field("volumes", &self.volumes);
27842        debug_struct.field("encryption_key", &self.encryption_key);
27843        debug_struct.field("service_mesh", &self.service_mesh);
27844        debug_struct.field(
27845            "encryption_key_revocation_action",
27846            &self.encryption_key_revocation_action,
27847        );
27848        debug_struct.field(
27849            "encryption_key_shutdown_duration",
27850            &self.encryption_key_shutdown_duration,
27851        );
27852        debug_struct.field("node_selector", &self.node_selector);
27853        if !self._unknown_fields.is_empty() {
27854            debug_struct.field("_unknown_fields", &self._unknown_fields);
27855        }
27856        debug_struct.finish()
27857    }
27858}
27859
27860/// The type of instance split allocation.
27861///
27862/// # Working with unknown values
27863///
27864/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27865/// additional enum variants at any time. Adding new variants is not considered
27866/// a breaking change. Applications should write their code in anticipation of:
27867///
27868/// - New values appearing in future releases of the client library, **and**
27869/// - New values received dynamically, without application changes.
27870///
27871/// Please consult the [Working with enums] section in the user guide for some
27872/// guidelines.
27873///
27874/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27875#[derive(Clone, Debug, PartialEq)]
27876#[non_exhaustive]
27877pub enum InstanceSplitAllocationType {
27878    /// Unspecified instance allocation type.
27879    Unspecified,
27880    /// Allocates instances to the Service's latest ready Revision.
27881    Latest,
27882    /// Allocates instances to a Revision by name.
27883    Revision,
27884    /// If set, the enum was initialized with an unknown value.
27885    ///
27886    /// Applications can examine the value using [InstanceSplitAllocationType::value] or
27887    /// [InstanceSplitAllocationType::name].
27888    UnknownValue(instance_split_allocation_type::UnknownValue),
27889}
27890
27891#[doc(hidden)]
27892pub mod instance_split_allocation_type {
27893    #[allow(unused_imports)]
27894    use super::*;
27895    #[derive(Clone, Debug, PartialEq)]
27896    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27897}
27898
27899impl InstanceSplitAllocationType {
27900    /// Gets the enum value.
27901    ///
27902    /// Returns `None` if the enum contains an unknown value deserialized from
27903    /// the string representation of enums.
27904    pub fn value(&self) -> std::option::Option<i32> {
27905        match self {
27906            Self::Unspecified => std::option::Option::Some(0),
27907            Self::Latest => std::option::Option::Some(1),
27908            Self::Revision => std::option::Option::Some(2),
27909            Self::UnknownValue(u) => u.0.value(),
27910        }
27911    }
27912
27913    /// Gets the enum value as a string.
27914    ///
27915    /// Returns `None` if the enum contains an unknown value deserialized from
27916    /// the integer representation of enums.
27917    pub fn name(&self) -> std::option::Option<&str> {
27918        match self {
27919            Self::Unspecified => {
27920                std::option::Option::Some("INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED")
27921            }
27922            Self::Latest => std::option::Option::Some("INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST"),
27923            Self::Revision => std::option::Option::Some("INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION"),
27924            Self::UnknownValue(u) => u.0.name(),
27925        }
27926    }
27927}
27928
27929impl std::default::Default for InstanceSplitAllocationType {
27930    fn default() -> Self {
27931        use std::convert::From;
27932        Self::from(0)
27933    }
27934}
27935
27936impl std::fmt::Display for InstanceSplitAllocationType {
27937    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27938        wkt::internal::display_enum(f, self.name(), self.value())
27939    }
27940}
27941
27942impl std::convert::From<i32> for InstanceSplitAllocationType {
27943    fn from(value: i32) -> Self {
27944        match value {
27945            0 => Self::Unspecified,
27946            1 => Self::Latest,
27947            2 => Self::Revision,
27948            _ => Self::UnknownValue(instance_split_allocation_type::UnknownValue(
27949                wkt::internal::UnknownEnumValue::Integer(value),
27950            )),
27951        }
27952    }
27953}
27954
27955impl std::convert::From<&str> for InstanceSplitAllocationType {
27956    fn from(value: &str) -> Self {
27957        use std::string::ToString;
27958        match value {
27959            "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" => Self::Unspecified,
27960            "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST" => Self::Latest,
27961            "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION" => Self::Revision,
27962            _ => Self::UnknownValue(instance_split_allocation_type::UnknownValue(
27963                wkt::internal::UnknownEnumValue::String(value.to_string()),
27964            )),
27965        }
27966    }
27967}
27968
27969impl serde::ser::Serialize for InstanceSplitAllocationType {
27970    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27971    where
27972        S: serde::Serializer,
27973    {
27974        match self {
27975            Self::Unspecified => serializer.serialize_i32(0),
27976            Self::Latest => serializer.serialize_i32(1),
27977            Self::Revision => serializer.serialize_i32(2),
27978            Self::UnknownValue(u) => u.0.serialize(serializer),
27979        }
27980    }
27981}
27982
27983impl<'de> serde::de::Deserialize<'de> for InstanceSplitAllocationType {
27984    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27985    where
27986        D: serde::Deserializer<'de>,
27987    {
27988        deserializer.deserialize_any(
27989            wkt::internal::EnumVisitor::<InstanceSplitAllocationType>::new(
27990                ".google.cloud.run.v2.InstanceSplitAllocationType",
27991            ),
27992        )
27993    }
27994}
27995
27996/// The type of instance allocation.
27997///
27998/// # Working with unknown values
27999///
28000/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28001/// additional enum variants at any time. Adding new variants is not considered
28002/// a breaking change. Applications should write their code in anticipation of:
28003///
28004/// - New values appearing in future releases of the client library, **and**
28005/// - New values received dynamically, without application changes.
28006///
28007/// Please consult the [Working with enums] section in the user guide for some
28008/// guidelines.
28009///
28010/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28011#[derive(Clone, Debug, PartialEq)]
28012#[non_exhaustive]
28013pub enum TrafficTargetAllocationType {
28014    /// Unspecified instance allocation type.
28015    Unspecified,
28016    /// Allocates instances to the Service's latest ready Revision.
28017    Latest,
28018    /// Allocates instances to a Revision by name.
28019    Revision,
28020    /// If set, the enum was initialized with an unknown value.
28021    ///
28022    /// Applications can examine the value using [TrafficTargetAllocationType::value] or
28023    /// [TrafficTargetAllocationType::name].
28024    UnknownValue(traffic_target_allocation_type::UnknownValue),
28025}
28026
28027#[doc(hidden)]
28028pub mod traffic_target_allocation_type {
28029    #[allow(unused_imports)]
28030    use super::*;
28031    #[derive(Clone, Debug, PartialEq)]
28032    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28033}
28034
28035impl TrafficTargetAllocationType {
28036    /// Gets the enum value.
28037    ///
28038    /// Returns `None` if the enum contains an unknown value deserialized from
28039    /// the string representation of enums.
28040    pub fn value(&self) -> std::option::Option<i32> {
28041        match self {
28042            Self::Unspecified => std::option::Option::Some(0),
28043            Self::Latest => std::option::Option::Some(1),
28044            Self::Revision => std::option::Option::Some(2),
28045            Self::UnknownValue(u) => u.0.value(),
28046        }
28047    }
28048
28049    /// Gets the enum value as a string.
28050    ///
28051    /// Returns `None` if the enum contains an unknown value deserialized from
28052    /// the integer representation of enums.
28053    pub fn name(&self) -> std::option::Option<&str> {
28054        match self {
28055            Self::Unspecified => {
28056                std::option::Option::Some("TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED")
28057            }
28058            Self::Latest => std::option::Option::Some("TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"),
28059            Self::Revision => std::option::Option::Some("TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"),
28060            Self::UnknownValue(u) => u.0.name(),
28061        }
28062    }
28063}
28064
28065impl std::default::Default for TrafficTargetAllocationType {
28066    fn default() -> Self {
28067        use std::convert::From;
28068        Self::from(0)
28069    }
28070}
28071
28072impl std::fmt::Display for TrafficTargetAllocationType {
28073    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28074        wkt::internal::display_enum(f, self.name(), self.value())
28075    }
28076}
28077
28078impl std::convert::From<i32> for TrafficTargetAllocationType {
28079    fn from(value: i32) -> Self {
28080        match value {
28081            0 => Self::Unspecified,
28082            1 => Self::Latest,
28083            2 => Self::Revision,
28084            _ => Self::UnknownValue(traffic_target_allocation_type::UnknownValue(
28085                wkt::internal::UnknownEnumValue::Integer(value),
28086            )),
28087        }
28088    }
28089}
28090
28091impl std::convert::From<&str> for TrafficTargetAllocationType {
28092    fn from(value: &str) -> Self {
28093        use std::string::ToString;
28094        match value {
28095            "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" => Self::Unspecified,
28096            "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST" => Self::Latest,
28097            "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION" => Self::Revision,
28098            _ => Self::UnknownValue(traffic_target_allocation_type::UnknownValue(
28099                wkt::internal::UnknownEnumValue::String(value.to_string()),
28100            )),
28101        }
28102    }
28103}
28104
28105impl serde::ser::Serialize for TrafficTargetAllocationType {
28106    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28107    where
28108        S: serde::Serializer,
28109    {
28110        match self {
28111            Self::Unspecified => serializer.serialize_i32(0),
28112            Self::Latest => serializer.serialize_i32(1),
28113            Self::Revision => serializer.serialize_i32(2),
28114            Self::UnknownValue(u) => u.0.serialize(serializer),
28115        }
28116    }
28117}
28118
28119impl<'de> serde::de::Deserialize<'de> for TrafficTargetAllocationType {
28120    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28121    where
28122        D: serde::Deserializer<'de>,
28123    {
28124        deserializer.deserialize_any(
28125            wkt::internal::EnumVisitor::<TrafficTargetAllocationType>::new(
28126                ".google.cloud.run.v2.TrafficTargetAllocationType",
28127            ),
28128        )
28129    }
28130}
28131
28132/// Allowed ingress traffic for the Container.
28133///
28134/// # Working with unknown values
28135///
28136/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28137/// additional enum variants at any time. Adding new variants is not considered
28138/// a breaking change. Applications should write their code in anticipation of:
28139///
28140/// - New values appearing in future releases of the client library, **and**
28141/// - New values received dynamically, without application changes.
28142///
28143/// Please consult the [Working with enums] section in the user guide for some
28144/// guidelines.
28145///
28146/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28147#[derive(Clone, Debug, PartialEq)]
28148#[non_exhaustive]
28149pub enum IngressTraffic {
28150    /// Unspecified
28151    Unspecified,
28152    /// All inbound traffic is allowed.
28153    All,
28154    /// Only internal traffic is allowed.
28155    InternalOnly,
28156    /// Both internal and Google Cloud Load Balancer traffic is allowed.
28157    InternalLoadBalancer,
28158    /// No ingress traffic is allowed.
28159    None,
28160    /// If set, the enum was initialized with an unknown value.
28161    ///
28162    /// Applications can examine the value using [IngressTraffic::value] or
28163    /// [IngressTraffic::name].
28164    UnknownValue(ingress_traffic::UnknownValue),
28165}
28166
28167#[doc(hidden)]
28168pub mod ingress_traffic {
28169    #[allow(unused_imports)]
28170    use super::*;
28171    #[derive(Clone, Debug, PartialEq)]
28172    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28173}
28174
28175impl IngressTraffic {
28176    /// Gets the enum value.
28177    ///
28178    /// Returns `None` if the enum contains an unknown value deserialized from
28179    /// the string representation of enums.
28180    pub fn value(&self) -> std::option::Option<i32> {
28181        match self {
28182            Self::Unspecified => std::option::Option::Some(0),
28183            Self::All => std::option::Option::Some(1),
28184            Self::InternalOnly => std::option::Option::Some(2),
28185            Self::InternalLoadBalancer => std::option::Option::Some(3),
28186            Self::None => std::option::Option::Some(4),
28187            Self::UnknownValue(u) => u.0.value(),
28188        }
28189    }
28190
28191    /// Gets the enum value as a string.
28192    ///
28193    /// Returns `None` if the enum contains an unknown value deserialized from
28194    /// the integer representation of enums.
28195    pub fn name(&self) -> std::option::Option<&str> {
28196        match self {
28197            Self::Unspecified => std::option::Option::Some("INGRESS_TRAFFIC_UNSPECIFIED"),
28198            Self::All => std::option::Option::Some("INGRESS_TRAFFIC_ALL"),
28199            Self::InternalOnly => std::option::Option::Some("INGRESS_TRAFFIC_INTERNAL_ONLY"),
28200            Self::InternalLoadBalancer => {
28201                std::option::Option::Some("INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER")
28202            }
28203            Self::None => std::option::Option::Some("INGRESS_TRAFFIC_NONE"),
28204            Self::UnknownValue(u) => u.0.name(),
28205        }
28206    }
28207}
28208
28209impl std::default::Default for IngressTraffic {
28210    fn default() -> Self {
28211        use std::convert::From;
28212        Self::from(0)
28213    }
28214}
28215
28216impl std::fmt::Display for IngressTraffic {
28217    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28218        wkt::internal::display_enum(f, self.name(), self.value())
28219    }
28220}
28221
28222impl std::convert::From<i32> for IngressTraffic {
28223    fn from(value: i32) -> Self {
28224        match value {
28225            0 => Self::Unspecified,
28226            1 => Self::All,
28227            2 => Self::InternalOnly,
28228            3 => Self::InternalLoadBalancer,
28229            4 => Self::None,
28230            _ => Self::UnknownValue(ingress_traffic::UnknownValue(
28231                wkt::internal::UnknownEnumValue::Integer(value),
28232            )),
28233        }
28234    }
28235}
28236
28237impl std::convert::From<&str> for IngressTraffic {
28238    fn from(value: &str) -> Self {
28239        use std::string::ToString;
28240        match value {
28241            "INGRESS_TRAFFIC_UNSPECIFIED" => Self::Unspecified,
28242            "INGRESS_TRAFFIC_ALL" => Self::All,
28243            "INGRESS_TRAFFIC_INTERNAL_ONLY" => Self::InternalOnly,
28244            "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER" => Self::InternalLoadBalancer,
28245            "INGRESS_TRAFFIC_NONE" => Self::None,
28246            _ => Self::UnknownValue(ingress_traffic::UnknownValue(
28247                wkt::internal::UnknownEnumValue::String(value.to_string()),
28248            )),
28249        }
28250    }
28251}
28252
28253impl serde::ser::Serialize for IngressTraffic {
28254    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28255    where
28256        S: serde::Serializer,
28257    {
28258        match self {
28259            Self::Unspecified => serializer.serialize_i32(0),
28260            Self::All => serializer.serialize_i32(1),
28261            Self::InternalOnly => serializer.serialize_i32(2),
28262            Self::InternalLoadBalancer => serializer.serialize_i32(3),
28263            Self::None => serializer.serialize_i32(4),
28264            Self::UnknownValue(u) => u.0.serialize(serializer),
28265        }
28266    }
28267}
28268
28269impl<'de> serde::de::Deserialize<'de> for IngressTraffic {
28270    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28271    where
28272        D: serde::Deserializer<'de>,
28273    {
28274        deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngressTraffic>::new(
28275            ".google.cloud.run.v2.IngressTraffic",
28276        ))
28277    }
28278}
28279
28280/// Alternatives for execution environments.
28281///
28282/// # Working with unknown values
28283///
28284/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28285/// additional enum variants at any time. Adding new variants is not considered
28286/// a breaking change. Applications should write their code in anticipation of:
28287///
28288/// - New values appearing in future releases of the client library, **and**
28289/// - New values received dynamically, without application changes.
28290///
28291/// Please consult the [Working with enums] section in the user guide for some
28292/// guidelines.
28293///
28294/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28295#[derive(Clone, Debug, PartialEq)]
28296#[non_exhaustive]
28297pub enum ExecutionEnvironment {
28298    /// Unspecified
28299    Unspecified,
28300    /// Uses the First Generation environment.
28301    Gen1,
28302    /// Uses Second Generation environment.
28303    Gen2,
28304    /// If set, the enum was initialized with an unknown value.
28305    ///
28306    /// Applications can examine the value using [ExecutionEnvironment::value] or
28307    /// [ExecutionEnvironment::name].
28308    UnknownValue(execution_environment::UnknownValue),
28309}
28310
28311#[doc(hidden)]
28312pub mod execution_environment {
28313    #[allow(unused_imports)]
28314    use super::*;
28315    #[derive(Clone, Debug, PartialEq)]
28316    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28317}
28318
28319impl ExecutionEnvironment {
28320    /// Gets the enum value.
28321    ///
28322    /// Returns `None` if the enum contains an unknown value deserialized from
28323    /// the string representation of enums.
28324    pub fn value(&self) -> std::option::Option<i32> {
28325        match self {
28326            Self::Unspecified => std::option::Option::Some(0),
28327            Self::Gen1 => std::option::Option::Some(1),
28328            Self::Gen2 => std::option::Option::Some(2),
28329            Self::UnknownValue(u) => u.0.value(),
28330        }
28331    }
28332
28333    /// Gets the enum value as a string.
28334    ///
28335    /// Returns `None` if the enum contains an unknown value deserialized from
28336    /// the integer representation of enums.
28337    pub fn name(&self) -> std::option::Option<&str> {
28338        match self {
28339            Self::Unspecified => std::option::Option::Some("EXECUTION_ENVIRONMENT_UNSPECIFIED"),
28340            Self::Gen1 => std::option::Option::Some("EXECUTION_ENVIRONMENT_GEN1"),
28341            Self::Gen2 => std::option::Option::Some("EXECUTION_ENVIRONMENT_GEN2"),
28342            Self::UnknownValue(u) => u.0.name(),
28343        }
28344    }
28345}
28346
28347impl std::default::Default for ExecutionEnvironment {
28348    fn default() -> Self {
28349        use std::convert::From;
28350        Self::from(0)
28351    }
28352}
28353
28354impl std::fmt::Display for ExecutionEnvironment {
28355    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28356        wkt::internal::display_enum(f, self.name(), self.value())
28357    }
28358}
28359
28360impl std::convert::From<i32> for ExecutionEnvironment {
28361    fn from(value: i32) -> Self {
28362        match value {
28363            0 => Self::Unspecified,
28364            1 => Self::Gen1,
28365            2 => Self::Gen2,
28366            _ => Self::UnknownValue(execution_environment::UnknownValue(
28367                wkt::internal::UnknownEnumValue::Integer(value),
28368            )),
28369        }
28370    }
28371}
28372
28373impl std::convert::From<&str> for ExecutionEnvironment {
28374    fn from(value: &str) -> Self {
28375        use std::string::ToString;
28376        match value {
28377            "EXECUTION_ENVIRONMENT_UNSPECIFIED" => Self::Unspecified,
28378            "EXECUTION_ENVIRONMENT_GEN1" => Self::Gen1,
28379            "EXECUTION_ENVIRONMENT_GEN2" => Self::Gen2,
28380            _ => Self::UnknownValue(execution_environment::UnknownValue(
28381                wkt::internal::UnknownEnumValue::String(value.to_string()),
28382            )),
28383        }
28384    }
28385}
28386
28387impl serde::ser::Serialize for ExecutionEnvironment {
28388    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28389    where
28390        S: serde::Serializer,
28391    {
28392        match self {
28393            Self::Unspecified => serializer.serialize_i32(0),
28394            Self::Gen1 => serializer.serialize_i32(1),
28395            Self::Gen2 => serializer.serialize_i32(2),
28396            Self::UnknownValue(u) => u.0.serialize(serializer),
28397        }
28398    }
28399}
28400
28401impl<'de> serde::de::Deserialize<'de> for ExecutionEnvironment {
28402    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28403    where
28404        D: serde::Deserializer<'de>,
28405    {
28406        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionEnvironment>::new(
28407            ".google.cloud.run.v2.ExecutionEnvironment",
28408        ))
28409    }
28410}
28411
28412/// Specifies behavior if an encryption key used by a resource is revoked.
28413///
28414/// # Working with unknown values
28415///
28416/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28417/// additional enum variants at any time. Adding new variants is not considered
28418/// a breaking change. Applications should write their code in anticipation of:
28419///
28420/// - New values appearing in future releases of the client library, **and**
28421/// - New values received dynamically, without application changes.
28422///
28423/// Please consult the [Working with enums] section in the user guide for some
28424/// guidelines.
28425///
28426/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28427#[derive(Clone, Debug, PartialEq)]
28428#[non_exhaustive]
28429pub enum EncryptionKeyRevocationAction {
28430    /// Unspecified
28431    Unspecified,
28432    /// Prevents the creation of new instances.
28433    PreventNew,
28434    /// Shuts down existing instances, and prevents creation of new ones.
28435    Shutdown,
28436    /// If set, the enum was initialized with an unknown value.
28437    ///
28438    /// Applications can examine the value using [EncryptionKeyRevocationAction::value] or
28439    /// [EncryptionKeyRevocationAction::name].
28440    UnknownValue(encryption_key_revocation_action::UnknownValue),
28441}
28442
28443#[doc(hidden)]
28444pub mod encryption_key_revocation_action {
28445    #[allow(unused_imports)]
28446    use super::*;
28447    #[derive(Clone, Debug, PartialEq)]
28448    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28449}
28450
28451impl EncryptionKeyRevocationAction {
28452    /// Gets the enum value.
28453    ///
28454    /// Returns `None` if the enum contains an unknown value deserialized from
28455    /// the string representation of enums.
28456    pub fn value(&self) -> std::option::Option<i32> {
28457        match self {
28458            Self::Unspecified => std::option::Option::Some(0),
28459            Self::PreventNew => std::option::Option::Some(1),
28460            Self::Shutdown => std::option::Option::Some(2),
28461            Self::UnknownValue(u) => u.0.value(),
28462        }
28463    }
28464
28465    /// Gets the enum value as a string.
28466    ///
28467    /// Returns `None` if the enum contains an unknown value deserialized from
28468    /// the integer representation of enums.
28469    pub fn name(&self) -> std::option::Option<&str> {
28470        match self {
28471            Self::Unspecified => {
28472                std::option::Option::Some("ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED")
28473            }
28474            Self::PreventNew => std::option::Option::Some("PREVENT_NEW"),
28475            Self::Shutdown => std::option::Option::Some("SHUTDOWN"),
28476            Self::UnknownValue(u) => u.0.name(),
28477        }
28478    }
28479}
28480
28481impl std::default::Default for EncryptionKeyRevocationAction {
28482    fn default() -> Self {
28483        use std::convert::From;
28484        Self::from(0)
28485    }
28486}
28487
28488impl std::fmt::Display for EncryptionKeyRevocationAction {
28489    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28490        wkt::internal::display_enum(f, self.name(), self.value())
28491    }
28492}
28493
28494impl std::convert::From<i32> for EncryptionKeyRevocationAction {
28495    fn from(value: i32) -> Self {
28496        match value {
28497            0 => Self::Unspecified,
28498            1 => Self::PreventNew,
28499            2 => Self::Shutdown,
28500            _ => Self::UnknownValue(encryption_key_revocation_action::UnknownValue(
28501                wkt::internal::UnknownEnumValue::Integer(value),
28502            )),
28503        }
28504    }
28505}
28506
28507impl std::convert::From<&str> for EncryptionKeyRevocationAction {
28508    fn from(value: &str) -> Self {
28509        use std::string::ToString;
28510        match value {
28511            "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" => Self::Unspecified,
28512            "PREVENT_NEW" => Self::PreventNew,
28513            "SHUTDOWN" => Self::Shutdown,
28514            _ => Self::UnknownValue(encryption_key_revocation_action::UnknownValue(
28515                wkt::internal::UnknownEnumValue::String(value.to_string()),
28516            )),
28517        }
28518    }
28519}
28520
28521impl serde::ser::Serialize for EncryptionKeyRevocationAction {
28522    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28523    where
28524        S: serde::Serializer,
28525    {
28526        match self {
28527            Self::Unspecified => serializer.serialize_i32(0),
28528            Self::PreventNew => serializer.serialize_i32(1),
28529            Self::Shutdown => serializer.serialize_i32(2),
28530            Self::UnknownValue(u) => u.0.serialize(serializer),
28531        }
28532    }
28533}
28534
28535impl<'de> serde::de::Deserialize<'de> for EncryptionKeyRevocationAction {
28536    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28537    where
28538        D: serde::Deserializer<'de>,
28539    {
28540        deserializer.deserialize_any(
28541            wkt::internal::EnumVisitor::<EncryptionKeyRevocationAction>::new(
28542                ".google.cloud.run.v2.EncryptionKeyRevocationAction",
28543            ),
28544        )
28545    }
28546}