google_cloud_appengine_v1/
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 async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate longrunning;
26extern crate lro;
27extern crate reqwest;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/)
40/// configuration for API handlers.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ApiConfigHandler {
44    /// Action to take when users access resources that require
45    /// authentication. Defaults to `redirect`.
46    pub auth_fail_action: crate::model::AuthFailAction,
47
48    /// Level of login required to access this resource. Defaults to
49    /// `optional`.
50    pub login: crate::model::LoginRequirement,
51
52    /// Path to the script from the application root directory.
53    pub script: std::string::String,
54
55    /// Security (HTTPS) enforcement for this URL.
56    pub security_level: crate::model::SecurityLevel,
57
58    /// URL to serve the endpoint at.
59    pub url: std::string::String,
60
61    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
62}
63
64impl ApiConfigHandler {
65    pub fn new() -> Self {
66        std::default::Default::default()
67    }
68
69    /// Sets the value of [auth_fail_action][crate::model::ApiConfigHandler::auth_fail_action].
70    ///
71    /// # Example
72    /// ```ignore,no_run
73    /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
74    /// use google_cloud_appengine_v1::model::AuthFailAction;
75    /// let x0 = ApiConfigHandler::new().set_auth_fail_action(AuthFailAction::Redirect);
76    /// let x1 = ApiConfigHandler::new().set_auth_fail_action(AuthFailAction::Unauthorized);
77    /// ```
78    pub fn set_auth_fail_action<T: std::convert::Into<crate::model::AuthFailAction>>(
79        mut self,
80        v: T,
81    ) -> Self {
82        self.auth_fail_action = v.into();
83        self
84    }
85
86    /// Sets the value of [login][crate::model::ApiConfigHandler::login].
87    ///
88    /// # Example
89    /// ```ignore,no_run
90    /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
91    /// use google_cloud_appengine_v1::model::LoginRequirement;
92    /// let x0 = ApiConfigHandler::new().set_login(LoginRequirement::LoginOptional);
93    /// let x1 = ApiConfigHandler::new().set_login(LoginRequirement::LoginAdmin);
94    /// let x2 = ApiConfigHandler::new().set_login(LoginRequirement::LoginRequired);
95    /// ```
96    pub fn set_login<T: std::convert::Into<crate::model::LoginRequirement>>(
97        mut self,
98        v: T,
99    ) -> Self {
100        self.login = v.into();
101        self
102    }
103
104    /// Sets the value of [script][crate::model::ApiConfigHandler::script].
105    ///
106    /// # Example
107    /// ```ignore,no_run
108    /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
109    /// let x = ApiConfigHandler::new().set_script("example");
110    /// ```
111    pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
112        self.script = v.into();
113        self
114    }
115
116    /// Sets the value of [security_level][crate::model::ApiConfigHandler::security_level].
117    ///
118    /// # Example
119    /// ```ignore,no_run
120    /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
121    /// use google_cloud_appengine_v1::model::SecurityLevel;
122    /// let x0 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureNever);
123    /// let x1 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureOptional);
124    /// let x2 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureAlways);
125    /// ```
126    pub fn set_security_level<T: std::convert::Into<crate::model::SecurityLevel>>(
127        mut self,
128        v: T,
129    ) -> Self {
130        self.security_level = v.into();
131        self
132    }
133
134    /// Sets the value of [url][crate::model::ApiConfigHandler::url].
135    ///
136    /// # Example
137    /// ```ignore,no_run
138    /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
139    /// let x = ApiConfigHandler::new().set_url("example");
140    /// ```
141    pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
142        self.url = v.into();
143        self
144    }
145}
146
147impl wkt::message::Message for ApiConfigHandler {
148    fn typename() -> &'static str {
149        "type.googleapis.com/google.appengine.v1.ApiConfigHandler"
150    }
151}
152
153/// Custom static error page to be served when an error occurs.
154#[derive(Clone, Default, PartialEq)]
155#[non_exhaustive]
156pub struct ErrorHandler {
157    /// Error condition this handler applies to.
158    pub error_code: crate::model::error_handler::ErrorCode,
159
160    /// Static file content to be served for this error.
161    pub static_file: std::string::String,
162
163    /// MIME type of file. Defaults to `text/html`.
164    pub mime_type: std::string::String,
165
166    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
167}
168
169impl ErrorHandler {
170    pub fn new() -> Self {
171        std::default::Default::default()
172    }
173
174    /// Sets the value of [error_code][crate::model::ErrorHandler::error_code].
175    ///
176    /// # Example
177    /// ```ignore,no_run
178    /// # use google_cloud_appengine_v1::model::ErrorHandler;
179    /// use google_cloud_appengine_v1::model::error_handler::ErrorCode;
180    /// let x0 = ErrorHandler::new().set_error_code(ErrorCode::OverQuota);
181    /// let x1 = ErrorHandler::new().set_error_code(ErrorCode::DosApiDenial);
182    /// let x2 = ErrorHandler::new().set_error_code(ErrorCode::Timeout);
183    /// ```
184    pub fn set_error_code<T: std::convert::Into<crate::model::error_handler::ErrorCode>>(
185        mut self,
186        v: T,
187    ) -> Self {
188        self.error_code = v.into();
189        self
190    }
191
192    /// Sets the value of [static_file][crate::model::ErrorHandler::static_file].
193    ///
194    /// # Example
195    /// ```ignore,no_run
196    /// # use google_cloud_appengine_v1::model::ErrorHandler;
197    /// let x = ErrorHandler::new().set_static_file("example");
198    /// ```
199    pub fn set_static_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
200        self.static_file = v.into();
201        self
202    }
203
204    /// Sets the value of [mime_type][crate::model::ErrorHandler::mime_type].
205    ///
206    /// # Example
207    /// ```ignore,no_run
208    /// # use google_cloud_appengine_v1::model::ErrorHandler;
209    /// let x = ErrorHandler::new().set_mime_type("example");
210    /// ```
211    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
212        self.mime_type = v.into();
213        self
214    }
215}
216
217impl wkt::message::Message for ErrorHandler {
218    fn typename() -> &'static str {
219        "type.googleapis.com/google.appengine.v1.ErrorHandler"
220    }
221}
222
223/// Defines additional types related to [ErrorHandler].
224pub mod error_handler {
225    #[allow(unused_imports)]
226    use super::*;
227
228    /// Error codes.
229    ///
230    /// # Working with unknown values
231    ///
232    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
233    /// additional enum variants at any time. Adding new variants is not considered
234    /// a breaking change. Applications should write their code in anticipation of:
235    ///
236    /// - New values appearing in future releases of the client library, **and**
237    /// - New values received dynamically, without application changes.
238    ///
239    /// Please consult the [Working with enums] section in the user guide for some
240    /// guidelines.
241    ///
242    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
243    #[derive(Clone, Debug, PartialEq)]
244    #[non_exhaustive]
245    pub enum ErrorCode {
246        /// Not specified. ERROR_CODE_DEFAULT is assumed.
247        Unspecified,
248        /// All other error types.
249        Default,
250        /// Application has exceeded a resource quota.
251        OverQuota,
252        /// Client blocked by the application's Denial of Service protection
253        /// configuration.
254        DosApiDenial,
255        /// Deadline reached before the application responds.
256        Timeout,
257        /// If set, the enum was initialized with an unknown value.
258        ///
259        /// Applications can examine the value using [ErrorCode::value] or
260        /// [ErrorCode::name].
261        UnknownValue(error_code::UnknownValue),
262    }
263
264    #[doc(hidden)]
265    pub mod error_code {
266        #[allow(unused_imports)]
267        use super::*;
268        #[derive(Clone, Debug, PartialEq)]
269        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
270    }
271
272    impl ErrorCode {
273        /// Gets the enum value.
274        ///
275        /// Returns `None` if the enum contains an unknown value deserialized from
276        /// the string representation of enums.
277        pub fn value(&self) -> std::option::Option<i32> {
278            match self {
279                Self::Unspecified => std::option::Option::Some(0),
280                Self::Default => std::option::Option::Some(0),
281                Self::OverQuota => std::option::Option::Some(1),
282                Self::DosApiDenial => std::option::Option::Some(2),
283                Self::Timeout => std::option::Option::Some(3),
284                Self::UnknownValue(u) => u.0.value(),
285            }
286        }
287
288        /// Gets the enum value as a string.
289        ///
290        /// Returns `None` if the enum contains an unknown value deserialized from
291        /// the integer representation of enums.
292        pub fn name(&self) -> std::option::Option<&str> {
293            match self {
294                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
295                Self::Default => std::option::Option::Some("ERROR_CODE_DEFAULT"),
296                Self::OverQuota => std::option::Option::Some("ERROR_CODE_OVER_QUOTA"),
297                Self::DosApiDenial => std::option::Option::Some("ERROR_CODE_DOS_API_DENIAL"),
298                Self::Timeout => std::option::Option::Some("ERROR_CODE_TIMEOUT"),
299                Self::UnknownValue(u) => u.0.name(),
300            }
301        }
302    }
303
304    impl std::default::Default for ErrorCode {
305        fn default() -> Self {
306            use std::convert::From;
307            Self::from(0)
308        }
309    }
310
311    impl std::fmt::Display for ErrorCode {
312        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
313            wkt::internal::display_enum(f, self.name(), self.value())
314        }
315    }
316
317    impl std::convert::From<i32> for ErrorCode {
318        fn from(value: i32) -> Self {
319            match value {
320                0 => Self::Default,
321                1 => Self::OverQuota,
322                2 => Self::DosApiDenial,
323                3 => Self::Timeout,
324                _ => Self::UnknownValue(error_code::UnknownValue(
325                    wkt::internal::UnknownEnumValue::Integer(value),
326                )),
327            }
328        }
329    }
330
331    impl std::convert::From<&str> for ErrorCode {
332        fn from(value: &str) -> Self {
333            use std::string::ToString;
334            match value {
335                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
336                "ERROR_CODE_DEFAULT" => Self::Default,
337                "ERROR_CODE_OVER_QUOTA" => Self::OverQuota,
338                "ERROR_CODE_DOS_API_DENIAL" => Self::DosApiDenial,
339                "ERROR_CODE_TIMEOUT" => Self::Timeout,
340                _ => Self::UnknownValue(error_code::UnknownValue(
341                    wkt::internal::UnknownEnumValue::String(value.to_string()),
342                )),
343            }
344        }
345    }
346
347    impl serde::ser::Serialize for ErrorCode {
348        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
349        where
350            S: serde::Serializer,
351        {
352            match self {
353                Self::Unspecified => serializer.serialize_i32(0),
354                Self::Default => serializer.serialize_i32(0),
355                Self::OverQuota => serializer.serialize_i32(1),
356                Self::DosApiDenial => serializer.serialize_i32(2),
357                Self::Timeout => serializer.serialize_i32(3),
358                Self::UnknownValue(u) => u.0.serialize(serializer),
359            }
360        }
361    }
362
363    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
364        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
365        where
366            D: serde::Deserializer<'de>,
367        {
368            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
369                ".google.appengine.v1.ErrorHandler.ErrorCode",
370            ))
371        }
372    }
373}
374
375/// URL pattern and description of how the URL should be handled. App Engine can
376/// handle URLs by executing application code or by serving static files
377/// uploaded with the version, such as images, CSS, or JavaScript.
378#[derive(Clone, Default, PartialEq)]
379#[non_exhaustive]
380pub struct UrlMap {
381    /// URL prefix. Uses regular expression syntax, which means regexp
382    /// special characters must be escaped, but should not contain groupings.
383    /// All URLs that begin with this prefix are handled by this handler, using the
384    /// portion of the URL after the prefix as part of the file path.
385    pub url_regex: std::string::String,
386
387    /// Security (HTTPS) enforcement for this URL.
388    pub security_level: crate::model::SecurityLevel,
389
390    /// Level of login required to access this resource. Not supported for Node.js
391    /// in the App Engine standard environment.
392    pub login: crate::model::LoginRequirement,
393
394    /// Action to take when users access resources that require
395    /// authentication. Defaults to `redirect`.
396    pub auth_fail_action: crate::model::AuthFailAction,
397
398    /// `30x` code to use when performing redirects for the `secure` field.
399    /// Defaults to `302`.
400    pub redirect_http_response_code: crate::model::url_map::RedirectHttpResponseCode,
401
402    /// Type of handler for this URL pattern.
403    pub handler_type: std::option::Option<crate::model::url_map::HandlerType>,
404
405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
406}
407
408impl UrlMap {
409    pub fn new() -> Self {
410        std::default::Default::default()
411    }
412
413    /// Sets the value of [url_regex][crate::model::UrlMap::url_regex].
414    ///
415    /// # Example
416    /// ```ignore,no_run
417    /// # use google_cloud_appengine_v1::model::UrlMap;
418    /// let x = UrlMap::new().set_url_regex("example");
419    /// ```
420    pub fn set_url_regex<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
421        self.url_regex = v.into();
422        self
423    }
424
425    /// Sets the value of [security_level][crate::model::UrlMap::security_level].
426    ///
427    /// # Example
428    /// ```ignore,no_run
429    /// # use google_cloud_appengine_v1::model::UrlMap;
430    /// use google_cloud_appengine_v1::model::SecurityLevel;
431    /// let x0 = UrlMap::new().set_security_level(SecurityLevel::SecureNever);
432    /// let x1 = UrlMap::new().set_security_level(SecurityLevel::SecureOptional);
433    /// let x2 = UrlMap::new().set_security_level(SecurityLevel::SecureAlways);
434    /// ```
435    pub fn set_security_level<T: std::convert::Into<crate::model::SecurityLevel>>(
436        mut self,
437        v: T,
438    ) -> Self {
439        self.security_level = v.into();
440        self
441    }
442
443    /// Sets the value of [login][crate::model::UrlMap::login].
444    ///
445    /// # Example
446    /// ```ignore,no_run
447    /// # use google_cloud_appengine_v1::model::UrlMap;
448    /// use google_cloud_appengine_v1::model::LoginRequirement;
449    /// let x0 = UrlMap::new().set_login(LoginRequirement::LoginOptional);
450    /// let x1 = UrlMap::new().set_login(LoginRequirement::LoginAdmin);
451    /// let x2 = UrlMap::new().set_login(LoginRequirement::LoginRequired);
452    /// ```
453    pub fn set_login<T: std::convert::Into<crate::model::LoginRequirement>>(
454        mut self,
455        v: T,
456    ) -> Self {
457        self.login = v.into();
458        self
459    }
460
461    /// Sets the value of [auth_fail_action][crate::model::UrlMap::auth_fail_action].
462    ///
463    /// # Example
464    /// ```ignore,no_run
465    /// # use google_cloud_appengine_v1::model::UrlMap;
466    /// use google_cloud_appengine_v1::model::AuthFailAction;
467    /// let x0 = UrlMap::new().set_auth_fail_action(AuthFailAction::Redirect);
468    /// let x1 = UrlMap::new().set_auth_fail_action(AuthFailAction::Unauthorized);
469    /// ```
470    pub fn set_auth_fail_action<T: std::convert::Into<crate::model::AuthFailAction>>(
471        mut self,
472        v: T,
473    ) -> Self {
474        self.auth_fail_action = v.into();
475        self
476    }
477
478    /// Sets the value of [redirect_http_response_code][crate::model::UrlMap::redirect_http_response_code].
479    ///
480    /// # Example
481    /// ```ignore,no_run
482    /// # use google_cloud_appengine_v1::model::UrlMap;
483    /// use google_cloud_appengine_v1::model::url_map::RedirectHttpResponseCode;
484    /// let x0 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode301);
485    /// let x1 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode302);
486    /// let x2 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode303);
487    /// ```
488    pub fn set_redirect_http_response_code<
489        T: std::convert::Into<crate::model::url_map::RedirectHttpResponseCode>,
490    >(
491        mut self,
492        v: T,
493    ) -> Self {
494        self.redirect_http_response_code = v.into();
495        self
496    }
497
498    /// Sets the value of [handler_type][crate::model::UrlMap::handler_type].
499    ///
500    /// Note that all the setters affecting `handler_type` are mutually
501    /// exclusive.
502    ///
503    /// # Example
504    /// ```ignore,no_run
505    /// # use google_cloud_appengine_v1::model::UrlMap;
506    /// use google_cloud_appengine_v1::model::StaticFilesHandler;
507    /// let x = UrlMap::new().set_handler_type(Some(
508    ///     google_cloud_appengine_v1::model::url_map::HandlerType::StaticFiles(StaticFilesHandler::default().into())));
509    /// ```
510    pub fn set_handler_type<
511        T: std::convert::Into<std::option::Option<crate::model::url_map::HandlerType>>,
512    >(
513        mut self,
514        v: T,
515    ) -> Self {
516        self.handler_type = v.into();
517        self
518    }
519
520    /// The value of [handler_type][crate::model::UrlMap::handler_type]
521    /// if it holds a `StaticFiles`, `None` if the field is not set or
522    /// holds a different branch.
523    pub fn static_files(
524        &self,
525    ) -> std::option::Option<&std::boxed::Box<crate::model::StaticFilesHandler>> {
526        #[allow(unreachable_patterns)]
527        self.handler_type.as_ref().and_then(|v| match v {
528            crate::model::url_map::HandlerType::StaticFiles(v) => std::option::Option::Some(v),
529            _ => std::option::Option::None,
530        })
531    }
532
533    /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
534    /// to hold a `StaticFiles`.
535    ///
536    /// Note that all the setters affecting `handler_type` are
537    /// mutually exclusive.
538    ///
539    /// # Example
540    /// ```ignore,no_run
541    /// # use google_cloud_appengine_v1::model::UrlMap;
542    /// use google_cloud_appengine_v1::model::StaticFilesHandler;
543    /// let x = UrlMap::new().set_static_files(StaticFilesHandler::default()/* use setters */);
544    /// assert!(x.static_files().is_some());
545    /// assert!(x.script().is_none());
546    /// assert!(x.api_endpoint().is_none());
547    /// ```
548    pub fn set_static_files<
549        T: std::convert::Into<std::boxed::Box<crate::model::StaticFilesHandler>>,
550    >(
551        mut self,
552        v: T,
553    ) -> Self {
554        self.handler_type =
555            std::option::Option::Some(crate::model::url_map::HandlerType::StaticFiles(v.into()));
556        self
557    }
558
559    /// The value of [handler_type][crate::model::UrlMap::handler_type]
560    /// if it holds a `Script`, `None` if the field is not set or
561    /// holds a different branch.
562    pub fn script(&self) -> std::option::Option<&std::boxed::Box<crate::model::ScriptHandler>> {
563        #[allow(unreachable_patterns)]
564        self.handler_type.as_ref().and_then(|v| match v {
565            crate::model::url_map::HandlerType::Script(v) => std::option::Option::Some(v),
566            _ => std::option::Option::None,
567        })
568    }
569
570    /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
571    /// to hold a `Script`.
572    ///
573    /// Note that all the setters affecting `handler_type` are
574    /// mutually exclusive.
575    ///
576    /// # Example
577    /// ```ignore,no_run
578    /// # use google_cloud_appengine_v1::model::UrlMap;
579    /// use google_cloud_appengine_v1::model::ScriptHandler;
580    /// let x = UrlMap::new().set_script(ScriptHandler::default()/* use setters */);
581    /// assert!(x.script().is_some());
582    /// assert!(x.static_files().is_none());
583    /// assert!(x.api_endpoint().is_none());
584    /// ```
585    pub fn set_script<T: std::convert::Into<std::boxed::Box<crate::model::ScriptHandler>>>(
586        mut self,
587        v: T,
588    ) -> Self {
589        self.handler_type =
590            std::option::Option::Some(crate::model::url_map::HandlerType::Script(v.into()));
591        self
592    }
593
594    /// The value of [handler_type][crate::model::UrlMap::handler_type]
595    /// if it holds a `ApiEndpoint`, `None` if the field is not set or
596    /// holds a different branch.
597    pub fn api_endpoint(
598        &self,
599    ) -> std::option::Option<&std::boxed::Box<crate::model::ApiEndpointHandler>> {
600        #[allow(unreachable_patterns)]
601        self.handler_type.as_ref().and_then(|v| match v {
602            crate::model::url_map::HandlerType::ApiEndpoint(v) => std::option::Option::Some(v),
603            _ => std::option::Option::None,
604        })
605    }
606
607    /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
608    /// to hold a `ApiEndpoint`.
609    ///
610    /// Note that all the setters affecting `handler_type` are
611    /// mutually exclusive.
612    ///
613    /// # Example
614    /// ```ignore,no_run
615    /// # use google_cloud_appengine_v1::model::UrlMap;
616    /// use google_cloud_appengine_v1::model::ApiEndpointHandler;
617    /// let x = UrlMap::new().set_api_endpoint(ApiEndpointHandler::default()/* use setters */);
618    /// assert!(x.api_endpoint().is_some());
619    /// assert!(x.static_files().is_none());
620    /// assert!(x.script().is_none());
621    /// ```
622    pub fn set_api_endpoint<
623        T: std::convert::Into<std::boxed::Box<crate::model::ApiEndpointHandler>>,
624    >(
625        mut self,
626        v: T,
627    ) -> Self {
628        self.handler_type =
629            std::option::Option::Some(crate::model::url_map::HandlerType::ApiEndpoint(v.into()));
630        self
631    }
632}
633
634impl wkt::message::Message for UrlMap {
635    fn typename() -> &'static str {
636        "type.googleapis.com/google.appengine.v1.UrlMap"
637    }
638}
639
640/// Defines additional types related to [UrlMap].
641pub mod url_map {
642    #[allow(unused_imports)]
643    use super::*;
644
645    /// Redirect codes.
646    ///
647    /// # Working with unknown values
648    ///
649    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
650    /// additional enum variants at any time. Adding new variants is not considered
651    /// a breaking change. Applications should write their code in anticipation of:
652    ///
653    /// - New values appearing in future releases of the client library, **and**
654    /// - New values received dynamically, without application changes.
655    ///
656    /// Please consult the [Working with enums] section in the user guide for some
657    /// guidelines.
658    ///
659    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
660    #[derive(Clone, Debug, PartialEq)]
661    #[non_exhaustive]
662    pub enum RedirectHttpResponseCode {
663        /// Not specified. `302` is assumed.
664        Unspecified,
665        /// `301 Moved Permanently` code.
666        RedirectHttpResponseCode301,
667        /// `302 Moved Temporarily` code.
668        RedirectHttpResponseCode302,
669        /// `303 See Other` code.
670        RedirectHttpResponseCode303,
671        /// `307 Temporary Redirect` code.
672        RedirectHttpResponseCode307,
673        /// If set, the enum was initialized with an unknown value.
674        ///
675        /// Applications can examine the value using [RedirectHttpResponseCode::value] or
676        /// [RedirectHttpResponseCode::name].
677        UnknownValue(redirect_http_response_code::UnknownValue),
678    }
679
680    #[doc(hidden)]
681    pub mod redirect_http_response_code {
682        #[allow(unused_imports)]
683        use super::*;
684        #[derive(Clone, Debug, PartialEq)]
685        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
686    }
687
688    impl RedirectHttpResponseCode {
689        /// Gets the enum value.
690        ///
691        /// Returns `None` if the enum contains an unknown value deserialized from
692        /// the string representation of enums.
693        pub fn value(&self) -> std::option::Option<i32> {
694            match self {
695                Self::Unspecified => std::option::Option::Some(0),
696                Self::RedirectHttpResponseCode301 => std::option::Option::Some(1),
697                Self::RedirectHttpResponseCode302 => std::option::Option::Some(2),
698                Self::RedirectHttpResponseCode303 => std::option::Option::Some(3),
699                Self::RedirectHttpResponseCode307 => std::option::Option::Some(4),
700                Self::UnknownValue(u) => u.0.value(),
701            }
702        }
703
704        /// Gets the enum value as a string.
705        ///
706        /// Returns `None` if the enum contains an unknown value deserialized from
707        /// the integer representation of enums.
708        pub fn name(&self) -> std::option::Option<&str> {
709            match self {
710                Self::Unspecified => {
711                    std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED")
712                }
713                Self::RedirectHttpResponseCode301 => {
714                    std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_301")
715                }
716                Self::RedirectHttpResponseCode302 => {
717                    std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_302")
718                }
719                Self::RedirectHttpResponseCode303 => {
720                    std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_303")
721                }
722                Self::RedirectHttpResponseCode307 => {
723                    std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_307")
724                }
725                Self::UnknownValue(u) => u.0.name(),
726            }
727        }
728    }
729
730    impl std::default::Default for RedirectHttpResponseCode {
731        fn default() -> Self {
732            use std::convert::From;
733            Self::from(0)
734        }
735    }
736
737    impl std::fmt::Display for RedirectHttpResponseCode {
738        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
739            wkt::internal::display_enum(f, self.name(), self.value())
740        }
741    }
742
743    impl std::convert::From<i32> for RedirectHttpResponseCode {
744        fn from(value: i32) -> Self {
745            match value {
746                0 => Self::Unspecified,
747                1 => Self::RedirectHttpResponseCode301,
748                2 => Self::RedirectHttpResponseCode302,
749                3 => Self::RedirectHttpResponseCode303,
750                4 => Self::RedirectHttpResponseCode307,
751                _ => Self::UnknownValue(redirect_http_response_code::UnknownValue(
752                    wkt::internal::UnknownEnumValue::Integer(value),
753                )),
754            }
755        }
756    }
757
758    impl std::convert::From<&str> for RedirectHttpResponseCode {
759        fn from(value: &str) -> Self {
760            use std::string::ToString;
761            match value {
762                "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED" => Self::Unspecified,
763                "REDIRECT_HTTP_RESPONSE_CODE_301" => Self::RedirectHttpResponseCode301,
764                "REDIRECT_HTTP_RESPONSE_CODE_302" => Self::RedirectHttpResponseCode302,
765                "REDIRECT_HTTP_RESPONSE_CODE_303" => Self::RedirectHttpResponseCode303,
766                "REDIRECT_HTTP_RESPONSE_CODE_307" => Self::RedirectHttpResponseCode307,
767                _ => Self::UnknownValue(redirect_http_response_code::UnknownValue(
768                    wkt::internal::UnknownEnumValue::String(value.to_string()),
769                )),
770            }
771        }
772    }
773
774    impl serde::ser::Serialize for RedirectHttpResponseCode {
775        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
776        where
777            S: serde::Serializer,
778        {
779            match self {
780                Self::Unspecified => serializer.serialize_i32(0),
781                Self::RedirectHttpResponseCode301 => serializer.serialize_i32(1),
782                Self::RedirectHttpResponseCode302 => serializer.serialize_i32(2),
783                Self::RedirectHttpResponseCode303 => serializer.serialize_i32(3),
784                Self::RedirectHttpResponseCode307 => serializer.serialize_i32(4),
785                Self::UnknownValue(u) => u.0.serialize(serializer),
786            }
787        }
788    }
789
790    impl<'de> serde::de::Deserialize<'de> for RedirectHttpResponseCode {
791        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
792        where
793            D: serde::Deserializer<'de>,
794        {
795            deserializer.deserialize_any(
796                wkt::internal::EnumVisitor::<RedirectHttpResponseCode>::new(
797                    ".google.appengine.v1.UrlMap.RedirectHttpResponseCode",
798                ),
799            )
800        }
801    }
802
803    /// Type of handler for this URL pattern.
804    #[derive(Clone, Debug, PartialEq)]
805    #[non_exhaustive]
806    pub enum HandlerType {
807        /// Returns the contents of a file, such as an image, as the response.
808        StaticFiles(std::boxed::Box<crate::model::StaticFilesHandler>),
809        /// Executes a script to handle the requests that match this URL
810        /// pattern. Only the `auto` value is supported for Node.js in the
811        /// App Engine standard environment, for example `"script": "auto"`.
812        Script(std::boxed::Box<crate::model::ScriptHandler>),
813        /// Uses API Endpoints to handle requests.
814        ApiEndpoint(std::boxed::Box<crate::model::ApiEndpointHandler>),
815    }
816}
817
818/// Files served directly to the user for a given URL, such as images, CSS
819/// stylesheets, or JavaScript source files. Static file handlers describe which
820/// files in the application directory are static files, and which URLs serve
821/// them.
822#[derive(Clone, Default, PartialEq)]
823#[non_exhaustive]
824pub struct StaticFilesHandler {
825    /// Path to the static files matched by the URL pattern, from the
826    /// application root directory. The path can refer to text matched in groupings
827    /// in the URL pattern.
828    pub path: std::string::String,
829
830    /// Regular expression that matches the file paths for all files that should be
831    /// referenced by this handler.
832    pub upload_path_regex: std::string::String,
833
834    /// HTTP headers to use for all responses from these URLs.
835    pub http_headers: std::collections::HashMap<std::string::String, std::string::String>,
836
837    /// MIME type used to serve all files served by this handler.
838    ///
839    /// Defaults to file-specific MIME types, which are derived from each file's
840    /// filename extension.
841    pub mime_type: std::string::String,
842
843    /// Time a static file served by this handler should be cached
844    /// by web proxies and browsers.
845    pub expiration: std::option::Option<wkt::Duration>,
846
847    /// Whether this handler should match the request if the file
848    /// referenced by the handler does not exist.
849    pub require_matching_file: bool,
850
851    /// Whether files should also be uploaded as code data. By default, files
852    /// declared in static file handlers are uploaded as static
853    /// data and are only served to end users; they cannot be read by the
854    /// application. If enabled, uploads are charged against both your code and
855    /// static data storage resource quotas.
856    pub application_readable: bool,
857
858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
859}
860
861impl StaticFilesHandler {
862    pub fn new() -> Self {
863        std::default::Default::default()
864    }
865
866    /// Sets the value of [path][crate::model::StaticFilesHandler::path].
867    ///
868    /// # Example
869    /// ```ignore,no_run
870    /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
871    /// let x = StaticFilesHandler::new().set_path("example");
872    /// ```
873    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
874        self.path = v.into();
875        self
876    }
877
878    /// Sets the value of [upload_path_regex][crate::model::StaticFilesHandler::upload_path_regex].
879    ///
880    /// # Example
881    /// ```ignore,no_run
882    /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
883    /// let x = StaticFilesHandler::new().set_upload_path_regex("example");
884    /// ```
885    pub fn set_upload_path_regex<T: std::convert::Into<std::string::String>>(
886        mut self,
887        v: T,
888    ) -> Self {
889        self.upload_path_regex = v.into();
890        self
891    }
892
893    /// Sets the value of [http_headers][crate::model::StaticFilesHandler::http_headers].
894    ///
895    /// # Example
896    /// ```ignore,no_run
897    /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
898    /// let x = StaticFilesHandler::new().set_http_headers([
899    ///     ("key0", "abc"),
900    ///     ("key1", "xyz"),
901    /// ]);
902    /// ```
903    pub fn set_http_headers<T, K, V>(mut self, v: T) -> Self
904    where
905        T: std::iter::IntoIterator<Item = (K, V)>,
906        K: std::convert::Into<std::string::String>,
907        V: std::convert::Into<std::string::String>,
908    {
909        use std::iter::Iterator;
910        self.http_headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
911        self
912    }
913
914    /// Sets the value of [mime_type][crate::model::StaticFilesHandler::mime_type].
915    ///
916    /// # Example
917    /// ```ignore,no_run
918    /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
919    /// let x = StaticFilesHandler::new().set_mime_type("example");
920    /// ```
921    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
922        self.mime_type = v.into();
923        self
924    }
925
926    /// Sets the value of [expiration][crate::model::StaticFilesHandler::expiration].
927    ///
928    /// # Example
929    /// ```ignore,no_run
930    /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
931    /// use wkt::Duration;
932    /// let x = StaticFilesHandler::new().set_expiration(Duration::default()/* use setters */);
933    /// ```
934    pub fn set_expiration<T>(mut self, v: T) -> Self
935    where
936        T: std::convert::Into<wkt::Duration>,
937    {
938        self.expiration = std::option::Option::Some(v.into());
939        self
940    }
941
942    /// Sets or clears the value of [expiration][crate::model::StaticFilesHandler::expiration].
943    ///
944    /// # Example
945    /// ```ignore,no_run
946    /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
947    /// use wkt::Duration;
948    /// let x = StaticFilesHandler::new().set_or_clear_expiration(Some(Duration::default()/* use setters */));
949    /// let x = StaticFilesHandler::new().set_or_clear_expiration(None::<Duration>);
950    /// ```
951    pub fn set_or_clear_expiration<T>(mut self, v: std::option::Option<T>) -> Self
952    where
953        T: std::convert::Into<wkt::Duration>,
954    {
955        self.expiration = v.map(|x| x.into());
956        self
957    }
958
959    /// Sets the value of [require_matching_file][crate::model::StaticFilesHandler::require_matching_file].
960    ///
961    /// # Example
962    /// ```ignore,no_run
963    /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
964    /// let x = StaticFilesHandler::new().set_require_matching_file(true);
965    /// ```
966    pub fn set_require_matching_file<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
967        self.require_matching_file = v.into();
968        self
969    }
970
971    /// Sets the value of [application_readable][crate::model::StaticFilesHandler::application_readable].
972    ///
973    /// # Example
974    /// ```ignore,no_run
975    /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
976    /// let x = StaticFilesHandler::new().set_application_readable(true);
977    /// ```
978    pub fn set_application_readable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
979        self.application_readable = v.into();
980        self
981    }
982}
983
984impl wkt::message::Message for StaticFilesHandler {
985    fn typename() -> &'static str {
986        "type.googleapis.com/google.appengine.v1.StaticFilesHandler"
987    }
988}
989
990/// Executes a script to handle the request that matches the URL pattern.
991#[derive(Clone, Default, PartialEq)]
992#[non_exhaustive]
993pub struct ScriptHandler {
994    /// Path to the script from the application root directory.
995    pub script_path: std::string::String,
996
997    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
998}
999
1000impl ScriptHandler {
1001    pub fn new() -> Self {
1002        std::default::Default::default()
1003    }
1004
1005    /// Sets the value of [script_path][crate::model::ScriptHandler::script_path].
1006    ///
1007    /// # Example
1008    /// ```ignore,no_run
1009    /// # use google_cloud_appengine_v1::model::ScriptHandler;
1010    /// let x = ScriptHandler::new().set_script_path("example");
1011    /// ```
1012    pub fn set_script_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1013        self.script_path = v.into();
1014        self
1015    }
1016}
1017
1018impl wkt::message::Message for ScriptHandler {
1019    fn typename() -> &'static str {
1020        "type.googleapis.com/google.appengine.v1.ScriptHandler"
1021    }
1022}
1023
1024/// Uses Google Cloud Endpoints to handle requests.
1025#[derive(Clone, Default, PartialEq)]
1026#[non_exhaustive]
1027pub struct ApiEndpointHandler {
1028    /// Path to the script from the application root directory.
1029    pub script_path: std::string::String,
1030
1031    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1032}
1033
1034impl ApiEndpointHandler {
1035    pub fn new() -> Self {
1036        std::default::Default::default()
1037    }
1038
1039    /// Sets the value of [script_path][crate::model::ApiEndpointHandler::script_path].
1040    ///
1041    /// # Example
1042    /// ```ignore,no_run
1043    /// # use google_cloud_appengine_v1::model::ApiEndpointHandler;
1044    /// let x = ApiEndpointHandler::new().set_script_path("example");
1045    /// ```
1046    pub fn set_script_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1047        self.script_path = v.into();
1048        self
1049    }
1050}
1051
1052impl wkt::message::Message for ApiEndpointHandler {
1053    fn typename() -> &'static str {
1054        "type.googleapis.com/google.appengine.v1.ApiEndpointHandler"
1055    }
1056}
1057
1058/// Health checking configuration for VM instances. Unhealthy instances
1059/// are killed and replaced with new instances. Only applicable for
1060/// instances in App Engine flexible environment.
1061#[derive(Clone, Default, PartialEq)]
1062#[non_exhaustive]
1063pub struct HealthCheck {
1064    /// Whether to explicitly disable health checks for this instance.
1065    pub disable_health_check: bool,
1066
1067    /// Host header to send when performing an HTTP health check.
1068    /// Example: "myapp.appspot.com"
1069    pub host: std::string::String,
1070
1071    /// Number of consecutive successful health checks required before receiving
1072    /// traffic.
1073    pub healthy_threshold: u32,
1074
1075    /// Number of consecutive failed health checks required before removing
1076    /// traffic.
1077    pub unhealthy_threshold: u32,
1078
1079    /// Number of consecutive failed health checks required before an instance is
1080    /// restarted.
1081    pub restart_threshold: u32,
1082
1083    /// Interval between health checks.
1084    pub check_interval: std::option::Option<wkt::Duration>,
1085
1086    /// Time before the health check is considered failed.
1087    pub timeout: std::option::Option<wkt::Duration>,
1088
1089    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1090}
1091
1092impl HealthCheck {
1093    pub fn new() -> Self {
1094        std::default::Default::default()
1095    }
1096
1097    /// Sets the value of [disable_health_check][crate::model::HealthCheck::disable_health_check].
1098    ///
1099    /// # Example
1100    /// ```ignore,no_run
1101    /// # use google_cloud_appengine_v1::model::HealthCheck;
1102    /// let x = HealthCheck::new().set_disable_health_check(true);
1103    /// ```
1104    pub fn set_disable_health_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1105        self.disable_health_check = v.into();
1106        self
1107    }
1108
1109    /// Sets the value of [host][crate::model::HealthCheck::host].
1110    ///
1111    /// # Example
1112    /// ```ignore,no_run
1113    /// # use google_cloud_appengine_v1::model::HealthCheck;
1114    /// let x = HealthCheck::new().set_host("example");
1115    /// ```
1116    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1117        self.host = v.into();
1118        self
1119    }
1120
1121    /// Sets the value of [healthy_threshold][crate::model::HealthCheck::healthy_threshold].
1122    ///
1123    /// # Example
1124    /// ```ignore,no_run
1125    /// # use google_cloud_appengine_v1::model::HealthCheck;
1126    /// let x = HealthCheck::new().set_healthy_threshold(42_u32);
1127    /// ```
1128    pub fn set_healthy_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1129        self.healthy_threshold = v.into();
1130        self
1131    }
1132
1133    /// Sets the value of [unhealthy_threshold][crate::model::HealthCheck::unhealthy_threshold].
1134    ///
1135    /// # Example
1136    /// ```ignore,no_run
1137    /// # use google_cloud_appengine_v1::model::HealthCheck;
1138    /// let x = HealthCheck::new().set_unhealthy_threshold(42_u32);
1139    /// ```
1140    pub fn set_unhealthy_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1141        self.unhealthy_threshold = v.into();
1142        self
1143    }
1144
1145    /// Sets the value of [restart_threshold][crate::model::HealthCheck::restart_threshold].
1146    ///
1147    /// # Example
1148    /// ```ignore,no_run
1149    /// # use google_cloud_appengine_v1::model::HealthCheck;
1150    /// let x = HealthCheck::new().set_restart_threshold(42_u32);
1151    /// ```
1152    pub fn set_restart_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1153        self.restart_threshold = v.into();
1154        self
1155    }
1156
1157    /// Sets the value of [check_interval][crate::model::HealthCheck::check_interval].
1158    ///
1159    /// # Example
1160    /// ```ignore,no_run
1161    /// # use google_cloud_appengine_v1::model::HealthCheck;
1162    /// use wkt::Duration;
1163    /// let x = HealthCheck::new().set_check_interval(Duration::default()/* use setters */);
1164    /// ```
1165    pub fn set_check_interval<T>(mut self, v: T) -> Self
1166    where
1167        T: std::convert::Into<wkt::Duration>,
1168    {
1169        self.check_interval = std::option::Option::Some(v.into());
1170        self
1171    }
1172
1173    /// Sets or clears the value of [check_interval][crate::model::HealthCheck::check_interval].
1174    ///
1175    /// # Example
1176    /// ```ignore,no_run
1177    /// # use google_cloud_appengine_v1::model::HealthCheck;
1178    /// use wkt::Duration;
1179    /// let x = HealthCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1180    /// let x = HealthCheck::new().set_or_clear_check_interval(None::<Duration>);
1181    /// ```
1182    pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1183    where
1184        T: std::convert::Into<wkt::Duration>,
1185    {
1186        self.check_interval = v.map(|x| x.into());
1187        self
1188    }
1189
1190    /// Sets the value of [timeout][crate::model::HealthCheck::timeout].
1191    ///
1192    /// # Example
1193    /// ```ignore,no_run
1194    /// # use google_cloud_appengine_v1::model::HealthCheck;
1195    /// use wkt::Duration;
1196    /// let x = HealthCheck::new().set_timeout(Duration::default()/* use setters */);
1197    /// ```
1198    pub fn set_timeout<T>(mut self, v: T) -> Self
1199    where
1200        T: std::convert::Into<wkt::Duration>,
1201    {
1202        self.timeout = std::option::Option::Some(v.into());
1203        self
1204    }
1205
1206    /// Sets or clears the value of [timeout][crate::model::HealthCheck::timeout].
1207    ///
1208    /// # Example
1209    /// ```ignore,no_run
1210    /// # use google_cloud_appengine_v1::model::HealthCheck;
1211    /// use wkt::Duration;
1212    /// let x = HealthCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1213    /// let x = HealthCheck::new().set_or_clear_timeout(None::<Duration>);
1214    /// ```
1215    pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1216    where
1217        T: std::convert::Into<wkt::Duration>,
1218    {
1219        self.timeout = v.map(|x| x.into());
1220        self
1221    }
1222}
1223
1224impl wkt::message::Message for HealthCheck {
1225    fn typename() -> &'static str {
1226        "type.googleapis.com/google.appengine.v1.HealthCheck"
1227    }
1228}
1229
1230/// Readiness checking configuration for VM instances. Unhealthy instances
1231/// are removed from traffic rotation.
1232#[derive(Clone, Default, PartialEq)]
1233#[non_exhaustive]
1234pub struct ReadinessCheck {
1235    /// The request path.
1236    pub path: std::string::String,
1237
1238    /// Host header to send when performing a HTTP Readiness check.
1239    /// Example: "myapp.appspot.com"
1240    pub host: std::string::String,
1241
1242    /// Number of consecutive failed checks required before removing
1243    /// traffic.
1244    pub failure_threshold: u32,
1245
1246    /// Number of consecutive successful checks required before receiving
1247    /// traffic.
1248    pub success_threshold: u32,
1249
1250    /// Interval between health checks.
1251    pub check_interval: std::option::Option<wkt::Duration>,
1252
1253    /// Time before the check is considered failed.
1254    pub timeout: std::option::Option<wkt::Duration>,
1255
1256    /// A maximum time limit on application initialization, measured from moment
1257    /// the application successfully replies to a healthcheck until it is ready to
1258    /// serve traffic.
1259    pub app_start_timeout: std::option::Option<wkt::Duration>,
1260
1261    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1262}
1263
1264impl ReadinessCheck {
1265    pub fn new() -> Self {
1266        std::default::Default::default()
1267    }
1268
1269    /// Sets the value of [path][crate::model::ReadinessCheck::path].
1270    ///
1271    /// # Example
1272    /// ```ignore,no_run
1273    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1274    /// let x = ReadinessCheck::new().set_path("example");
1275    /// ```
1276    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1277        self.path = v.into();
1278        self
1279    }
1280
1281    /// Sets the value of [host][crate::model::ReadinessCheck::host].
1282    ///
1283    /// # Example
1284    /// ```ignore,no_run
1285    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1286    /// let x = ReadinessCheck::new().set_host("example");
1287    /// ```
1288    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1289        self.host = v.into();
1290        self
1291    }
1292
1293    /// Sets the value of [failure_threshold][crate::model::ReadinessCheck::failure_threshold].
1294    ///
1295    /// # Example
1296    /// ```ignore,no_run
1297    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1298    /// let x = ReadinessCheck::new().set_failure_threshold(42_u32);
1299    /// ```
1300    pub fn set_failure_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1301        self.failure_threshold = v.into();
1302        self
1303    }
1304
1305    /// Sets the value of [success_threshold][crate::model::ReadinessCheck::success_threshold].
1306    ///
1307    /// # Example
1308    /// ```ignore,no_run
1309    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1310    /// let x = ReadinessCheck::new().set_success_threshold(42_u32);
1311    /// ```
1312    pub fn set_success_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1313        self.success_threshold = v.into();
1314        self
1315    }
1316
1317    /// Sets the value of [check_interval][crate::model::ReadinessCheck::check_interval].
1318    ///
1319    /// # Example
1320    /// ```ignore,no_run
1321    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1322    /// use wkt::Duration;
1323    /// let x = ReadinessCheck::new().set_check_interval(Duration::default()/* use setters */);
1324    /// ```
1325    pub fn set_check_interval<T>(mut self, v: T) -> Self
1326    where
1327        T: std::convert::Into<wkt::Duration>,
1328    {
1329        self.check_interval = std::option::Option::Some(v.into());
1330        self
1331    }
1332
1333    /// Sets or clears the value of [check_interval][crate::model::ReadinessCheck::check_interval].
1334    ///
1335    /// # Example
1336    /// ```ignore,no_run
1337    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1338    /// use wkt::Duration;
1339    /// let x = ReadinessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1340    /// let x = ReadinessCheck::new().set_or_clear_check_interval(None::<Duration>);
1341    /// ```
1342    pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1343    where
1344        T: std::convert::Into<wkt::Duration>,
1345    {
1346        self.check_interval = v.map(|x| x.into());
1347        self
1348    }
1349
1350    /// Sets the value of [timeout][crate::model::ReadinessCheck::timeout].
1351    ///
1352    /// # Example
1353    /// ```ignore,no_run
1354    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1355    /// use wkt::Duration;
1356    /// let x = ReadinessCheck::new().set_timeout(Duration::default()/* use setters */);
1357    /// ```
1358    pub fn set_timeout<T>(mut self, v: T) -> Self
1359    where
1360        T: std::convert::Into<wkt::Duration>,
1361    {
1362        self.timeout = std::option::Option::Some(v.into());
1363        self
1364    }
1365
1366    /// Sets or clears the value of [timeout][crate::model::ReadinessCheck::timeout].
1367    ///
1368    /// # Example
1369    /// ```ignore,no_run
1370    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1371    /// use wkt::Duration;
1372    /// let x = ReadinessCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1373    /// let x = ReadinessCheck::new().set_or_clear_timeout(None::<Duration>);
1374    /// ```
1375    pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1376    where
1377        T: std::convert::Into<wkt::Duration>,
1378    {
1379        self.timeout = v.map(|x| x.into());
1380        self
1381    }
1382
1383    /// Sets the value of [app_start_timeout][crate::model::ReadinessCheck::app_start_timeout].
1384    ///
1385    /// # Example
1386    /// ```ignore,no_run
1387    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1388    /// use wkt::Duration;
1389    /// let x = ReadinessCheck::new().set_app_start_timeout(Duration::default()/* use setters */);
1390    /// ```
1391    pub fn set_app_start_timeout<T>(mut self, v: T) -> Self
1392    where
1393        T: std::convert::Into<wkt::Duration>,
1394    {
1395        self.app_start_timeout = std::option::Option::Some(v.into());
1396        self
1397    }
1398
1399    /// Sets or clears the value of [app_start_timeout][crate::model::ReadinessCheck::app_start_timeout].
1400    ///
1401    /// # Example
1402    /// ```ignore,no_run
1403    /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1404    /// use wkt::Duration;
1405    /// let x = ReadinessCheck::new().set_or_clear_app_start_timeout(Some(Duration::default()/* use setters */));
1406    /// let x = ReadinessCheck::new().set_or_clear_app_start_timeout(None::<Duration>);
1407    /// ```
1408    pub fn set_or_clear_app_start_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1409    where
1410        T: std::convert::Into<wkt::Duration>,
1411    {
1412        self.app_start_timeout = v.map(|x| x.into());
1413        self
1414    }
1415}
1416
1417impl wkt::message::Message for ReadinessCheck {
1418    fn typename() -> &'static str {
1419        "type.googleapis.com/google.appengine.v1.ReadinessCheck"
1420    }
1421}
1422
1423/// Health checking configuration for VM instances. Unhealthy instances
1424/// are killed and replaced with new instances.
1425#[derive(Clone, Default, PartialEq)]
1426#[non_exhaustive]
1427pub struct LivenessCheck {
1428    /// The request path.
1429    pub path: std::string::String,
1430
1431    /// Host header to send when performing a HTTP Liveness check.
1432    /// Example: "myapp.appspot.com"
1433    pub host: std::string::String,
1434
1435    /// Number of consecutive failed checks required before considering the
1436    /// VM unhealthy.
1437    pub failure_threshold: u32,
1438
1439    /// Number of consecutive successful checks required before considering
1440    /// the VM healthy.
1441    pub success_threshold: u32,
1442
1443    /// Interval between health checks.
1444    pub check_interval: std::option::Option<wkt::Duration>,
1445
1446    /// Time before the check is considered failed.
1447    pub timeout: std::option::Option<wkt::Duration>,
1448
1449    /// The initial delay before starting to execute the checks.
1450    pub initial_delay: std::option::Option<wkt::Duration>,
1451
1452    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1453}
1454
1455impl LivenessCheck {
1456    pub fn new() -> Self {
1457        std::default::Default::default()
1458    }
1459
1460    /// Sets the value of [path][crate::model::LivenessCheck::path].
1461    ///
1462    /// # Example
1463    /// ```ignore,no_run
1464    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1465    /// let x = LivenessCheck::new().set_path("example");
1466    /// ```
1467    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1468        self.path = v.into();
1469        self
1470    }
1471
1472    /// Sets the value of [host][crate::model::LivenessCheck::host].
1473    ///
1474    /// # Example
1475    /// ```ignore,no_run
1476    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1477    /// let x = LivenessCheck::new().set_host("example");
1478    /// ```
1479    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1480        self.host = v.into();
1481        self
1482    }
1483
1484    /// Sets the value of [failure_threshold][crate::model::LivenessCheck::failure_threshold].
1485    ///
1486    /// # Example
1487    /// ```ignore,no_run
1488    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1489    /// let x = LivenessCheck::new().set_failure_threshold(42_u32);
1490    /// ```
1491    pub fn set_failure_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1492        self.failure_threshold = v.into();
1493        self
1494    }
1495
1496    /// Sets the value of [success_threshold][crate::model::LivenessCheck::success_threshold].
1497    ///
1498    /// # Example
1499    /// ```ignore,no_run
1500    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1501    /// let x = LivenessCheck::new().set_success_threshold(42_u32);
1502    /// ```
1503    pub fn set_success_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1504        self.success_threshold = v.into();
1505        self
1506    }
1507
1508    /// Sets the value of [check_interval][crate::model::LivenessCheck::check_interval].
1509    ///
1510    /// # Example
1511    /// ```ignore,no_run
1512    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1513    /// use wkt::Duration;
1514    /// let x = LivenessCheck::new().set_check_interval(Duration::default()/* use setters */);
1515    /// ```
1516    pub fn set_check_interval<T>(mut self, v: T) -> Self
1517    where
1518        T: std::convert::Into<wkt::Duration>,
1519    {
1520        self.check_interval = std::option::Option::Some(v.into());
1521        self
1522    }
1523
1524    /// Sets or clears the value of [check_interval][crate::model::LivenessCheck::check_interval].
1525    ///
1526    /// # Example
1527    /// ```ignore,no_run
1528    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1529    /// use wkt::Duration;
1530    /// let x = LivenessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1531    /// let x = LivenessCheck::new().set_or_clear_check_interval(None::<Duration>);
1532    /// ```
1533    pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1534    where
1535        T: std::convert::Into<wkt::Duration>,
1536    {
1537        self.check_interval = v.map(|x| x.into());
1538        self
1539    }
1540
1541    /// Sets the value of [timeout][crate::model::LivenessCheck::timeout].
1542    ///
1543    /// # Example
1544    /// ```ignore,no_run
1545    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1546    /// use wkt::Duration;
1547    /// let x = LivenessCheck::new().set_timeout(Duration::default()/* use setters */);
1548    /// ```
1549    pub fn set_timeout<T>(mut self, v: T) -> Self
1550    where
1551        T: std::convert::Into<wkt::Duration>,
1552    {
1553        self.timeout = std::option::Option::Some(v.into());
1554        self
1555    }
1556
1557    /// Sets or clears the value of [timeout][crate::model::LivenessCheck::timeout].
1558    ///
1559    /// # Example
1560    /// ```ignore,no_run
1561    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1562    /// use wkt::Duration;
1563    /// let x = LivenessCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1564    /// let x = LivenessCheck::new().set_or_clear_timeout(None::<Duration>);
1565    /// ```
1566    pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1567    where
1568        T: std::convert::Into<wkt::Duration>,
1569    {
1570        self.timeout = v.map(|x| x.into());
1571        self
1572    }
1573
1574    /// Sets the value of [initial_delay][crate::model::LivenessCheck::initial_delay].
1575    ///
1576    /// # Example
1577    /// ```ignore,no_run
1578    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1579    /// use wkt::Duration;
1580    /// let x = LivenessCheck::new().set_initial_delay(Duration::default()/* use setters */);
1581    /// ```
1582    pub fn set_initial_delay<T>(mut self, v: T) -> Self
1583    where
1584        T: std::convert::Into<wkt::Duration>,
1585    {
1586        self.initial_delay = std::option::Option::Some(v.into());
1587        self
1588    }
1589
1590    /// Sets or clears the value of [initial_delay][crate::model::LivenessCheck::initial_delay].
1591    ///
1592    /// # Example
1593    /// ```ignore,no_run
1594    /// # use google_cloud_appengine_v1::model::LivenessCheck;
1595    /// use wkt::Duration;
1596    /// let x = LivenessCheck::new().set_or_clear_initial_delay(Some(Duration::default()/* use setters */));
1597    /// let x = LivenessCheck::new().set_or_clear_initial_delay(None::<Duration>);
1598    /// ```
1599    pub fn set_or_clear_initial_delay<T>(mut self, v: std::option::Option<T>) -> Self
1600    where
1601        T: std::convert::Into<wkt::Duration>,
1602    {
1603        self.initial_delay = v.map(|x| x.into());
1604        self
1605    }
1606}
1607
1608impl wkt::message::Message for LivenessCheck {
1609    fn typename() -> &'static str {
1610        "type.googleapis.com/google.appengine.v1.LivenessCheck"
1611    }
1612}
1613
1614/// Third-party Python runtime library that is required by the application.
1615#[derive(Clone, Default, PartialEq)]
1616#[non_exhaustive]
1617pub struct Library {
1618    /// Name of the library. Example: "django".
1619    pub name: std::string::String,
1620
1621    /// Version of the library to select, or "latest".
1622    pub version: std::string::String,
1623
1624    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1625}
1626
1627impl Library {
1628    pub fn new() -> Self {
1629        std::default::Default::default()
1630    }
1631
1632    /// Sets the value of [name][crate::model::Library::name].
1633    ///
1634    /// # Example
1635    /// ```ignore,no_run
1636    /// # use google_cloud_appengine_v1::model::Library;
1637    /// let x = Library::new().set_name("example");
1638    /// ```
1639    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1640        self.name = v.into();
1641        self
1642    }
1643
1644    /// Sets the value of [version][crate::model::Library::version].
1645    ///
1646    /// # Example
1647    /// ```ignore,no_run
1648    /// # use google_cloud_appengine_v1::model::Library;
1649    /// let x = Library::new().set_version("example");
1650    /// ```
1651    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1652        self.version = v.into();
1653        self
1654    }
1655}
1656
1657impl wkt::message::Message for Library {
1658    fn typename() -> &'static str {
1659        "type.googleapis.com/google.appengine.v1.Library"
1660    }
1661}
1662
1663/// Request message for `Applications.GetApplication`.
1664#[derive(Clone, Default, PartialEq)]
1665#[non_exhaustive]
1666pub struct GetApplicationRequest {
1667    /// Name of the Application resource to get. Example: `apps/myapp`.
1668    pub name: std::string::String,
1669
1670    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1671}
1672
1673impl GetApplicationRequest {
1674    pub fn new() -> Self {
1675        std::default::Default::default()
1676    }
1677
1678    /// Sets the value of [name][crate::model::GetApplicationRequest::name].
1679    ///
1680    /// # Example
1681    /// ```ignore,no_run
1682    /// # use google_cloud_appengine_v1::model::GetApplicationRequest;
1683    /// let x = GetApplicationRequest::new().set_name("example");
1684    /// ```
1685    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1686        self.name = v.into();
1687        self
1688    }
1689}
1690
1691impl wkt::message::Message for GetApplicationRequest {
1692    fn typename() -> &'static str {
1693        "type.googleapis.com/google.appengine.v1.GetApplicationRequest"
1694    }
1695}
1696
1697/// Request message for `Applications.CreateApplication`.
1698#[derive(Clone, Default, PartialEq)]
1699#[non_exhaustive]
1700pub struct CreateApplicationRequest {
1701    /// Application configuration.
1702    pub application: std::option::Option<crate::model::Application>,
1703
1704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1705}
1706
1707impl CreateApplicationRequest {
1708    pub fn new() -> Self {
1709        std::default::Default::default()
1710    }
1711
1712    /// Sets the value of [application][crate::model::CreateApplicationRequest::application].
1713    ///
1714    /// # Example
1715    /// ```ignore,no_run
1716    /// # use google_cloud_appengine_v1::model::CreateApplicationRequest;
1717    /// use google_cloud_appengine_v1::model::Application;
1718    /// let x = CreateApplicationRequest::new().set_application(Application::default()/* use setters */);
1719    /// ```
1720    pub fn set_application<T>(mut self, v: T) -> Self
1721    where
1722        T: std::convert::Into<crate::model::Application>,
1723    {
1724        self.application = std::option::Option::Some(v.into());
1725        self
1726    }
1727
1728    /// Sets or clears the value of [application][crate::model::CreateApplicationRequest::application].
1729    ///
1730    /// # Example
1731    /// ```ignore,no_run
1732    /// # use google_cloud_appengine_v1::model::CreateApplicationRequest;
1733    /// use google_cloud_appengine_v1::model::Application;
1734    /// let x = CreateApplicationRequest::new().set_or_clear_application(Some(Application::default()/* use setters */));
1735    /// let x = CreateApplicationRequest::new().set_or_clear_application(None::<Application>);
1736    /// ```
1737    pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
1738    where
1739        T: std::convert::Into<crate::model::Application>,
1740    {
1741        self.application = v.map(|x| x.into());
1742        self
1743    }
1744}
1745
1746impl wkt::message::Message for CreateApplicationRequest {
1747    fn typename() -> &'static str {
1748        "type.googleapis.com/google.appengine.v1.CreateApplicationRequest"
1749    }
1750}
1751
1752/// Request message for `Applications.UpdateApplication`.
1753#[derive(Clone, Default, PartialEq)]
1754#[non_exhaustive]
1755pub struct UpdateApplicationRequest {
1756    /// Name of the Application resource to update. Example: `apps/myapp`.
1757    pub name: std::string::String,
1758
1759    /// An Application containing the updated resource.
1760    pub application: std::option::Option<crate::model::Application>,
1761
1762    /// Required. Standard field mask for the set of fields to be updated.
1763    pub update_mask: std::option::Option<wkt::FieldMask>,
1764
1765    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1766}
1767
1768impl UpdateApplicationRequest {
1769    pub fn new() -> Self {
1770        std::default::Default::default()
1771    }
1772
1773    /// Sets the value of [name][crate::model::UpdateApplicationRequest::name].
1774    ///
1775    /// # Example
1776    /// ```ignore,no_run
1777    /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1778    /// let x = UpdateApplicationRequest::new().set_name("example");
1779    /// ```
1780    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1781        self.name = v.into();
1782        self
1783    }
1784
1785    /// Sets the value of [application][crate::model::UpdateApplicationRequest::application].
1786    ///
1787    /// # Example
1788    /// ```ignore,no_run
1789    /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1790    /// use google_cloud_appengine_v1::model::Application;
1791    /// let x = UpdateApplicationRequest::new().set_application(Application::default()/* use setters */);
1792    /// ```
1793    pub fn set_application<T>(mut self, v: T) -> Self
1794    where
1795        T: std::convert::Into<crate::model::Application>,
1796    {
1797        self.application = std::option::Option::Some(v.into());
1798        self
1799    }
1800
1801    /// Sets or clears the value of [application][crate::model::UpdateApplicationRequest::application].
1802    ///
1803    /// # Example
1804    /// ```ignore,no_run
1805    /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1806    /// use google_cloud_appengine_v1::model::Application;
1807    /// let x = UpdateApplicationRequest::new().set_or_clear_application(Some(Application::default()/* use setters */));
1808    /// let x = UpdateApplicationRequest::new().set_or_clear_application(None::<Application>);
1809    /// ```
1810    pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
1811    where
1812        T: std::convert::Into<crate::model::Application>,
1813    {
1814        self.application = v.map(|x| x.into());
1815        self
1816    }
1817
1818    /// Sets the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
1819    ///
1820    /// # Example
1821    /// ```ignore,no_run
1822    /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1823    /// use wkt::FieldMask;
1824    /// let x = UpdateApplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1825    /// ```
1826    pub fn set_update_mask<T>(mut self, v: T) -> Self
1827    where
1828        T: std::convert::Into<wkt::FieldMask>,
1829    {
1830        self.update_mask = std::option::Option::Some(v.into());
1831        self
1832    }
1833
1834    /// Sets or clears the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
1835    ///
1836    /// # Example
1837    /// ```ignore,no_run
1838    /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1839    /// use wkt::FieldMask;
1840    /// let x = UpdateApplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1841    /// let x = UpdateApplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1842    /// ```
1843    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1844    where
1845        T: std::convert::Into<wkt::FieldMask>,
1846    {
1847        self.update_mask = v.map(|x| x.into());
1848        self
1849    }
1850}
1851
1852impl wkt::message::Message for UpdateApplicationRequest {
1853    fn typename() -> &'static str {
1854        "type.googleapis.com/google.appengine.v1.UpdateApplicationRequest"
1855    }
1856}
1857
1858/// Request message for 'Applications.RepairApplication'.
1859#[derive(Clone, Default, PartialEq)]
1860#[non_exhaustive]
1861pub struct RepairApplicationRequest {
1862    /// Name of the application to repair. Example: `apps/myapp`
1863    pub name: std::string::String,
1864
1865    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1866}
1867
1868impl RepairApplicationRequest {
1869    pub fn new() -> Self {
1870        std::default::Default::default()
1871    }
1872
1873    /// Sets the value of [name][crate::model::RepairApplicationRequest::name].
1874    ///
1875    /// # Example
1876    /// ```ignore,no_run
1877    /// # use google_cloud_appengine_v1::model::RepairApplicationRequest;
1878    /// let x = RepairApplicationRequest::new().set_name("example");
1879    /// ```
1880    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1881        self.name = v.into();
1882        self
1883    }
1884}
1885
1886impl wkt::message::Message for RepairApplicationRequest {
1887    fn typename() -> &'static str {
1888        "type.googleapis.com/google.appengine.v1.RepairApplicationRequest"
1889    }
1890}
1891
1892/// Request message for `Services.ListServices`.
1893#[derive(Clone, Default, PartialEq)]
1894#[non_exhaustive]
1895pub struct ListServicesRequest {
1896    /// Name of the parent Application resource. Example: `apps/myapp`.
1897    pub parent: std::string::String,
1898
1899    /// Maximum results to return per page.
1900    pub page_size: i32,
1901
1902    /// Continuation token for fetching the next page of results.
1903    pub page_token: std::string::String,
1904
1905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1906}
1907
1908impl ListServicesRequest {
1909    pub fn new() -> Self {
1910        std::default::Default::default()
1911    }
1912
1913    /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
1914    ///
1915    /// # Example
1916    /// ```ignore,no_run
1917    /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1918    /// let x = ListServicesRequest::new().set_parent("example");
1919    /// ```
1920    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1921        self.parent = v.into();
1922        self
1923    }
1924
1925    /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
1926    ///
1927    /// # Example
1928    /// ```ignore,no_run
1929    /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1930    /// let x = ListServicesRequest::new().set_page_size(42);
1931    /// ```
1932    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1933        self.page_size = v.into();
1934        self
1935    }
1936
1937    /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
1938    ///
1939    /// # Example
1940    /// ```ignore,no_run
1941    /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1942    /// let x = ListServicesRequest::new().set_page_token("example");
1943    /// ```
1944    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1945        self.page_token = v.into();
1946        self
1947    }
1948}
1949
1950impl wkt::message::Message for ListServicesRequest {
1951    fn typename() -> &'static str {
1952        "type.googleapis.com/google.appengine.v1.ListServicesRequest"
1953    }
1954}
1955
1956/// Response message for `Services.ListServices`.
1957#[derive(Clone, Default, PartialEq)]
1958#[non_exhaustive]
1959pub struct ListServicesResponse {
1960    /// The services belonging to the requested application.
1961    pub services: std::vec::Vec<crate::model::Service>,
1962
1963    /// Continuation token for fetching the next page of results.
1964    pub next_page_token: std::string::String,
1965
1966    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1967}
1968
1969impl ListServicesResponse {
1970    pub fn new() -> Self {
1971        std::default::Default::default()
1972    }
1973
1974    /// Sets the value of [services][crate::model::ListServicesResponse::services].
1975    ///
1976    /// # Example
1977    /// ```ignore,no_run
1978    /// # use google_cloud_appengine_v1::model::ListServicesResponse;
1979    /// use google_cloud_appengine_v1::model::Service;
1980    /// let x = ListServicesResponse::new()
1981    ///     .set_services([
1982    ///         Service::default()/* use setters */,
1983    ///         Service::default()/* use (different) setters */,
1984    ///     ]);
1985    /// ```
1986    pub fn set_services<T, V>(mut self, v: T) -> Self
1987    where
1988        T: std::iter::IntoIterator<Item = V>,
1989        V: std::convert::Into<crate::model::Service>,
1990    {
1991        use std::iter::Iterator;
1992        self.services = v.into_iter().map(|i| i.into()).collect();
1993        self
1994    }
1995
1996    /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
1997    ///
1998    /// # Example
1999    /// ```ignore,no_run
2000    /// # use google_cloud_appengine_v1::model::ListServicesResponse;
2001    /// let x = ListServicesResponse::new().set_next_page_token("example");
2002    /// ```
2003    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2004        self.next_page_token = v.into();
2005        self
2006    }
2007}
2008
2009impl wkt::message::Message for ListServicesResponse {
2010    fn typename() -> &'static str {
2011        "type.googleapis.com/google.appengine.v1.ListServicesResponse"
2012    }
2013}
2014
2015#[doc(hidden)]
2016impl gax::paginator::internal::PageableResponse for ListServicesResponse {
2017    type PageItem = crate::model::Service;
2018
2019    fn items(self) -> std::vec::Vec<Self::PageItem> {
2020        self.services
2021    }
2022
2023    fn next_page_token(&self) -> std::string::String {
2024        use std::clone::Clone;
2025        self.next_page_token.clone()
2026    }
2027}
2028
2029/// Request message for `Services.GetService`.
2030#[derive(Clone, Default, PartialEq)]
2031#[non_exhaustive]
2032pub struct GetServiceRequest {
2033    /// Name of the resource requested. Example: `apps/myapp/services/default`.
2034    pub name: std::string::String,
2035
2036    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2037}
2038
2039impl GetServiceRequest {
2040    pub fn new() -> Self {
2041        std::default::Default::default()
2042    }
2043
2044    /// Sets the value of [name][crate::model::GetServiceRequest::name].
2045    ///
2046    /// # Example
2047    /// ```ignore,no_run
2048    /// # use google_cloud_appengine_v1::model::GetServiceRequest;
2049    /// let x = GetServiceRequest::new().set_name("example");
2050    /// ```
2051    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2052        self.name = v.into();
2053        self
2054    }
2055}
2056
2057impl wkt::message::Message for GetServiceRequest {
2058    fn typename() -> &'static str {
2059        "type.googleapis.com/google.appengine.v1.GetServiceRequest"
2060    }
2061}
2062
2063/// Request message for `Services.UpdateService`.
2064#[derive(Clone, Default, PartialEq)]
2065#[non_exhaustive]
2066pub struct UpdateServiceRequest {
2067    /// Name of the resource to update. Example: `apps/myapp/services/default`.
2068    pub name: std::string::String,
2069
2070    /// A Service resource containing the updated service. Only fields set in the
2071    /// field mask will be updated.
2072    pub service: std::option::Option<crate::model::Service>,
2073
2074    /// Required. Standard field mask for the set of fields to be updated.
2075    pub update_mask: std::option::Option<wkt::FieldMask>,
2076
2077    /// Set to `true` to gradually shift traffic to one or more versions that you
2078    /// specify. By default, traffic is shifted immediately.
2079    /// For gradual traffic migration, the target versions
2080    /// must be located within instances that are configured for both
2081    /// [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType)
2082    /// and
2083    /// [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling).
2084    /// You must specify the
2085    /// [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy)
2086    /// field in the Service resource. Gradual traffic migration is not
2087    /// supported in the App Engine flexible environment. For examples, see
2088    /// [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
2089    pub migrate_traffic: bool,
2090
2091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2092}
2093
2094impl UpdateServiceRequest {
2095    pub fn new() -> Self {
2096        std::default::Default::default()
2097    }
2098
2099    /// Sets the value of [name][crate::model::UpdateServiceRequest::name].
2100    ///
2101    /// # Example
2102    /// ```ignore,no_run
2103    /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2104    /// let x = UpdateServiceRequest::new().set_name("example");
2105    /// ```
2106    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2107        self.name = v.into();
2108        self
2109    }
2110
2111    /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
2112    ///
2113    /// # Example
2114    /// ```ignore,no_run
2115    /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2116    /// use google_cloud_appengine_v1::model::Service;
2117    /// let x = UpdateServiceRequest::new().set_service(Service::default()/* use setters */);
2118    /// ```
2119    pub fn set_service<T>(mut self, v: T) -> Self
2120    where
2121        T: std::convert::Into<crate::model::Service>,
2122    {
2123        self.service = std::option::Option::Some(v.into());
2124        self
2125    }
2126
2127    /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
2128    ///
2129    /// # Example
2130    /// ```ignore,no_run
2131    /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2132    /// use google_cloud_appengine_v1::model::Service;
2133    /// let x = UpdateServiceRequest::new().set_or_clear_service(Some(Service::default()/* use setters */));
2134    /// let x = UpdateServiceRequest::new().set_or_clear_service(None::<Service>);
2135    /// ```
2136    pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
2137    where
2138        T: std::convert::Into<crate::model::Service>,
2139    {
2140        self.service = v.map(|x| x.into());
2141        self
2142    }
2143
2144    /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
2145    ///
2146    /// # Example
2147    /// ```ignore,no_run
2148    /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2149    /// use wkt::FieldMask;
2150    /// let x = UpdateServiceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2151    /// ```
2152    pub fn set_update_mask<T>(mut self, v: T) -> Self
2153    where
2154        T: std::convert::Into<wkt::FieldMask>,
2155    {
2156        self.update_mask = std::option::Option::Some(v.into());
2157        self
2158    }
2159
2160    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
2161    ///
2162    /// # Example
2163    /// ```ignore,no_run
2164    /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2165    /// use wkt::FieldMask;
2166    /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2167    /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2168    /// ```
2169    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2170    where
2171        T: std::convert::Into<wkt::FieldMask>,
2172    {
2173        self.update_mask = v.map(|x| x.into());
2174        self
2175    }
2176
2177    /// Sets the value of [migrate_traffic][crate::model::UpdateServiceRequest::migrate_traffic].
2178    ///
2179    /// # Example
2180    /// ```ignore,no_run
2181    /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2182    /// let x = UpdateServiceRequest::new().set_migrate_traffic(true);
2183    /// ```
2184    pub fn set_migrate_traffic<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2185        self.migrate_traffic = v.into();
2186        self
2187    }
2188}
2189
2190impl wkt::message::Message for UpdateServiceRequest {
2191    fn typename() -> &'static str {
2192        "type.googleapis.com/google.appengine.v1.UpdateServiceRequest"
2193    }
2194}
2195
2196/// Request message for `Services.DeleteService`.
2197#[derive(Clone, Default, PartialEq)]
2198#[non_exhaustive]
2199pub struct DeleteServiceRequest {
2200    /// Name of the resource requested. Example: `apps/myapp/services/default`.
2201    pub name: std::string::String,
2202
2203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2204}
2205
2206impl DeleteServiceRequest {
2207    pub fn new() -> Self {
2208        std::default::Default::default()
2209    }
2210
2211    /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
2212    ///
2213    /// # Example
2214    /// ```ignore,no_run
2215    /// # use google_cloud_appengine_v1::model::DeleteServiceRequest;
2216    /// let x = DeleteServiceRequest::new().set_name("example");
2217    /// ```
2218    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2219        self.name = v.into();
2220        self
2221    }
2222}
2223
2224impl wkt::message::Message for DeleteServiceRequest {
2225    fn typename() -> &'static str {
2226        "type.googleapis.com/google.appengine.v1.DeleteServiceRequest"
2227    }
2228}
2229
2230/// Request message for `Versions.ListVersions`.
2231#[derive(Clone, Default, PartialEq)]
2232#[non_exhaustive]
2233pub struct ListVersionsRequest {
2234    /// Name of the parent Service resource. Example:
2235    /// `apps/myapp/services/default`.
2236    pub parent: std::string::String,
2237
2238    /// Controls the set of fields returned in the `List` response.
2239    pub view: crate::model::VersionView,
2240
2241    /// Maximum results to return per page.
2242    pub page_size: i32,
2243
2244    /// Continuation token for fetching the next page of results.
2245    pub page_token: std::string::String,
2246
2247    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2248}
2249
2250impl ListVersionsRequest {
2251    pub fn new() -> Self {
2252        std::default::Default::default()
2253    }
2254
2255    /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
2256    ///
2257    /// # Example
2258    /// ```ignore,no_run
2259    /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2260    /// let x = ListVersionsRequest::new().set_parent("example");
2261    /// ```
2262    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2263        self.parent = v.into();
2264        self
2265    }
2266
2267    /// Sets the value of [view][crate::model::ListVersionsRequest::view].
2268    ///
2269    /// # Example
2270    /// ```ignore,no_run
2271    /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2272    /// use google_cloud_appengine_v1::model::VersionView;
2273    /// let x0 = ListVersionsRequest::new().set_view(VersionView::Full);
2274    /// ```
2275    pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
2276        self.view = v.into();
2277        self
2278    }
2279
2280    /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
2281    ///
2282    /// # Example
2283    /// ```ignore,no_run
2284    /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2285    /// let x = ListVersionsRequest::new().set_page_size(42);
2286    /// ```
2287    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2288        self.page_size = v.into();
2289        self
2290    }
2291
2292    /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
2293    ///
2294    /// # Example
2295    /// ```ignore,no_run
2296    /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2297    /// let x = ListVersionsRequest::new().set_page_token("example");
2298    /// ```
2299    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2300        self.page_token = v.into();
2301        self
2302    }
2303}
2304
2305impl wkt::message::Message for ListVersionsRequest {
2306    fn typename() -> &'static str {
2307        "type.googleapis.com/google.appengine.v1.ListVersionsRequest"
2308    }
2309}
2310
2311/// Response message for `Versions.ListVersions`.
2312#[derive(Clone, Default, PartialEq)]
2313#[non_exhaustive]
2314pub struct ListVersionsResponse {
2315    /// The versions belonging to the requested service.
2316    pub versions: std::vec::Vec<crate::model::Version>,
2317
2318    /// Continuation token for fetching the next page of results.
2319    pub next_page_token: std::string::String,
2320
2321    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2322}
2323
2324impl ListVersionsResponse {
2325    pub fn new() -> Self {
2326        std::default::Default::default()
2327    }
2328
2329    /// Sets the value of [versions][crate::model::ListVersionsResponse::versions].
2330    ///
2331    /// # Example
2332    /// ```ignore,no_run
2333    /// # use google_cloud_appengine_v1::model::ListVersionsResponse;
2334    /// use google_cloud_appengine_v1::model::Version;
2335    /// let x = ListVersionsResponse::new()
2336    ///     .set_versions([
2337    ///         Version::default()/* use setters */,
2338    ///         Version::default()/* use (different) setters */,
2339    ///     ]);
2340    /// ```
2341    pub fn set_versions<T, V>(mut self, v: T) -> Self
2342    where
2343        T: std::iter::IntoIterator<Item = V>,
2344        V: std::convert::Into<crate::model::Version>,
2345    {
2346        use std::iter::Iterator;
2347        self.versions = v.into_iter().map(|i| i.into()).collect();
2348        self
2349    }
2350
2351    /// Sets the value of [next_page_token][crate::model::ListVersionsResponse::next_page_token].
2352    ///
2353    /// # Example
2354    /// ```ignore,no_run
2355    /// # use google_cloud_appengine_v1::model::ListVersionsResponse;
2356    /// let x = ListVersionsResponse::new().set_next_page_token("example");
2357    /// ```
2358    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2359        self.next_page_token = v.into();
2360        self
2361    }
2362}
2363
2364impl wkt::message::Message for ListVersionsResponse {
2365    fn typename() -> &'static str {
2366        "type.googleapis.com/google.appengine.v1.ListVersionsResponse"
2367    }
2368}
2369
2370#[doc(hidden)]
2371impl gax::paginator::internal::PageableResponse for ListVersionsResponse {
2372    type PageItem = crate::model::Version;
2373
2374    fn items(self) -> std::vec::Vec<Self::PageItem> {
2375        self.versions
2376    }
2377
2378    fn next_page_token(&self) -> std::string::String {
2379        use std::clone::Clone;
2380        self.next_page_token.clone()
2381    }
2382}
2383
2384/// Request message for `Versions.GetVersion`.
2385#[derive(Clone, Default, PartialEq)]
2386#[non_exhaustive]
2387pub struct GetVersionRequest {
2388    /// Name of the resource requested. Example:
2389    /// `apps/myapp/services/default/versions/v1`.
2390    pub name: std::string::String,
2391
2392    /// Controls the set of fields returned in the `Get` response.
2393    pub view: crate::model::VersionView,
2394
2395    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2396}
2397
2398impl GetVersionRequest {
2399    pub fn new() -> Self {
2400        std::default::Default::default()
2401    }
2402
2403    /// Sets the value of [name][crate::model::GetVersionRequest::name].
2404    ///
2405    /// # Example
2406    /// ```ignore,no_run
2407    /// # use google_cloud_appengine_v1::model::GetVersionRequest;
2408    /// let x = GetVersionRequest::new().set_name("example");
2409    /// ```
2410    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2411        self.name = v.into();
2412        self
2413    }
2414
2415    /// Sets the value of [view][crate::model::GetVersionRequest::view].
2416    ///
2417    /// # Example
2418    /// ```ignore,no_run
2419    /// # use google_cloud_appengine_v1::model::GetVersionRequest;
2420    /// use google_cloud_appengine_v1::model::VersionView;
2421    /// let x0 = GetVersionRequest::new().set_view(VersionView::Full);
2422    /// ```
2423    pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
2424        self.view = v.into();
2425        self
2426    }
2427}
2428
2429impl wkt::message::Message for GetVersionRequest {
2430    fn typename() -> &'static str {
2431        "type.googleapis.com/google.appengine.v1.GetVersionRequest"
2432    }
2433}
2434
2435/// Request message for `Versions.CreateVersion`.
2436#[derive(Clone, Default, PartialEq)]
2437#[non_exhaustive]
2438pub struct CreateVersionRequest {
2439    /// Name of the parent resource to create this version under. Example:
2440    /// `apps/myapp/services/default`.
2441    pub parent: std::string::String,
2442
2443    /// Application deployment configuration.
2444    pub version: std::option::Option<crate::model::Version>,
2445
2446    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2447}
2448
2449impl CreateVersionRequest {
2450    pub fn new() -> Self {
2451        std::default::Default::default()
2452    }
2453
2454    /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
2455    ///
2456    /// # Example
2457    /// ```ignore,no_run
2458    /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2459    /// let x = CreateVersionRequest::new().set_parent("example");
2460    /// ```
2461    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2462        self.parent = v.into();
2463        self
2464    }
2465
2466    /// Sets the value of [version][crate::model::CreateVersionRequest::version].
2467    ///
2468    /// # Example
2469    /// ```ignore,no_run
2470    /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2471    /// use google_cloud_appengine_v1::model::Version;
2472    /// let x = CreateVersionRequest::new().set_version(Version::default()/* use setters */);
2473    /// ```
2474    pub fn set_version<T>(mut self, v: T) -> Self
2475    where
2476        T: std::convert::Into<crate::model::Version>,
2477    {
2478        self.version = std::option::Option::Some(v.into());
2479        self
2480    }
2481
2482    /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
2483    ///
2484    /// # Example
2485    /// ```ignore,no_run
2486    /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2487    /// use google_cloud_appengine_v1::model::Version;
2488    /// let x = CreateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
2489    /// let x = CreateVersionRequest::new().set_or_clear_version(None::<Version>);
2490    /// ```
2491    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2492    where
2493        T: std::convert::Into<crate::model::Version>,
2494    {
2495        self.version = v.map(|x| x.into());
2496        self
2497    }
2498}
2499
2500impl wkt::message::Message for CreateVersionRequest {
2501    fn typename() -> &'static str {
2502        "type.googleapis.com/google.appengine.v1.CreateVersionRequest"
2503    }
2504}
2505
2506/// Request message for `Versions.UpdateVersion`.
2507#[derive(Clone, Default, PartialEq)]
2508#[non_exhaustive]
2509pub struct UpdateVersionRequest {
2510    /// Name of the resource to update. Example:
2511    /// `apps/myapp/services/default/versions/1`.
2512    pub name: std::string::String,
2513
2514    /// A Version containing the updated resource. Only fields set in the field
2515    /// mask will be updated.
2516    pub version: std::option::Option<crate::model::Version>,
2517
2518    /// Standard field mask for the set of fields to be updated.
2519    pub update_mask: std::option::Option<wkt::FieldMask>,
2520
2521    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2522}
2523
2524impl UpdateVersionRequest {
2525    pub fn new() -> Self {
2526        std::default::Default::default()
2527    }
2528
2529    /// Sets the value of [name][crate::model::UpdateVersionRequest::name].
2530    ///
2531    /// # Example
2532    /// ```ignore,no_run
2533    /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2534    /// let x = UpdateVersionRequest::new().set_name("example");
2535    /// ```
2536    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2537        self.name = v.into();
2538        self
2539    }
2540
2541    /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
2542    ///
2543    /// # Example
2544    /// ```ignore,no_run
2545    /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2546    /// use google_cloud_appengine_v1::model::Version;
2547    /// let x = UpdateVersionRequest::new().set_version(Version::default()/* use setters */);
2548    /// ```
2549    pub fn set_version<T>(mut self, v: T) -> Self
2550    where
2551        T: std::convert::Into<crate::model::Version>,
2552    {
2553        self.version = std::option::Option::Some(v.into());
2554        self
2555    }
2556
2557    /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
2558    ///
2559    /// # Example
2560    /// ```ignore,no_run
2561    /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2562    /// use google_cloud_appengine_v1::model::Version;
2563    /// let x = UpdateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
2564    /// let x = UpdateVersionRequest::new().set_or_clear_version(None::<Version>);
2565    /// ```
2566    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2567    where
2568        T: std::convert::Into<crate::model::Version>,
2569    {
2570        self.version = v.map(|x| x.into());
2571        self
2572    }
2573
2574    /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
2575    ///
2576    /// # Example
2577    /// ```ignore,no_run
2578    /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2579    /// use wkt::FieldMask;
2580    /// let x = UpdateVersionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2581    /// ```
2582    pub fn set_update_mask<T>(mut self, v: T) -> Self
2583    where
2584        T: std::convert::Into<wkt::FieldMask>,
2585    {
2586        self.update_mask = std::option::Option::Some(v.into());
2587        self
2588    }
2589
2590    /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
2591    ///
2592    /// # Example
2593    /// ```ignore,no_run
2594    /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2595    /// use wkt::FieldMask;
2596    /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2597    /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2598    /// ```
2599    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2600    where
2601        T: std::convert::Into<wkt::FieldMask>,
2602    {
2603        self.update_mask = v.map(|x| x.into());
2604        self
2605    }
2606}
2607
2608impl wkt::message::Message for UpdateVersionRequest {
2609    fn typename() -> &'static str {
2610        "type.googleapis.com/google.appengine.v1.UpdateVersionRequest"
2611    }
2612}
2613
2614/// Request message for `Versions.DeleteVersion`.
2615#[derive(Clone, Default, PartialEq)]
2616#[non_exhaustive]
2617pub struct DeleteVersionRequest {
2618    /// Name of the resource requested. Example:
2619    /// `apps/myapp/services/default/versions/v1`.
2620    pub name: std::string::String,
2621
2622    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2623}
2624
2625impl DeleteVersionRequest {
2626    pub fn new() -> Self {
2627        std::default::Default::default()
2628    }
2629
2630    /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
2631    ///
2632    /// # Example
2633    /// ```ignore,no_run
2634    /// # use google_cloud_appengine_v1::model::DeleteVersionRequest;
2635    /// let x = DeleteVersionRequest::new().set_name("example");
2636    /// ```
2637    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2638        self.name = v.into();
2639        self
2640    }
2641}
2642
2643impl wkt::message::Message for DeleteVersionRequest {
2644    fn typename() -> &'static str {
2645        "type.googleapis.com/google.appengine.v1.DeleteVersionRequest"
2646    }
2647}
2648
2649/// Request message for `Instances.ListInstances`.
2650#[derive(Clone, Default, PartialEq)]
2651#[non_exhaustive]
2652pub struct ListInstancesRequest {
2653    /// Name of the parent Version resource. Example:
2654    /// `apps/myapp/services/default/versions/v1`.
2655    pub parent: std::string::String,
2656
2657    /// Maximum results to return per page.
2658    pub page_size: i32,
2659
2660    /// Continuation token for fetching the next page of results.
2661    pub page_token: std::string::String,
2662
2663    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2664}
2665
2666impl ListInstancesRequest {
2667    pub fn new() -> Self {
2668        std::default::Default::default()
2669    }
2670
2671    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
2672    ///
2673    /// # Example
2674    /// ```ignore,no_run
2675    /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2676    /// let x = ListInstancesRequest::new().set_parent("example");
2677    /// ```
2678    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2679        self.parent = v.into();
2680        self
2681    }
2682
2683    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
2684    ///
2685    /// # Example
2686    /// ```ignore,no_run
2687    /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2688    /// let x = ListInstancesRequest::new().set_page_size(42);
2689    /// ```
2690    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2691        self.page_size = v.into();
2692        self
2693    }
2694
2695    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
2696    ///
2697    /// # Example
2698    /// ```ignore,no_run
2699    /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2700    /// let x = ListInstancesRequest::new().set_page_token("example");
2701    /// ```
2702    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2703        self.page_token = v.into();
2704        self
2705    }
2706}
2707
2708impl wkt::message::Message for ListInstancesRequest {
2709    fn typename() -> &'static str {
2710        "type.googleapis.com/google.appengine.v1.ListInstancesRequest"
2711    }
2712}
2713
2714/// Response message for `Instances.ListInstances`.
2715#[derive(Clone, Default, PartialEq)]
2716#[non_exhaustive]
2717pub struct ListInstancesResponse {
2718    /// The instances belonging to the requested version.
2719    pub instances: std::vec::Vec<crate::model::Instance>,
2720
2721    /// Continuation token for fetching the next page of results.
2722    pub next_page_token: std::string::String,
2723
2724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2725}
2726
2727impl ListInstancesResponse {
2728    pub fn new() -> Self {
2729        std::default::Default::default()
2730    }
2731
2732    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
2733    ///
2734    /// # Example
2735    /// ```ignore,no_run
2736    /// # use google_cloud_appengine_v1::model::ListInstancesResponse;
2737    /// use google_cloud_appengine_v1::model::Instance;
2738    /// let x = ListInstancesResponse::new()
2739    ///     .set_instances([
2740    ///         Instance::default()/* use setters */,
2741    ///         Instance::default()/* use (different) setters */,
2742    ///     ]);
2743    /// ```
2744    pub fn set_instances<T, V>(mut self, v: T) -> Self
2745    where
2746        T: std::iter::IntoIterator<Item = V>,
2747        V: std::convert::Into<crate::model::Instance>,
2748    {
2749        use std::iter::Iterator;
2750        self.instances = v.into_iter().map(|i| i.into()).collect();
2751        self
2752    }
2753
2754    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
2755    ///
2756    /// # Example
2757    /// ```ignore,no_run
2758    /// # use google_cloud_appengine_v1::model::ListInstancesResponse;
2759    /// let x = ListInstancesResponse::new().set_next_page_token("example");
2760    /// ```
2761    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762        self.next_page_token = v.into();
2763        self
2764    }
2765}
2766
2767impl wkt::message::Message for ListInstancesResponse {
2768    fn typename() -> &'static str {
2769        "type.googleapis.com/google.appengine.v1.ListInstancesResponse"
2770    }
2771}
2772
2773#[doc(hidden)]
2774impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
2775    type PageItem = crate::model::Instance;
2776
2777    fn items(self) -> std::vec::Vec<Self::PageItem> {
2778        self.instances
2779    }
2780
2781    fn next_page_token(&self) -> std::string::String {
2782        use std::clone::Clone;
2783        self.next_page_token.clone()
2784    }
2785}
2786
2787/// Request message for `Instances.GetInstance`.
2788#[derive(Clone, Default, PartialEq)]
2789#[non_exhaustive]
2790pub struct GetInstanceRequest {
2791    /// Name of the resource requested. Example:
2792    /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2793    pub name: std::string::String,
2794
2795    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2796}
2797
2798impl GetInstanceRequest {
2799    pub fn new() -> Self {
2800        std::default::Default::default()
2801    }
2802
2803    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2804    ///
2805    /// # Example
2806    /// ```ignore,no_run
2807    /// # use google_cloud_appengine_v1::model::GetInstanceRequest;
2808    /// let x = GetInstanceRequest::new().set_name("example");
2809    /// ```
2810    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2811        self.name = v.into();
2812        self
2813    }
2814}
2815
2816impl wkt::message::Message for GetInstanceRequest {
2817    fn typename() -> &'static str {
2818        "type.googleapis.com/google.appengine.v1.GetInstanceRequest"
2819    }
2820}
2821
2822/// Request message for `Instances.DeleteInstance`.
2823#[derive(Clone, Default, PartialEq)]
2824#[non_exhaustive]
2825pub struct DeleteInstanceRequest {
2826    /// Name of the resource requested. Example:
2827    /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2828    pub name: std::string::String,
2829
2830    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2831}
2832
2833impl DeleteInstanceRequest {
2834    pub fn new() -> Self {
2835        std::default::Default::default()
2836    }
2837
2838    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
2839    ///
2840    /// # Example
2841    /// ```ignore,no_run
2842    /// # use google_cloud_appengine_v1::model::DeleteInstanceRequest;
2843    /// let x = DeleteInstanceRequest::new().set_name("example");
2844    /// ```
2845    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2846        self.name = v.into();
2847        self
2848    }
2849}
2850
2851impl wkt::message::Message for DeleteInstanceRequest {
2852    fn typename() -> &'static str {
2853        "type.googleapis.com/google.appengine.v1.DeleteInstanceRequest"
2854    }
2855}
2856
2857/// Request message for `Instances.DebugInstance`.
2858#[derive(Clone, Default, PartialEq)]
2859#[non_exhaustive]
2860pub struct DebugInstanceRequest {
2861    /// Name of the resource requested. Example:
2862    /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2863    pub name: std::string::String,
2864
2865    /// Public SSH key to add to the instance. Examples:
2866    ///
2867    /// * `[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]`
2868    /// * `[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}`
2869    ///
2870    /// For more information, see
2871    /// [Adding and Removing SSH Keys](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).
2872    pub ssh_key: std::string::String,
2873
2874    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2875}
2876
2877impl DebugInstanceRequest {
2878    pub fn new() -> Self {
2879        std::default::Default::default()
2880    }
2881
2882    /// Sets the value of [name][crate::model::DebugInstanceRequest::name].
2883    ///
2884    /// # Example
2885    /// ```ignore,no_run
2886    /// # use google_cloud_appengine_v1::model::DebugInstanceRequest;
2887    /// let x = DebugInstanceRequest::new().set_name("example");
2888    /// ```
2889    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2890        self.name = v.into();
2891        self
2892    }
2893
2894    /// Sets the value of [ssh_key][crate::model::DebugInstanceRequest::ssh_key].
2895    ///
2896    /// # Example
2897    /// ```ignore,no_run
2898    /// # use google_cloud_appengine_v1::model::DebugInstanceRequest;
2899    /// let x = DebugInstanceRequest::new().set_ssh_key("example");
2900    /// ```
2901    pub fn set_ssh_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2902        self.ssh_key = v.into();
2903        self
2904    }
2905}
2906
2907impl wkt::message::Message for DebugInstanceRequest {
2908    fn typename() -> &'static str {
2909        "type.googleapis.com/google.appengine.v1.DebugInstanceRequest"
2910    }
2911}
2912
2913/// Request message for `Firewall.ListIngressRules`.
2914#[derive(Clone, Default, PartialEq)]
2915#[non_exhaustive]
2916pub struct ListIngressRulesRequest {
2917    /// Name of the Firewall collection to retrieve.
2918    /// Example: `apps/myapp/firewall/ingressRules`.
2919    pub parent: std::string::String,
2920
2921    /// Maximum results to return per page.
2922    pub page_size: i32,
2923
2924    /// Continuation token for fetching the next page of results.
2925    pub page_token: std::string::String,
2926
2927    /// A valid IP Address. If set, only rules matching this address will be
2928    /// returned. The first returned rule will be the rule that fires on requests
2929    /// from this IP.
2930    pub matching_address: std::string::String,
2931
2932    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2933}
2934
2935impl ListIngressRulesRequest {
2936    pub fn new() -> Self {
2937        std::default::Default::default()
2938    }
2939
2940    /// Sets the value of [parent][crate::model::ListIngressRulesRequest::parent].
2941    ///
2942    /// # Example
2943    /// ```ignore,no_run
2944    /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2945    /// let x = ListIngressRulesRequest::new().set_parent("example");
2946    /// ```
2947    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2948        self.parent = v.into();
2949        self
2950    }
2951
2952    /// Sets the value of [page_size][crate::model::ListIngressRulesRequest::page_size].
2953    ///
2954    /// # Example
2955    /// ```ignore,no_run
2956    /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2957    /// let x = ListIngressRulesRequest::new().set_page_size(42);
2958    /// ```
2959    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2960        self.page_size = v.into();
2961        self
2962    }
2963
2964    /// Sets the value of [page_token][crate::model::ListIngressRulesRequest::page_token].
2965    ///
2966    /// # Example
2967    /// ```ignore,no_run
2968    /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2969    /// let x = ListIngressRulesRequest::new().set_page_token("example");
2970    /// ```
2971    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2972        self.page_token = v.into();
2973        self
2974    }
2975
2976    /// Sets the value of [matching_address][crate::model::ListIngressRulesRequest::matching_address].
2977    ///
2978    /// # Example
2979    /// ```ignore,no_run
2980    /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2981    /// let x = ListIngressRulesRequest::new().set_matching_address("example");
2982    /// ```
2983    pub fn set_matching_address<T: std::convert::Into<std::string::String>>(
2984        mut self,
2985        v: T,
2986    ) -> Self {
2987        self.matching_address = v.into();
2988        self
2989    }
2990}
2991
2992impl wkt::message::Message for ListIngressRulesRequest {
2993    fn typename() -> &'static str {
2994        "type.googleapis.com/google.appengine.v1.ListIngressRulesRequest"
2995    }
2996}
2997
2998/// Response message for `Firewall.ListIngressRules`.
2999#[derive(Clone, Default, PartialEq)]
3000#[non_exhaustive]
3001pub struct ListIngressRulesResponse {
3002    /// The ingress FirewallRules for this application.
3003    pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3004
3005    /// Continuation token for fetching the next page of results.
3006    pub next_page_token: std::string::String,
3007
3008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3009}
3010
3011impl ListIngressRulesResponse {
3012    pub fn new() -> Self {
3013        std::default::Default::default()
3014    }
3015
3016    /// Sets the value of [ingress_rules][crate::model::ListIngressRulesResponse::ingress_rules].
3017    ///
3018    /// # Example
3019    /// ```ignore,no_run
3020    /// # use google_cloud_appengine_v1::model::ListIngressRulesResponse;
3021    /// use google_cloud_appengine_v1::model::FirewallRule;
3022    /// let x = ListIngressRulesResponse::new()
3023    ///     .set_ingress_rules([
3024    ///         FirewallRule::default()/* use setters */,
3025    ///         FirewallRule::default()/* use (different) setters */,
3026    ///     ]);
3027    /// ```
3028    pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3029    where
3030        T: std::iter::IntoIterator<Item = V>,
3031        V: std::convert::Into<crate::model::FirewallRule>,
3032    {
3033        use std::iter::Iterator;
3034        self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3035        self
3036    }
3037
3038    /// Sets the value of [next_page_token][crate::model::ListIngressRulesResponse::next_page_token].
3039    ///
3040    /// # Example
3041    /// ```ignore,no_run
3042    /// # use google_cloud_appengine_v1::model::ListIngressRulesResponse;
3043    /// let x = ListIngressRulesResponse::new().set_next_page_token("example");
3044    /// ```
3045    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3046        self.next_page_token = v.into();
3047        self
3048    }
3049}
3050
3051impl wkt::message::Message for ListIngressRulesResponse {
3052    fn typename() -> &'static str {
3053        "type.googleapis.com/google.appengine.v1.ListIngressRulesResponse"
3054    }
3055}
3056
3057#[doc(hidden)]
3058impl gax::paginator::internal::PageableResponse for ListIngressRulesResponse {
3059    type PageItem = crate::model::FirewallRule;
3060
3061    fn items(self) -> std::vec::Vec<Self::PageItem> {
3062        self.ingress_rules
3063    }
3064
3065    fn next_page_token(&self) -> std::string::String {
3066        use std::clone::Clone;
3067        self.next_page_token.clone()
3068    }
3069}
3070
3071/// Request message for `Firewall.BatchUpdateIngressRules`.
3072#[derive(Clone, Default, PartialEq)]
3073#[non_exhaustive]
3074pub struct BatchUpdateIngressRulesRequest {
3075    /// Name of the Firewall collection to set.
3076    /// Example: `apps/myapp/firewall/ingressRules`.
3077    pub name: std::string::String,
3078
3079    /// A list of FirewallRules to replace the existing set.
3080    pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3081
3082    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3083}
3084
3085impl BatchUpdateIngressRulesRequest {
3086    pub fn new() -> Self {
3087        std::default::Default::default()
3088    }
3089
3090    /// Sets the value of [name][crate::model::BatchUpdateIngressRulesRequest::name].
3091    ///
3092    /// # Example
3093    /// ```ignore,no_run
3094    /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesRequest;
3095    /// let x = BatchUpdateIngressRulesRequest::new().set_name("example");
3096    /// ```
3097    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3098        self.name = v.into();
3099        self
3100    }
3101
3102    /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesRequest::ingress_rules].
3103    ///
3104    /// # Example
3105    /// ```ignore,no_run
3106    /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesRequest;
3107    /// use google_cloud_appengine_v1::model::FirewallRule;
3108    /// let x = BatchUpdateIngressRulesRequest::new()
3109    ///     .set_ingress_rules([
3110    ///         FirewallRule::default()/* use setters */,
3111    ///         FirewallRule::default()/* use (different) setters */,
3112    ///     ]);
3113    /// ```
3114    pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3115    where
3116        T: std::iter::IntoIterator<Item = V>,
3117        V: std::convert::Into<crate::model::FirewallRule>,
3118    {
3119        use std::iter::Iterator;
3120        self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3121        self
3122    }
3123}
3124
3125impl wkt::message::Message for BatchUpdateIngressRulesRequest {
3126    fn typename() -> &'static str {
3127        "type.googleapis.com/google.appengine.v1.BatchUpdateIngressRulesRequest"
3128    }
3129}
3130
3131/// Response message for `Firewall.UpdateAllIngressRules`.
3132#[derive(Clone, Default, PartialEq)]
3133#[non_exhaustive]
3134pub struct BatchUpdateIngressRulesResponse {
3135    /// The full list of ingress FirewallRules for this application.
3136    pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3137
3138    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3139}
3140
3141impl BatchUpdateIngressRulesResponse {
3142    pub fn new() -> Self {
3143        std::default::Default::default()
3144    }
3145
3146    /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesResponse::ingress_rules].
3147    ///
3148    /// # Example
3149    /// ```ignore,no_run
3150    /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesResponse;
3151    /// use google_cloud_appengine_v1::model::FirewallRule;
3152    /// let x = BatchUpdateIngressRulesResponse::new()
3153    ///     .set_ingress_rules([
3154    ///         FirewallRule::default()/* use setters */,
3155    ///         FirewallRule::default()/* use (different) setters */,
3156    ///     ]);
3157    /// ```
3158    pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3159    where
3160        T: std::iter::IntoIterator<Item = V>,
3161        V: std::convert::Into<crate::model::FirewallRule>,
3162    {
3163        use std::iter::Iterator;
3164        self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3165        self
3166    }
3167}
3168
3169impl wkt::message::Message for BatchUpdateIngressRulesResponse {
3170    fn typename() -> &'static str {
3171        "type.googleapis.com/google.appengine.v1.BatchUpdateIngressRulesResponse"
3172    }
3173}
3174
3175/// Request message for `Firewall.CreateIngressRule`.
3176#[derive(Clone, Default, PartialEq)]
3177#[non_exhaustive]
3178pub struct CreateIngressRuleRequest {
3179    /// Name of the parent Firewall collection in which to create a new rule.
3180    /// Example: `apps/myapp/firewall/ingressRules`.
3181    pub parent: std::string::String,
3182
3183    /// A FirewallRule containing the new resource.
3184    ///
3185    /// The user may optionally provide a position at which the new rule will be
3186    /// placed. The positions define a sequential list starting at 1. If a rule
3187    /// already exists at the given position, rules greater than the provided
3188    /// position will be moved forward by one.
3189    ///
3190    /// If no position is provided, the server will place the rule as the second to
3191    /// last rule in the sequence before the required default allow-all or deny-all
3192    /// rule.
3193    pub rule: std::option::Option<crate::model::FirewallRule>,
3194
3195    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3196}
3197
3198impl CreateIngressRuleRequest {
3199    pub fn new() -> Self {
3200        std::default::Default::default()
3201    }
3202
3203    /// Sets the value of [parent][crate::model::CreateIngressRuleRequest::parent].
3204    ///
3205    /// # Example
3206    /// ```ignore,no_run
3207    /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3208    /// let x = CreateIngressRuleRequest::new().set_parent("example");
3209    /// ```
3210    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3211        self.parent = v.into();
3212        self
3213    }
3214
3215    /// Sets the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3216    ///
3217    /// # Example
3218    /// ```ignore,no_run
3219    /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3220    /// use google_cloud_appengine_v1::model::FirewallRule;
3221    /// let x = CreateIngressRuleRequest::new().set_rule(FirewallRule::default()/* use setters */);
3222    /// ```
3223    pub fn set_rule<T>(mut self, v: T) -> Self
3224    where
3225        T: std::convert::Into<crate::model::FirewallRule>,
3226    {
3227        self.rule = std::option::Option::Some(v.into());
3228        self
3229    }
3230
3231    /// Sets or clears the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3232    ///
3233    /// # Example
3234    /// ```ignore,no_run
3235    /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3236    /// use google_cloud_appengine_v1::model::FirewallRule;
3237    /// let x = CreateIngressRuleRequest::new().set_or_clear_rule(Some(FirewallRule::default()/* use setters */));
3238    /// let x = CreateIngressRuleRequest::new().set_or_clear_rule(None::<FirewallRule>);
3239    /// ```
3240    pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3241    where
3242        T: std::convert::Into<crate::model::FirewallRule>,
3243    {
3244        self.rule = v.map(|x| x.into());
3245        self
3246    }
3247}
3248
3249impl wkt::message::Message for CreateIngressRuleRequest {
3250    fn typename() -> &'static str {
3251        "type.googleapis.com/google.appengine.v1.CreateIngressRuleRequest"
3252    }
3253}
3254
3255/// Request message for `Firewall.GetIngressRule`.
3256#[derive(Clone, Default, PartialEq)]
3257#[non_exhaustive]
3258pub struct GetIngressRuleRequest {
3259    /// Name of the Firewall resource to retrieve.
3260    /// Example: `apps/myapp/firewall/ingressRules/100`.
3261    pub name: std::string::String,
3262
3263    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3264}
3265
3266impl GetIngressRuleRequest {
3267    pub fn new() -> Self {
3268        std::default::Default::default()
3269    }
3270
3271    /// Sets the value of [name][crate::model::GetIngressRuleRequest::name].
3272    ///
3273    /// # Example
3274    /// ```ignore,no_run
3275    /// # use google_cloud_appengine_v1::model::GetIngressRuleRequest;
3276    /// let x = GetIngressRuleRequest::new().set_name("example");
3277    /// ```
3278    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3279        self.name = v.into();
3280        self
3281    }
3282}
3283
3284impl wkt::message::Message for GetIngressRuleRequest {
3285    fn typename() -> &'static str {
3286        "type.googleapis.com/google.appengine.v1.GetIngressRuleRequest"
3287    }
3288}
3289
3290/// Request message for `Firewall.UpdateIngressRule`.
3291#[derive(Clone, Default, PartialEq)]
3292#[non_exhaustive]
3293pub struct UpdateIngressRuleRequest {
3294    /// Name of the Firewall resource to update.
3295    /// Example: `apps/myapp/firewall/ingressRules/100`.
3296    pub name: std::string::String,
3297
3298    /// A FirewallRule containing the updated resource
3299    pub rule: std::option::Option<crate::model::FirewallRule>,
3300
3301    /// Standard field mask for the set of fields to be updated.
3302    pub update_mask: std::option::Option<wkt::FieldMask>,
3303
3304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3305}
3306
3307impl UpdateIngressRuleRequest {
3308    pub fn new() -> Self {
3309        std::default::Default::default()
3310    }
3311
3312    /// Sets the value of [name][crate::model::UpdateIngressRuleRequest::name].
3313    ///
3314    /// # Example
3315    /// ```ignore,no_run
3316    /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3317    /// let x = UpdateIngressRuleRequest::new().set_name("example");
3318    /// ```
3319    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3320        self.name = v.into();
3321        self
3322    }
3323
3324    /// Sets the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3325    ///
3326    /// # Example
3327    /// ```ignore,no_run
3328    /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3329    /// use google_cloud_appengine_v1::model::FirewallRule;
3330    /// let x = UpdateIngressRuleRequest::new().set_rule(FirewallRule::default()/* use setters */);
3331    /// ```
3332    pub fn set_rule<T>(mut self, v: T) -> Self
3333    where
3334        T: std::convert::Into<crate::model::FirewallRule>,
3335    {
3336        self.rule = std::option::Option::Some(v.into());
3337        self
3338    }
3339
3340    /// Sets or clears the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3341    ///
3342    /// # Example
3343    /// ```ignore,no_run
3344    /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3345    /// use google_cloud_appengine_v1::model::FirewallRule;
3346    /// let x = UpdateIngressRuleRequest::new().set_or_clear_rule(Some(FirewallRule::default()/* use setters */));
3347    /// let x = UpdateIngressRuleRequest::new().set_or_clear_rule(None::<FirewallRule>);
3348    /// ```
3349    pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3350    where
3351        T: std::convert::Into<crate::model::FirewallRule>,
3352    {
3353        self.rule = v.map(|x| x.into());
3354        self
3355    }
3356
3357    /// Sets the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3358    ///
3359    /// # Example
3360    /// ```ignore,no_run
3361    /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3362    /// use wkt::FieldMask;
3363    /// let x = UpdateIngressRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3364    /// ```
3365    pub fn set_update_mask<T>(mut self, v: T) -> Self
3366    where
3367        T: std::convert::Into<wkt::FieldMask>,
3368    {
3369        self.update_mask = std::option::Option::Some(v.into());
3370        self
3371    }
3372
3373    /// Sets or clears the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3374    ///
3375    /// # Example
3376    /// ```ignore,no_run
3377    /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3378    /// use wkt::FieldMask;
3379    /// let x = UpdateIngressRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3380    /// let x = UpdateIngressRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3381    /// ```
3382    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3383    where
3384        T: std::convert::Into<wkt::FieldMask>,
3385    {
3386        self.update_mask = v.map(|x| x.into());
3387        self
3388    }
3389}
3390
3391impl wkt::message::Message for UpdateIngressRuleRequest {
3392    fn typename() -> &'static str {
3393        "type.googleapis.com/google.appengine.v1.UpdateIngressRuleRequest"
3394    }
3395}
3396
3397/// Request message for `Firewall.DeleteIngressRule`.
3398#[derive(Clone, Default, PartialEq)]
3399#[non_exhaustive]
3400pub struct DeleteIngressRuleRequest {
3401    /// Name of the Firewall resource to delete.
3402    /// Example: `apps/myapp/firewall/ingressRules/100`.
3403    pub name: std::string::String,
3404
3405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3406}
3407
3408impl DeleteIngressRuleRequest {
3409    pub fn new() -> Self {
3410        std::default::Default::default()
3411    }
3412
3413    /// Sets the value of [name][crate::model::DeleteIngressRuleRequest::name].
3414    ///
3415    /// # Example
3416    /// ```ignore,no_run
3417    /// # use google_cloud_appengine_v1::model::DeleteIngressRuleRequest;
3418    /// let x = DeleteIngressRuleRequest::new().set_name("example");
3419    /// ```
3420    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3421        self.name = v.into();
3422        self
3423    }
3424}
3425
3426impl wkt::message::Message for DeleteIngressRuleRequest {
3427    fn typename() -> &'static str {
3428        "type.googleapis.com/google.appengine.v1.DeleteIngressRuleRequest"
3429    }
3430}
3431
3432/// Request message for `AuthorizedDomains.ListAuthorizedDomains`.
3433#[derive(Clone, Default, PartialEq)]
3434#[non_exhaustive]
3435pub struct ListAuthorizedDomainsRequest {
3436    /// Name of the parent Application resource. Example: `apps/myapp`.
3437    pub parent: std::string::String,
3438
3439    /// Maximum results to return per page.
3440    pub page_size: i32,
3441
3442    /// Continuation token for fetching the next page of results.
3443    pub page_token: std::string::String,
3444
3445    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3446}
3447
3448impl ListAuthorizedDomainsRequest {
3449    pub fn new() -> Self {
3450        std::default::Default::default()
3451    }
3452
3453    /// Sets the value of [parent][crate::model::ListAuthorizedDomainsRequest::parent].
3454    ///
3455    /// # Example
3456    /// ```ignore,no_run
3457    /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3458    /// let x = ListAuthorizedDomainsRequest::new().set_parent("example");
3459    /// ```
3460    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3461        self.parent = v.into();
3462        self
3463    }
3464
3465    /// Sets the value of [page_size][crate::model::ListAuthorizedDomainsRequest::page_size].
3466    ///
3467    /// # Example
3468    /// ```ignore,no_run
3469    /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3470    /// let x = ListAuthorizedDomainsRequest::new().set_page_size(42);
3471    /// ```
3472    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3473        self.page_size = v.into();
3474        self
3475    }
3476
3477    /// Sets the value of [page_token][crate::model::ListAuthorizedDomainsRequest::page_token].
3478    ///
3479    /// # Example
3480    /// ```ignore,no_run
3481    /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3482    /// let x = ListAuthorizedDomainsRequest::new().set_page_token("example");
3483    /// ```
3484    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3485        self.page_token = v.into();
3486        self
3487    }
3488}
3489
3490impl wkt::message::Message for ListAuthorizedDomainsRequest {
3491    fn typename() -> &'static str {
3492        "type.googleapis.com/google.appengine.v1.ListAuthorizedDomainsRequest"
3493    }
3494}
3495
3496/// Response message for `AuthorizedDomains.ListAuthorizedDomains`.
3497#[derive(Clone, Default, PartialEq)]
3498#[non_exhaustive]
3499pub struct ListAuthorizedDomainsResponse {
3500    /// The authorized domains belonging to the user.
3501    pub domains: std::vec::Vec<crate::model::AuthorizedDomain>,
3502
3503    /// Continuation token for fetching the next page of results.
3504    pub next_page_token: std::string::String,
3505
3506    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3507}
3508
3509impl ListAuthorizedDomainsResponse {
3510    pub fn new() -> Self {
3511        std::default::Default::default()
3512    }
3513
3514    /// Sets the value of [domains][crate::model::ListAuthorizedDomainsResponse::domains].
3515    ///
3516    /// # Example
3517    /// ```ignore,no_run
3518    /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsResponse;
3519    /// use google_cloud_appengine_v1::model::AuthorizedDomain;
3520    /// let x = ListAuthorizedDomainsResponse::new()
3521    ///     .set_domains([
3522    ///         AuthorizedDomain::default()/* use setters */,
3523    ///         AuthorizedDomain::default()/* use (different) setters */,
3524    ///     ]);
3525    /// ```
3526    pub fn set_domains<T, V>(mut self, v: T) -> Self
3527    where
3528        T: std::iter::IntoIterator<Item = V>,
3529        V: std::convert::Into<crate::model::AuthorizedDomain>,
3530    {
3531        use std::iter::Iterator;
3532        self.domains = v.into_iter().map(|i| i.into()).collect();
3533        self
3534    }
3535
3536    /// Sets the value of [next_page_token][crate::model::ListAuthorizedDomainsResponse::next_page_token].
3537    ///
3538    /// # Example
3539    /// ```ignore,no_run
3540    /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsResponse;
3541    /// let x = ListAuthorizedDomainsResponse::new().set_next_page_token("example");
3542    /// ```
3543    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3544        self.next_page_token = v.into();
3545        self
3546    }
3547}
3548
3549impl wkt::message::Message for ListAuthorizedDomainsResponse {
3550    fn typename() -> &'static str {
3551        "type.googleapis.com/google.appengine.v1.ListAuthorizedDomainsResponse"
3552    }
3553}
3554
3555#[doc(hidden)]
3556impl gax::paginator::internal::PageableResponse for ListAuthorizedDomainsResponse {
3557    type PageItem = crate::model::AuthorizedDomain;
3558
3559    fn items(self) -> std::vec::Vec<Self::PageItem> {
3560        self.domains
3561    }
3562
3563    fn next_page_token(&self) -> std::string::String {
3564        use std::clone::Clone;
3565        self.next_page_token.clone()
3566    }
3567}
3568
3569/// Request message for `AuthorizedCertificates.ListAuthorizedCertificates`.
3570#[derive(Clone, Default, PartialEq)]
3571#[non_exhaustive]
3572pub struct ListAuthorizedCertificatesRequest {
3573    /// Name of the parent `Application` resource. Example: `apps/myapp`.
3574    pub parent: std::string::String,
3575
3576    /// Controls the set of fields returned in the `LIST` response.
3577    pub view: crate::model::AuthorizedCertificateView,
3578
3579    /// Maximum results to return per page.
3580    pub page_size: i32,
3581
3582    /// Continuation token for fetching the next page of results.
3583    pub page_token: std::string::String,
3584
3585    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3586}
3587
3588impl ListAuthorizedCertificatesRequest {
3589    pub fn new() -> Self {
3590        std::default::Default::default()
3591    }
3592
3593    /// Sets the value of [parent][crate::model::ListAuthorizedCertificatesRequest::parent].
3594    ///
3595    /// # Example
3596    /// ```ignore,no_run
3597    /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3598    /// let x = ListAuthorizedCertificatesRequest::new().set_parent("example");
3599    /// ```
3600    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3601        self.parent = v.into();
3602        self
3603    }
3604
3605    /// Sets the value of [view][crate::model::ListAuthorizedCertificatesRequest::view].
3606    ///
3607    /// # Example
3608    /// ```ignore,no_run
3609    /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3610    /// use google_cloud_appengine_v1::model::AuthorizedCertificateView;
3611    /// let x0 = ListAuthorizedCertificatesRequest::new().set_view(AuthorizedCertificateView::FullCertificate);
3612    /// ```
3613    pub fn set_view<T: std::convert::Into<crate::model::AuthorizedCertificateView>>(
3614        mut self,
3615        v: T,
3616    ) -> Self {
3617        self.view = v.into();
3618        self
3619    }
3620
3621    /// Sets the value of [page_size][crate::model::ListAuthorizedCertificatesRequest::page_size].
3622    ///
3623    /// # Example
3624    /// ```ignore,no_run
3625    /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3626    /// let x = ListAuthorizedCertificatesRequest::new().set_page_size(42);
3627    /// ```
3628    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3629        self.page_size = v.into();
3630        self
3631    }
3632
3633    /// Sets the value of [page_token][crate::model::ListAuthorizedCertificatesRequest::page_token].
3634    ///
3635    /// # Example
3636    /// ```ignore,no_run
3637    /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3638    /// let x = ListAuthorizedCertificatesRequest::new().set_page_token("example");
3639    /// ```
3640    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3641        self.page_token = v.into();
3642        self
3643    }
3644}
3645
3646impl wkt::message::Message for ListAuthorizedCertificatesRequest {
3647    fn typename() -> &'static str {
3648        "type.googleapis.com/google.appengine.v1.ListAuthorizedCertificatesRequest"
3649    }
3650}
3651
3652/// Response message for `AuthorizedCertificates.ListAuthorizedCertificates`.
3653#[derive(Clone, Default, PartialEq)]
3654#[non_exhaustive]
3655pub struct ListAuthorizedCertificatesResponse {
3656    /// The SSL certificates the user is authorized to administer.
3657    pub certificates: std::vec::Vec<crate::model::AuthorizedCertificate>,
3658
3659    /// Continuation token for fetching the next page of results.
3660    pub next_page_token: std::string::String,
3661
3662    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3663}
3664
3665impl ListAuthorizedCertificatesResponse {
3666    pub fn new() -> Self {
3667        std::default::Default::default()
3668    }
3669
3670    /// Sets the value of [certificates][crate::model::ListAuthorizedCertificatesResponse::certificates].
3671    ///
3672    /// # Example
3673    /// ```ignore,no_run
3674    /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesResponse;
3675    /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3676    /// let x = ListAuthorizedCertificatesResponse::new()
3677    ///     .set_certificates([
3678    ///         AuthorizedCertificate::default()/* use setters */,
3679    ///         AuthorizedCertificate::default()/* use (different) setters */,
3680    ///     ]);
3681    /// ```
3682    pub fn set_certificates<T, V>(mut self, v: T) -> Self
3683    where
3684        T: std::iter::IntoIterator<Item = V>,
3685        V: std::convert::Into<crate::model::AuthorizedCertificate>,
3686    {
3687        use std::iter::Iterator;
3688        self.certificates = v.into_iter().map(|i| i.into()).collect();
3689        self
3690    }
3691
3692    /// Sets the value of [next_page_token][crate::model::ListAuthorizedCertificatesResponse::next_page_token].
3693    ///
3694    /// # Example
3695    /// ```ignore,no_run
3696    /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesResponse;
3697    /// let x = ListAuthorizedCertificatesResponse::new().set_next_page_token("example");
3698    /// ```
3699    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3700        self.next_page_token = v.into();
3701        self
3702    }
3703}
3704
3705impl wkt::message::Message for ListAuthorizedCertificatesResponse {
3706    fn typename() -> &'static str {
3707        "type.googleapis.com/google.appengine.v1.ListAuthorizedCertificatesResponse"
3708    }
3709}
3710
3711#[doc(hidden)]
3712impl gax::paginator::internal::PageableResponse for ListAuthorizedCertificatesResponse {
3713    type PageItem = crate::model::AuthorizedCertificate;
3714
3715    fn items(self) -> std::vec::Vec<Self::PageItem> {
3716        self.certificates
3717    }
3718
3719    fn next_page_token(&self) -> std::string::String {
3720        use std::clone::Clone;
3721        self.next_page_token.clone()
3722    }
3723}
3724
3725/// Request message for `AuthorizedCertificates.GetAuthorizedCertificate`.
3726#[derive(Clone, Default, PartialEq)]
3727#[non_exhaustive]
3728pub struct GetAuthorizedCertificateRequest {
3729    /// Name of the resource requested. Example:
3730    /// `apps/myapp/authorizedCertificates/12345`.
3731    pub name: std::string::String,
3732
3733    /// Controls the set of fields returned in the `GET` response.
3734    pub view: crate::model::AuthorizedCertificateView,
3735
3736    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3737}
3738
3739impl GetAuthorizedCertificateRequest {
3740    pub fn new() -> Self {
3741        std::default::Default::default()
3742    }
3743
3744    /// Sets the value of [name][crate::model::GetAuthorizedCertificateRequest::name].
3745    ///
3746    /// # Example
3747    /// ```ignore,no_run
3748    /// # use google_cloud_appengine_v1::model::GetAuthorizedCertificateRequest;
3749    /// let x = GetAuthorizedCertificateRequest::new().set_name("example");
3750    /// ```
3751    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3752        self.name = v.into();
3753        self
3754    }
3755
3756    /// Sets the value of [view][crate::model::GetAuthorizedCertificateRequest::view].
3757    ///
3758    /// # Example
3759    /// ```ignore,no_run
3760    /// # use google_cloud_appengine_v1::model::GetAuthorizedCertificateRequest;
3761    /// use google_cloud_appengine_v1::model::AuthorizedCertificateView;
3762    /// let x0 = GetAuthorizedCertificateRequest::new().set_view(AuthorizedCertificateView::FullCertificate);
3763    /// ```
3764    pub fn set_view<T: std::convert::Into<crate::model::AuthorizedCertificateView>>(
3765        mut self,
3766        v: T,
3767    ) -> Self {
3768        self.view = v.into();
3769        self
3770    }
3771}
3772
3773impl wkt::message::Message for GetAuthorizedCertificateRequest {
3774    fn typename() -> &'static str {
3775        "type.googleapis.com/google.appengine.v1.GetAuthorizedCertificateRequest"
3776    }
3777}
3778
3779/// Request message for `AuthorizedCertificates.CreateAuthorizedCertificate`.
3780#[derive(Clone, Default, PartialEq)]
3781#[non_exhaustive]
3782pub struct CreateAuthorizedCertificateRequest {
3783    /// Name of the parent `Application` resource. Example: `apps/myapp`.
3784    pub parent: std::string::String,
3785
3786    /// SSL certificate data.
3787    pub certificate: std::option::Option<crate::model::AuthorizedCertificate>,
3788
3789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3790}
3791
3792impl CreateAuthorizedCertificateRequest {
3793    pub fn new() -> Self {
3794        std::default::Default::default()
3795    }
3796
3797    /// Sets the value of [parent][crate::model::CreateAuthorizedCertificateRequest::parent].
3798    ///
3799    /// # Example
3800    /// ```ignore,no_run
3801    /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3802    /// let x = CreateAuthorizedCertificateRequest::new().set_parent("example");
3803    /// ```
3804    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3805        self.parent = v.into();
3806        self
3807    }
3808
3809    /// Sets the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
3810    ///
3811    /// # Example
3812    /// ```ignore,no_run
3813    /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3814    /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3815    /// let x = CreateAuthorizedCertificateRequest::new().set_certificate(AuthorizedCertificate::default()/* use setters */);
3816    /// ```
3817    pub fn set_certificate<T>(mut self, v: T) -> Self
3818    where
3819        T: std::convert::Into<crate::model::AuthorizedCertificate>,
3820    {
3821        self.certificate = std::option::Option::Some(v.into());
3822        self
3823    }
3824
3825    /// Sets or clears the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
3826    ///
3827    /// # Example
3828    /// ```ignore,no_run
3829    /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3830    /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3831    /// let x = CreateAuthorizedCertificateRequest::new().set_or_clear_certificate(Some(AuthorizedCertificate::default()/* use setters */));
3832    /// let x = CreateAuthorizedCertificateRequest::new().set_or_clear_certificate(None::<AuthorizedCertificate>);
3833    /// ```
3834    pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
3835    where
3836        T: std::convert::Into<crate::model::AuthorizedCertificate>,
3837    {
3838        self.certificate = v.map(|x| x.into());
3839        self
3840    }
3841}
3842
3843impl wkt::message::Message for CreateAuthorizedCertificateRequest {
3844    fn typename() -> &'static str {
3845        "type.googleapis.com/google.appengine.v1.CreateAuthorizedCertificateRequest"
3846    }
3847}
3848
3849/// Request message for `AuthorizedCertificates.UpdateAuthorizedCertificate`.
3850#[derive(Clone, Default, PartialEq)]
3851#[non_exhaustive]
3852pub struct UpdateAuthorizedCertificateRequest {
3853    /// Name of the resource to update. Example:
3854    /// `apps/myapp/authorizedCertificates/12345`.
3855    pub name: std::string::String,
3856
3857    /// An `AuthorizedCertificate` containing the updated resource. Only fields set
3858    /// in the field mask will be updated.
3859    pub certificate: std::option::Option<crate::model::AuthorizedCertificate>,
3860
3861    /// Standard field mask for the set of fields to be updated. Updates are only
3862    /// supported on the `certificate_raw_data` and `display_name` fields.
3863    pub update_mask: std::option::Option<wkt::FieldMask>,
3864
3865    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3866}
3867
3868impl UpdateAuthorizedCertificateRequest {
3869    pub fn new() -> Self {
3870        std::default::Default::default()
3871    }
3872
3873    /// Sets the value of [name][crate::model::UpdateAuthorizedCertificateRequest::name].
3874    ///
3875    /// # Example
3876    /// ```ignore,no_run
3877    /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3878    /// let x = UpdateAuthorizedCertificateRequest::new().set_name("example");
3879    /// ```
3880    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3881        self.name = v.into();
3882        self
3883    }
3884
3885    /// Sets the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
3886    ///
3887    /// # Example
3888    /// ```ignore,no_run
3889    /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3890    /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3891    /// let x = UpdateAuthorizedCertificateRequest::new().set_certificate(AuthorizedCertificate::default()/* use setters */);
3892    /// ```
3893    pub fn set_certificate<T>(mut self, v: T) -> Self
3894    where
3895        T: std::convert::Into<crate::model::AuthorizedCertificate>,
3896    {
3897        self.certificate = std::option::Option::Some(v.into());
3898        self
3899    }
3900
3901    /// Sets or clears the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
3902    ///
3903    /// # Example
3904    /// ```ignore,no_run
3905    /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3906    /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3907    /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_certificate(Some(AuthorizedCertificate::default()/* use setters */));
3908    /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_certificate(None::<AuthorizedCertificate>);
3909    /// ```
3910    pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
3911    where
3912        T: std::convert::Into<crate::model::AuthorizedCertificate>,
3913    {
3914        self.certificate = v.map(|x| x.into());
3915        self
3916    }
3917
3918    /// Sets the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
3919    ///
3920    /// # Example
3921    /// ```ignore,no_run
3922    /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3923    /// use wkt::FieldMask;
3924    /// let x = UpdateAuthorizedCertificateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3925    /// ```
3926    pub fn set_update_mask<T>(mut self, v: T) -> Self
3927    where
3928        T: std::convert::Into<wkt::FieldMask>,
3929    {
3930        self.update_mask = std::option::Option::Some(v.into());
3931        self
3932    }
3933
3934    /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
3935    ///
3936    /// # Example
3937    /// ```ignore,no_run
3938    /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3939    /// use wkt::FieldMask;
3940    /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3941    /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3942    /// ```
3943    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3944    where
3945        T: std::convert::Into<wkt::FieldMask>,
3946    {
3947        self.update_mask = v.map(|x| x.into());
3948        self
3949    }
3950}
3951
3952impl wkt::message::Message for UpdateAuthorizedCertificateRequest {
3953    fn typename() -> &'static str {
3954        "type.googleapis.com/google.appengine.v1.UpdateAuthorizedCertificateRequest"
3955    }
3956}
3957
3958/// Request message for `AuthorizedCertificates.DeleteAuthorizedCertificate`.
3959#[derive(Clone, Default, PartialEq)]
3960#[non_exhaustive]
3961pub struct DeleteAuthorizedCertificateRequest {
3962    /// Name of the resource to delete. Example:
3963    /// `apps/myapp/authorizedCertificates/12345`.
3964    pub name: std::string::String,
3965
3966    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3967}
3968
3969impl DeleteAuthorizedCertificateRequest {
3970    pub fn new() -> Self {
3971        std::default::Default::default()
3972    }
3973
3974    /// Sets the value of [name][crate::model::DeleteAuthorizedCertificateRequest::name].
3975    ///
3976    /// # Example
3977    /// ```ignore,no_run
3978    /// # use google_cloud_appengine_v1::model::DeleteAuthorizedCertificateRequest;
3979    /// let x = DeleteAuthorizedCertificateRequest::new().set_name("example");
3980    /// ```
3981    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3982        self.name = v.into();
3983        self
3984    }
3985}
3986
3987impl wkt::message::Message for DeleteAuthorizedCertificateRequest {
3988    fn typename() -> &'static str {
3989        "type.googleapis.com/google.appengine.v1.DeleteAuthorizedCertificateRequest"
3990    }
3991}
3992
3993/// Request message for `DomainMappings.ListDomainMappings`.
3994#[derive(Clone, Default, PartialEq)]
3995#[non_exhaustive]
3996pub struct ListDomainMappingsRequest {
3997    /// Name of the parent Application resource. Example: `apps/myapp`.
3998    pub parent: std::string::String,
3999
4000    /// Maximum results to return per page.
4001    pub page_size: i32,
4002
4003    /// Continuation token for fetching the next page of results.
4004    pub page_token: std::string::String,
4005
4006    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4007}
4008
4009impl ListDomainMappingsRequest {
4010    pub fn new() -> Self {
4011        std::default::Default::default()
4012    }
4013
4014    /// Sets the value of [parent][crate::model::ListDomainMappingsRequest::parent].
4015    ///
4016    /// # Example
4017    /// ```ignore,no_run
4018    /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4019    /// let x = ListDomainMappingsRequest::new().set_parent("example");
4020    /// ```
4021    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4022        self.parent = v.into();
4023        self
4024    }
4025
4026    /// Sets the value of [page_size][crate::model::ListDomainMappingsRequest::page_size].
4027    ///
4028    /// # Example
4029    /// ```ignore,no_run
4030    /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4031    /// let x = ListDomainMappingsRequest::new().set_page_size(42);
4032    /// ```
4033    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4034        self.page_size = v.into();
4035        self
4036    }
4037
4038    /// Sets the value of [page_token][crate::model::ListDomainMappingsRequest::page_token].
4039    ///
4040    /// # Example
4041    /// ```ignore,no_run
4042    /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4043    /// let x = ListDomainMappingsRequest::new().set_page_token("example");
4044    /// ```
4045    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4046        self.page_token = v.into();
4047        self
4048    }
4049}
4050
4051impl wkt::message::Message for ListDomainMappingsRequest {
4052    fn typename() -> &'static str {
4053        "type.googleapis.com/google.appengine.v1.ListDomainMappingsRequest"
4054    }
4055}
4056
4057/// Response message for `DomainMappings.ListDomainMappings`.
4058#[derive(Clone, Default, PartialEq)]
4059#[non_exhaustive]
4060pub struct ListDomainMappingsResponse {
4061    /// The domain mappings for the application.
4062    pub domain_mappings: std::vec::Vec<crate::model::DomainMapping>,
4063
4064    /// Continuation token for fetching the next page of results.
4065    pub next_page_token: std::string::String,
4066
4067    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4068}
4069
4070impl ListDomainMappingsResponse {
4071    pub fn new() -> Self {
4072        std::default::Default::default()
4073    }
4074
4075    /// Sets the value of [domain_mappings][crate::model::ListDomainMappingsResponse::domain_mappings].
4076    ///
4077    /// # Example
4078    /// ```ignore,no_run
4079    /// # use google_cloud_appengine_v1::model::ListDomainMappingsResponse;
4080    /// use google_cloud_appengine_v1::model::DomainMapping;
4081    /// let x = ListDomainMappingsResponse::new()
4082    ///     .set_domain_mappings([
4083    ///         DomainMapping::default()/* use setters */,
4084    ///         DomainMapping::default()/* use (different) setters */,
4085    ///     ]);
4086    /// ```
4087    pub fn set_domain_mappings<T, V>(mut self, v: T) -> Self
4088    where
4089        T: std::iter::IntoIterator<Item = V>,
4090        V: std::convert::Into<crate::model::DomainMapping>,
4091    {
4092        use std::iter::Iterator;
4093        self.domain_mappings = v.into_iter().map(|i| i.into()).collect();
4094        self
4095    }
4096
4097    /// Sets the value of [next_page_token][crate::model::ListDomainMappingsResponse::next_page_token].
4098    ///
4099    /// # Example
4100    /// ```ignore,no_run
4101    /// # use google_cloud_appengine_v1::model::ListDomainMappingsResponse;
4102    /// let x = ListDomainMappingsResponse::new().set_next_page_token("example");
4103    /// ```
4104    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4105        self.next_page_token = v.into();
4106        self
4107    }
4108}
4109
4110impl wkt::message::Message for ListDomainMappingsResponse {
4111    fn typename() -> &'static str {
4112        "type.googleapis.com/google.appengine.v1.ListDomainMappingsResponse"
4113    }
4114}
4115
4116#[doc(hidden)]
4117impl gax::paginator::internal::PageableResponse for ListDomainMappingsResponse {
4118    type PageItem = crate::model::DomainMapping;
4119
4120    fn items(self) -> std::vec::Vec<Self::PageItem> {
4121        self.domain_mappings
4122    }
4123
4124    fn next_page_token(&self) -> std::string::String {
4125        use std::clone::Clone;
4126        self.next_page_token.clone()
4127    }
4128}
4129
4130/// Request message for `DomainMappings.GetDomainMapping`.
4131#[derive(Clone, Default, PartialEq)]
4132#[non_exhaustive]
4133pub struct GetDomainMappingRequest {
4134    /// Name of the resource requested. Example:
4135    /// `apps/myapp/domainMappings/example.com`.
4136    pub name: std::string::String,
4137
4138    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4139}
4140
4141impl GetDomainMappingRequest {
4142    pub fn new() -> Self {
4143        std::default::Default::default()
4144    }
4145
4146    /// Sets the value of [name][crate::model::GetDomainMappingRequest::name].
4147    ///
4148    /// # Example
4149    /// ```ignore,no_run
4150    /// # use google_cloud_appengine_v1::model::GetDomainMappingRequest;
4151    /// let x = GetDomainMappingRequest::new().set_name("example");
4152    /// ```
4153    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4154        self.name = v.into();
4155        self
4156    }
4157}
4158
4159impl wkt::message::Message for GetDomainMappingRequest {
4160    fn typename() -> &'static str {
4161        "type.googleapis.com/google.appengine.v1.GetDomainMappingRequest"
4162    }
4163}
4164
4165/// Request message for `DomainMappings.CreateDomainMapping`.
4166#[derive(Clone, Default, PartialEq)]
4167#[non_exhaustive]
4168pub struct CreateDomainMappingRequest {
4169    /// Name of the parent Application resource. Example: `apps/myapp`.
4170    pub parent: std::string::String,
4171
4172    /// Domain mapping configuration.
4173    pub domain_mapping: std::option::Option<crate::model::DomainMapping>,
4174
4175    /// Whether the domain creation should override any existing mappings for this
4176    /// domain. By default, overrides are rejected.
4177    pub override_strategy: crate::model::DomainOverrideStrategy,
4178
4179    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4180}
4181
4182impl CreateDomainMappingRequest {
4183    pub fn new() -> Self {
4184        std::default::Default::default()
4185    }
4186
4187    /// Sets the value of [parent][crate::model::CreateDomainMappingRequest::parent].
4188    ///
4189    /// # Example
4190    /// ```ignore,no_run
4191    /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4192    /// let x = CreateDomainMappingRequest::new().set_parent("example");
4193    /// ```
4194    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4195        self.parent = v.into();
4196        self
4197    }
4198
4199    /// Sets the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4200    ///
4201    /// # Example
4202    /// ```ignore,no_run
4203    /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4204    /// use google_cloud_appengine_v1::model::DomainMapping;
4205    /// let x = CreateDomainMappingRequest::new().set_domain_mapping(DomainMapping::default()/* use setters */);
4206    /// ```
4207    pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4208    where
4209        T: std::convert::Into<crate::model::DomainMapping>,
4210    {
4211        self.domain_mapping = std::option::Option::Some(v.into());
4212        self
4213    }
4214
4215    /// Sets or clears the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4216    ///
4217    /// # Example
4218    /// ```ignore,no_run
4219    /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4220    /// use google_cloud_appengine_v1::model::DomainMapping;
4221    /// let x = CreateDomainMappingRequest::new().set_or_clear_domain_mapping(Some(DomainMapping::default()/* use setters */));
4222    /// let x = CreateDomainMappingRequest::new().set_or_clear_domain_mapping(None::<DomainMapping>);
4223    /// ```
4224    pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4225    where
4226        T: std::convert::Into<crate::model::DomainMapping>,
4227    {
4228        self.domain_mapping = v.map(|x| x.into());
4229        self
4230    }
4231
4232    /// Sets the value of [override_strategy][crate::model::CreateDomainMappingRequest::override_strategy].
4233    ///
4234    /// # Example
4235    /// ```ignore,no_run
4236    /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4237    /// use google_cloud_appengine_v1::model::DomainOverrideStrategy;
4238    /// let x0 = CreateDomainMappingRequest::new().set_override_strategy(DomainOverrideStrategy::Strict);
4239    /// let x1 = CreateDomainMappingRequest::new().set_override_strategy(DomainOverrideStrategy::Override);
4240    /// ```
4241    pub fn set_override_strategy<T: std::convert::Into<crate::model::DomainOverrideStrategy>>(
4242        mut self,
4243        v: T,
4244    ) -> Self {
4245        self.override_strategy = v.into();
4246        self
4247    }
4248}
4249
4250impl wkt::message::Message for CreateDomainMappingRequest {
4251    fn typename() -> &'static str {
4252        "type.googleapis.com/google.appengine.v1.CreateDomainMappingRequest"
4253    }
4254}
4255
4256/// Request message for `DomainMappings.UpdateDomainMapping`.
4257#[derive(Clone, Default, PartialEq)]
4258#[non_exhaustive]
4259pub struct UpdateDomainMappingRequest {
4260    /// Name of the resource to update. Example:
4261    /// `apps/myapp/domainMappings/example.com`.
4262    pub name: std::string::String,
4263
4264    /// A domain mapping containing the updated resource. Only fields set
4265    /// in the field mask will be updated.
4266    pub domain_mapping: std::option::Option<crate::model::DomainMapping>,
4267
4268    /// Required. Standard field mask for the set of fields to be updated.
4269    pub update_mask: std::option::Option<wkt::FieldMask>,
4270
4271    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4272}
4273
4274impl UpdateDomainMappingRequest {
4275    pub fn new() -> Self {
4276        std::default::Default::default()
4277    }
4278
4279    /// Sets the value of [name][crate::model::UpdateDomainMappingRequest::name].
4280    ///
4281    /// # Example
4282    /// ```ignore,no_run
4283    /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4284    /// let x = UpdateDomainMappingRequest::new().set_name("example");
4285    /// ```
4286    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4287        self.name = v.into();
4288        self
4289    }
4290
4291    /// Sets the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
4292    ///
4293    /// # Example
4294    /// ```ignore,no_run
4295    /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4296    /// use google_cloud_appengine_v1::model::DomainMapping;
4297    /// let x = UpdateDomainMappingRequest::new().set_domain_mapping(DomainMapping::default()/* use setters */);
4298    /// ```
4299    pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4300    where
4301        T: std::convert::Into<crate::model::DomainMapping>,
4302    {
4303        self.domain_mapping = std::option::Option::Some(v.into());
4304        self
4305    }
4306
4307    /// Sets or clears the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
4308    ///
4309    /// # Example
4310    /// ```ignore,no_run
4311    /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4312    /// use google_cloud_appengine_v1::model::DomainMapping;
4313    /// let x = UpdateDomainMappingRequest::new().set_or_clear_domain_mapping(Some(DomainMapping::default()/* use setters */));
4314    /// let x = UpdateDomainMappingRequest::new().set_or_clear_domain_mapping(None::<DomainMapping>);
4315    /// ```
4316    pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4317    where
4318        T: std::convert::Into<crate::model::DomainMapping>,
4319    {
4320        self.domain_mapping = v.map(|x| x.into());
4321        self
4322    }
4323
4324    /// Sets the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
4325    ///
4326    /// # Example
4327    /// ```ignore,no_run
4328    /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4329    /// use wkt::FieldMask;
4330    /// let x = UpdateDomainMappingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4331    /// ```
4332    pub fn set_update_mask<T>(mut self, v: T) -> Self
4333    where
4334        T: std::convert::Into<wkt::FieldMask>,
4335    {
4336        self.update_mask = std::option::Option::Some(v.into());
4337        self
4338    }
4339
4340    /// Sets or clears the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
4341    ///
4342    /// # Example
4343    /// ```ignore,no_run
4344    /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4345    /// use wkt::FieldMask;
4346    /// let x = UpdateDomainMappingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4347    /// let x = UpdateDomainMappingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4348    /// ```
4349    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4350    where
4351        T: std::convert::Into<wkt::FieldMask>,
4352    {
4353        self.update_mask = v.map(|x| x.into());
4354        self
4355    }
4356}
4357
4358impl wkt::message::Message for UpdateDomainMappingRequest {
4359    fn typename() -> &'static str {
4360        "type.googleapis.com/google.appengine.v1.UpdateDomainMappingRequest"
4361    }
4362}
4363
4364/// Request message for `DomainMappings.DeleteDomainMapping`.
4365#[derive(Clone, Default, PartialEq)]
4366#[non_exhaustive]
4367pub struct DeleteDomainMappingRequest {
4368    /// Name of the resource to delete. Example:
4369    /// `apps/myapp/domainMappings/example.com`.
4370    pub name: std::string::String,
4371
4372    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4373}
4374
4375impl DeleteDomainMappingRequest {
4376    pub fn new() -> Self {
4377        std::default::Default::default()
4378    }
4379
4380    /// Sets the value of [name][crate::model::DeleteDomainMappingRequest::name].
4381    ///
4382    /// # Example
4383    /// ```ignore,no_run
4384    /// # use google_cloud_appengine_v1::model::DeleteDomainMappingRequest;
4385    /// let x = DeleteDomainMappingRequest::new().set_name("example");
4386    /// ```
4387    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4388        self.name = v.into();
4389        self
4390    }
4391}
4392
4393impl wkt::message::Message for DeleteDomainMappingRequest {
4394    fn typename() -> &'static str {
4395        "type.googleapis.com/google.appengine.v1.DeleteDomainMappingRequest"
4396    }
4397}
4398
4399/// An Application resource contains the top-level configuration of an App
4400/// Engine application.
4401#[derive(Clone, Default, PartialEq)]
4402#[non_exhaustive]
4403pub struct Application {
4404    /// Full path to the Application resource in the API.
4405    /// Example: `apps/myapp`.
4406    ///
4407    /// @OutputOnly
4408    pub name: std::string::String,
4409
4410    /// Identifier of the Application resource. This identifier is equivalent
4411    /// to the project ID of the Google Cloud Platform project where you want to
4412    /// deploy your application.
4413    /// Example: `myapp`.
4414    pub id: std::string::String,
4415
4416    /// HTTP path dispatch rules for requests to the application that do not
4417    /// explicitly target a service or version. Rules are order-dependent.
4418    /// Up to 20 dispatch rules can be supported.
4419    pub dispatch_rules: std::vec::Vec<crate::model::UrlDispatchRule>,
4420
4421    /// Google Apps authentication domain that controls which users can access
4422    /// this application.
4423    ///
4424    /// Defaults to open access for any Google Account.
4425    pub auth_domain: std::string::String,
4426
4427    /// Location from which this application runs. Application instances
4428    /// run out of the data centers in the specified location, which is also where
4429    /// all of the application's end user content is stored.
4430    ///
4431    /// Defaults to `us-central`.
4432    ///
4433    /// View the list of
4434    /// [supported locations](https://cloud.google.com/appengine/docs/locations).
4435    pub location_id: std::string::String,
4436
4437    /// Google Cloud Storage bucket that can be used for storing files
4438    /// associated with this application. This bucket is associated with the
4439    /// application and can be used by the gcloud deployment commands.
4440    ///
4441    /// @OutputOnly
4442    pub code_bucket: std::string::String,
4443
4444    /// Cookie expiration policy for this application.
4445    pub default_cookie_expiration: std::option::Option<wkt::Duration>,
4446
4447    /// Serving status of this application.
4448    pub serving_status: crate::model::application::ServingStatus,
4449
4450    /// Hostname used to reach this application, as resolved by App Engine.
4451    ///
4452    /// @OutputOnly
4453    pub default_hostname: std::string::String,
4454
4455    /// Google Cloud Storage bucket that can be used by this application to store
4456    /// content.
4457    ///
4458    /// @OutputOnly
4459    pub default_bucket: std::string::String,
4460
4461    /// The service account associated with the application.
4462    /// This is the app-level default identity. If no identity provided during
4463    /// create version, Admin API will fallback to this one.
4464    pub service_account: std::string::String,
4465
4466    pub iap: std::option::Option<crate::model::application::IdentityAwareProxy>,
4467
4468    /// The Google Container Registry domain used for storing managed build docker
4469    /// images for this application.
4470    pub gcr_domain: std::string::String,
4471
4472    /// The type of the Cloud Firestore or Cloud Datastore database associated with
4473    /// this application.
4474    pub database_type: crate::model::application::DatabaseType,
4475
4476    /// The feature specific settings to be used in the application.
4477    pub feature_settings: std::option::Option<crate::model::application::FeatureSettings>,
4478
4479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4480}
4481
4482impl Application {
4483    pub fn new() -> Self {
4484        std::default::Default::default()
4485    }
4486
4487    /// Sets the value of [name][crate::model::Application::name].
4488    ///
4489    /// # Example
4490    /// ```ignore,no_run
4491    /// # use google_cloud_appengine_v1::model::Application;
4492    /// let x = Application::new().set_name("example");
4493    /// ```
4494    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4495        self.name = v.into();
4496        self
4497    }
4498
4499    /// Sets the value of [id][crate::model::Application::id].
4500    ///
4501    /// # Example
4502    /// ```ignore,no_run
4503    /// # use google_cloud_appengine_v1::model::Application;
4504    /// let x = Application::new().set_id("example");
4505    /// ```
4506    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4507        self.id = v.into();
4508        self
4509    }
4510
4511    /// Sets the value of [dispatch_rules][crate::model::Application::dispatch_rules].
4512    ///
4513    /// # Example
4514    /// ```ignore,no_run
4515    /// # use google_cloud_appengine_v1::model::Application;
4516    /// use google_cloud_appengine_v1::model::UrlDispatchRule;
4517    /// let x = Application::new()
4518    ///     .set_dispatch_rules([
4519    ///         UrlDispatchRule::default()/* use setters */,
4520    ///         UrlDispatchRule::default()/* use (different) setters */,
4521    ///     ]);
4522    /// ```
4523    pub fn set_dispatch_rules<T, V>(mut self, v: T) -> Self
4524    where
4525        T: std::iter::IntoIterator<Item = V>,
4526        V: std::convert::Into<crate::model::UrlDispatchRule>,
4527    {
4528        use std::iter::Iterator;
4529        self.dispatch_rules = v.into_iter().map(|i| i.into()).collect();
4530        self
4531    }
4532
4533    /// Sets the value of [auth_domain][crate::model::Application::auth_domain].
4534    ///
4535    /// # Example
4536    /// ```ignore,no_run
4537    /// # use google_cloud_appengine_v1::model::Application;
4538    /// let x = Application::new().set_auth_domain("example");
4539    /// ```
4540    pub fn set_auth_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4541        self.auth_domain = v.into();
4542        self
4543    }
4544
4545    /// Sets the value of [location_id][crate::model::Application::location_id].
4546    ///
4547    /// # Example
4548    /// ```ignore,no_run
4549    /// # use google_cloud_appengine_v1::model::Application;
4550    /// let x = Application::new().set_location_id("example");
4551    /// ```
4552    pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4553        self.location_id = v.into();
4554        self
4555    }
4556
4557    /// Sets the value of [code_bucket][crate::model::Application::code_bucket].
4558    ///
4559    /// # Example
4560    /// ```ignore,no_run
4561    /// # use google_cloud_appengine_v1::model::Application;
4562    /// let x = Application::new().set_code_bucket("example");
4563    /// ```
4564    pub fn set_code_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4565        self.code_bucket = v.into();
4566        self
4567    }
4568
4569    /// Sets the value of [default_cookie_expiration][crate::model::Application::default_cookie_expiration].
4570    ///
4571    /// # Example
4572    /// ```ignore,no_run
4573    /// # use google_cloud_appengine_v1::model::Application;
4574    /// use wkt::Duration;
4575    /// let x = Application::new().set_default_cookie_expiration(Duration::default()/* use setters */);
4576    /// ```
4577    pub fn set_default_cookie_expiration<T>(mut self, v: T) -> Self
4578    where
4579        T: std::convert::Into<wkt::Duration>,
4580    {
4581        self.default_cookie_expiration = std::option::Option::Some(v.into());
4582        self
4583    }
4584
4585    /// Sets or clears the value of [default_cookie_expiration][crate::model::Application::default_cookie_expiration].
4586    ///
4587    /// # Example
4588    /// ```ignore,no_run
4589    /// # use google_cloud_appengine_v1::model::Application;
4590    /// use wkt::Duration;
4591    /// let x = Application::new().set_or_clear_default_cookie_expiration(Some(Duration::default()/* use setters */));
4592    /// let x = Application::new().set_or_clear_default_cookie_expiration(None::<Duration>);
4593    /// ```
4594    pub fn set_or_clear_default_cookie_expiration<T>(mut self, v: std::option::Option<T>) -> Self
4595    where
4596        T: std::convert::Into<wkt::Duration>,
4597    {
4598        self.default_cookie_expiration = v.map(|x| x.into());
4599        self
4600    }
4601
4602    /// Sets the value of [serving_status][crate::model::Application::serving_status].
4603    ///
4604    /// # Example
4605    /// ```ignore,no_run
4606    /// # use google_cloud_appengine_v1::model::Application;
4607    /// use google_cloud_appengine_v1::model::application::ServingStatus;
4608    /// let x0 = Application::new().set_serving_status(ServingStatus::Serving);
4609    /// let x1 = Application::new().set_serving_status(ServingStatus::UserDisabled);
4610    /// let x2 = Application::new().set_serving_status(ServingStatus::SystemDisabled);
4611    /// ```
4612    pub fn set_serving_status<T: std::convert::Into<crate::model::application::ServingStatus>>(
4613        mut self,
4614        v: T,
4615    ) -> Self {
4616        self.serving_status = v.into();
4617        self
4618    }
4619
4620    /// Sets the value of [default_hostname][crate::model::Application::default_hostname].
4621    ///
4622    /// # Example
4623    /// ```ignore,no_run
4624    /// # use google_cloud_appengine_v1::model::Application;
4625    /// let x = Application::new().set_default_hostname("example");
4626    /// ```
4627    pub fn set_default_hostname<T: std::convert::Into<std::string::String>>(
4628        mut self,
4629        v: T,
4630    ) -> Self {
4631        self.default_hostname = v.into();
4632        self
4633    }
4634
4635    /// Sets the value of [default_bucket][crate::model::Application::default_bucket].
4636    ///
4637    /// # Example
4638    /// ```ignore,no_run
4639    /// # use google_cloud_appengine_v1::model::Application;
4640    /// let x = Application::new().set_default_bucket("example");
4641    /// ```
4642    pub fn set_default_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4643        self.default_bucket = v.into();
4644        self
4645    }
4646
4647    /// Sets the value of [service_account][crate::model::Application::service_account].
4648    ///
4649    /// # Example
4650    /// ```ignore,no_run
4651    /// # use google_cloud_appengine_v1::model::Application;
4652    /// let x = Application::new().set_service_account("example");
4653    /// ```
4654    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4655        self.service_account = v.into();
4656        self
4657    }
4658
4659    /// Sets the value of [iap][crate::model::Application::iap].
4660    ///
4661    /// # Example
4662    /// ```ignore,no_run
4663    /// # use google_cloud_appengine_v1::model::Application;
4664    /// use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4665    /// let x = Application::new().set_iap(IdentityAwareProxy::default()/* use setters */);
4666    /// ```
4667    pub fn set_iap<T>(mut self, v: T) -> Self
4668    where
4669        T: std::convert::Into<crate::model::application::IdentityAwareProxy>,
4670    {
4671        self.iap = std::option::Option::Some(v.into());
4672        self
4673    }
4674
4675    /// Sets or clears the value of [iap][crate::model::Application::iap].
4676    ///
4677    /// # Example
4678    /// ```ignore,no_run
4679    /// # use google_cloud_appengine_v1::model::Application;
4680    /// use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4681    /// let x = Application::new().set_or_clear_iap(Some(IdentityAwareProxy::default()/* use setters */));
4682    /// let x = Application::new().set_or_clear_iap(None::<IdentityAwareProxy>);
4683    /// ```
4684    pub fn set_or_clear_iap<T>(mut self, v: std::option::Option<T>) -> Self
4685    where
4686        T: std::convert::Into<crate::model::application::IdentityAwareProxy>,
4687    {
4688        self.iap = v.map(|x| x.into());
4689        self
4690    }
4691
4692    /// Sets the value of [gcr_domain][crate::model::Application::gcr_domain].
4693    ///
4694    /// # Example
4695    /// ```ignore,no_run
4696    /// # use google_cloud_appengine_v1::model::Application;
4697    /// let x = Application::new().set_gcr_domain("example");
4698    /// ```
4699    pub fn set_gcr_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4700        self.gcr_domain = v.into();
4701        self
4702    }
4703
4704    /// Sets the value of [database_type][crate::model::Application::database_type].
4705    ///
4706    /// # Example
4707    /// ```ignore,no_run
4708    /// # use google_cloud_appengine_v1::model::Application;
4709    /// use google_cloud_appengine_v1::model::application::DatabaseType;
4710    /// let x0 = Application::new().set_database_type(DatabaseType::CloudDatastore);
4711    /// let x1 = Application::new().set_database_type(DatabaseType::CloudFirestore);
4712    /// let x2 = Application::new().set_database_type(DatabaseType::CloudDatastoreCompatibility);
4713    /// ```
4714    pub fn set_database_type<T: std::convert::Into<crate::model::application::DatabaseType>>(
4715        mut self,
4716        v: T,
4717    ) -> Self {
4718        self.database_type = v.into();
4719        self
4720    }
4721
4722    /// Sets the value of [feature_settings][crate::model::Application::feature_settings].
4723    ///
4724    /// # Example
4725    /// ```ignore,no_run
4726    /// # use google_cloud_appengine_v1::model::Application;
4727    /// use google_cloud_appengine_v1::model::application::FeatureSettings;
4728    /// let x = Application::new().set_feature_settings(FeatureSettings::default()/* use setters */);
4729    /// ```
4730    pub fn set_feature_settings<T>(mut self, v: T) -> Self
4731    where
4732        T: std::convert::Into<crate::model::application::FeatureSettings>,
4733    {
4734        self.feature_settings = std::option::Option::Some(v.into());
4735        self
4736    }
4737
4738    /// Sets or clears the value of [feature_settings][crate::model::Application::feature_settings].
4739    ///
4740    /// # Example
4741    /// ```ignore,no_run
4742    /// # use google_cloud_appengine_v1::model::Application;
4743    /// use google_cloud_appengine_v1::model::application::FeatureSettings;
4744    /// let x = Application::new().set_or_clear_feature_settings(Some(FeatureSettings::default()/* use setters */));
4745    /// let x = Application::new().set_or_clear_feature_settings(None::<FeatureSettings>);
4746    /// ```
4747    pub fn set_or_clear_feature_settings<T>(mut self, v: std::option::Option<T>) -> Self
4748    where
4749        T: std::convert::Into<crate::model::application::FeatureSettings>,
4750    {
4751        self.feature_settings = v.map(|x| x.into());
4752        self
4753    }
4754}
4755
4756impl wkt::message::Message for Application {
4757    fn typename() -> &'static str {
4758        "type.googleapis.com/google.appengine.v1.Application"
4759    }
4760}
4761
4762/// Defines additional types related to [Application].
4763pub mod application {
4764    #[allow(unused_imports)]
4765    use super::*;
4766
4767    /// Identity-Aware Proxy
4768    #[derive(Clone, Default, PartialEq)]
4769    #[non_exhaustive]
4770    pub struct IdentityAwareProxy {
4771        /// Whether the serving infrastructure will authenticate and
4772        /// authorize all incoming requests.
4773        ///
4774        /// If true, the `oauth2_client_id` and `oauth2_client_secret`
4775        /// fields must be non-empty.
4776        pub enabled: bool,
4777
4778        /// OAuth2 client ID to use for the authentication flow.
4779        pub oauth2_client_id: std::string::String,
4780
4781        /// OAuth2 client secret to use for the authentication flow.
4782        ///
4783        /// For security reasons, this value cannot be retrieved via the API.
4784        /// Instead, the SHA-256 hash of the value is returned in the
4785        /// `oauth2_client_secret_sha256` field.
4786        ///
4787        /// @InputOnly
4788        pub oauth2_client_secret: std::string::String,
4789
4790        /// Hex-encoded SHA-256 hash of the client secret.
4791        ///
4792        /// @OutputOnly
4793        pub oauth2_client_secret_sha256: std::string::String,
4794
4795        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4796    }
4797
4798    impl IdentityAwareProxy {
4799        pub fn new() -> Self {
4800            std::default::Default::default()
4801        }
4802
4803        /// Sets the value of [enabled][crate::model::application::IdentityAwareProxy::enabled].
4804        ///
4805        /// # Example
4806        /// ```ignore,no_run
4807        /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4808        /// let x = IdentityAwareProxy::new().set_enabled(true);
4809        /// ```
4810        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4811            self.enabled = v.into();
4812            self
4813        }
4814
4815        /// Sets the value of [oauth2_client_id][crate::model::application::IdentityAwareProxy::oauth2_client_id].
4816        ///
4817        /// # Example
4818        /// ```ignore,no_run
4819        /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4820        /// let x = IdentityAwareProxy::new().set_oauth2_client_id("example");
4821        /// ```
4822        pub fn set_oauth2_client_id<T: std::convert::Into<std::string::String>>(
4823            mut self,
4824            v: T,
4825        ) -> Self {
4826            self.oauth2_client_id = v.into();
4827            self
4828        }
4829
4830        /// Sets the value of [oauth2_client_secret][crate::model::application::IdentityAwareProxy::oauth2_client_secret].
4831        ///
4832        /// # Example
4833        /// ```ignore,no_run
4834        /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4835        /// let x = IdentityAwareProxy::new().set_oauth2_client_secret("example");
4836        /// ```
4837        pub fn set_oauth2_client_secret<T: std::convert::Into<std::string::String>>(
4838            mut self,
4839            v: T,
4840        ) -> Self {
4841            self.oauth2_client_secret = v.into();
4842            self
4843        }
4844
4845        /// Sets the value of [oauth2_client_secret_sha256][crate::model::application::IdentityAwareProxy::oauth2_client_secret_sha256].
4846        ///
4847        /// # Example
4848        /// ```ignore,no_run
4849        /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4850        /// let x = IdentityAwareProxy::new().set_oauth2_client_secret_sha256("example");
4851        /// ```
4852        pub fn set_oauth2_client_secret_sha256<T: std::convert::Into<std::string::String>>(
4853            mut self,
4854            v: T,
4855        ) -> Self {
4856            self.oauth2_client_secret_sha256 = v.into();
4857            self
4858        }
4859    }
4860
4861    impl wkt::message::Message for IdentityAwareProxy {
4862        fn typename() -> &'static str {
4863            "type.googleapis.com/google.appengine.v1.Application.IdentityAwareProxy"
4864        }
4865    }
4866
4867    /// The feature specific settings to be used in the application. These define
4868    /// behaviors that are user configurable.
4869    #[derive(Clone, Default, PartialEq)]
4870    #[non_exhaustive]
4871    pub struct FeatureSettings {
4872        /// Boolean value indicating if split health checks should be used instead
4873        /// of the legacy health checks. At an app.yaml level, this means defaulting
4874        /// to 'readiness_check' and 'liveness_check' values instead of
4875        /// 'health_check' ones. Once the legacy 'health_check' behavior is
4876        /// deprecated, and this value is always true, this setting can
4877        /// be removed.
4878        pub split_health_checks: bool,
4879
4880        /// If true, use [Container-Optimized OS](https://cloud.google.com/container-optimized-os/)
4881        /// base image for VMs, rather than a base Debian image.
4882        pub use_container_optimized_os: bool,
4883
4884        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4885    }
4886
4887    impl FeatureSettings {
4888        pub fn new() -> Self {
4889            std::default::Default::default()
4890        }
4891
4892        /// Sets the value of [split_health_checks][crate::model::application::FeatureSettings::split_health_checks].
4893        ///
4894        /// # Example
4895        /// ```ignore,no_run
4896        /// # use google_cloud_appengine_v1::model::application::FeatureSettings;
4897        /// let x = FeatureSettings::new().set_split_health_checks(true);
4898        /// ```
4899        pub fn set_split_health_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4900            self.split_health_checks = v.into();
4901            self
4902        }
4903
4904        /// Sets the value of [use_container_optimized_os][crate::model::application::FeatureSettings::use_container_optimized_os].
4905        ///
4906        /// # Example
4907        /// ```ignore,no_run
4908        /// # use google_cloud_appengine_v1::model::application::FeatureSettings;
4909        /// let x = FeatureSettings::new().set_use_container_optimized_os(true);
4910        /// ```
4911        pub fn set_use_container_optimized_os<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4912            self.use_container_optimized_os = v.into();
4913            self
4914        }
4915    }
4916
4917    impl wkt::message::Message for FeatureSettings {
4918        fn typename() -> &'static str {
4919            "type.googleapis.com/google.appengine.v1.Application.FeatureSettings"
4920        }
4921    }
4922
4923    ///
4924    /// # Working with unknown values
4925    ///
4926    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4927    /// additional enum variants at any time. Adding new variants is not considered
4928    /// a breaking change. Applications should write their code in anticipation of:
4929    ///
4930    /// - New values appearing in future releases of the client library, **and**
4931    /// - New values received dynamically, without application changes.
4932    ///
4933    /// Please consult the [Working with enums] section in the user guide for some
4934    /// guidelines.
4935    ///
4936    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4937    #[derive(Clone, Debug, PartialEq)]
4938    #[non_exhaustive]
4939    pub enum ServingStatus {
4940        /// Serving status is unspecified.
4941        Unspecified,
4942        /// Application is serving.
4943        Serving,
4944        /// Application has been disabled by the user.
4945        UserDisabled,
4946        /// Application has been disabled by the system.
4947        SystemDisabled,
4948        /// If set, the enum was initialized with an unknown value.
4949        ///
4950        /// Applications can examine the value using [ServingStatus::value] or
4951        /// [ServingStatus::name].
4952        UnknownValue(serving_status::UnknownValue),
4953    }
4954
4955    #[doc(hidden)]
4956    pub mod serving_status {
4957        #[allow(unused_imports)]
4958        use super::*;
4959        #[derive(Clone, Debug, PartialEq)]
4960        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4961    }
4962
4963    impl ServingStatus {
4964        /// Gets the enum value.
4965        ///
4966        /// Returns `None` if the enum contains an unknown value deserialized from
4967        /// the string representation of enums.
4968        pub fn value(&self) -> std::option::Option<i32> {
4969            match self {
4970                Self::Unspecified => std::option::Option::Some(0),
4971                Self::Serving => std::option::Option::Some(1),
4972                Self::UserDisabled => std::option::Option::Some(2),
4973                Self::SystemDisabled => std::option::Option::Some(3),
4974                Self::UnknownValue(u) => u.0.value(),
4975            }
4976        }
4977
4978        /// Gets the enum value as a string.
4979        ///
4980        /// Returns `None` if the enum contains an unknown value deserialized from
4981        /// the integer representation of enums.
4982        pub fn name(&self) -> std::option::Option<&str> {
4983            match self {
4984                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
4985                Self::Serving => std::option::Option::Some("SERVING"),
4986                Self::UserDisabled => std::option::Option::Some("USER_DISABLED"),
4987                Self::SystemDisabled => std::option::Option::Some("SYSTEM_DISABLED"),
4988                Self::UnknownValue(u) => u.0.name(),
4989            }
4990        }
4991    }
4992
4993    impl std::default::Default for ServingStatus {
4994        fn default() -> Self {
4995            use std::convert::From;
4996            Self::from(0)
4997        }
4998    }
4999
5000    impl std::fmt::Display for ServingStatus {
5001        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5002            wkt::internal::display_enum(f, self.name(), self.value())
5003        }
5004    }
5005
5006    impl std::convert::From<i32> for ServingStatus {
5007        fn from(value: i32) -> Self {
5008            match value {
5009                0 => Self::Unspecified,
5010                1 => Self::Serving,
5011                2 => Self::UserDisabled,
5012                3 => Self::SystemDisabled,
5013                _ => Self::UnknownValue(serving_status::UnknownValue(
5014                    wkt::internal::UnknownEnumValue::Integer(value),
5015                )),
5016            }
5017        }
5018    }
5019
5020    impl std::convert::From<&str> for ServingStatus {
5021        fn from(value: &str) -> Self {
5022            use std::string::ToString;
5023            match value {
5024                "UNSPECIFIED" => Self::Unspecified,
5025                "SERVING" => Self::Serving,
5026                "USER_DISABLED" => Self::UserDisabled,
5027                "SYSTEM_DISABLED" => Self::SystemDisabled,
5028                _ => Self::UnknownValue(serving_status::UnknownValue(
5029                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5030                )),
5031            }
5032        }
5033    }
5034
5035    impl serde::ser::Serialize for ServingStatus {
5036        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5037        where
5038            S: serde::Serializer,
5039        {
5040            match self {
5041                Self::Unspecified => serializer.serialize_i32(0),
5042                Self::Serving => serializer.serialize_i32(1),
5043                Self::UserDisabled => serializer.serialize_i32(2),
5044                Self::SystemDisabled => serializer.serialize_i32(3),
5045                Self::UnknownValue(u) => u.0.serialize(serializer),
5046            }
5047        }
5048    }
5049
5050    impl<'de> serde::de::Deserialize<'de> for ServingStatus {
5051        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5052        where
5053            D: serde::Deserializer<'de>,
5054        {
5055            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServingStatus>::new(
5056                ".google.appengine.v1.Application.ServingStatus",
5057            ))
5058        }
5059    }
5060
5061    ///
5062    /// # Working with unknown values
5063    ///
5064    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5065    /// additional enum variants at any time. Adding new variants is not considered
5066    /// a breaking change. Applications should write their code in anticipation of:
5067    ///
5068    /// - New values appearing in future releases of the client library, **and**
5069    /// - New values received dynamically, without application changes.
5070    ///
5071    /// Please consult the [Working with enums] section in the user guide for some
5072    /// guidelines.
5073    ///
5074    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5075    #[derive(Clone, Debug, PartialEq)]
5076    #[non_exhaustive]
5077    pub enum DatabaseType {
5078        /// Database type is unspecified.
5079        Unspecified,
5080        /// Cloud Datastore
5081        CloudDatastore,
5082        /// Cloud Firestore Native
5083        CloudFirestore,
5084        /// Cloud Firestore in Datastore Mode
5085        CloudDatastoreCompatibility,
5086        /// If set, the enum was initialized with an unknown value.
5087        ///
5088        /// Applications can examine the value using [DatabaseType::value] or
5089        /// [DatabaseType::name].
5090        UnknownValue(database_type::UnknownValue),
5091    }
5092
5093    #[doc(hidden)]
5094    pub mod database_type {
5095        #[allow(unused_imports)]
5096        use super::*;
5097        #[derive(Clone, Debug, PartialEq)]
5098        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5099    }
5100
5101    impl DatabaseType {
5102        /// Gets the enum value.
5103        ///
5104        /// Returns `None` if the enum contains an unknown value deserialized from
5105        /// the string representation of enums.
5106        pub fn value(&self) -> std::option::Option<i32> {
5107            match self {
5108                Self::Unspecified => std::option::Option::Some(0),
5109                Self::CloudDatastore => std::option::Option::Some(1),
5110                Self::CloudFirestore => std::option::Option::Some(2),
5111                Self::CloudDatastoreCompatibility => std::option::Option::Some(3),
5112                Self::UnknownValue(u) => u.0.value(),
5113            }
5114        }
5115
5116        /// Gets the enum value as a string.
5117        ///
5118        /// Returns `None` if the enum contains an unknown value deserialized from
5119        /// the integer representation of enums.
5120        pub fn name(&self) -> std::option::Option<&str> {
5121            match self {
5122                Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
5123                Self::CloudDatastore => std::option::Option::Some("CLOUD_DATASTORE"),
5124                Self::CloudFirestore => std::option::Option::Some("CLOUD_FIRESTORE"),
5125                Self::CloudDatastoreCompatibility => {
5126                    std::option::Option::Some("CLOUD_DATASTORE_COMPATIBILITY")
5127                }
5128                Self::UnknownValue(u) => u.0.name(),
5129            }
5130        }
5131    }
5132
5133    impl std::default::Default for DatabaseType {
5134        fn default() -> Self {
5135            use std::convert::From;
5136            Self::from(0)
5137        }
5138    }
5139
5140    impl std::fmt::Display for DatabaseType {
5141        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5142            wkt::internal::display_enum(f, self.name(), self.value())
5143        }
5144    }
5145
5146    impl std::convert::From<i32> for DatabaseType {
5147        fn from(value: i32) -> Self {
5148            match value {
5149                0 => Self::Unspecified,
5150                1 => Self::CloudDatastore,
5151                2 => Self::CloudFirestore,
5152                3 => Self::CloudDatastoreCompatibility,
5153                _ => Self::UnknownValue(database_type::UnknownValue(
5154                    wkt::internal::UnknownEnumValue::Integer(value),
5155                )),
5156            }
5157        }
5158    }
5159
5160    impl std::convert::From<&str> for DatabaseType {
5161        fn from(value: &str) -> Self {
5162            use std::string::ToString;
5163            match value {
5164                "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
5165                "CLOUD_DATASTORE" => Self::CloudDatastore,
5166                "CLOUD_FIRESTORE" => Self::CloudFirestore,
5167                "CLOUD_DATASTORE_COMPATIBILITY" => Self::CloudDatastoreCompatibility,
5168                _ => Self::UnknownValue(database_type::UnknownValue(
5169                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5170                )),
5171            }
5172        }
5173    }
5174
5175    impl serde::ser::Serialize for DatabaseType {
5176        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5177        where
5178            S: serde::Serializer,
5179        {
5180            match self {
5181                Self::Unspecified => serializer.serialize_i32(0),
5182                Self::CloudDatastore => serializer.serialize_i32(1),
5183                Self::CloudFirestore => serializer.serialize_i32(2),
5184                Self::CloudDatastoreCompatibility => serializer.serialize_i32(3),
5185                Self::UnknownValue(u) => u.0.serialize(serializer),
5186            }
5187        }
5188    }
5189
5190    impl<'de> serde::de::Deserialize<'de> for DatabaseType {
5191        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5192        where
5193            D: serde::Deserializer<'de>,
5194        {
5195            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
5196                ".google.appengine.v1.Application.DatabaseType",
5197            ))
5198        }
5199    }
5200}
5201
5202/// Rules to match an HTTP request and dispatch that request to a service.
5203#[derive(Clone, Default, PartialEq)]
5204#[non_exhaustive]
5205pub struct UrlDispatchRule {
5206    /// Domain name to match against. The wildcard "`*`" is supported if
5207    /// specified before a period: "`*.`".
5208    ///
5209    /// Defaults to matching all domains: "`*`".
5210    pub domain: std::string::String,
5211
5212    /// Pathname within the host. Must start with a "`/`". A
5213    /// single "`*`" can be included at the end of the path.
5214    ///
5215    /// The sum of the lengths of the domain and path may not
5216    /// exceed 100 characters.
5217    pub path: std::string::String,
5218
5219    /// Resource ID of a service in this application that should
5220    /// serve the matched request. The service must already
5221    /// exist. Example: `default`.
5222    pub service: std::string::String,
5223
5224    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5225}
5226
5227impl UrlDispatchRule {
5228    pub fn new() -> Self {
5229        std::default::Default::default()
5230    }
5231
5232    /// Sets the value of [domain][crate::model::UrlDispatchRule::domain].
5233    ///
5234    /// # Example
5235    /// ```ignore,no_run
5236    /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5237    /// let x = UrlDispatchRule::new().set_domain("example");
5238    /// ```
5239    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5240        self.domain = v.into();
5241        self
5242    }
5243
5244    /// Sets the value of [path][crate::model::UrlDispatchRule::path].
5245    ///
5246    /// # Example
5247    /// ```ignore,no_run
5248    /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5249    /// let x = UrlDispatchRule::new().set_path("example");
5250    /// ```
5251    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5252        self.path = v.into();
5253        self
5254    }
5255
5256    /// Sets the value of [service][crate::model::UrlDispatchRule::service].
5257    ///
5258    /// # Example
5259    /// ```ignore,no_run
5260    /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5261    /// let x = UrlDispatchRule::new().set_service("example");
5262    /// ```
5263    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5264        self.service = v.into();
5265        self
5266    }
5267}
5268
5269impl wkt::message::Message for UrlDispatchRule {
5270    fn typename() -> &'static str {
5271        "type.googleapis.com/google.appengine.v1.UrlDispatchRule"
5272    }
5273}
5274
5275/// App Engine admin service audit log.
5276#[derive(Clone, Default, PartialEq)]
5277#[non_exhaustive]
5278pub struct AuditData {
5279    /// Detailed information about methods that require it. Does not include
5280    /// simple Get, List or Delete methods because all significant information
5281    /// (resource name, number of returned elements for List operations) is already
5282    /// included in parent audit log message.
5283    pub method: std::option::Option<crate::model::audit_data::Method>,
5284
5285    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5286}
5287
5288impl AuditData {
5289    pub fn new() -> Self {
5290        std::default::Default::default()
5291    }
5292
5293    /// Sets the value of [method][crate::model::AuditData::method].
5294    ///
5295    /// Note that all the setters affecting `method` are mutually
5296    /// exclusive.
5297    ///
5298    /// # Example
5299    /// ```ignore,no_run
5300    /// # use google_cloud_appengine_v1::model::AuditData;
5301    /// use google_cloud_appengine_v1::model::UpdateServiceMethod;
5302    /// let x = AuditData::new().set_method(Some(
5303    ///     google_cloud_appengine_v1::model::audit_data::Method::UpdateService(UpdateServiceMethod::default().into())));
5304    /// ```
5305    pub fn set_method<
5306        T: std::convert::Into<std::option::Option<crate::model::audit_data::Method>>,
5307    >(
5308        mut self,
5309        v: T,
5310    ) -> Self {
5311        self.method = v.into();
5312        self
5313    }
5314
5315    /// The value of [method][crate::model::AuditData::method]
5316    /// if it holds a `UpdateService`, `None` if the field is not set or
5317    /// holds a different branch.
5318    pub fn update_service(
5319        &self,
5320    ) -> std::option::Option<&std::boxed::Box<crate::model::UpdateServiceMethod>> {
5321        #[allow(unreachable_patterns)]
5322        self.method.as_ref().and_then(|v| match v {
5323            crate::model::audit_data::Method::UpdateService(v) => std::option::Option::Some(v),
5324            _ => std::option::Option::None,
5325        })
5326    }
5327
5328    /// Sets the value of [method][crate::model::AuditData::method]
5329    /// to hold a `UpdateService`.
5330    ///
5331    /// Note that all the setters affecting `method` are
5332    /// mutually exclusive.
5333    ///
5334    /// # Example
5335    /// ```ignore,no_run
5336    /// # use google_cloud_appengine_v1::model::AuditData;
5337    /// use google_cloud_appengine_v1::model::UpdateServiceMethod;
5338    /// let x = AuditData::new().set_update_service(UpdateServiceMethod::default()/* use setters */);
5339    /// assert!(x.update_service().is_some());
5340    /// assert!(x.create_version().is_none());
5341    /// ```
5342    pub fn set_update_service<
5343        T: std::convert::Into<std::boxed::Box<crate::model::UpdateServiceMethod>>,
5344    >(
5345        mut self,
5346        v: T,
5347    ) -> Self {
5348        self.method =
5349            std::option::Option::Some(crate::model::audit_data::Method::UpdateService(v.into()));
5350        self
5351    }
5352
5353    /// The value of [method][crate::model::AuditData::method]
5354    /// if it holds a `CreateVersion`, `None` if the field is not set or
5355    /// holds a different branch.
5356    pub fn create_version(
5357        &self,
5358    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateVersionMethod>> {
5359        #[allow(unreachable_patterns)]
5360        self.method.as_ref().and_then(|v| match v {
5361            crate::model::audit_data::Method::CreateVersion(v) => std::option::Option::Some(v),
5362            _ => std::option::Option::None,
5363        })
5364    }
5365
5366    /// Sets the value of [method][crate::model::AuditData::method]
5367    /// to hold a `CreateVersion`.
5368    ///
5369    /// Note that all the setters affecting `method` are
5370    /// mutually exclusive.
5371    ///
5372    /// # Example
5373    /// ```ignore,no_run
5374    /// # use google_cloud_appengine_v1::model::AuditData;
5375    /// use google_cloud_appengine_v1::model::CreateVersionMethod;
5376    /// let x = AuditData::new().set_create_version(CreateVersionMethod::default()/* use setters */);
5377    /// assert!(x.create_version().is_some());
5378    /// assert!(x.update_service().is_none());
5379    /// ```
5380    pub fn set_create_version<
5381        T: std::convert::Into<std::boxed::Box<crate::model::CreateVersionMethod>>,
5382    >(
5383        mut self,
5384        v: T,
5385    ) -> Self {
5386        self.method =
5387            std::option::Option::Some(crate::model::audit_data::Method::CreateVersion(v.into()));
5388        self
5389    }
5390}
5391
5392impl wkt::message::Message for AuditData {
5393    fn typename() -> &'static str {
5394        "type.googleapis.com/google.appengine.v1.AuditData"
5395    }
5396}
5397
5398/// Defines additional types related to [AuditData].
5399pub mod audit_data {
5400    #[allow(unused_imports)]
5401    use super::*;
5402
5403    /// Detailed information about methods that require it. Does not include
5404    /// simple Get, List or Delete methods because all significant information
5405    /// (resource name, number of returned elements for List operations) is already
5406    /// included in parent audit log message.
5407    #[derive(Clone, Debug, PartialEq)]
5408    #[non_exhaustive]
5409    pub enum Method {
5410        /// Detailed information about UpdateService call.
5411        UpdateService(std::boxed::Box<crate::model::UpdateServiceMethod>),
5412        /// Detailed information about CreateVersion call.
5413        CreateVersion(std::boxed::Box<crate::model::CreateVersionMethod>),
5414    }
5415}
5416
5417/// Detailed information about UpdateService call.
5418#[derive(Clone, Default, PartialEq)]
5419#[non_exhaustive]
5420pub struct UpdateServiceMethod {
5421    /// Update service request.
5422    pub request: std::option::Option<crate::model::UpdateServiceRequest>,
5423
5424    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5425}
5426
5427impl UpdateServiceMethod {
5428    pub fn new() -> Self {
5429        std::default::Default::default()
5430    }
5431
5432    /// Sets the value of [request][crate::model::UpdateServiceMethod::request].
5433    ///
5434    /// # Example
5435    /// ```ignore,no_run
5436    /// # use google_cloud_appengine_v1::model::UpdateServiceMethod;
5437    /// use google_cloud_appengine_v1::model::UpdateServiceRequest;
5438    /// let x = UpdateServiceMethod::new().set_request(UpdateServiceRequest::default()/* use setters */);
5439    /// ```
5440    pub fn set_request<T>(mut self, v: T) -> Self
5441    where
5442        T: std::convert::Into<crate::model::UpdateServiceRequest>,
5443    {
5444        self.request = std::option::Option::Some(v.into());
5445        self
5446    }
5447
5448    /// Sets or clears the value of [request][crate::model::UpdateServiceMethod::request].
5449    ///
5450    /// # Example
5451    /// ```ignore,no_run
5452    /// # use google_cloud_appengine_v1::model::UpdateServiceMethod;
5453    /// use google_cloud_appengine_v1::model::UpdateServiceRequest;
5454    /// let x = UpdateServiceMethod::new().set_or_clear_request(Some(UpdateServiceRequest::default()/* use setters */));
5455    /// let x = UpdateServiceMethod::new().set_or_clear_request(None::<UpdateServiceRequest>);
5456    /// ```
5457    pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5458    where
5459        T: std::convert::Into<crate::model::UpdateServiceRequest>,
5460    {
5461        self.request = v.map(|x| x.into());
5462        self
5463    }
5464}
5465
5466impl wkt::message::Message for UpdateServiceMethod {
5467    fn typename() -> &'static str {
5468        "type.googleapis.com/google.appengine.v1.UpdateServiceMethod"
5469    }
5470}
5471
5472/// Detailed information about CreateVersion call.
5473#[derive(Clone, Default, PartialEq)]
5474#[non_exhaustive]
5475pub struct CreateVersionMethod {
5476    /// Create version request.
5477    pub request: std::option::Option<crate::model::CreateVersionRequest>,
5478
5479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5480}
5481
5482impl CreateVersionMethod {
5483    pub fn new() -> Self {
5484        std::default::Default::default()
5485    }
5486
5487    /// Sets the value of [request][crate::model::CreateVersionMethod::request].
5488    ///
5489    /// # Example
5490    /// ```ignore,no_run
5491    /// # use google_cloud_appengine_v1::model::CreateVersionMethod;
5492    /// use google_cloud_appengine_v1::model::CreateVersionRequest;
5493    /// let x = CreateVersionMethod::new().set_request(CreateVersionRequest::default()/* use setters */);
5494    /// ```
5495    pub fn set_request<T>(mut self, v: T) -> Self
5496    where
5497        T: std::convert::Into<crate::model::CreateVersionRequest>,
5498    {
5499        self.request = std::option::Option::Some(v.into());
5500        self
5501    }
5502
5503    /// Sets or clears the value of [request][crate::model::CreateVersionMethod::request].
5504    ///
5505    /// # Example
5506    /// ```ignore,no_run
5507    /// # use google_cloud_appengine_v1::model::CreateVersionMethod;
5508    /// use google_cloud_appengine_v1::model::CreateVersionRequest;
5509    /// let x = CreateVersionMethod::new().set_or_clear_request(Some(CreateVersionRequest::default()/* use setters */));
5510    /// let x = CreateVersionMethod::new().set_or_clear_request(None::<CreateVersionRequest>);
5511    /// ```
5512    pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5513    where
5514        T: std::convert::Into<crate::model::CreateVersionRequest>,
5515    {
5516        self.request = v.map(|x| x.into());
5517        self
5518    }
5519}
5520
5521impl wkt::message::Message for CreateVersionMethod {
5522    fn typename() -> &'static str {
5523        "type.googleapis.com/google.appengine.v1.CreateVersionMethod"
5524    }
5525}
5526
5527/// An SSL certificate that a user has been authorized to administer. A user
5528/// is authorized to administer any certificate that applies to one of their
5529/// authorized domains.
5530#[derive(Clone, Default, PartialEq)]
5531#[non_exhaustive]
5532pub struct AuthorizedCertificate {
5533    /// Full path to the `AuthorizedCertificate` resource in the API. Example:
5534    /// `apps/myapp/authorizedCertificates/12345`.
5535    ///
5536    /// @OutputOnly
5537    pub name: std::string::String,
5538
5539    /// Relative name of the certificate. This is a unique value autogenerated
5540    /// on `AuthorizedCertificate` resource creation. Example: `12345`.
5541    ///
5542    /// @OutputOnly
5543    pub id: std::string::String,
5544
5545    /// The user-specified display name of the certificate. This is not
5546    /// guaranteed to be unique. Example: `My Certificate`.
5547    pub display_name: std::string::String,
5548
5549    /// Topmost applicable domains of this certificate. This certificate
5550    /// applies to these domains and their subdomains. Example: `example.com`.
5551    ///
5552    /// @OutputOnly
5553    pub domain_names: std::vec::Vec<std::string::String>,
5554
5555    /// The time when this certificate expires. To update the renewal time on this
5556    /// certificate, upload an SSL certificate with a different expiration time
5557    /// using [`AuthorizedCertificates.UpdateAuthorizedCertificate`]().
5558    ///
5559    /// @OutputOnly
5560    pub expire_time: std::option::Option<wkt::Timestamp>,
5561
5562    /// The SSL certificate serving the `AuthorizedCertificate` resource. This
5563    /// must be obtained independently from a certificate authority.
5564    pub certificate_raw_data: std::option::Option<crate::model::CertificateRawData>,
5565
5566    /// Only applicable if this certificate is managed by App Engine. Managed
5567    /// certificates are tied to the lifecycle of a `DomainMapping` and cannot be
5568    /// updated or deleted via the `AuthorizedCertificates` API. If this
5569    /// certificate is manually administered by the user, this field will be empty.
5570    ///
5571    /// @OutputOnly
5572    pub managed_certificate: std::option::Option<crate::model::ManagedCertificate>,
5573
5574    /// The full paths to user visible Domain Mapping resources that have this
5575    /// certificate mapped. Example: `apps/myapp/domainMappings/example.com`.
5576    ///
5577    /// This may not represent the full list of mapped domain mappings if the user
5578    /// does not have `VIEWER` permissions on all of the applications that have
5579    /// this certificate mapped. See `domain_mappings_count` for a complete count.
5580    ///
5581    /// Only returned by `GET` or `LIST` requests when specifically requested by
5582    /// the `view=FULL_CERTIFICATE` option.
5583    ///
5584    /// @OutputOnly
5585    pub visible_domain_mappings: std::vec::Vec<std::string::String>,
5586
5587    /// Aggregate count of the domain mappings with this certificate mapped. This
5588    /// count includes domain mappings on applications for which the user does not
5589    /// have `VIEWER` permissions.
5590    ///
5591    /// Only returned by `GET` or `LIST` requests when specifically requested by
5592    /// the `view=FULL_CERTIFICATE` option.
5593    ///
5594    /// @OutputOnly
5595    pub domain_mappings_count: i32,
5596
5597    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5598}
5599
5600impl AuthorizedCertificate {
5601    pub fn new() -> Self {
5602        std::default::Default::default()
5603    }
5604
5605    /// Sets the value of [name][crate::model::AuthorizedCertificate::name].
5606    ///
5607    /// # Example
5608    /// ```ignore,no_run
5609    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5610    /// let x = AuthorizedCertificate::new().set_name("example");
5611    /// ```
5612    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5613        self.name = v.into();
5614        self
5615    }
5616
5617    /// Sets the value of [id][crate::model::AuthorizedCertificate::id].
5618    ///
5619    /// # Example
5620    /// ```ignore,no_run
5621    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5622    /// let x = AuthorizedCertificate::new().set_id("example");
5623    /// ```
5624    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5625        self.id = v.into();
5626        self
5627    }
5628
5629    /// Sets the value of [display_name][crate::model::AuthorizedCertificate::display_name].
5630    ///
5631    /// # Example
5632    /// ```ignore,no_run
5633    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5634    /// let x = AuthorizedCertificate::new().set_display_name("example");
5635    /// ```
5636    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5637        self.display_name = v.into();
5638        self
5639    }
5640
5641    /// Sets the value of [domain_names][crate::model::AuthorizedCertificate::domain_names].
5642    ///
5643    /// # Example
5644    /// ```ignore,no_run
5645    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5646    /// let x = AuthorizedCertificate::new().set_domain_names(["a", "b", "c"]);
5647    /// ```
5648    pub fn set_domain_names<T, V>(mut self, v: T) -> Self
5649    where
5650        T: std::iter::IntoIterator<Item = V>,
5651        V: std::convert::Into<std::string::String>,
5652    {
5653        use std::iter::Iterator;
5654        self.domain_names = v.into_iter().map(|i| i.into()).collect();
5655        self
5656    }
5657
5658    /// Sets the value of [expire_time][crate::model::AuthorizedCertificate::expire_time].
5659    ///
5660    /// # Example
5661    /// ```ignore,no_run
5662    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5663    /// use wkt::Timestamp;
5664    /// let x = AuthorizedCertificate::new().set_expire_time(Timestamp::default()/* use setters */);
5665    /// ```
5666    pub fn set_expire_time<T>(mut self, v: T) -> Self
5667    where
5668        T: std::convert::Into<wkt::Timestamp>,
5669    {
5670        self.expire_time = std::option::Option::Some(v.into());
5671        self
5672    }
5673
5674    /// Sets or clears the value of [expire_time][crate::model::AuthorizedCertificate::expire_time].
5675    ///
5676    /// # Example
5677    /// ```ignore,no_run
5678    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5679    /// use wkt::Timestamp;
5680    /// let x = AuthorizedCertificate::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
5681    /// let x = AuthorizedCertificate::new().set_or_clear_expire_time(None::<Timestamp>);
5682    /// ```
5683    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
5684    where
5685        T: std::convert::Into<wkt::Timestamp>,
5686    {
5687        self.expire_time = v.map(|x| x.into());
5688        self
5689    }
5690
5691    /// Sets the value of [certificate_raw_data][crate::model::AuthorizedCertificate::certificate_raw_data].
5692    ///
5693    /// # Example
5694    /// ```ignore,no_run
5695    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5696    /// use google_cloud_appengine_v1::model::CertificateRawData;
5697    /// let x = AuthorizedCertificate::new().set_certificate_raw_data(CertificateRawData::default()/* use setters */);
5698    /// ```
5699    pub fn set_certificate_raw_data<T>(mut self, v: T) -> Self
5700    where
5701        T: std::convert::Into<crate::model::CertificateRawData>,
5702    {
5703        self.certificate_raw_data = std::option::Option::Some(v.into());
5704        self
5705    }
5706
5707    /// Sets or clears the value of [certificate_raw_data][crate::model::AuthorizedCertificate::certificate_raw_data].
5708    ///
5709    /// # Example
5710    /// ```ignore,no_run
5711    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5712    /// use google_cloud_appengine_v1::model::CertificateRawData;
5713    /// let x = AuthorizedCertificate::new().set_or_clear_certificate_raw_data(Some(CertificateRawData::default()/* use setters */));
5714    /// let x = AuthorizedCertificate::new().set_or_clear_certificate_raw_data(None::<CertificateRawData>);
5715    /// ```
5716    pub fn set_or_clear_certificate_raw_data<T>(mut self, v: std::option::Option<T>) -> Self
5717    where
5718        T: std::convert::Into<crate::model::CertificateRawData>,
5719    {
5720        self.certificate_raw_data = v.map(|x| x.into());
5721        self
5722    }
5723
5724    /// Sets the value of [managed_certificate][crate::model::AuthorizedCertificate::managed_certificate].
5725    ///
5726    /// # Example
5727    /// ```ignore,no_run
5728    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5729    /// use google_cloud_appengine_v1::model::ManagedCertificate;
5730    /// let x = AuthorizedCertificate::new().set_managed_certificate(ManagedCertificate::default()/* use setters */);
5731    /// ```
5732    pub fn set_managed_certificate<T>(mut self, v: T) -> Self
5733    where
5734        T: std::convert::Into<crate::model::ManagedCertificate>,
5735    {
5736        self.managed_certificate = std::option::Option::Some(v.into());
5737        self
5738    }
5739
5740    /// Sets or clears the value of [managed_certificate][crate::model::AuthorizedCertificate::managed_certificate].
5741    ///
5742    /// # Example
5743    /// ```ignore,no_run
5744    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5745    /// use google_cloud_appengine_v1::model::ManagedCertificate;
5746    /// let x = AuthorizedCertificate::new().set_or_clear_managed_certificate(Some(ManagedCertificate::default()/* use setters */));
5747    /// let x = AuthorizedCertificate::new().set_or_clear_managed_certificate(None::<ManagedCertificate>);
5748    /// ```
5749    pub fn set_or_clear_managed_certificate<T>(mut self, v: std::option::Option<T>) -> Self
5750    where
5751        T: std::convert::Into<crate::model::ManagedCertificate>,
5752    {
5753        self.managed_certificate = v.map(|x| x.into());
5754        self
5755    }
5756
5757    /// Sets the value of [visible_domain_mappings][crate::model::AuthorizedCertificate::visible_domain_mappings].
5758    ///
5759    /// # Example
5760    /// ```ignore,no_run
5761    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5762    /// let x = AuthorizedCertificate::new().set_visible_domain_mappings(["a", "b", "c"]);
5763    /// ```
5764    pub fn set_visible_domain_mappings<T, V>(mut self, v: T) -> Self
5765    where
5766        T: std::iter::IntoIterator<Item = V>,
5767        V: std::convert::Into<std::string::String>,
5768    {
5769        use std::iter::Iterator;
5770        self.visible_domain_mappings = v.into_iter().map(|i| i.into()).collect();
5771        self
5772    }
5773
5774    /// Sets the value of [domain_mappings_count][crate::model::AuthorizedCertificate::domain_mappings_count].
5775    ///
5776    /// # Example
5777    /// ```ignore,no_run
5778    /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5779    /// let x = AuthorizedCertificate::new().set_domain_mappings_count(42);
5780    /// ```
5781    pub fn set_domain_mappings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5782        self.domain_mappings_count = v.into();
5783        self
5784    }
5785}
5786
5787impl wkt::message::Message for AuthorizedCertificate {
5788    fn typename() -> &'static str {
5789        "type.googleapis.com/google.appengine.v1.AuthorizedCertificate"
5790    }
5791}
5792
5793/// An SSL certificate obtained from a certificate authority.
5794#[derive(Clone, Default, PartialEq)]
5795#[non_exhaustive]
5796pub struct CertificateRawData {
5797    /// PEM encoded x.509 public key certificate. This field is set once on
5798    /// certificate creation. Must include the header and footer. Example:
5799    pub public_certificate: std::string::String,
5800
5801    /// Unencrypted PEM encoded RSA private key. This field is set once on
5802    /// certificate creation and then encrypted. The key size must be 2048
5803    /// bits or fewer. Must include the header and footer. Example:
5804    ///
5805    /// @InputOnly
5806    pub private_key: std::string::String,
5807
5808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5809}
5810
5811impl CertificateRawData {
5812    pub fn new() -> Self {
5813        std::default::Default::default()
5814    }
5815
5816    /// Sets the value of [public_certificate][crate::model::CertificateRawData::public_certificate].
5817    ///
5818    /// # Example
5819    /// ```ignore,no_run
5820    /// # use google_cloud_appengine_v1::model::CertificateRawData;
5821    /// let x = CertificateRawData::new().set_public_certificate("example");
5822    /// ```
5823    pub fn set_public_certificate<T: std::convert::Into<std::string::String>>(
5824        mut self,
5825        v: T,
5826    ) -> Self {
5827        self.public_certificate = v.into();
5828        self
5829    }
5830
5831    /// Sets the value of [private_key][crate::model::CertificateRawData::private_key].
5832    ///
5833    /// # Example
5834    /// ```ignore,no_run
5835    /// # use google_cloud_appengine_v1::model::CertificateRawData;
5836    /// let x = CertificateRawData::new().set_private_key("example");
5837    /// ```
5838    pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5839        self.private_key = v.into();
5840        self
5841    }
5842}
5843
5844impl wkt::message::Message for CertificateRawData {
5845    fn typename() -> &'static str {
5846        "type.googleapis.com/google.appengine.v1.CertificateRawData"
5847    }
5848}
5849
5850/// A certificate managed by App Engine.
5851#[derive(Clone, Default, PartialEq)]
5852#[non_exhaustive]
5853pub struct ManagedCertificate {
5854    /// Time at which the certificate was last renewed. The renewal process is
5855    /// fully managed. Certificate renewal will automatically occur before the
5856    /// certificate expires. Renewal errors can be tracked via `ManagementStatus`.
5857    ///
5858    /// @OutputOnly
5859    pub last_renewal_time: std::option::Option<wkt::Timestamp>,
5860
5861    /// Status of certificate management. Refers to the most recent certificate
5862    /// acquisition or renewal attempt.
5863    ///
5864    /// @OutputOnly
5865    pub status: crate::model::ManagementStatus,
5866
5867    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5868}
5869
5870impl ManagedCertificate {
5871    pub fn new() -> Self {
5872        std::default::Default::default()
5873    }
5874
5875    /// Sets the value of [last_renewal_time][crate::model::ManagedCertificate::last_renewal_time].
5876    ///
5877    /// # Example
5878    /// ```ignore,no_run
5879    /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5880    /// use wkt::Timestamp;
5881    /// let x = ManagedCertificate::new().set_last_renewal_time(Timestamp::default()/* use setters */);
5882    /// ```
5883    pub fn set_last_renewal_time<T>(mut self, v: T) -> Self
5884    where
5885        T: std::convert::Into<wkt::Timestamp>,
5886    {
5887        self.last_renewal_time = std::option::Option::Some(v.into());
5888        self
5889    }
5890
5891    /// Sets or clears the value of [last_renewal_time][crate::model::ManagedCertificate::last_renewal_time].
5892    ///
5893    /// # Example
5894    /// ```ignore,no_run
5895    /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5896    /// use wkt::Timestamp;
5897    /// let x = ManagedCertificate::new().set_or_clear_last_renewal_time(Some(Timestamp::default()/* use setters */));
5898    /// let x = ManagedCertificate::new().set_or_clear_last_renewal_time(None::<Timestamp>);
5899    /// ```
5900    pub fn set_or_clear_last_renewal_time<T>(mut self, v: std::option::Option<T>) -> Self
5901    where
5902        T: std::convert::Into<wkt::Timestamp>,
5903    {
5904        self.last_renewal_time = v.map(|x| x.into());
5905        self
5906    }
5907
5908    /// Sets the value of [status][crate::model::ManagedCertificate::status].
5909    ///
5910    /// # Example
5911    /// ```ignore,no_run
5912    /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5913    /// use google_cloud_appengine_v1::model::ManagementStatus;
5914    /// let x0 = ManagedCertificate::new().set_status(ManagementStatus::Ok);
5915    /// let x1 = ManagedCertificate::new().set_status(ManagementStatus::Pending);
5916    /// let x2 = ManagedCertificate::new().set_status(ManagementStatus::FailedRetryingNotVisible);
5917    /// ```
5918    pub fn set_status<T: std::convert::Into<crate::model::ManagementStatus>>(
5919        mut self,
5920        v: T,
5921    ) -> Self {
5922        self.status = v.into();
5923        self
5924    }
5925}
5926
5927impl wkt::message::Message for ManagedCertificate {
5928    fn typename() -> &'static str {
5929        "type.googleapis.com/google.appengine.v1.ManagedCertificate"
5930    }
5931}
5932
5933/// Code and application artifacts used to deploy a version to App Engine.
5934#[derive(Clone, Default, PartialEq)]
5935#[non_exhaustive]
5936pub struct Deployment {
5937    /// Manifest of the files stored in Google Cloud Storage that are included
5938    /// as part of this version. All files must be readable using the
5939    /// credentials supplied with this call.
5940    pub files: std::collections::HashMap<std::string::String, crate::model::FileInfo>,
5941
5942    /// The Docker image for the container that runs the version.
5943    /// Only applicable for instances running in the App Engine flexible environment.
5944    pub container: std::option::Option<crate::model::ContainerInfo>,
5945
5946    /// The zip file for this deployment, if this is a zip deployment.
5947    pub zip: std::option::Option<crate::model::ZipInfo>,
5948
5949    /// Options for any Google Cloud Build builds created as a part of this
5950    /// deployment.
5951    ///
5952    /// These options will only be used if a new build is created, such as when
5953    /// deploying to the App Engine flexible environment using files or zip.
5954    pub cloud_build_options: std::option::Option<crate::model::CloudBuildOptions>,
5955
5956    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5957}
5958
5959impl Deployment {
5960    pub fn new() -> Self {
5961        std::default::Default::default()
5962    }
5963
5964    /// Sets the value of [files][crate::model::Deployment::files].
5965    ///
5966    /// # Example
5967    /// ```ignore,no_run
5968    /// # use google_cloud_appengine_v1::model::Deployment;
5969    /// use google_cloud_appengine_v1::model::FileInfo;
5970    /// let x = Deployment::new().set_files([
5971    ///     ("key0", FileInfo::default()/* use setters */),
5972    ///     ("key1", FileInfo::default()/* use (different) setters */),
5973    /// ]);
5974    /// ```
5975    pub fn set_files<T, K, V>(mut self, v: T) -> Self
5976    where
5977        T: std::iter::IntoIterator<Item = (K, V)>,
5978        K: std::convert::Into<std::string::String>,
5979        V: std::convert::Into<crate::model::FileInfo>,
5980    {
5981        use std::iter::Iterator;
5982        self.files = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5983        self
5984    }
5985
5986    /// Sets the value of [container][crate::model::Deployment::container].
5987    ///
5988    /// # Example
5989    /// ```ignore,no_run
5990    /// # use google_cloud_appengine_v1::model::Deployment;
5991    /// use google_cloud_appengine_v1::model::ContainerInfo;
5992    /// let x = Deployment::new().set_container(ContainerInfo::default()/* use setters */);
5993    /// ```
5994    pub fn set_container<T>(mut self, v: T) -> Self
5995    where
5996        T: std::convert::Into<crate::model::ContainerInfo>,
5997    {
5998        self.container = std::option::Option::Some(v.into());
5999        self
6000    }
6001
6002    /// Sets or clears the value of [container][crate::model::Deployment::container].
6003    ///
6004    /// # Example
6005    /// ```ignore,no_run
6006    /// # use google_cloud_appengine_v1::model::Deployment;
6007    /// use google_cloud_appengine_v1::model::ContainerInfo;
6008    /// let x = Deployment::new().set_or_clear_container(Some(ContainerInfo::default()/* use setters */));
6009    /// let x = Deployment::new().set_or_clear_container(None::<ContainerInfo>);
6010    /// ```
6011    pub fn set_or_clear_container<T>(mut self, v: std::option::Option<T>) -> Self
6012    where
6013        T: std::convert::Into<crate::model::ContainerInfo>,
6014    {
6015        self.container = v.map(|x| x.into());
6016        self
6017    }
6018
6019    /// Sets the value of [zip][crate::model::Deployment::zip].
6020    ///
6021    /// # Example
6022    /// ```ignore,no_run
6023    /// # use google_cloud_appengine_v1::model::Deployment;
6024    /// use google_cloud_appengine_v1::model::ZipInfo;
6025    /// let x = Deployment::new().set_zip(ZipInfo::default()/* use setters */);
6026    /// ```
6027    pub fn set_zip<T>(mut self, v: T) -> Self
6028    where
6029        T: std::convert::Into<crate::model::ZipInfo>,
6030    {
6031        self.zip = std::option::Option::Some(v.into());
6032        self
6033    }
6034
6035    /// Sets or clears the value of [zip][crate::model::Deployment::zip].
6036    ///
6037    /// # Example
6038    /// ```ignore,no_run
6039    /// # use google_cloud_appengine_v1::model::Deployment;
6040    /// use google_cloud_appengine_v1::model::ZipInfo;
6041    /// let x = Deployment::new().set_or_clear_zip(Some(ZipInfo::default()/* use setters */));
6042    /// let x = Deployment::new().set_or_clear_zip(None::<ZipInfo>);
6043    /// ```
6044    pub fn set_or_clear_zip<T>(mut self, v: std::option::Option<T>) -> Self
6045    where
6046        T: std::convert::Into<crate::model::ZipInfo>,
6047    {
6048        self.zip = v.map(|x| x.into());
6049        self
6050    }
6051
6052    /// Sets the value of [cloud_build_options][crate::model::Deployment::cloud_build_options].
6053    ///
6054    /// # Example
6055    /// ```ignore,no_run
6056    /// # use google_cloud_appengine_v1::model::Deployment;
6057    /// use google_cloud_appengine_v1::model::CloudBuildOptions;
6058    /// let x = Deployment::new().set_cloud_build_options(CloudBuildOptions::default()/* use setters */);
6059    /// ```
6060    pub fn set_cloud_build_options<T>(mut self, v: T) -> Self
6061    where
6062        T: std::convert::Into<crate::model::CloudBuildOptions>,
6063    {
6064        self.cloud_build_options = std::option::Option::Some(v.into());
6065        self
6066    }
6067
6068    /// Sets or clears the value of [cloud_build_options][crate::model::Deployment::cloud_build_options].
6069    ///
6070    /// # Example
6071    /// ```ignore,no_run
6072    /// # use google_cloud_appengine_v1::model::Deployment;
6073    /// use google_cloud_appengine_v1::model::CloudBuildOptions;
6074    /// let x = Deployment::new().set_or_clear_cloud_build_options(Some(CloudBuildOptions::default()/* use setters */));
6075    /// let x = Deployment::new().set_or_clear_cloud_build_options(None::<CloudBuildOptions>);
6076    /// ```
6077    pub fn set_or_clear_cloud_build_options<T>(mut self, v: std::option::Option<T>) -> Self
6078    where
6079        T: std::convert::Into<crate::model::CloudBuildOptions>,
6080    {
6081        self.cloud_build_options = v.map(|x| x.into());
6082        self
6083    }
6084}
6085
6086impl wkt::message::Message for Deployment {
6087    fn typename() -> &'static str {
6088        "type.googleapis.com/google.appengine.v1.Deployment"
6089    }
6090}
6091
6092/// Single source file that is part of the version to be deployed. Each source
6093/// file that is deployed must be specified separately.
6094#[derive(Clone, Default, PartialEq)]
6095#[non_exhaustive]
6096pub struct FileInfo {
6097    /// URL source to use to fetch this file. Must be a URL to a resource in
6098    /// Google Cloud Storage in the form
6099    /// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
6100    pub source_url: std::string::String,
6101
6102    /// The SHA1 hash of the file, in hex.
6103    pub sha1_sum: std::string::String,
6104
6105    /// The MIME type of the file.
6106    ///
6107    /// Defaults to the value from Google Cloud Storage.
6108    pub mime_type: std::string::String,
6109
6110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6111}
6112
6113impl FileInfo {
6114    pub fn new() -> Self {
6115        std::default::Default::default()
6116    }
6117
6118    /// Sets the value of [source_url][crate::model::FileInfo::source_url].
6119    ///
6120    /// # Example
6121    /// ```ignore,no_run
6122    /// # use google_cloud_appengine_v1::model::FileInfo;
6123    /// let x = FileInfo::new().set_source_url("example");
6124    /// ```
6125    pub fn set_source_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6126        self.source_url = v.into();
6127        self
6128    }
6129
6130    /// Sets the value of [sha1_sum][crate::model::FileInfo::sha1_sum].
6131    ///
6132    /// # Example
6133    /// ```ignore,no_run
6134    /// # use google_cloud_appengine_v1::model::FileInfo;
6135    /// let x = FileInfo::new().set_sha1_sum("example");
6136    /// ```
6137    pub fn set_sha1_sum<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6138        self.sha1_sum = v.into();
6139        self
6140    }
6141
6142    /// Sets the value of [mime_type][crate::model::FileInfo::mime_type].
6143    ///
6144    /// # Example
6145    /// ```ignore,no_run
6146    /// # use google_cloud_appengine_v1::model::FileInfo;
6147    /// let x = FileInfo::new().set_mime_type("example");
6148    /// ```
6149    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6150        self.mime_type = v.into();
6151        self
6152    }
6153}
6154
6155impl wkt::message::Message for FileInfo {
6156    fn typename() -> &'static str {
6157        "type.googleapis.com/google.appengine.v1.FileInfo"
6158    }
6159}
6160
6161/// Docker image that is used to create a container and start a VM instance for
6162/// the version that you deploy. Only applicable for instances running in the App
6163/// Engine flexible environment.
6164#[derive(Clone, Default, PartialEq)]
6165#[non_exhaustive]
6166pub struct ContainerInfo {
6167    /// URI to the hosted container image in Google Container Registry. The URI
6168    /// must be fully qualified and include a tag or digest.
6169    /// Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest"
6170    pub image: std::string::String,
6171
6172    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6173}
6174
6175impl ContainerInfo {
6176    pub fn new() -> Self {
6177        std::default::Default::default()
6178    }
6179
6180    /// Sets the value of [image][crate::model::ContainerInfo::image].
6181    ///
6182    /// # Example
6183    /// ```ignore,no_run
6184    /// # use google_cloud_appengine_v1::model::ContainerInfo;
6185    /// let x = ContainerInfo::new().set_image("example");
6186    /// ```
6187    pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6188        self.image = v.into();
6189        self
6190    }
6191}
6192
6193impl wkt::message::Message for ContainerInfo {
6194    fn typename() -> &'static str {
6195        "type.googleapis.com/google.appengine.v1.ContainerInfo"
6196    }
6197}
6198
6199/// Options for the build operations performed as a part of the version
6200/// deployment. Only applicable for App Engine flexible environment when creating
6201/// a version using source code directly.
6202#[derive(Clone, Default, PartialEq)]
6203#[non_exhaustive]
6204pub struct CloudBuildOptions {
6205    /// Path to the yaml file used in deployment, used to determine runtime
6206    /// configuration details.
6207    ///
6208    /// Required for flexible environment builds.
6209    ///
6210    /// See <https://cloud.google.com/appengine/docs/standard/python/config/appref>
6211    /// for more details.
6212    pub app_yaml_path: std::string::String,
6213
6214    /// The Cloud Build timeout used as part of any dependent builds performed by
6215    /// version creation. Defaults to 10 minutes.
6216    pub cloud_build_timeout: std::option::Option<wkt::Duration>,
6217
6218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6219}
6220
6221impl CloudBuildOptions {
6222    pub fn new() -> Self {
6223        std::default::Default::default()
6224    }
6225
6226    /// Sets the value of [app_yaml_path][crate::model::CloudBuildOptions::app_yaml_path].
6227    ///
6228    /// # Example
6229    /// ```ignore,no_run
6230    /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6231    /// let x = CloudBuildOptions::new().set_app_yaml_path("example");
6232    /// ```
6233    pub fn set_app_yaml_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6234        self.app_yaml_path = v.into();
6235        self
6236    }
6237
6238    /// Sets the value of [cloud_build_timeout][crate::model::CloudBuildOptions::cloud_build_timeout].
6239    ///
6240    /// # Example
6241    /// ```ignore,no_run
6242    /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6243    /// use wkt::Duration;
6244    /// let x = CloudBuildOptions::new().set_cloud_build_timeout(Duration::default()/* use setters */);
6245    /// ```
6246    pub fn set_cloud_build_timeout<T>(mut self, v: T) -> Self
6247    where
6248        T: std::convert::Into<wkt::Duration>,
6249    {
6250        self.cloud_build_timeout = std::option::Option::Some(v.into());
6251        self
6252    }
6253
6254    /// Sets or clears the value of [cloud_build_timeout][crate::model::CloudBuildOptions::cloud_build_timeout].
6255    ///
6256    /// # Example
6257    /// ```ignore,no_run
6258    /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6259    /// use wkt::Duration;
6260    /// let x = CloudBuildOptions::new().set_or_clear_cloud_build_timeout(Some(Duration::default()/* use setters */));
6261    /// let x = CloudBuildOptions::new().set_or_clear_cloud_build_timeout(None::<Duration>);
6262    /// ```
6263    pub fn set_or_clear_cloud_build_timeout<T>(mut self, v: std::option::Option<T>) -> Self
6264    where
6265        T: std::convert::Into<wkt::Duration>,
6266    {
6267        self.cloud_build_timeout = v.map(|x| x.into());
6268        self
6269    }
6270}
6271
6272impl wkt::message::Message for CloudBuildOptions {
6273    fn typename() -> &'static str {
6274        "type.googleapis.com/google.appengine.v1.CloudBuildOptions"
6275    }
6276}
6277
6278/// The zip file information for a zip deployment.
6279#[derive(Clone, Default, PartialEq)]
6280#[non_exhaustive]
6281pub struct ZipInfo {
6282    /// URL of the zip file to deploy from. Must be a URL to a resource in
6283    /// Google Cloud Storage in the form
6284    /// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
6285    pub source_url: std::string::String,
6286
6287    /// An estimate of the number of files in a zip for a zip deployment.
6288    /// If set, must be greater than or equal to the actual number of files.
6289    /// Used for optimizing performance; if not provided, deployment may be slow.
6290    pub files_count: i32,
6291
6292    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6293}
6294
6295impl ZipInfo {
6296    pub fn new() -> Self {
6297        std::default::Default::default()
6298    }
6299
6300    /// Sets the value of [source_url][crate::model::ZipInfo::source_url].
6301    ///
6302    /// # Example
6303    /// ```ignore,no_run
6304    /// # use google_cloud_appengine_v1::model::ZipInfo;
6305    /// let x = ZipInfo::new().set_source_url("example");
6306    /// ```
6307    pub fn set_source_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6308        self.source_url = v.into();
6309        self
6310    }
6311
6312    /// Sets the value of [files_count][crate::model::ZipInfo::files_count].
6313    ///
6314    /// # Example
6315    /// ```ignore,no_run
6316    /// # use google_cloud_appengine_v1::model::ZipInfo;
6317    /// let x = ZipInfo::new().set_files_count(42);
6318    /// ```
6319    pub fn set_files_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6320        self.files_count = v.into();
6321        self
6322    }
6323}
6324
6325impl wkt::message::Message for ZipInfo {
6326    fn typename() -> &'static str {
6327        "type.googleapis.com/google.appengine.v1.ZipInfo"
6328    }
6329}
6330
6331/// A domain that a user has been authorized to administer. To authorize use
6332/// of a domain, verify ownership via
6333/// [Search Console](https://search.google.com/search-console/welcome).
6334#[derive(Clone, Default, PartialEq)]
6335#[non_exhaustive]
6336pub struct AuthorizedDomain {
6337    /// Full path to the `AuthorizedDomain` resource in the API. Example:
6338    /// `apps/myapp/authorizedDomains/example.com`.
6339    ///
6340    /// @OutputOnly
6341    pub name: std::string::String,
6342
6343    /// Fully qualified domain name of the domain authorized for use. Example:
6344    /// `example.com`.
6345    pub id: std::string::String,
6346
6347    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6348}
6349
6350impl AuthorizedDomain {
6351    pub fn new() -> Self {
6352        std::default::Default::default()
6353    }
6354
6355    /// Sets the value of [name][crate::model::AuthorizedDomain::name].
6356    ///
6357    /// # Example
6358    /// ```ignore,no_run
6359    /// # use google_cloud_appengine_v1::model::AuthorizedDomain;
6360    /// let x = AuthorizedDomain::new().set_name("example");
6361    /// ```
6362    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6363        self.name = v.into();
6364        self
6365    }
6366
6367    /// Sets the value of [id][crate::model::AuthorizedDomain::id].
6368    ///
6369    /// # Example
6370    /// ```ignore,no_run
6371    /// # use google_cloud_appengine_v1::model::AuthorizedDomain;
6372    /// let x = AuthorizedDomain::new().set_id("example");
6373    /// ```
6374    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6375        self.id = v.into();
6376        self
6377    }
6378}
6379
6380impl wkt::message::Message for AuthorizedDomain {
6381    fn typename() -> &'static str {
6382        "type.googleapis.com/google.appengine.v1.AuthorizedDomain"
6383    }
6384}
6385
6386/// A domain serving an App Engine application.
6387#[derive(Clone, Default, PartialEq)]
6388#[non_exhaustive]
6389pub struct DomainMapping {
6390    /// Full path to the `DomainMapping` resource in the API. Example:
6391    /// `apps/myapp/domainMapping/example.com`.
6392    ///
6393    /// @OutputOnly
6394    pub name: std::string::String,
6395
6396    /// Relative name of the domain serving the application. Example:
6397    /// `example.com`.
6398    pub id: std::string::String,
6399
6400    /// SSL configuration for this domain. If unconfigured, this domain will not
6401    /// serve with SSL.
6402    pub ssl_settings: std::option::Option<crate::model::SslSettings>,
6403
6404    /// The resource records required to configure this domain mapping. These
6405    /// records must be added to the domain's DNS configuration in order to
6406    /// serve the application via this domain mapping.
6407    ///
6408    /// @OutputOnly
6409    pub resource_records: std::vec::Vec<crate::model::ResourceRecord>,
6410
6411    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6412}
6413
6414impl DomainMapping {
6415    pub fn new() -> Self {
6416        std::default::Default::default()
6417    }
6418
6419    /// Sets the value of [name][crate::model::DomainMapping::name].
6420    ///
6421    /// # Example
6422    /// ```ignore,no_run
6423    /// # use google_cloud_appengine_v1::model::DomainMapping;
6424    /// let x = DomainMapping::new().set_name("example");
6425    /// ```
6426    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6427        self.name = v.into();
6428        self
6429    }
6430
6431    /// Sets the value of [id][crate::model::DomainMapping::id].
6432    ///
6433    /// # Example
6434    /// ```ignore,no_run
6435    /// # use google_cloud_appengine_v1::model::DomainMapping;
6436    /// let x = DomainMapping::new().set_id("example");
6437    /// ```
6438    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6439        self.id = v.into();
6440        self
6441    }
6442
6443    /// Sets the value of [ssl_settings][crate::model::DomainMapping::ssl_settings].
6444    ///
6445    /// # Example
6446    /// ```ignore,no_run
6447    /// # use google_cloud_appengine_v1::model::DomainMapping;
6448    /// use google_cloud_appengine_v1::model::SslSettings;
6449    /// let x = DomainMapping::new().set_ssl_settings(SslSettings::default()/* use setters */);
6450    /// ```
6451    pub fn set_ssl_settings<T>(mut self, v: T) -> Self
6452    where
6453        T: std::convert::Into<crate::model::SslSettings>,
6454    {
6455        self.ssl_settings = std::option::Option::Some(v.into());
6456        self
6457    }
6458
6459    /// Sets or clears the value of [ssl_settings][crate::model::DomainMapping::ssl_settings].
6460    ///
6461    /// # Example
6462    /// ```ignore,no_run
6463    /// # use google_cloud_appengine_v1::model::DomainMapping;
6464    /// use google_cloud_appengine_v1::model::SslSettings;
6465    /// let x = DomainMapping::new().set_or_clear_ssl_settings(Some(SslSettings::default()/* use setters */));
6466    /// let x = DomainMapping::new().set_or_clear_ssl_settings(None::<SslSettings>);
6467    /// ```
6468    pub fn set_or_clear_ssl_settings<T>(mut self, v: std::option::Option<T>) -> Self
6469    where
6470        T: std::convert::Into<crate::model::SslSettings>,
6471    {
6472        self.ssl_settings = v.map(|x| x.into());
6473        self
6474    }
6475
6476    /// Sets the value of [resource_records][crate::model::DomainMapping::resource_records].
6477    ///
6478    /// # Example
6479    /// ```ignore,no_run
6480    /// # use google_cloud_appengine_v1::model::DomainMapping;
6481    /// use google_cloud_appengine_v1::model::ResourceRecord;
6482    /// let x = DomainMapping::new()
6483    ///     .set_resource_records([
6484    ///         ResourceRecord::default()/* use setters */,
6485    ///         ResourceRecord::default()/* use (different) setters */,
6486    ///     ]);
6487    /// ```
6488    pub fn set_resource_records<T, V>(mut self, v: T) -> Self
6489    where
6490        T: std::iter::IntoIterator<Item = V>,
6491        V: std::convert::Into<crate::model::ResourceRecord>,
6492    {
6493        use std::iter::Iterator;
6494        self.resource_records = v.into_iter().map(|i| i.into()).collect();
6495        self
6496    }
6497}
6498
6499impl wkt::message::Message for DomainMapping {
6500    fn typename() -> &'static str {
6501        "type.googleapis.com/google.appengine.v1.DomainMapping"
6502    }
6503}
6504
6505/// SSL configuration for a `DomainMapping` resource.
6506#[derive(Clone, Default, PartialEq)]
6507#[non_exhaustive]
6508pub struct SslSettings {
6509    /// ID of the `AuthorizedCertificate` resource configuring SSL for the
6510    /// application. Clearing this field will remove SSL support.
6511    ///
6512    /// By default, a managed certificate is automatically created for every
6513    /// domain mapping. To omit SSL support or to configure SSL manually, specify
6514    /// `SslManagementType.MANUAL` on a `CREATE` or `UPDATE` request. You must
6515    /// be authorized to administer the `AuthorizedCertificate` resource to
6516    /// manually map it to a `DomainMapping` resource.
6517    /// Example: `12345`.
6518    pub certificate_id: std::string::String,
6519
6520    /// SSL management type for this domain. If `AUTOMATIC`, a managed certificate
6521    /// is automatically provisioned. If `MANUAL`, `certificate_id` must be
6522    /// manually specified in order to configure SSL for this domain.
6523    pub ssl_management_type: crate::model::ssl_settings::SslManagementType,
6524
6525    /// ID of the managed `AuthorizedCertificate` resource currently being
6526    /// provisioned, if applicable. Until the new managed certificate has been
6527    /// successfully provisioned, the previous SSL state will be preserved. Once
6528    /// the provisioning process completes, the `certificate_id` field will reflect
6529    /// the new managed certificate and this field will be left empty. To remove
6530    /// SSL support while there is still a pending managed certificate, clear the
6531    /// `certificate_id` field with an `UpdateDomainMappingRequest`.
6532    ///
6533    /// @OutputOnly
6534    pub pending_managed_certificate_id: std::string::String,
6535
6536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6537}
6538
6539impl SslSettings {
6540    pub fn new() -> Self {
6541        std::default::Default::default()
6542    }
6543
6544    /// Sets the value of [certificate_id][crate::model::SslSettings::certificate_id].
6545    ///
6546    /// # Example
6547    /// ```ignore,no_run
6548    /// # use google_cloud_appengine_v1::model::SslSettings;
6549    /// let x = SslSettings::new().set_certificate_id("example");
6550    /// ```
6551    pub fn set_certificate_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6552        self.certificate_id = v.into();
6553        self
6554    }
6555
6556    /// Sets the value of [ssl_management_type][crate::model::SslSettings::ssl_management_type].
6557    ///
6558    /// # Example
6559    /// ```ignore,no_run
6560    /// # use google_cloud_appengine_v1::model::SslSettings;
6561    /// use google_cloud_appengine_v1::model::ssl_settings::SslManagementType;
6562    /// let x0 = SslSettings::new().set_ssl_management_type(SslManagementType::Automatic);
6563    /// let x1 = SslSettings::new().set_ssl_management_type(SslManagementType::Manual);
6564    /// ```
6565    pub fn set_ssl_management_type<
6566        T: std::convert::Into<crate::model::ssl_settings::SslManagementType>,
6567    >(
6568        mut self,
6569        v: T,
6570    ) -> Self {
6571        self.ssl_management_type = v.into();
6572        self
6573    }
6574
6575    /// Sets the value of [pending_managed_certificate_id][crate::model::SslSettings::pending_managed_certificate_id].
6576    ///
6577    /// # Example
6578    /// ```ignore,no_run
6579    /// # use google_cloud_appengine_v1::model::SslSettings;
6580    /// let x = SslSettings::new().set_pending_managed_certificate_id("example");
6581    /// ```
6582    pub fn set_pending_managed_certificate_id<T: std::convert::Into<std::string::String>>(
6583        mut self,
6584        v: T,
6585    ) -> Self {
6586        self.pending_managed_certificate_id = v.into();
6587        self
6588    }
6589}
6590
6591impl wkt::message::Message for SslSettings {
6592    fn typename() -> &'static str {
6593        "type.googleapis.com/google.appengine.v1.SslSettings"
6594    }
6595}
6596
6597/// Defines additional types related to [SslSettings].
6598pub mod ssl_settings {
6599    #[allow(unused_imports)]
6600    use super::*;
6601
6602    /// The SSL management type for this domain.
6603    ///
6604    /// # Working with unknown values
6605    ///
6606    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6607    /// additional enum variants at any time. Adding new variants is not considered
6608    /// a breaking change. Applications should write their code in anticipation of:
6609    ///
6610    /// - New values appearing in future releases of the client library, **and**
6611    /// - New values received dynamically, without application changes.
6612    ///
6613    /// Please consult the [Working with enums] section in the user guide for some
6614    /// guidelines.
6615    ///
6616    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6617    #[derive(Clone, Debug, PartialEq)]
6618    #[non_exhaustive]
6619    pub enum SslManagementType {
6620        /// Defaults to `AUTOMATIC`.
6621        Unspecified,
6622        /// SSL support for this domain is configured automatically. The mapped SSL
6623        /// certificate will be automatically renewed.
6624        Automatic,
6625        /// SSL support for this domain is configured manually by the user. Either
6626        /// the domain has no SSL support or a user-obtained SSL certificate has been
6627        /// explictly mapped to this domain.
6628        Manual,
6629        /// If set, the enum was initialized with an unknown value.
6630        ///
6631        /// Applications can examine the value using [SslManagementType::value] or
6632        /// [SslManagementType::name].
6633        UnknownValue(ssl_management_type::UnknownValue),
6634    }
6635
6636    #[doc(hidden)]
6637    pub mod ssl_management_type {
6638        #[allow(unused_imports)]
6639        use super::*;
6640        #[derive(Clone, Debug, PartialEq)]
6641        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6642    }
6643
6644    impl SslManagementType {
6645        /// Gets the enum value.
6646        ///
6647        /// Returns `None` if the enum contains an unknown value deserialized from
6648        /// the string representation of enums.
6649        pub fn value(&self) -> std::option::Option<i32> {
6650            match self {
6651                Self::Unspecified => std::option::Option::Some(0),
6652                Self::Automatic => std::option::Option::Some(1),
6653                Self::Manual => std::option::Option::Some(2),
6654                Self::UnknownValue(u) => u.0.value(),
6655            }
6656        }
6657
6658        /// Gets the enum value as a string.
6659        ///
6660        /// Returns `None` if the enum contains an unknown value deserialized from
6661        /// the integer representation of enums.
6662        pub fn name(&self) -> std::option::Option<&str> {
6663            match self {
6664                Self::Unspecified => std::option::Option::Some("SSL_MANAGEMENT_TYPE_UNSPECIFIED"),
6665                Self::Automatic => std::option::Option::Some("AUTOMATIC"),
6666                Self::Manual => std::option::Option::Some("MANUAL"),
6667                Self::UnknownValue(u) => u.0.name(),
6668            }
6669        }
6670    }
6671
6672    impl std::default::Default for SslManagementType {
6673        fn default() -> Self {
6674            use std::convert::From;
6675            Self::from(0)
6676        }
6677    }
6678
6679    impl std::fmt::Display for SslManagementType {
6680        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6681            wkt::internal::display_enum(f, self.name(), self.value())
6682        }
6683    }
6684
6685    impl std::convert::From<i32> for SslManagementType {
6686        fn from(value: i32) -> Self {
6687            match value {
6688                0 => Self::Unspecified,
6689                1 => Self::Automatic,
6690                2 => Self::Manual,
6691                _ => Self::UnknownValue(ssl_management_type::UnknownValue(
6692                    wkt::internal::UnknownEnumValue::Integer(value),
6693                )),
6694            }
6695        }
6696    }
6697
6698    impl std::convert::From<&str> for SslManagementType {
6699        fn from(value: &str) -> Self {
6700            use std::string::ToString;
6701            match value {
6702                "SSL_MANAGEMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
6703                "AUTOMATIC" => Self::Automatic,
6704                "MANUAL" => Self::Manual,
6705                _ => Self::UnknownValue(ssl_management_type::UnknownValue(
6706                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6707                )),
6708            }
6709        }
6710    }
6711
6712    impl serde::ser::Serialize for SslManagementType {
6713        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6714        where
6715            S: serde::Serializer,
6716        {
6717            match self {
6718                Self::Unspecified => serializer.serialize_i32(0),
6719                Self::Automatic => serializer.serialize_i32(1),
6720                Self::Manual => serializer.serialize_i32(2),
6721                Self::UnknownValue(u) => u.0.serialize(serializer),
6722            }
6723        }
6724    }
6725
6726    impl<'de> serde::de::Deserialize<'de> for SslManagementType {
6727        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6728        where
6729            D: serde::Deserializer<'de>,
6730        {
6731            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslManagementType>::new(
6732                ".google.appengine.v1.SslSettings.SslManagementType",
6733            ))
6734        }
6735    }
6736}
6737
6738/// A DNS resource record.
6739#[derive(Clone, Default, PartialEq)]
6740#[non_exhaustive]
6741pub struct ResourceRecord {
6742    /// Relative name of the object affected by this record. Only applicable for
6743    /// `CNAME` records. Example: 'www'.
6744    pub name: std::string::String,
6745
6746    /// Data for this record. Values vary by record type, as defined in RFC 1035
6747    /// (section 5) and RFC 1034 (section 3.6.1).
6748    pub rrdata: std::string::String,
6749
6750    /// Resource record type. Example: `AAAA`.
6751    pub r#type: crate::model::resource_record::RecordType,
6752
6753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6754}
6755
6756impl ResourceRecord {
6757    pub fn new() -> Self {
6758        std::default::Default::default()
6759    }
6760
6761    /// Sets the value of [name][crate::model::ResourceRecord::name].
6762    ///
6763    /// # Example
6764    /// ```ignore,no_run
6765    /// # use google_cloud_appengine_v1::model::ResourceRecord;
6766    /// let x = ResourceRecord::new().set_name("example");
6767    /// ```
6768    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6769        self.name = v.into();
6770        self
6771    }
6772
6773    /// Sets the value of [rrdata][crate::model::ResourceRecord::rrdata].
6774    ///
6775    /// # Example
6776    /// ```ignore,no_run
6777    /// # use google_cloud_appengine_v1::model::ResourceRecord;
6778    /// let x = ResourceRecord::new().set_rrdata("example");
6779    /// ```
6780    pub fn set_rrdata<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6781        self.rrdata = v.into();
6782        self
6783    }
6784
6785    /// Sets the value of [r#type][crate::model::ResourceRecord::type].
6786    ///
6787    /// # Example
6788    /// ```ignore,no_run
6789    /// # use google_cloud_appengine_v1::model::ResourceRecord;
6790    /// use google_cloud_appengine_v1::model::resource_record::RecordType;
6791    /// let x0 = ResourceRecord::new().set_type(RecordType::A);
6792    /// let x1 = ResourceRecord::new().set_type(RecordType::Aaaa);
6793    /// let x2 = ResourceRecord::new().set_type(RecordType::Cname);
6794    /// ```
6795    pub fn set_type<T: std::convert::Into<crate::model::resource_record::RecordType>>(
6796        mut self,
6797        v: T,
6798    ) -> Self {
6799        self.r#type = v.into();
6800        self
6801    }
6802}
6803
6804impl wkt::message::Message for ResourceRecord {
6805    fn typename() -> &'static str {
6806        "type.googleapis.com/google.appengine.v1.ResourceRecord"
6807    }
6808}
6809
6810/// Defines additional types related to [ResourceRecord].
6811pub mod resource_record {
6812    #[allow(unused_imports)]
6813    use super::*;
6814
6815    /// A resource record type.
6816    ///
6817    /// # Working with unknown values
6818    ///
6819    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6820    /// additional enum variants at any time. Adding new variants is not considered
6821    /// a breaking change. Applications should write their code in anticipation of:
6822    ///
6823    /// - New values appearing in future releases of the client library, **and**
6824    /// - New values received dynamically, without application changes.
6825    ///
6826    /// Please consult the [Working with enums] section in the user guide for some
6827    /// guidelines.
6828    ///
6829    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6830    #[derive(Clone, Debug, PartialEq)]
6831    #[non_exhaustive]
6832    pub enum RecordType {
6833        /// An unknown resource record.
6834        Unspecified,
6835        /// An A resource record. Data is an IPv4 address.
6836        A,
6837        /// An AAAA resource record. Data is an IPv6 address.
6838        Aaaa,
6839        /// A CNAME resource record. Data is a domain name to be aliased.
6840        Cname,
6841        /// If set, the enum was initialized with an unknown value.
6842        ///
6843        /// Applications can examine the value using [RecordType::value] or
6844        /// [RecordType::name].
6845        UnknownValue(record_type::UnknownValue),
6846    }
6847
6848    #[doc(hidden)]
6849    pub mod record_type {
6850        #[allow(unused_imports)]
6851        use super::*;
6852        #[derive(Clone, Debug, PartialEq)]
6853        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6854    }
6855
6856    impl RecordType {
6857        /// Gets the enum value.
6858        ///
6859        /// Returns `None` if the enum contains an unknown value deserialized from
6860        /// the string representation of enums.
6861        pub fn value(&self) -> std::option::Option<i32> {
6862            match self {
6863                Self::Unspecified => std::option::Option::Some(0),
6864                Self::A => std::option::Option::Some(1),
6865                Self::Aaaa => std::option::Option::Some(2),
6866                Self::Cname => std::option::Option::Some(3),
6867                Self::UnknownValue(u) => u.0.value(),
6868            }
6869        }
6870
6871        /// Gets the enum value as a string.
6872        ///
6873        /// Returns `None` if the enum contains an unknown value deserialized from
6874        /// the integer representation of enums.
6875        pub fn name(&self) -> std::option::Option<&str> {
6876            match self {
6877                Self::Unspecified => std::option::Option::Some("RECORD_TYPE_UNSPECIFIED"),
6878                Self::A => std::option::Option::Some("A"),
6879                Self::Aaaa => std::option::Option::Some("AAAA"),
6880                Self::Cname => std::option::Option::Some("CNAME"),
6881                Self::UnknownValue(u) => u.0.name(),
6882            }
6883        }
6884    }
6885
6886    impl std::default::Default for RecordType {
6887        fn default() -> Self {
6888            use std::convert::From;
6889            Self::from(0)
6890        }
6891    }
6892
6893    impl std::fmt::Display for RecordType {
6894        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6895            wkt::internal::display_enum(f, self.name(), self.value())
6896        }
6897    }
6898
6899    impl std::convert::From<i32> for RecordType {
6900        fn from(value: i32) -> Self {
6901            match value {
6902                0 => Self::Unspecified,
6903                1 => Self::A,
6904                2 => Self::Aaaa,
6905                3 => Self::Cname,
6906                _ => Self::UnknownValue(record_type::UnknownValue(
6907                    wkt::internal::UnknownEnumValue::Integer(value),
6908                )),
6909            }
6910        }
6911    }
6912
6913    impl std::convert::From<&str> for RecordType {
6914        fn from(value: &str) -> Self {
6915            use std::string::ToString;
6916            match value {
6917                "RECORD_TYPE_UNSPECIFIED" => Self::Unspecified,
6918                "A" => Self::A,
6919                "AAAA" => Self::Aaaa,
6920                "CNAME" => Self::Cname,
6921                _ => Self::UnknownValue(record_type::UnknownValue(
6922                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6923                )),
6924            }
6925        }
6926    }
6927
6928    impl serde::ser::Serialize for RecordType {
6929        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6930        where
6931            S: serde::Serializer,
6932        {
6933            match self {
6934                Self::Unspecified => serializer.serialize_i32(0),
6935                Self::A => serializer.serialize_i32(1),
6936                Self::Aaaa => serializer.serialize_i32(2),
6937                Self::Cname => serializer.serialize_i32(3),
6938                Self::UnknownValue(u) => u.0.serialize(serializer),
6939            }
6940        }
6941    }
6942
6943    impl<'de> serde::de::Deserialize<'de> for RecordType {
6944        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6945        where
6946            D: serde::Deserializer<'de>,
6947        {
6948            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordType>::new(
6949                ".google.appengine.v1.ResourceRecord.RecordType",
6950            ))
6951        }
6952    }
6953}
6954
6955/// A single firewall rule that is evaluated against incoming traffic
6956/// and provides an action to take on matched requests.
6957#[derive(Clone, Default, PartialEq)]
6958#[non_exhaustive]
6959pub struct FirewallRule {
6960    /// A positive integer between [1, Int32.MaxValue-1] that defines the order of
6961    /// rule evaluation. Rules with the lowest priority are evaluated first.
6962    ///
6963    /// A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic
6964    /// when no previous rule matches. Only the action of this rule can be modified
6965    /// by the user.
6966    pub priority: i32,
6967
6968    /// The action to take on matched requests.
6969    pub action: crate::model::firewall_rule::Action,
6970
6971    /// IP address or range, defined using CIDR notation, of requests that this
6972    /// rule applies to. You can use the wildcard character "*" to match all IPs
6973    /// equivalent to "0/0" and "::/0" together.
6974    /// Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32`
6975    /// or `2001:0db8:0000:0042:0000:8a2e:0370:7334`.
6976    pub source_range: std::string::String,
6977
6978    /// An optional string description of this rule.
6979    /// This field has a maximum length of 100 characters.
6980    pub description: std::string::String,
6981
6982    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6983}
6984
6985impl FirewallRule {
6986    pub fn new() -> Self {
6987        std::default::Default::default()
6988    }
6989
6990    /// Sets the value of [priority][crate::model::FirewallRule::priority].
6991    ///
6992    /// # Example
6993    /// ```ignore,no_run
6994    /// # use google_cloud_appengine_v1::model::FirewallRule;
6995    /// let x = FirewallRule::new().set_priority(42);
6996    /// ```
6997    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6998        self.priority = v.into();
6999        self
7000    }
7001
7002    /// Sets the value of [action][crate::model::FirewallRule::action].
7003    ///
7004    /// # Example
7005    /// ```ignore,no_run
7006    /// # use google_cloud_appengine_v1::model::FirewallRule;
7007    /// use google_cloud_appengine_v1::model::firewall_rule::Action;
7008    /// let x0 = FirewallRule::new().set_action(Action::Allow);
7009    /// let x1 = FirewallRule::new().set_action(Action::Deny);
7010    /// ```
7011    pub fn set_action<T: std::convert::Into<crate::model::firewall_rule::Action>>(
7012        mut self,
7013        v: T,
7014    ) -> Self {
7015        self.action = v.into();
7016        self
7017    }
7018
7019    /// Sets the value of [source_range][crate::model::FirewallRule::source_range].
7020    ///
7021    /// # Example
7022    /// ```ignore,no_run
7023    /// # use google_cloud_appengine_v1::model::FirewallRule;
7024    /// let x = FirewallRule::new().set_source_range("example");
7025    /// ```
7026    pub fn set_source_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7027        self.source_range = v.into();
7028        self
7029    }
7030
7031    /// Sets the value of [description][crate::model::FirewallRule::description].
7032    ///
7033    /// # Example
7034    /// ```ignore,no_run
7035    /// # use google_cloud_appengine_v1::model::FirewallRule;
7036    /// let x = FirewallRule::new().set_description("example");
7037    /// ```
7038    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7039        self.description = v.into();
7040        self
7041    }
7042}
7043
7044impl wkt::message::Message for FirewallRule {
7045    fn typename() -> &'static str {
7046        "type.googleapis.com/google.appengine.v1.FirewallRule"
7047    }
7048}
7049
7050/// Defines additional types related to [FirewallRule].
7051pub mod firewall_rule {
7052    #[allow(unused_imports)]
7053    use super::*;
7054
7055    /// Available actions to take on matching requests.
7056    ///
7057    /// # Working with unknown values
7058    ///
7059    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7060    /// additional enum variants at any time. Adding new variants is not considered
7061    /// a breaking change. Applications should write their code in anticipation of:
7062    ///
7063    /// - New values appearing in future releases of the client library, **and**
7064    /// - New values received dynamically, without application changes.
7065    ///
7066    /// Please consult the [Working with enums] section in the user guide for some
7067    /// guidelines.
7068    ///
7069    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7070    #[derive(Clone, Debug, PartialEq)]
7071    #[non_exhaustive]
7072    pub enum Action {
7073        UnspecifiedAction,
7074        /// Matching requests are allowed.
7075        Allow,
7076        /// Matching requests are denied.
7077        Deny,
7078        /// If set, the enum was initialized with an unknown value.
7079        ///
7080        /// Applications can examine the value using [Action::value] or
7081        /// [Action::name].
7082        UnknownValue(action::UnknownValue),
7083    }
7084
7085    #[doc(hidden)]
7086    pub mod action {
7087        #[allow(unused_imports)]
7088        use super::*;
7089        #[derive(Clone, Debug, PartialEq)]
7090        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7091    }
7092
7093    impl Action {
7094        /// Gets the enum value.
7095        ///
7096        /// Returns `None` if the enum contains an unknown value deserialized from
7097        /// the string representation of enums.
7098        pub fn value(&self) -> std::option::Option<i32> {
7099            match self {
7100                Self::UnspecifiedAction => std::option::Option::Some(0),
7101                Self::Allow => std::option::Option::Some(1),
7102                Self::Deny => std::option::Option::Some(2),
7103                Self::UnknownValue(u) => u.0.value(),
7104            }
7105        }
7106
7107        /// Gets the enum value as a string.
7108        ///
7109        /// Returns `None` if the enum contains an unknown value deserialized from
7110        /// the integer representation of enums.
7111        pub fn name(&self) -> std::option::Option<&str> {
7112            match self {
7113                Self::UnspecifiedAction => std::option::Option::Some("UNSPECIFIED_ACTION"),
7114                Self::Allow => std::option::Option::Some("ALLOW"),
7115                Self::Deny => std::option::Option::Some("DENY"),
7116                Self::UnknownValue(u) => u.0.name(),
7117            }
7118        }
7119    }
7120
7121    impl std::default::Default for Action {
7122        fn default() -> Self {
7123            use std::convert::From;
7124            Self::from(0)
7125        }
7126    }
7127
7128    impl std::fmt::Display for Action {
7129        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7130            wkt::internal::display_enum(f, self.name(), self.value())
7131        }
7132    }
7133
7134    impl std::convert::From<i32> for Action {
7135        fn from(value: i32) -> Self {
7136            match value {
7137                0 => Self::UnspecifiedAction,
7138                1 => Self::Allow,
7139                2 => Self::Deny,
7140                _ => Self::UnknownValue(action::UnknownValue(
7141                    wkt::internal::UnknownEnumValue::Integer(value),
7142                )),
7143            }
7144        }
7145    }
7146
7147    impl std::convert::From<&str> for Action {
7148        fn from(value: &str) -> Self {
7149            use std::string::ToString;
7150            match value {
7151                "UNSPECIFIED_ACTION" => Self::UnspecifiedAction,
7152                "ALLOW" => Self::Allow,
7153                "DENY" => Self::Deny,
7154                _ => Self::UnknownValue(action::UnknownValue(
7155                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7156                )),
7157            }
7158        }
7159    }
7160
7161    impl serde::ser::Serialize for Action {
7162        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7163        where
7164            S: serde::Serializer,
7165        {
7166            match self {
7167                Self::UnspecifiedAction => serializer.serialize_i32(0),
7168                Self::Allow => serializer.serialize_i32(1),
7169                Self::Deny => serializer.serialize_i32(2),
7170                Self::UnknownValue(u) => u.0.serialize(serializer),
7171            }
7172        }
7173    }
7174
7175    impl<'de> serde::de::Deserialize<'de> for Action {
7176        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7177        where
7178            D: serde::Deserializer<'de>,
7179        {
7180            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
7181                ".google.appengine.v1.FirewallRule.Action",
7182            ))
7183        }
7184    }
7185}
7186
7187/// An Instance resource is the computing unit that App Engine uses to
7188/// automatically scale an application.
7189#[derive(Clone, Default, PartialEq)]
7190#[non_exhaustive]
7191pub struct Instance {
7192    /// Output only. Full path to the Instance resource in the API.
7193    /// Example: `apps/myapp/services/default/versions/v1/instances/instance-1`.
7194    pub name: std::string::String,
7195
7196    /// Output only. Relative name of the instance within the version.
7197    /// Example: `instance-1`.
7198    pub id: std::string::String,
7199
7200    /// Output only. App Engine release this instance is running on.
7201    pub app_engine_release: std::string::String,
7202
7203    /// Output only. Availability of the instance.
7204    pub availability: crate::model::instance::Availability,
7205
7206    /// Output only. Name of the virtual machine where this instance lives. Only applicable
7207    /// for instances in App Engine flexible environment.
7208    pub vm_name: std::string::String,
7209
7210    /// Output only. Zone where the virtual machine is located. Only applicable for instances
7211    /// in App Engine flexible environment.
7212    pub vm_zone_name: std::string::String,
7213
7214    /// Output only. Virtual machine ID of this instance. Only applicable for instances in
7215    /// App Engine flexible environment.
7216    pub vm_id: std::string::String,
7217
7218    /// Output only. Time that this instance was started.
7219    ///
7220    /// @OutputOnly
7221    pub start_time: std::option::Option<wkt::Timestamp>,
7222
7223    /// Output only. Number of requests since this instance was started.
7224    pub requests: i32,
7225
7226    /// Output only. Number of errors since this instance was started.
7227    pub errors: i32,
7228
7229    /// Output only. Average queries per second (QPS) over the last minute.
7230    pub qps: f32,
7231
7232    /// Output only. Average latency (ms) over the last minute.
7233    pub average_latency: i32,
7234
7235    /// Output only. Total memory in use (bytes).
7236    pub memory_usage: i64,
7237
7238    /// Output only. Status of the virtual machine where this instance lives. Only applicable
7239    /// for instances in App Engine flexible environment.
7240    pub vm_status: std::string::String,
7241
7242    /// Output only. Whether this instance is in debug mode. Only applicable for instances in
7243    /// App Engine flexible environment.
7244    pub vm_debug_enabled: bool,
7245
7246    /// Output only. The IP address of this instance. Only applicable for instances in App
7247    /// Engine flexible environment.
7248    pub vm_ip: std::string::String,
7249
7250    /// Output only. The liveness health check of this instance. Only applicable for instances
7251    /// in App Engine flexible environment.
7252    pub vm_liveness: crate::model::instance::liveness::LivenessState,
7253
7254    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7255}
7256
7257impl Instance {
7258    pub fn new() -> Self {
7259        std::default::Default::default()
7260    }
7261
7262    /// Sets the value of [name][crate::model::Instance::name].
7263    ///
7264    /// # Example
7265    /// ```ignore,no_run
7266    /// # use google_cloud_appengine_v1::model::Instance;
7267    /// let x = Instance::new().set_name("example");
7268    /// ```
7269    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7270        self.name = v.into();
7271        self
7272    }
7273
7274    /// Sets the value of [id][crate::model::Instance::id].
7275    ///
7276    /// # Example
7277    /// ```ignore,no_run
7278    /// # use google_cloud_appengine_v1::model::Instance;
7279    /// let x = Instance::new().set_id("example");
7280    /// ```
7281    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7282        self.id = v.into();
7283        self
7284    }
7285
7286    /// Sets the value of [app_engine_release][crate::model::Instance::app_engine_release].
7287    ///
7288    /// # Example
7289    /// ```ignore,no_run
7290    /// # use google_cloud_appengine_v1::model::Instance;
7291    /// let x = Instance::new().set_app_engine_release("example");
7292    /// ```
7293    pub fn set_app_engine_release<T: std::convert::Into<std::string::String>>(
7294        mut self,
7295        v: T,
7296    ) -> Self {
7297        self.app_engine_release = v.into();
7298        self
7299    }
7300
7301    /// Sets the value of [availability][crate::model::Instance::availability].
7302    ///
7303    /// # Example
7304    /// ```ignore,no_run
7305    /// # use google_cloud_appengine_v1::model::Instance;
7306    /// use google_cloud_appengine_v1::model::instance::Availability;
7307    /// let x0 = Instance::new().set_availability(Availability::Resident);
7308    /// let x1 = Instance::new().set_availability(Availability::Dynamic);
7309    /// ```
7310    pub fn set_availability<T: std::convert::Into<crate::model::instance::Availability>>(
7311        mut self,
7312        v: T,
7313    ) -> Self {
7314        self.availability = v.into();
7315        self
7316    }
7317
7318    /// Sets the value of [vm_name][crate::model::Instance::vm_name].
7319    ///
7320    /// # Example
7321    /// ```ignore,no_run
7322    /// # use google_cloud_appengine_v1::model::Instance;
7323    /// let x = Instance::new().set_vm_name("example");
7324    /// ```
7325    pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7326        self.vm_name = v.into();
7327        self
7328    }
7329
7330    /// Sets the value of [vm_zone_name][crate::model::Instance::vm_zone_name].
7331    ///
7332    /// # Example
7333    /// ```ignore,no_run
7334    /// # use google_cloud_appengine_v1::model::Instance;
7335    /// let x = Instance::new().set_vm_zone_name("example");
7336    /// ```
7337    pub fn set_vm_zone_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7338        self.vm_zone_name = v.into();
7339        self
7340    }
7341
7342    /// Sets the value of [vm_id][crate::model::Instance::vm_id].
7343    ///
7344    /// # Example
7345    /// ```ignore,no_run
7346    /// # use google_cloud_appengine_v1::model::Instance;
7347    /// let x = Instance::new().set_vm_id("example");
7348    /// ```
7349    pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7350        self.vm_id = v.into();
7351        self
7352    }
7353
7354    /// Sets the value of [start_time][crate::model::Instance::start_time].
7355    ///
7356    /// # Example
7357    /// ```ignore,no_run
7358    /// # use google_cloud_appengine_v1::model::Instance;
7359    /// use wkt::Timestamp;
7360    /// let x = Instance::new().set_start_time(Timestamp::default()/* use setters */);
7361    /// ```
7362    pub fn set_start_time<T>(mut self, v: T) -> Self
7363    where
7364        T: std::convert::Into<wkt::Timestamp>,
7365    {
7366        self.start_time = std::option::Option::Some(v.into());
7367        self
7368    }
7369
7370    /// Sets or clears the value of [start_time][crate::model::Instance::start_time].
7371    ///
7372    /// # Example
7373    /// ```ignore,no_run
7374    /// # use google_cloud_appengine_v1::model::Instance;
7375    /// use wkt::Timestamp;
7376    /// let x = Instance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7377    /// let x = Instance::new().set_or_clear_start_time(None::<Timestamp>);
7378    /// ```
7379    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7380    where
7381        T: std::convert::Into<wkt::Timestamp>,
7382    {
7383        self.start_time = v.map(|x| x.into());
7384        self
7385    }
7386
7387    /// Sets the value of [requests][crate::model::Instance::requests].
7388    ///
7389    /// # Example
7390    /// ```ignore,no_run
7391    /// # use google_cloud_appengine_v1::model::Instance;
7392    /// let x = Instance::new().set_requests(42);
7393    /// ```
7394    pub fn set_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7395        self.requests = v.into();
7396        self
7397    }
7398
7399    /// Sets the value of [errors][crate::model::Instance::errors].
7400    ///
7401    /// # Example
7402    /// ```ignore,no_run
7403    /// # use google_cloud_appengine_v1::model::Instance;
7404    /// let x = Instance::new().set_errors(42);
7405    /// ```
7406    pub fn set_errors<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7407        self.errors = v.into();
7408        self
7409    }
7410
7411    /// Sets the value of [qps][crate::model::Instance::qps].
7412    ///
7413    /// # Example
7414    /// ```ignore,no_run
7415    /// # use google_cloud_appengine_v1::model::Instance;
7416    /// let x = Instance::new().set_qps(42.0);
7417    /// ```
7418    pub fn set_qps<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7419        self.qps = v.into();
7420        self
7421    }
7422
7423    /// Sets the value of [average_latency][crate::model::Instance::average_latency].
7424    ///
7425    /// # Example
7426    /// ```ignore,no_run
7427    /// # use google_cloud_appengine_v1::model::Instance;
7428    /// let x = Instance::new().set_average_latency(42);
7429    /// ```
7430    pub fn set_average_latency<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7431        self.average_latency = v.into();
7432        self
7433    }
7434
7435    /// Sets the value of [memory_usage][crate::model::Instance::memory_usage].
7436    ///
7437    /// # Example
7438    /// ```ignore,no_run
7439    /// # use google_cloud_appengine_v1::model::Instance;
7440    /// let x = Instance::new().set_memory_usage(42);
7441    /// ```
7442    pub fn set_memory_usage<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7443        self.memory_usage = v.into();
7444        self
7445    }
7446
7447    /// Sets the value of [vm_status][crate::model::Instance::vm_status].
7448    ///
7449    /// # Example
7450    /// ```ignore,no_run
7451    /// # use google_cloud_appengine_v1::model::Instance;
7452    /// let x = Instance::new().set_vm_status("example");
7453    /// ```
7454    pub fn set_vm_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7455        self.vm_status = v.into();
7456        self
7457    }
7458
7459    /// Sets the value of [vm_debug_enabled][crate::model::Instance::vm_debug_enabled].
7460    ///
7461    /// # Example
7462    /// ```ignore,no_run
7463    /// # use google_cloud_appengine_v1::model::Instance;
7464    /// let x = Instance::new().set_vm_debug_enabled(true);
7465    /// ```
7466    pub fn set_vm_debug_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7467        self.vm_debug_enabled = v.into();
7468        self
7469    }
7470
7471    /// Sets the value of [vm_ip][crate::model::Instance::vm_ip].
7472    ///
7473    /// # Example
7474    /// ```ignore,no_run
7475    /// # use google_cloud_appengine_v1::model::Instance;
7476    /// let x = Instance::new().set_vm_ip("example");
7477    /// ```
7478    pub fn set_vm_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7479        self.vm_ip = v.into();
7480        self
7481    }
7482
7483    /// Sets the value of [vm_liveness][crate::model::Instance::vm_liveness].
7484    ///
7485    /// # Example
7486    /// ```ignore,no_run
7487    /// # use google_cloud_appengine_v1::model::Instance;
7488    /// use google_cloud_appengine_v1::model::instance::liveness::LivenessState;
7489    /// let x0 = Instance::new().set_vm_liveness(LivenessState::Unknown);
7490    /// let x1 = Instance::new().set_vm_liveness(LivenessState::Healthy);
7491    /// let x2 = Instance::new().set_vm_liveness(LivenessState::Unhealthy);
7492    /// ```
7493    pub fn set_vm_liveness<
7494        T: std::convert::Into<crate::model::instance::liveness::LivenessState>,
7495    >(
7496        mut self,
7497        v: T,
7498    ) -> Self {
7499        self.vm_liveness = v.into();
7500        self
7501    }
7502}
7503
7504impl wkt::message::Message for Instance {
7505    fn typename() -> &'static str {
7506        "type.googleapis.com/google.appengine.v1.Instance"
7507    }
7508}
7509
7510/// Defines additional types related to [Instance].
7511pub mod instance {
7512    #[allow(unused_imports)]
7513    use super::*;
7514
7515    /// Wrapper for LivenessState enum.
7516    #[derive(Clone, Default, PartialEq)]
7517    #[non_exhaustive]
7518    pub struct Liveness {
7519        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7520    }
7521
7522    impl Liveness {
7523        pub fn new() -> Self {
7524            std::default::Default::default()
7525        }
7526    }
7527
7528    impl wkt::message::Message for Liveness {
7529        fn typename() -> &'static str {
7530            "type.googleapis.com/google.appengine.v1.Instance.Liveness"
7531        }
7532    }
7533
7534    /// Defines additional types related to [Liveness].
7535    pub mod liveness {
7536        #[allow(unused_imports)]
7537        use super::*;
7538
7539        /// Liveness health check status for Flex instances.
7540        ///
7541        /// # Working with unknown values
7542        ///
7543        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7544        /// additional enum variants at any time. Adding new variants is not considered
7545        /// a breaking change. Applications should write their code in anticipation of:
7546        ///
7547        /// - New values appearing in future releases of the client library, **and**
7548        /// - New values received dynamically, without application changes.
7549        ///
7550        /// Please consult the [Working with enums] section in the user guide for some
7551        /// guidelines.
7552        ///
7553        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7554        #[derive(Clone, Debug, PartialEq)]
7555        #[non_exhaustive]
7556        pub enum LivenessState {
7557            /// There is no liveness health check for the instance. Only applicable for
7558            /// instances in App Engine standard environment.
7559            Unspecified,
7560            /// The health checking system is aware of the instance but its health is
7561            /// not known at the moment.
7562            Unknown,
7563            /// The instance is reachable i.e. a connection to the application health
7564            /// checking endpoint can be established, and conforms to the requirements
7565            /// defined by the health check.
7566            Healthy,
7567            /// The instance is reachable, but does not conform to the requirements
7568            /// defined by the health check.
7569            Unhealthy,
7570            /// The instance is being drained. The existing connections to the instance
7571            /// have time to complete, but the new ones are being refused.
7572            Draining,
7573            /// The instance is unreachable i.e. a connection to the application health
7574            /// checking endpoint cannot be established, or the server does not respond
7575            /// within the specified timeout.
7576            Timeout,
7577            /// If set, the enum was initialized with an unknown value.
7578            ///
7579            /// Applications can examine the value using [LivenessState::value] or
7580            /// [LivenessState::name].
7581            UnknownValue(liveness_state::UnknownValue),
7582        }
7583
7584        #[doc(hidden)]
7585        pub mod liveness_state {
7586            #[allow(unused_imports)]
7587            use super::*;
7588            #[derive(Clone, Debug, PartialEq)]
7589            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7590        }
7591
7592        impl LivenessState {
7593            /// Gets the enum value.
7594            ///
7595            /// Returns `None` if the enum contains an unknown value deserialized from
7596            /// the string representation of enums.
7597            pub fn value(&self) -> std::option::Option<i32> {
7598                match self {
7599                    Self::Unspecified => std::option::Option::Some(0),
7600                    Self::Unknown => std::option::Option::Some(1),
7601                    Self::Healthy => std::option::Option::Some(2),
7602                    Self::Unhealthy => std::option::Option::Some(3),
7603                    Self::Draining => std::option::Option::Some(4),
7604                    Self::Timeout => std::option::Option::Some(5),
7605                    Self::UnknownValue(u) => u.0.value(),
7606                }
7607            }
7608
7609            /// Gets the enum value as a string.
7610            ///
7611            /// Returns `None` if the enum contains an unknown value deserialized from
7612            /// the integer representation of enums.
7613            pub fn name(&self) -> std::option::Option<&str> {
7614                match self {
7615                    Self::Unspecified => std::option::Option::Some("LIVENESS_STATE_UNSPECIFIED"),
7616                    Self::Unknown => std::option::Option::Some("UNKNOWN"),
7617                    Self::Healthy => std::option::Option::Some("HEALTHY"),
7618                    Self::Unhealthy => std::option::Option::Some("UNHEALTHY"),
7619                    Self::Draining => std::option::Option::Some("DRAINING"),
7620                    Self::Timeout => std::option::Option::Some("TIMEOUT"),
7621                    Self::UnknownValue(u) => u.0.name(),
7622                }
7623            }
7624        }
7625
7626        impl std::default::Default for LivenessState {
7627            fn default() -> Self {
7628                use std::convert::From;
7629                Self::from(0)
7630            }
7631        }
7632
7633        impl std::fmt::Display for LivenessState {
7634            fn fmt(
7635                &self,
7636                f: &mut std::fmt::Formatter<'_>,
7637            ) -> std::result::Result<(), std::fmt::Error> {
7638                wkt::internal::display_enum(f, self.name(), self.value())
7639            }
7640        }
7641
7642        impl std::convert::From<i32> for LivenessState {
7643            fn from(value: i32) -> Self {
7644                match value {
7645                    0 => Self::Unspecified,
7646                    1 => Self::Unknown,
7647                    2 => Self::Healthy,
7648                    3 => Self::Unhealthy,
7649                    4 => Self::Draining,
7650                    5 => Self::Timeout,
7651                    _ => Self::UnknownValue(liveness_state::UnknownValue(
7652                        wkt::internal::UnknownEnumValue::Integer(value),
7653                    )),
7654                }
7655            }
7656        }
7657
7658        impl std::convert::From<&str> for LivenessState {
7659            fn from(value: &str) -> Self {
7660                use std::string::ToString;
7661                match value {
7662                    "LIVENESS_STATE_UNSPECIFIED" => Self::Unspecified,
7663                    "UNKNOWN" => Self::Unknown,
7664                    "HEALTHY" => Self::Healthy,
7665                    "UNHEALTHY" => Self::Unhealthy,
7666                    "DRAINING" => Self::Draining,
7667                    "TIMEOUT" => Self::Timeout,
7668                    _ => Self::UnknownValue(liveness_state::UnknownValue(
7669                        wkt::internal::UnknownEnumValue::String(value.to_string()),
7670                    )),
7671                }
7672            }
7673        }
7674
7675        impl serde::ser::Serialize for LivenessState {
7676            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7677            where
7678                S: serde::Serializer,
7679            {
7680                match self {
7681                    Self::Unspecified => serializer.serialize_i32(0),
7682                    Self::Unknown => serializer.serialize_i32(1),
7683                    Self::Healthy => serializer.serialize_i32(2),
7684                    Self::Unhealthy => serializer.serialize_i32(3),
7685                    Self::Draining => serializer.serialize_i32(4),
7686                    Self::Timeout => serializer.serialize_i32(5),
7687                    Self::UnknownValue(u) => u.0.serialize(serializer),
7688                }
7689            }
7690        }
7691
7692        impl<'de> serde::de::Deserialize<'de> for LivenessState {
7693            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7694            where
7695                D: serde::Deserializer<'de>,
7696            {
7697                deserializer.deserialize_any(wkt::internal::EnumVisitor::<LivenessState>::new(
7698                    ".google.appengine.v1.Instance.Liveness.LivenessState",
7699                ))
7700            }
7701        }
7702    }
7703
7704    /// Availability of the instance.
7705    ///
7706    /// # Working with unknown values
7707    ///
7708    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7709    /// additional enum variants at any time. Adding new variants is not considered
7710    /// a breaking change. Applications should write their code in anticipation of:
7711    ///
7712    /// - New values appearing in future releases of the client library, **and**
7713    /// - New values received dynamically, without application changes.
7714    ///
7715    /// Please consult the [Working with enums] section in the user guide for some
7716    /// guidelines.
7717    ///
7718    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7719    #[derive(Clone, Debug, PartialEq)]
7720    #[non_exhaustive]
7721    pub enum Availability {
7722        Unspecified,
7723        Resident,
7724        Dynamic,
7725        /// If set, the enum was initialized with an unknown value.
7726        ///
7727        /// Applications can examine the value using [Availability::value] or
7728        /// [Availability::name].
7729        UnknownValue(availability::UnknownValue),
7730    }
7731
7732    #[doc(hidden)]
7733    pub mod availability {
7734        #[allow(unused_imports)]
7735        use super::*;
7736        #[derive(Clone, Debug, PartialEq)]
7737        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7738    }
7739
7740    impl Availability {
7741        /// Gets the enum value.
7742        ///
7743        /// Returns `None` if the enum contains an unknown value deserialized from
7744        /// the string representation of enums.
7745        pub fn value(&self) -> std::option::Option<i32> {
7746            match self {
7747                Self::Unspecified => std::option::Option::Some(0),
7748                Self::Resident => std::option::Option::Some(1),
7749                Self::Dynamic => std::option::Option::Some(2),
7750                Self::UnknownValue(u) => u.0.value(),
7751            }
7752        }
7753
7754        /// Gets the enum value as a string.
7755        ///
7756        /// Returns `None` if the enum contains an unknown value deserialized from
7757        /// the integer representation of enums.
7758        pub fn name(&self) -> std::option::Option<&str> {
7759            match self {
7760                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
7761                Self::Resident => std::option::Option::Some("RESIDENT"),
7762                Self::Dynamic => std::option::Option::Some("DYNAMIC"),
7763                Self::UnknownValue(u) => u.0.name(),
7764            }
7765        }
7766    }
7767
7768    impl std::default::Default for Availability {
7769        fn default() -> Self {
7770            use std::convert::From;
7771            Self::from(0)
7772        }
7773    }
7774
7775    impl std::fmt::Display for Availability {
7776        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7777            wkt::internal::display_enum(f, self.name(), self.value())
7778        }
7779    }
7780
7781    impl std::convert::From<i32> for Availability {
7782        fn from(value: i32) -> Self {
7783            match value {
7784                0 => Self::Unspecified,
7785                1 => Self::Resident,
7786                2 => Self::Dynamic,
7787                _ => Self::UnknownValue(availability::UnknownValue(
7788                    wkt::internal::UnknownEnumValue::Integer(value),
7789                )),
7790            }
7791        }
7792    }
7793
7794    impl std::convert::From<&str> for Availability {
7795        fn from(value: &str) -> Self {
7796            use std::string::ToString;
7797            match value {
7798                "UNSPECIFIED" => Self::Unspecified,
7799                "RESIDENT" => Self::Resident,
7800                "DYNAMIC" => Self::Dynamic,
7801                _ => Self::UnknownValue(availability::UnknownValue(
7802                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7803                )),
7804            }
7805        }
7806    }
7807
7808    impl serde::ser::Serialize for Availability {
7809        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7810        where
7811            S: serde::Serializer,
7812        {
7813            match self {
7814                Self::Unspecified => serializer.serialize_i32(0),
7815                Self::Resident => serializer.serialize_i32(1),
7816                Self::Dynamic => serializer.serialize_i32(2),
7817                Self::UnknownValue(u) => u.0.serialize(serializer),
7818            }
7819        }
7820    }
7821
7822    impl<'de> serde::de::Deserialize<'de> for Availability {
7823        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7824        where
7825            D: serde::Deserializer<'de>,
7826        {
7827            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Availability>::new(
7828                ".google.appengine.v1.Instance.Availability",
7829            ))
7830        }
7831    }
7832}
7833
7834/// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location].
7835#[derive(Clone, Default, PartialEq)]
7836#[non_exhaustive]
7837pub struct LocationMetadata {
7838    /// App Engine standard environment is available in the given location.
7839    ///
7840    /// @OutputOnly
7841    pub standard_environment_available: bool,
7842
7843    /// App Engine flexible environment is available in the given location.
7844    ///
7845    /// @OutputOnly
7846    pub flexible_environment_available: bool,
7847
7848    /// Output only. [Search API](https://cloud.google.com/appengine/docs/standard/python/search)
7849    /// is available in the given location.
7850    pub search_api_available: bool,
7851
7852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7853}
7854
7855impl LocationMetadata {
7856    pub fn new() -> Self {
7857        std::default::Default::default()
7858    }
7859
7860    /// Sets the value of [standard_environment_available][crate::model::LocationMetadata::standard_environment_available].
7861    ///
7862    /// # Example
7863    /// ```ignore,no_run
7864    /// # use google_cloud_appengine_v1::model::LocationMetadata;
7865    /// let x = LocationMetadata::new().set_standard_environment_available(true);
7866    /// ```
7867    pub fn set_standard_environment_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7868        self.standard_environment_available = v.into();
7869        self
7870    }
7871
7872    /// Sets the value of [flexible_environment_available][crate::model::LocationMetadata::flexible_environment_available].
7873    ///
7874    /// # Example
7875    /// ```ignore,no_run
7876    /// # use google_cloud_appengine_v1::model::LocationMetadata;
7877    /// let x = LocationMetadata::new().set_flexible_environment_available(true);
7878    /// ```
7879    pub fn set_flexible_environment_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7880        self.flexible_environment_available = v.into();
7881        self
7882    }
7883
7884    /// Sets the value of [search_api_available][crate::model::LocationMetadata::search_api_available].
7885    ///
7886    /// # Example
7887    /// ```ignore,no_run
7888    /// # use google_cloud_appengine_v1::model::LocationMetadata;
7889    /// let x = LocationMetadata::new().set_search_api_available(true);
7890    /// ```
7891    pub fn set_search_api_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7892        self.search_api_available = v.into();
7893        self
7894    }
7895}
7896
7897impl wkt::message::Message for LocationMetadata {
7898    fn typename() -> &'static str {
7899        "type.googleapis.com/google.appengine.v1.LocationMetadata"
7900    }
7901}
7902
7903/// A NetworkSettings resource is a container for ingress settings for a version
7904/// or service.
7905#[derive(Clone, Default, PartialEq)]
7906#[non_exhaustive]
7907pub struct NetworkSettings {
7908    /// The ingress settings for version or service.
7909    pub ingress_traffic_allowed: crate::model::network_settings::IngressTrafficAllowed,
7910
7911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7912}
7913
7914impl NetworkSettings {
7915    pub fn new() -> Self {
7916        std::default::Default::default()
7917    }
7918
7919    /// Sets the value of [ingress_traffic_allowed][crate::model::NetworkSettings::ingress_traffic_allowed].
7920    ///
7921    /// # Example
7922    /// ```ignore,no_run
7923    /// # use google_cloud_appengine_v1::model::NetworkSettings;
7924    /// use google_cloud_appengine_v1::model::network_settings::IngressTrafficAllowed;
7925    /// let x0 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::All);
7926    /// let x1 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::InternalOnly);
7927    /// let x2 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::InternalAndLb);
7928    /// ```
7929    pub fn set_ingress_traffic_allowed<
7930        T: std::convert::Into<crate::model::network_settings::IngressTrafficAllowed>,
7931    >(
7932        mut self,
7933        v: T,
7934    ) -> Self {
7935        self.ingress_traffic_allowed = v.into();
7936        self
7937    }
7938}
7939
7940impl wkt::message::Message for NetworkSettings {
7941    fn typename() -> &'static str {
7942        "type.googleapis.com/google.appengine.v1.NetworkSettings"
7943    }
7944}
7945
7946/// Defines additional types related to [NetworkSettings].
7947pub mod network_settings {
7948    #[allow(unused_imports)]
7949    use super::*;
7950
7951    /// If unspecified, INGRESS_TRAFFIC_ALLOWED_ALL will be used.
7952    ///
7953    /// # Working with unknown values
7954    ///
7955    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7956    /// additional enum variants at any time. Adding new variants is not considered
7957    /// a breaking change. Applications should write their code in anticipation of:
7958    ///
7959    /// - New values appearing in future releases of the client library, **and**
7960    /// - New values received dynamically, without application changes.
7961    ///
7962    /// Please consult the [Working with enums] section in the user guide for some
7963    /// guidelines.
7964    ///
7965    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7966    #[derive(Clone, Debug, PartialEq)]
7967    #[non_exhaustive]
7968    pub enum IngressTrafficAllowed {
7969        /// Unspecified
7970        Unspecified,
7971        /// Allow HTTP traffic from public and private sources.
7972        All,
7973        /// Allow HTTP traffic from only private VPC sources.
7974        InternalOnly,
7975        /// Allow HTTP traffic from private VPC sources and through load balancers.
7976        InternalAndLb,
7977        /// If set, the enum was initialized with an unknown value.
7978        ///
7979        /// Applications can examine the value using [IngressTrafficAllowed::value] or
7980        /// [IngressTrafficAllowed::name].
7981        UnknownValue(ingress_traffic_allowed::UnknownValue),
7982    }
7983
7984    #[doc(hidden)]
7985    pub mod ingress_traffic_allowed {
7986        #[allow(unused_imports)]
7987        use super::*;
7988        #[derive(Clone, Debug, PartialEq)]
7989        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7990    }
7991
7992    impl IngressTrafficAllowed {
7993        /// Gets the enum value.
7994        ///
7995        /// Returns `None` if the enum contains an unknown value deserialized from
7996        /// the string representation of enums.
7997        pub fn value(&self) -> std::option::Option<i32> {
7998            match self {
7999                Self::Unspecified => std::option::Option::Some(0),
8000                Self::All => std::option::Option::Some(1),
8001                Self::InternalOnly => std::option::Option::Some(2),
8002                Self::InternalAndLb => std::option::Option::Some(3),
8003                Self::UnknownValue(u) => u.0.value(),
8004            }
8005        }
8006
8007        /// Gets the enum value as a string.
8008        ///
8009        /// Returns `None` if the enum contains an unknown value deserialized from
8010        /// the integer representation of enums.
8011        pub fn name(&self) -> std::option::Option<&str> {
8012            match self {
8013                Self::Unspecified => {
8014                    std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED")
8015                }
8016                Self::All => std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_ALL"),
8017                Self::InternalOnly => {
8018                    std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY")
8019                }
8020                Self::InternalAndLb => {
8021                    std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB")
8022                }
8023                Self::UnknownValue(u) => u.0.name(),
8024            }
8025        }
8026    }
8027
8028    impl std::default::Default for IngressTrafficAllowed {
8029        fn default() -> Self {
8030            use std::convert::From;
8031            Self::from(0)
8032        }
8033    }
8034
8035    impl std::fmt::Display for IngressTrafficAllowed {
8036        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8037            wkt::internal::display_enum(f, self.name(), self.value())
8038        }
8039    }
8040
8041    impl std::convert::From<i32> for IngressTrafficAllowed {
8042        fn from(value: i32) -> Self {
8043            match value {
8044                0 => Self::Unspecified,
8045                1 => Self::All,
8046                2 => Self::InternalOnly,
8047                3 => Self::InternalAndLb,
8048                _ => Self::UnknownValue(ingress_traffic_allowed::UnknownValue(
8049                    wkt::internal::UnknownEnumValue::Integer(value),
8050                )),
8051            }
8052        }
8053    }
8054
8055    impl std::convert::From<&str> for IngressTrafficAllowed {
8056        fn from(value: &str) -> Self {
8057            use std::string::ToString;
8058            match value {
8059                "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED" => Self::Unspecified,
8060                "INGRESS_TRAFFIC_ALLOWED_ALL" => Self::All,
8061                "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY" => Self::InternalOnly,
8062                "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB" => Self::InternalAndLb,
8063                _ => Self::UnknownValue(ingress_traffic_allowed::UnknownValue(
8064                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8065                )),
8066            }
8067        }
8068    }
8069
8070    impl serde::ser::Serialize for IngressTrafficAllowed {
8071        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8072        where
8073            S: serde::Serializer,
8074        {
8075            match self {
8076                Self::Unspecified => serializer.serialize_i32(0),
8077                Self::All => serializer.serialize_i32(1),
8078                Self::InternalOnly => serializer.serialize_i32(2),
8079                Self::InternalAndLb => serializer.serialize_i32(3),
8080                Self::UnknownValue(u) => u.0.serialize(serializer),
8081            }
8082        }
8083    }
8084
8085    impl<'de> serde::de::Deserialize<'de> for IngressTrafficAllowed {
8086        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8087        where
8088            D: serde::Deserializer<'de>,
8089        {
8090            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngressTrafficAllowed>::new(
8091                ".google.appengine.v1.NetworkSettings.IngressTrafficAllowed",
8092            ))
8093        }
8094    }
8095}
8096
8097/// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation].
8098///
8099/// [google.longrunning.Operation]: longrunning::model::Operation
8100#[derive(Clone, Default, PartialEq)]
8101#[non_exhaustive]
8102pub struct OperationMetadataV1 {
8103    /// API method that initiated this operation. Example:
8104    /// `google.appengine.v1.Versions.CreateVersion`.
8105    ///
8106    /// @OutputOnly
8107    pub method: std::string::String,
8108
8109    /// Time that this operation was created.
8110    ///
8111    /// @OutputOnly
8112    pub insert_time: std::option::Option<wkt::Timestamp>,
8113
8114    /// Time that this operation completed.
8115    ///
8116    /// @OutputOnly
8117    pub end_time: std::option::Option<wkt::Timestamp>,
8118
8119    /// User who requested this operation.
8120    ///
8121    /// @OutputOnly
8122    pub user: std::string::String,
8123
8124    /// Name of the resource that this operation is acting on. Example:
8125    /// `apps/myapp/services/default`.
8126    ///
8127    /// @OutputOnly
8128    pub target: std::string::String,
8129
8130    /// Ephemeral message that may change every time the operation is polled.
8131    /// @OutputOnly
8132    pub ephemeral_message: std::string::String,
8133
8134    /// Durable messages that persist on every operation poll.
8135    /// @OutputOnly
8136    pub warning: std::vec::Vec<std::string::String>,
8137
8138    /// Metadata specific to the type of operation in progress.
8139    /// @OutputOnly
8140    pub method_metadata: std::option::Option<crate::model::operation_metadata_v_1::MethodMetadata>,
8141
8142    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8143}
8144
8145impl OperationMetadataV1 {
8146    pub fn new() -> Self {
8147        std::default::Default::default()
8148    }
8149
8150    /// Sets the value of [method][crate::model::OperationMetadataV1::method].
8151    ///
8152    /// # Example
8153    /// ```ignore,no_run
8154    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8155    /// let x = OperationMetadataV1::new().set_method("example");
8156    /// ```
8157    pub fn set_method<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8158        self.method = v.into();
8159        self
8160    }
8161
8162    /// Sets the value of [insert_time][crate::model::OperationMetadataV1::insert_time].
8163    ///
8164    /// # Example
8165    /// ```ignore,no_run
8166    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8167    /// use wkt::Timestamp;
8168    /// let x = OperationMetadataV1::new().set_insert_time(Timestamp::default()/* use setters */);
8169    /// ```
8170    pub fn set_insert_time<T>(mut self, v: T) -> Self
8171    where
8172        T: std::convert::Into<wkt::Timestamp>,
8173    {
8174        self.insert_time = std::option::Option::Some(v.into());
8175        self
8176    }
8177
8178    /// Sets or clears the value of [insert_time][crate::model::OperationMetadataV1::insert_time].
8179    ///
8180    /// # Example
8181    /// ```ignore,no_run
8182    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8183    /// use wkt::Timestamp;
8184    /// let x = OperationMetadataV1::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
8185    /// let x = OperationMetadataV1::new().set_or_clear_insert_time(None::<Timestamp>);
8186    /// ```
8187    pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
8188    where
8189        T: std::convert::Into<wkt::Timestamp>,
8190    {
8191        self.insert_time = v.map(|x| x.into());
8192        self
8193    }
8194
8195    /// Sets the value of [end_time][crate::model::OperationMetadataV1::end_time].
8196    ///
8197    /// # Example
8198    /// ```ignore,no_run
8199    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8200    /// use wkt::Timestamp;
8201    /// let x = OperationMetadataV1::new().set_end_time(Timestamp::default()/* use setters */);
8202    /// ```
8203    pub fn set_end_time<T>(mut self, v: T) -> Self
8204    where
8205        T: std::convert::Into<wkt::Timestamp>,
8206    {
8207        self.end_time = std::option::Option::Some(v.into());
8208        self
8209    }
8210
8211    /// Sets or clears the value of [end_time][crate::model::OperationMetadataV1::end_time].
8212    ///
8213    /// # Example
8214    /// ```ignore,no_run
8215    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8216    /// use wkt::Timestamp;
8217    /// let x = OperationMetadataV1::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8218    /// let x = OperationMetadataV1::new().set_or_clear_end_time(None::<Timestamp>);
8219    /// ```
8220    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8221    where
8222        T: std::convert::Into<wkt::Timestamp>,
8223    {
8224        self.end_time = v.map(|x| x.into());
8225        self
8226    }
8227
8228    /// Sets the value of [user][crate::model::OperationMetadataV1::user].
8229    ///
8230    /// # Example
8231    /// ```ignore,no_run
8232    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8233    /// let x = OperationMetadataV1::new().set_user("example");
8234    /// ```
8235    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8236        self.user = v.into();
8237        self
8238    }
8239
8240    /// Sets the value of [target][crate::model::OperationMetadataV1::target].
8241    ///
8242    /// # Example
8243    /// ```ignore,no_run
8244    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8245    /// let x = OperationMetadataV1::new().set_target("example");
8246    /// ```
8247    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8248        self.target = v.into();
8249        self
8250    }
8251
8252    /// Sets the value of [ephemeral_message][crate::model::OperationMetadataV1::ephemeral_message].
8253    ///
8254    /// # Example
8255    /// ```ignore,no_run
8256    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8257    /// let x = OperationMetadataV1::new().set_ephemeral_message("example");
8258    /// ```
8259    pub fn set_ephemeral_message<T: std::convert::Into<std::string::String>>(
8260        mut self,
8261        v: T,
8262    ) -> Self {
8263        self.ephemeral_message = v.into();
8264        self
8265    }
8266
8267    /// Sets the value of [warning][crate::model::OperationMetadataV1::warning].
8268    ///
8269    /// # Example
8270    /// ```ignore,no_run
8271    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8272    /// let x = OperationMetadataV1::new().set_warning(["a", "b", "c"]);
8273    /// ```
8274    pub fn set_warning<T, V>(mut self, v: T) -> Self
8275    where
8276        T: std::iter::IntoIterator<Item = V>,
8277        V: std::convert::Into<std::string::String>,
8278    {
8279        use std::iter::Iterator;
8280        self.warning = v.into_iter().map(|i| i.into()).collect();
8281        self
8282    }
8283
8284    /// Sets the value of [method_metadata][crate::model::OperationMetadataV1::method_metadata].
8285    ///
8286    /// Note that all the setters affecting `method_metadata` are mutually
8287    /// exclusive.
8288    ///
8289    /// # Example
8290    /// ```ignore,no_run
8291    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8292    /// use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8293    /// let x = OperationMetadataV1::new().set_method_metadata(Some(
8294    ///     google_cloud_appengine_v1::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(CreateVersionMetadataV1::default().into())));
8295    /// ```
8296    pub fn set_method_metadata<
8297        T: std::convert::Into<
8298                std::option::Option<crate::model::operation_metadata_v_1::MethodMetadata>,
8299            >,
8300    >(
8301        mut self,
8302        v: T,
8303    ) -> Self {
8304        self.method_metadata = v.into();
8305        self
8306    }
8307
8308    /// The value of [method_metadata][crate::model::OperationMetadataV1::method_metadata]
8309    /// if it holds a `CreateVersionMetadata`, `None` if the field is not set or
8310    /// holds a different branch.
8311    pub fn create_version_metadata(
8312        &self,
8313    ) -> std::option::Option<&std::boxed::Box<crate::model::CreateVersionMetadataV1>> {
8314        #[allow(unreachable_patterns)]
8315        self.method_metadata.as_ref().and_then(|v| match v {
8316            crate::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(v) => {
8317                std::option::Option::Some(v)
8318            }
8319            _ => std::option::Option::None,
8320        })
8321    }
8322
8323    /// Sets the value of [method_metadata][crate::model::OperationMetadataV1::method_metadata]
8324    /// to hold a `CreateVersionMetadata`.
8325    ///
8326    /// Note that all the setters affecting `method_metadata` are
8327    /// mutually exclusive.
8328    ///
8329    /// # Example
8330    /// ```ignore,no_run
8331    /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8332    /// use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8333    /// let x = OperationMetadataV1::new().set_create_version_metadata(CreateVersionMetadataV1::default()/* use setters */);
8334    /// assert!(x.create_version_metadata().is_some());
8335    /// ```
8336    pub fn set_create_version_metadata<
8337        T: std::convert::Into<std::boxed::Box<crate::model::CreateVersionMetadataV1>>,
8338    >(
8339        mut self,
8340        v: T,
8341    ) -> Self {
8342        self.method_metadata = std::option::Option::Some(
8343            crate::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(v.into()),
8344        );
8345        self
8346    }
8347}
8348
8349impl wkt::message::Message for OperationMetadataV1 {
8350    fn typename() -> &'static str {
8351        "type.googleapis.com/google.appengine.v1.OperationMetadataV1"
8352    }
8353}
8354
8355/// Defines additional types related to [OperationMetadataV1].
8356pub mod operation_metadata_v_1 {
8357    #[allow(unused_imports)]
8358    use super::*;
8359
8360    /// Metadata specific to the type of operation in progress.
8361    /// @OutputOnly
8362    #[derive(Clone, Debug, PartialEq)]
8363    #[non_exhaustive]
8364    pub enum MethodMetadata {
8365        CreateVersionMetadata(std::boxed::Box<crate::model::CreateVersionMetadataV1>),
8366    }
8367}
8368
8369/// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation] during a
8370/// [google.appengine.v1.CreateVersionRequest][google.appengine.v1.CreateVersionRequest].
8371///
8372/// [google.appengine.v1.CreateVersionRequest]: crate::model::CreateVersionRequest
8373/// [google.longrunning.Operation]: longrunning::model::Operation
8374#[derive(Clone, Default, PartialEq)]
8375#[non_exhaustive]
8376pub struct CreateVersionMetadataV1 {
8377    /// The Cloud Build ID if one was created as part of the version create.
8378    /// @OutputOnly
8379    pub cloud_build_id: std::string::String,
8380
8381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8382}
8383
8384impl CreateVersionMetadataV1 {
8385    pub fn new() -> Self {
8386        std::default::Default::default()
8387    }
8388
8389    /// Sets the value of [cloud_build_id][crate::model::CreateVersionMetadataV1::cloud_build_id].
8390    ///
8391    /// # Example
8392    /// ```ignore,no_run
8393    /// # use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8394    /// let x = CreateVersionMetadataV1::new().set_cloud_build_id("example");
8395    /// ```
8396    pub fn set_cloud_build_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8397        self.cloud_build_id = v.into();
8398        self
8399    }
8400}
8401
8402impl wkt::message::Message for CreateVersionMetadataV1 {
8403    fn typename() -> &'static str {
8404        "type.googleapis.com/google.appengine.v1.CreateVersionMetadataV1"
8405    }
8406}
8407
8408/// A Service resource is a logical component of an application that can share
8409/// state and communicate in a secure fashion with other services.
8410/// For example, an application that handles customer requests might
8411/// include separate services to handle tasks such as backend data
8412/// analysis or API requests from mobile devices. Each service has a
8413/// collection of versions that define a specific set of code used to
8414/// implement the functionality of that service.
8415#[derive(Clone, Default, PartialEq)]
8416#[non_exhaustive]
8417pub struct Service {
8418    /// Full path to the Service resource in the API.
8419    /// Example: `apps/myapp/services/default`.
8420    ///
8421    /// @OutputOnly
8422    pub name: std::string::String,
8423
8424    /// Relative name of the service within the application.
8425    /// Example: `default`.
8426    ///
8427    /// @OutputOnly
8428    pub id: std::string::String,
8429
8430    /// Mapping that defines fractional HTTP traffic diversion to
8431    /// different versions within the service.
8432    pub split: std::option::Option<crate::model::TrafficSplit>,
8433
8434    /// A set of labels to apply to this service. Labels are key/value pairs that
8435    /// describe the service and all resources that belong to it (e.g.,
8436    /// versions). The labels can be used to search and group resources, and are
8437    /// propagated to the usage and billing reports, enabling fine-grain analysis
8438    /// of costs. An example of using labels is to tag resources belonging to
8439    /// different environments (e.g., "env=prod", "env=qa").
8440    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8441
8442    /// Ingress settings for this service. Will apply to all versions.
8443    pub network_settings: std::option::Option<crate::model::NetworkSettings>,
8444
8445    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8446}
8447
8448impl Service {
8449    pub fn new() -> Self {
8450        std::default::Default::default()
8451    }
8452
8453    /// Sets the value of [name][crate::model::Service::name].
8454    ///
8455    /// # Example
8456    /// ```ignore,no_run
8457    /// # use google_cloud_appengine_v1::model::Service;
8458    /// let x = Service::new().set_name("example");
8459    /// ```
8460    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8461        self.name = v.into();
8462        self
8463    }
8464
8465    /// Sets the value of [id][crate::model::Service::id].
8466    ///
8467    /// # Example
8468    /// ```ignore,no_run
8469    /// # use google_cloud_appengine_v1::model::Service;
8470    /// let x = Service::new().set_id("example");
8471    /// ```
8472    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8473        self.id = v.into();
8474        self
8475    }
8476
8477    /// Sets the value of [split][crate::model::Service::split].
8478    ///
8479    /// # Example
8480    /// ```ignore,no_run
8481    /// # use google_cloud_appengine_v1::model::Service;
8482    /// use google_cloud_appengine_v1::model::TrafficSplit;
8483    /// let x = Service::new().set_split(TrafficSplit::default()/* use setters */);
8484    /// ```
8485    pub fn set_split<T>(mut self, v: T) -> Self
8486    where
8487        T: std::convert::Into<crate::model::TrafficSplit>,
8488    {
8489        self.split = std::option::Option::Some(v.into());
8490        self
8491    }
8492
8493    /// Sets or clears the value of [split][crate::model::Service::split].
8494    ///
8495    /// # Example
8496    /// ```ignore,no_run
8497    /// # use google_cloud_appengine_v1::model::Service;
8498    /// use google_cloud_appengine_v1::model::TrafficSplit;
8499    /// let x = Service::new().set_or_clear_split(Some(TrafficSplit::default()/* use setters */));
8500    /// let x = Service::new().set_or_clear_split(None::<TrafficSplit>);
8501    /// ```
8502    pub fn set_or_clear_split<T>(mut self, v: std::option::Option<T>) -> Self
8503    where
8504        T: std::convert::Into<crate::model::TrafficSplit>,
8505    {
8506        self.split = v.map(|x| x.into());
8507        self
8508    }
8509
8510    /// Sets the value of [labels][crate::model::Service::labels].
8511    ///
8512    /// # Example
8513    /// ```ignore,no_run
8514    /// # use google_cloud_appengine_v1::model::Service;
8515    /// let x = Service::new().set_labels([
8516    ///     ("key0", "abc"),
8517    ///     ("key1", "xyz"),
8518    /// ]);
8519    /// ```
8520    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8521    where
8522        T: std::iter::IntoIterator<Item = (K, V)>,
8523        K: std::convert::Into<std::string::String>,
8524        V: std::convert::Into<std::string::String>,
8525    {
8526        use std::iter::Iterator;
8527        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8528        self
8529    }
8530
8531    /// Sets the value of [network_settings][crate::model::Service::network_settings].
8532    ///
8533    /// # Example
8534    /// ```ignore,no_run
8535    /// # use google_cloud_appengine_v1::model::Service;
8536    /// use google_cloud_appengine_v1::model::NetworkSettings;
8537    /// let x = Service::new().set_network_settings(NetworkSettings::default()/* use setters */);
8538    /// ```
8539    pub fn set_network_settings<T>(mut self, v: T) -> Self
8540    where
8541        T: std::convert::Into<crate::model::NetworkSettings>,
8542    {
8543        self.network_settings = std::option::Option::Some(v.into());
8544        self
8545    }
8546
8547    /// Sets or clears the value of [network_settings][crate::model::Service::network_settings].
8548    ///
8549    /// # Example
8550    /// ```ignore,no_run
8551    /// # use google_cloud_appengine_v1::model::Service;
8552    /// use google_cloud_appengine_v1::model::NetworkSettings;
8553    /// let x = Service::new().set_or_clear_network_settings(Some(NetworkSettings::default()/* use setters */));
8554    /// let x = Service::new().set_or_clear_network_settings(None::<NetworkSettings>);
8555    /// ```
8556    pub fn set_or_clear_network_settings<T>(mut self, v: std::option::Option<T>) -> Self
8557    where
8558        T: std::convert::Into<crate::model::NetworkSettings>,
8559    {
8560        self.network_settings = v.map(|x| x.into());
8561        self
8562    }
8563}
8564
8565impl wkt::message::Message for Service {
8566    fn typename() -> &'static str {
8567        "type.googleapis.com/google.appengine.v1.Service"
8568    }
8569}
8570
8571/// Traffic routing configuration for versions within a single service. Traffic
8572/// splits define how traffic directed to the service is assigned to versions.
8573#[derive(Clone, Default, PartialEq)]
8574#[non_exhaustive]
8575pub struct TrafficSplit {
8576    /// Mechanism used to determine which version a request is sent to.
8577    /// The traffic selection algorithm will
8578    /// be stable for either type until allocations are changed.
8579    pub shard_by: crate::model::traffic_split::ShardBy,
8580
8581    /// Mapping from version IDs within the service to fractional
8582    /// (0.000, 1] allocations of traffic for that version. Each version can
8583    /// be specified only once, but some versions in the service may not
8584    /// have any traffic allocation. Services that have traffic allocated
8585    /// cannot be deleted until either the service is deleted or
8586    /// their traffic allocation is removed. Allocations must sum to 1.
8587    /// Up to two decimal place precision is supported for IP-based splits and
8588    /// up to three decimal places is supported for cookie-based splits.
8589    pub allocations: std::collections::HashMap<std::string::String, f64>,
8590
8591    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8592}
8593
8594impl TrafficSplit {
8595    pub fn new() -> Self {
8596        std::default::Default::default()
8597    }
8598
8599    /// Sets the value of [shard_by][crate::model::TrafficSplit::shard_by].
8600    ///
8601    /// # Example
8602    /// ```ignore,no_run
8603    /// # use google_cloud_appengine_v1::model::TrafficSplit;
8604    /// use google_cloud_appengine_v1::model::traffic_split::ShardBy;
8605    /// let x0 = TrafficSplit::new().set_shard_by(ShardBy::Cookie);
8606    /// let x1 = TrafficSplit::new().set_shard_by(ShardBy::Ip);
8607    /// let x2 = TrafficSplit::new().set_shard_by(ShardBy::Random);
8608    /// ```
8609    pub fn set_shard_by<T: std::convert::Into<crate::model::traffic_split::ShardBy>>(
8610        mut self,
8611        v: T,
8612    ) -> Self {
8613        self.shard_by = v.into();
8614        self
8615    }
8616
8617    /// Sets the value of [allocations][crate::model::TrafficSplit::allocations].
8618    ///
8619    /// # Example
8620    /// ```ignore,no_run
8621    /// # use google_cloud_appengine_v1::model::TrafficSplit;
8622    /// let x = TrafficSplit::new().set_allocations([
8623    ///     ("key0", 123.5),
8624    ///     ("key1", 456.5),
8625    /// ]);
8626    /// ```
8627    pub fn set_allocations<T, K, V>(mut self, v: T) -> Self
8628    where
8629        T: std::iter::IntoIterator<Item = (K, V)>,
8630        K: std::convert::Into<std::string::String>,
8631        V: std::convert::Into<f64>,
8632    {
8633        use std::iter::Iterator;
8634        self.allocations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8635        self
8636    }
8637}
8638
8639impl wkt::message::Message for TrafficSplit {
8640    fn typename() -> &'static str {
8641        "type.googleapis.com/google.appengine.v1.TrafficSplit"
8642    }
8643}
8644
8645/// Defines additional types related to [TrafficSplit].
8646pub mod traffic_split {
8647    #[allow(unused_imports)]
8648    use super::*;
8649
8650    /// Available sharding mechanisms.
8651    ///
8652    /// # Working with unknown values
8653    ///
8654    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8655    /// additional enum variants at any time. Adding new variants is not considered
8656    /// a breaking change. Applications should write their code in anticipation of:
8657    ///
8658    /// - New values appearing in future releases of the client library, **and**
8659    /// - New values received dynamically, without application changes.
8660    ///
8661    /// Please consult the [Working with enums] section in the user guide for some
8662    /// guidelines.
8663    ///
8664    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8665    #[derive(Clone, Debug, PartialEq)]
8666    #[non_exhaustive]
8667    pub enum ShardBy {
8668        /// Diversion method unspecified.
8669        Unspecified,
8670        /// Diversion based on a specially named cookie, "GOOGAPPUID." The cookie
8671        /// must be set by the application itself or no diversion will occur.
8672        Cookie,
8673        /// Diversion based on applying the modulus operation to a fingerprint
8674        /// of the IP address.
8675        Ip,
8676        /// Diversion based on weighted random assignment. An incoming request is
8677        /// randomly routed to a version in the traffic split, with probability
8678        /// proportional to the version's traffic share.
8679        Random,
8680        /// If set, the enum was initialized with an unknown value.
8681        ///
8682        /// Applications can examine the value using [ShardBy::value] or
8683        /// [ShardBy::name].
8684        UnknownValue(shard_by::UnknownValue),
8685    }
8686
8687    #[doc(hidden)]
8688    pub mod shard_by {
8689        #[allow(unused_imports)]
8690        use super::*;
8691        #[derive(Clone, Debug, PartialEq)]
8692        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8693    }
8694
8695    impl ShardBy {
8696        /// Gets the enum value.
8697        ///
8698        /// Returns `None` if the enum contains an unknown value deserialized from
8699        /// the string representation of enums.
8700        pub fn value(&self) -> std::option::Option<i32> {
8701            match self {
8702                Self::Unspecified => std::option::Option::Some(0),
8703                Self::Cookie => std::option::Option::Some(1),
8704                Self::Ip => std::option::Option::Some(2),
8705                Self::Random => std::option::Option::Some(3),
8706                Self::UnknownValue(u) => u.0.value(),
8707            }
8708        }
8709
8710        /// Gets the enum value as a string.
8711        ///
8712        /// Returns `None` if the enum contains an unknown value deserialized from
8713        /// the integer representation of enums.
8714        pub fn name(&self) -> std::option::Option<&str> {
8715            match self {
8716                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
8717                Self::Cookie => std::option::Option::Some("COOKIE"),
8718                Self::Ip => std::option::Option::Some("IP"),
8719                Self::Random => std::option::Option::Some("RANDOM"),
8720                Self::UnknownValue(u) => u.0.name(),
8721            }
8722        }
8723    }
8724
8725    impl std::default::Default for ShardBy {
8726        fn default() -> Self {
8727            use std::convert::From;
8728            Self::from(0)
8729        }
8730    }
8731
8732    impl std::fmt::Display for ShardBy {
8733        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8734            wkt::internal::display_enum(f, self.name(), self.value())
8735        }
8736    }
8737
8738    impl std::convert::From<i32> for ShardBy {
8739        fn from(value: i32) -> Self {
8740            match value {
8741                0 => Self::Unspecified,
8742                1 => Self::Cookie,
8743                2 => Self::Ip,
8744                3 => Self::Random,
8745                _ => Self::UnknownValue(shard_by::UnknownValue(
8746                    wkt::internal::UnknownEnumValue::Integer(value),
8747                )),
8748            }
8749        }
8750    }
8751
8752    impl std::convert::From<&str> for ShardBy {
8753        fn from(value: &str) -> Self {
8754            use std::string::ToString;
8755            match value {
8756                "UNSPECIFIED" => Self::Unspecified,
8757                "COOKIE" => Self::Cookie,
8758                "IP" => Self::Ip,
8759                "RANDOM" => Self::Random,
8760                _ => Self::UnknownValue(shard_by::UnknownValue(
8761                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8762                )),
8763            }
8764        }
8765    }
8766
8767    impl serde::ser::Serialize for ShardBy {
8768        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8769        where
8770            S: serde::Serializer,
8771        {
8772            match self {
8773                Self::Unspecified => serializer.serialize_i32(0),
8774                Self::Cookie => serializer.serialize_i32(1),
8775                Self::Ip => serializer.serialize_i32(2),
8776                Self::Random => serializer.serialize_i32(3),
8777                Self::UnknownValue(u) => u.0.serialize(serializer),
8778            }
8779        }
8780    }
8781
8782    impl<'de> serde::de::Deserialize<'de> for ShardBy {
8783        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8784        where
8785            D: serde::Deserializer<'de>,
8786        {
8787            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ShardBy>::new(
8788                ".google.appengine.v1.TrafficSplit.ShardBy",
8789            ))
8790        }
8791    }
8792}
8793
8794/// A Version resource is a specific set of source code and configuration files
8795/// that are deployed into a service.
8796#[derive(Clone, Default, PartialEq)]
8797#[non_exhaustive]
8798pub struct Version {
8799    /// Full path to the Version resource in the API.  Example:
8800    /// `apps/myapp/services/default/versions/v1`.
8801    ///
8802    /// @OutputOnly
8803    pub name: std::string::String,
8804
8805    /// Relative name of the version within the service.  Example: `v1`.
8806    /// Version names can contain only lowercase letters, numbers, or hyphens.
8807    /// Reserved names: "default", "latest", and any name with the prefix "ah-".
8808    pub id: std::string::String,
8809
8810    /// Before an application can receive email or XMPP messages, the application
8811    /// must be configured to enable the service.
8812    pub inbound_services: std::vec::Vec<crate::model::InboundServiceType>,
8813
8814    /// Instance class that is used to run this version. Valid values are:
8815    ///
8816    /// * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G`
8817    /// * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
8818    ///
8819    /// Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
8820    /// BasicScaling.
8821    pub instance_class: std::string::String,
8822
8823    /// Extra network settings.
8824    /// Only applicable in the App Engine flexible environment.
8825    pub network: std::option::Option<crate::model::Network>,
8826
8827    /// The Google Compute Engine zones that are supported by this version in the
8828    /// App Engine flexible environment. Deprecated.
8829    pub zones: std::vec::Vec<std::string::String>,
8830
8831    /// Machine resources for this version.
8832    /// Only applicable in the App Engine flexible environment.
8833    pub resources: std::option::Option<crate::model::Resources>,
8834
8835    /// Desired runtime. Example: `python27`.
8836    pub runtime: std::string::String,
8837
8838    /// The channel of the runtime to use. Only available for some
8839    /// runtimes. Defaults to the `default` channel.
8840    pub runtime_channel: std::string::String,
8841
8842    /// Whether multiple requests can be dispatched to this version at once.
8843    pub threadsafe: bool,
8844
8845    /// Whether to deploy this version in a container on a virtual machine.
8846    pub vm: bool,
8847
8848    /// Allows App Engine second generation runtimes to access the legacy bundled
8849    /// services.
8850    pub app_engine_apis: bool,
8851
8852    /// Metadata settings that are supplied to this version to enable
8853    /// beta runtime features.
8854    pub beta_settings: std::collections::HashMap<std::string::String, std::string::String>,
8855
8856    /// App Engine execution environment for this version.
8857    ///
8858    /// Defaults to `standard`.
8859    pub env: std::string::String,
8860
8861    /// Current serving status of this version. Only the versions with a
8862    /// `SERVING` status create instances and can be billed.
8863    ///
8864    /// `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`.
8865    pub serving_status: crate::model::ServingStatus,
8866
8867    /// Email address of the user who created this version.
8868    ///
8869    /// @OutputOnly
8870    pub created_by: std::string::String,
8871
8872    /// Time that this version was created.
8873    ///
8874    /// @OutputOnly
8875    pub create_time: std::option::Option<wkt::Timestamp>,
8876
8877    /// Total size in bytes of all the files that are included in this version
8878    /// and currently hosted on the App Engine disk.
8879    ///
8880    /// @OutputOnly
8881    pub disk_usage_bytes: i64,
8882
8883    /// The version of the API in the given runtime environment. Please see the
8884    /// app.yaml reference for valid values at
8885    /// <https://cloud.google.com/appengine/docs/standard/>\<language\>/config/appref
8886    pub runtime_api_version: std::string::String,
8887
8888    /// The path or name of the app's main executable.
8889    pub runtime_main_executable_path: std::string::String,
8890
8891    /// The identity that the deployed version will run as.
8892    /// Admin API will use the App Engine Appspot service account as default if
8893    /// this field is neither provided in app.yaml file nor through CLI flag.
8894    pub service_account: std::string::String,
8895
8896    /// An ordered list of URL-matching patterns that should be applied to incoming
8897    /// requests. The first matching URL handles the request and other request
8898    /// handlers are not attempted.
8899    ///
8900    /// Only returned in `GET` requests if `view=FULL` is set.
8901    pub handlers: std::vec::Vec<crate::model::UrlMap>,
8902
8903    /// Custom static error pages. Limited to 10KB per page.
8904    ///
8905    /// Only returned in `GET` requests if `view=FULL` is set.
8906    pub error_handlers: std::vec::Vec<crate::model::ErrorHandler>,
8907
8908    /// Configuration for third-party Python runtime libraries that are required
8909    /// by the application.
8910    ///
8911    /// Only returned in `GET` requests if `view=FULL` is set.
8912    pub libraries: std::vec::Vec<crate::model::Library>,
8913
8914    /// Serving configuration for
8915    /// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
8916    ///
8917    /// Only returned in `GET` requests if `view=FULL` is set.
8918    pub api_config: std::option::Option<crate::model::ApiConfigHandler>,
8919
8920    /// Environment variables available to the application.
8921    ///
8922    /// Only returned in `GET` requests if `view=FULL` is set.
8923    pub env_variables: std::collections::HashMap<std::string::String, std::string::String>,
8924
8925    /// Environment variables available to the build environment.
8926    ///
8927    /// Only returned in `GET` requests if `view=FULL` is set.
8928    pub build_env_variables: std::collections::HashMap<std::string::String, std::string::String>,
8929
8930    /// Duration that static files should be cached by web proxies and browsers.
8931    /// Only applicable if the corresponding
8932    /// [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StaticFilesHandler)
8933    /// does not specify its own expiration time.
8934    ///
8935    /// Only returned in `GET` requests if `view=FULL` is set.
8936    pub default_expiration: std::option::Option<wkt::Duration>,
8937
8938    /// Configures health checking for instances. Unhealthy instances are
8939    /// stopped and replaced with new instances.
8940    /// Only applicable in the App Engine flexible environment.
8941    ///
8942    /// Only returned in `GET` requests if `view=FULL` is set.
8943    pub health_check: std::option::Option<crate::model::HealthCheck>,
8944
8945    /// Configures readiness health checking for instances.
8946    /// Unhealthy instances are not put into the backend traffic rotation.
8947    ///
8948    /// Only returned in `GET` requests if `view=FULL` is set.
8949    pub readiness_check: std::option::Option<crate::model::ReadinessCheck>,
8950
8951    /// Configures liveness health checking for instances.
8952    /// Unhealthy instances are stopped and replaced with new instances
8953    ///
8954    /// Only returned in `GET` requests if `view=FULL` is set.
8955    pub liveness_check: std::option::Option<crate::model::LivenessCheck>,
8956
8957    /// Files that match this pattern will not be built into this version.
8958    /// Only applicable for Go runtimes.
8959    ///
8960    /// Only returned in `GET` requests if `view=FULL` is set.
8961    pub nobuild_files_regex: std::string::String,
8962
8963    /// Code and application artifacts that make up this version.
8964    ///
8965    /// Only returned in `GET` requests if `view=FULL` is set.
8966    pub deployment: std::option::Option<crate::model::Deployment>,
8967
8968    /// Serving URL for this version. Example:
8969    /// `https://myversion-dot-myservice-dot-myapp.appspot.com`
8970    ///
8971    /// @OutputOnly
8972    pub version_url: std::string::String,
8973
8974    /// Cloud Endpoints configuration.
8975    ///
8976    /// If endpoints_api_service is set, the Cloud Endpoints Extensible Service
8977    /// Proxy will be provided to serve the API implemented by the app.
8978    pub endpoints_api_service: std::option::Option<crate::model::EndpointsApiService>,
8979
8980    /// The entrypoint for the application.
8981    pub entrypoint: std::option::Option<crate::model::Entrypoint>,
8982
8983    /// Enables VPC connectivity for standard apps.
8984    pub vpc_access_connector: std::option::Option<crate::model::VpcAccessConnector>,
8985
8986    /// Controls how instances are created, scaled, and reaped.
8987    ///
8988    /// Defaults to `AutomaticScaling`.
8989    pub scaling: std::option::Option<crate::model::version::Scaling>,
8990
8991    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8992}
8993
8994impl Version {
8995    pub fn new() -> Self {
8996        std::default::Default::default()
8997    }
8998
8999    /// Sets the value of [name][crate::model::Version::name].
9000    ///
9001    /// # Example
9002    /// ```ignore,no_run
9003    /// # use google_cloud_appengine_v1::model::Version;
9004    /// let x = Version::new().set_name("example");
9005    /// ```
9006    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9007        self.name = v.into();
9008        self
9009    }
9010
9011    /// Sets the value of [id][crate::model::Version::id].
9012    ///
9013    /// # Example
9014    /// ```ignore,no_run
9015    /// # use google_cloud_appengine_v1::model::Version;
9016    /// let x = Version::new().set_id("example");
9017    /// ```
9018    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9019        self.id = v.into();
9020        self
9021    }
9022
9023    /// Sets the value of [inbound_services][crate::model::Version::inbound_services].
9024    ///
9025    /// # Example
9026    /// ```ignore,no_run
9027    /// # use google_cloud_appengine_v1::model::Version;
9028    /// use google_cloud_appengine_v1::model::InboundServiceType;
9029    /// let x = Version::new().set_inbound_services([
9030    ///     InboundServiceType::InboundServiceMail,
9031    ///     InboundServiceType::InboundServiceMailBounce,
9032    ///     InboundServiceType::InboundServiceXmppError,
9033    /// ]);
9034    /// ```
9035    pub fn set_inbound_services<T, V>(mut self, v: T) -> Self
9036    where
9037        T: std::iter::IntoIterator<Item = V>,
9038        V: std::convert::Into<crate::model::InboundServiceType>,
9039    {
9040        use std::iter::Iterator;
9041        self.inbound_services = v.into_iter().map(|i| i.into()).collect();
9042        self
9043    }
9044
9045    /// Sets the value of [instance_class][crate::model::Version::instance_class].
9046    ///
9047    /// # Example
9048    /// ```ignore,no_run
9049    /// # use google_cloud_appengine_v1::model::Version;
9050    /// let x = Version::new().set_instance_class("example");
9051    /// ```
9052    pub fn set_instance_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9053        self.instance_class = v.into();
9054        self
9055    }
9056
9057    /// Sets the value of [network][crate::model::Version::network].
9058    ///
9059    /// # Example
9060    /// ```ignore,no_run
9061    /// # use google_cloud_appengine_v1::model::Version;
9062    /// use google_cloud_appengine_v1::model::Network;
9063    /// let x = Version::new().set_network(Network::default()/* use setters */);
9064    /// ```
9065    pub fn set_network<T>(mut self, v: T) -> Self
9066    where
9067        T: std::convert::Into<crate::model::Network>,
9068    {
9069        self.network = std::option::Option::Some(v.into());
9070        self
9071    }
9072
9073    /// Sets or clears the value of [network][crate::model::Version::network].
9074    ///
9075    /// # Example
9076    /// ```ignore,no_run
9077    /// # use google_cloud_appengine_v1::model::Version;
9078    /// use google_cloud_appengine_v1::model::Network;
9079    /// let x = Version::new().set_or_clear_network(Some(Network::default()/* use setters */));
9080    /// let x = Version::new().set_or_clear_network(None::<Network>);
9081    /// ```
9082    pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
9083    where
9084        T: std::convert::Into<crate::model::Network>,
9085    {
9086        self.network = v.map(|x| x.into());
9087        self
9088    }
9089
9090    /// Sets the value of [zones][crate::model::Version::zones].
9091    ///
9092    /// # Example
9093    /// ```ignore,no_run
9094    /// # use google_cloud_appengine_v1::model::Version;
9095    /// let x = Version::new().set_zones(["a", "b", "c"]);
9096    /// ```
9097    pub fn set_zones<T, V>(mut self, v: T) -> Self
9098    where
9099        T: std::iter::IntoIterator<Item = V>,
9100        V: std::convert::Into<std::string::String>,
9101    {
9102        use std::iter::Iterator;
9103        self.zones = v.into_iter().map(|i| i.into()).collect();
9104        self
9105    }
9106
9107    /// Sets the value of [resources][crate::model::Version::resources].
9108    ///
9109    /// # Example
9110    /// ```ignore,no_run
9111    /// # use google_cloud_appengine_v1::model::Version;
9112    /// use google_cloud_appengine_v1::model::Resources;
9113    /// let x = Version::new().set_resources(Resources::default()/* use setters */);
9114    /// ```
9115    pub fn set_resources<T>(mut self, v: T) -> Self
9116    where
9117        T: std::convert::Into<crate::model::Resources>,
9118    {
9119        self.resources = std::option::Option::Some(v.into());
9120        self
9121    }
9122
9123    /// Sets or clears the value of [resources][crate::model::Version::resources].
9124    ///
9125    /// # Example
9126    /// ```ignore,no_run
9127    /// # use google_cloud_appengine_v1::model::Version;
9128    /// use google_cloud_appengine_v1::model::Resources;
9129    /// let x = Version::new().set_or_clear_resources(Some(Resources::default()/* use setters */));
9130    /// let x = Version::new().set_or_clear_resources(None::<Resources>);
9131    /// ```
9132    pub fn set_or_clear_resources<T>(mut self, v: std::option::Option<T>) -> Self
9133    where
9134        T: std::convert::Into<crate::model::Resources>,
9135    {
9136        self.resources = v.map(|x| x.into());
9137        self
9138    }
9139
9140    /// Sets the value of [runtime][crate::model::Version::runtime].
9141    ///
9142    /// # Example
9143    /// ```ignore,no_run
9144    /// # use google_cloud_appengine_v1::model::Version;
9145    /// let x = Version::new().set_runtime("example");
9146    /// ```
9147    pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9148        self.runtime = v.into();
9149        self
9150    }
9151
9152    /// Sets the value of [runtime_channel][crate::model::Version::runtime_channel].
9153    ///
9154    /// # Example
9155    /// ```ignore,no_run
9156    /// # use google_cloud_appengine_v1::model::Version;
9157    /// let x = Version::new().set_runtime_channel("example");
9158    /// ```
9159    pub fn set_runtime_channel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9160        self.runtime_channel = v.into();
9161        self
9162    }
9163
9164    /// Sets the value of [threadsafe][crate::model::Version::threadsafe].
9165    ///
9166    /// # Example
9167    /// ```ignore,no_run
9168    /// # use google_cloud_appengine_v1::model::Version;
9169    /// let x = Version::new().set_threadsafe(true);
9170    /// ```
9171    pub fn set_threadsafe<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9172        self.threadsafe = v.into();
9173        self
9174    }
9175
9176    /// Sets the value of [vm][crate::model::Version::vm].
9177    ///
9178    /// # Example
9179    /// ```ignore,no_run
9180    /// # use google_cloud_appengine_v1::model::Version;
9181    /// let x = Version::new().set_vm(true);
9182    /// ```
9183    pub fn set_vm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9184        self.vm = v.into();
9185        self
9186    }
9187
9188    /// Sets the value of [app_engine_apis][crate::model::Version::app_engine_apis].
9189    ///
9190    /// # Example
9191    /// ```ignore,no_run
9192    /// # use google_cloud_appengine_v1::model::Version;
9193    /// let x = Version::new().set_app_engine_apis(true);
9194    /// ```
9195    pub fn set_app_engine_apis<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9196        self.app_engine_apis = v.into();
9197        self
9198    }
9199
9200    /// Sets the value of [beta_settings][crate::model::Version::beta_settings].
9201    ///
9202    /// # Example
9203    /// ```ignore,no_run
9204    /// # use google_cloud_appengine_v1::model::Version;
9205    /// let x = Version::new().set_beta_settings([
9206    ///     ("key0", "abc"),
9207    ///     ("key1", "xyz"),
9208    /// ]);
9209    /// ```
9210    pub fn set_beta_settings<T, K, V>(mut self, v: T) -> Self
9211    where
9212        T: std::iter::IntoIterator<Item = (K, V)>,
9213        K: std::convert::Into<std::string::String>,
9214        V: std::convert::Into<std::string::String>,
9215    {
9216        use std::iter::Iterator;
9217        self.beta_settings = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9218        self
9219    }
9220
9221    /// Sets the value of [env][crate::model::Version::env].
9222    ///
9223    /// # Example
9224    /// ```ignore,no_run
9225    /// # use google_cloud_appengine_v1::model::Version;
9226    /// let x = Version::new().set_env("example");
9227    /// ```
9228    pub fn set_env<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9229        self.env = v.into();
9230        self
9231    }
9232
9233    /// Sets the value of [serving_status][crate::model::Version::serving_status].
9234    ///
9235    /// # Example
9236    /// ```ignore,no_run
9237    /// # use google_cloud_appengine_v1::model::Version;
9238    /// use google_cloud_appengine_v1::model::ServingStatus;
9239    /// let x0 = Version::new().set_serving_status(ServingStatus::Serving);
9240    /// let x1 = Version::new().set_serving_status(ServingStatus::Stopped);
9241    /// ```
9242    pub fn set_serving_status<T: std::convert::Into<crate::model::ServingStatus>>(
9243        mut self,
9244        v: T,
9245    ) -> Self {
9246        self.serving_status = v.into();
9247        self
9248    }
9249
9250    /// Sets the value of [created_by][crate::model::Version::created_by].
9251    ///
9252    /// # Example
9253    /// ```ignore,no_run
9254    /// # use google_cloud_appengine_v1::model::Version;
9255    /// let x = Version::new().set_created_by("example");
9256    /// ```
9257    pub fn set_created_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9258        self.created_by = v.into();
9259        self
9260    }
9261
9262    /// Sets the value of [create_time][crate::model::Version::create_time].
9263    ///
9264    /// # Example
9265    /// ```ignore,no_run
9266    /// # use google_cloud_appengine_v1::model::Version;
9267    /// use wkt::Timestamp;
9268    /// let x = Version::new().set_create_time(Timestamp::default()/* use setters */);
9269    /// ```
9270    pub fn set_create_time<T>(mut self, v: T) -> Self
9271    where
9272        T: std::convert::Into<wkt::Timestamp>,
9273    {
9274        self.create_time = std::option::Option::Some(v.into());
9275        self
9276    }
9277
9278    /// Sets or clears the value of [create_time][crate::model::Version::create_time].
9279    ///
9280    /// # Example
9281    /// ```ignore,no_run
9282    /// # use google_cloud_appengine_v1::model::Version;
9283    /// use wkt::Timestamp;
9284    /// let x = Version::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9285    /// let x = Version::new().set_or_clear_create_time(None::<Timestamp>);
9286    /// ```
9287    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9288    where
9289        T: std::convert::Into<wkt::Timestamp>,
9290    {
9291        self.create_time = v.map(|x| x.into());
9292        self
9293    }
9294
9295    /// Sets the value of [disk_usage_bytes][crate::model::Version::disk_usage_bytes].
9296    ///
9297    /// # Example
9298    /// ```ignore,no_run
9299    /// # use google_cloud_appengine_v1::model::Version;
9300    /// let x = Version::new().set_disk_usage_bytes(42);
9301    /// ```
9302    pub fn set_disk_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9303        self.disk_usage_bytes = v.into();
9304        self
9305    }
9306
9307    /// Sets the value of [runtime_api_version][crate::model::Version::runtime_api_version].
9308    ///
9309    /// # Example
9310    /// ```ignore,no_run
9311    /// # use google_cloud_appengine_v1::model::Version;
9312    /// let x = Version::new().set_runtime_api_version("example");
9313    /// ```
9314    pub fn set_runtime_api_version<T: std::convert::Into<std::string::String>>(
9315        mut self,
9316        v: T,
9317    ) -> Self {
9318        self.runtime_api_version = v.into();
9319        self
9320    }
9321
9322    /// Sets the value of [runtime_main_executable_path][crate::model::Version::runtime_main_executable_path].
9323    ///
9324    /// # Example
9325    /// ```ignore,no_run
9326    /// # use google_cloud_appengine_v1::model::Version;
9327    /// let x = Version::new().set_runtime_main_executable_path("example");
9328    /// ```
9329    pub fn set_runtime_main_executable_path<T: std::convert::Into<std::string::String>>(
9330        mut self,
9331        v: T,
9332    ) -> Self {
9333        self.runtime_main_executable_path = v.into();
9334        self
9335    }
9336
9337    /// Sets the value of [service_account][crate::model::Version::service_account].
9338    ///
9339    /// # Example
9340    /// ```ignore,no_run
9341    /// # use google_cloud_appengine_v1::model::Version;
9342    /// let x = Version::new().set_service_account("example");
9343    /// ```
9344    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9345        self.service_account = v.into();
9346        self
9347    }
9348
9349    /// Sets the value of [handlers][crate::model::Version::handlers].
9350    ///
9351    /// # Example
9352    /// ```ignore,no_run
9353    /// # use google_cloud_appengine_v1::model::Version;
9354    /// use google_cloud_appengine_v1::model::UrlMap;
9355    /// let x = Version::new()
9356    ///     .set_handlers([
9357    ///         UrlMap::default()/* use setters */,
9358    ///         UrlMap::default()/* use (different) setters */,
9359    ///     ]);
9360    /// ```
9361    pub fn set_handlers<T, V>(mut self, v: T) -> Self
9362    where
9363        T: std::iter::IntoIterator<Item = V>,
9364        V: std::convert::Into<crate::model::UrlMap>,
9365    {
9366        use std::iter::Iterator;
9367        self.handlers = v.into_iter().map(|i| i.into()).collect();
9368        self
9369    }
9370
9371    /// Sets the value of [error_handlers][crate::model::Version::error_handlers].
9372    ///
9373    /// # Example
9374    /// ```ignore,no_run
9375    /// # use google_cloud_appengine_v1::model::Version;
9376    /// use google_cloud_appengine_v1::model::ErrorHandler;
9377    /// let x = Version::new()
9378    ///     .set_error_handlers([
9379    ///         ErrorHandler::default()/* use setters */,
9380    ///         ErrorHandler::default()/* use (different) setters */,
9381    ///     ]);
9382    /// ```
9383    pub fn set_error_handlers<T, V>(mut self, v: T) -> Self
9384    where
9385        T: std::iter::IntoIterator<Item = V>,
9386        V: std::convert::Into<crate::model::ErrorHandler>,
9387    {
9388        use std::iter::Iterator;
9389        self.error_handlers = v.into_iter().map(|i| i.into()).collect();
9390        self
9391    }
9392
9393    /// Sets the value of [libraries][crate::model::Version::libraries].
9394    ///
9395    /// # Example
9396    /// ```ignore,no_run
9397    /// # use google_cloud_appengine_v1::model::Version;
9398    /// use google_cloud_appengine_v1::model::Library;
9399    /// let x = Version::new()
9400    ///     .set_libraries([
9401    ///         Library::default()/* use setters */,
9402    ///         Library::default()/* use (different) setters */,
9403    ///     ]);
9404    /// ```
9405    pub fn set_libraries<T, V>(mut self, v: T) -> Self
9406    where
9407        T: std::iter::IntoIterator<Item = V>,
9408        V: std::convert::Into<crate::model::Library>,
9409    {
9410        use std::iter::Iterator;
9411        self.libraries = v.into_iter().map(|i| i.into()).collect();
9412        self
9413    }
9414
9415    /// Sets the value of [api_config][crate::model::Version::api_config].
9416    ///
9417    /// # Example
9418    /// ```ignore,no_run
9419    /// # use google_cloud_appengine_v1::model::Version;
9420    /// use google_cloud_appengine_v1::model::ApiConfigHandler;
9421    /// let x = Version::new().set_api_config(ApiConfigHandler::default()/* use setters */);
9422    /// ```
9423    pub fn set_api_config<T>(mut self, v: T) -> Self
9424    where
9425        T: std::convert::Into<crate::model::ApiConfigHandler>,
9426    {
9427        self.api_config = std::option::Option::Some(v.into());
9428        self
9429    }
9430
9431    /// Sets or clears the value of [api_config][crate::model::Version::api_config].
9432    ///
9433    /// # Example
9434    /// ```ignore,no_run
9435    /// # use google_cloud_appengine_v1::model::Version;
9436    /// use google_cloud_appengine_v1::model::ApiConfigHandler;
9437    /// let x = Version::new().set_or_clear_api_config(Some(ApiConfigHandler::default()/* use setters */));
9438    /// let x = Version::new().set_or_clear_api_config(None::<ApiConfigHandler>);
9439    /// ```
9440    pub fn set_or_clear_api_config<T>(mut self, v: std::option::Option<T>) -> Self
9441    where
9442        T: std::convert::Into<crate::model::ApiConfigHandler>,
9443    {
9444        self.api_config = v.map(|x| x.into());
9445        self
9446    }
9447
9448    /// Sets the value of [env_variables][crate::model::Version::env_variables].
9449    ///
9450    /// # Example
9451    /// ```ignore,no_run
9452    /// # use google_cloud_appengine_v1::model::Version;
9453    /// let x = Version::new().set_env_variables([
9454    ///     ("key0", "abc"),
9455    ///     ("key1", "xyz"),
9456    /// ]);
9457    /// ```
9458    pub fn set_env_variables<T, K, V>(mut self, v: T) -> Self
9459    where
9460        T: std::iter::IntoIterator<Item = (K, V)>,
9461        K: std::convert::Into<std::string::String>,
9462        V: std::convert::Into<std::string::String>,
9463    {
9464        use std::iter::Iterator;
9465        self.env_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9466        self
9467    }
9468
9469    /// Sets the value of [build_env_variables][crate::model::Version::build_env_variables].
9470    ///
9471    /// # Example
9472    /// ```ignore,no_run
9473    /// # use google_cloud_appengine_v1::model::Version;
9474    /// let x = Version::new().set_build_env_variables([
9475    ///     ("key0", "abc"),
9476    ///     ("key1", "xyz"),
9477    /// ]);
9478    /// ```
9479    pub fn set_build_env_variables<T, K, V>(mut self, v: T) -> Self
9480    where
9481        T: std::iter::IntoIterator<Item = (K, V)>,
9482        K: std::convert::Into<std::string::String>,
9483        V: std::convert::Into<std::string::String>,
9484    {
9485        use std::iter::Iterator;
9486        self.build_env_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9487        self
9488    }
9489
9490    /// Sets the value of [default_expiration][crate::model::Version::default_expiration].
9491    ///
9492    /// # Example
9493    /// ```ignore,no_run
9494    /// # use google_cloud_appengine_v1::model::Version;
9495    /// use wkt::Duration;
9496    /// let x = Version::new().set_default_expiration(Duration::default()/* use setters */);
9497    /// ```
9498    pub fn set_default_expiration<T>(mut self, v: T) -> Self
9499    where
9500        T: std::convert::Into<wkt::Duration>,
9501    {
9502        self.default_expiration = std::option::Option::Some(v.into());
9503        self
9504    }
9505
9506    /// Sets or clears the value of [default_expiration][crate::model::Version::default_expiration].
9507    ///
9508    /// # Example
9509    /// ```ignore,no_run
9510    /// # use google_cloud_appengine_v1::model::Version;
9511    /// use wkt::Duration;
9512    /// let x = Version::new().set_or_clear_default_expiration(Some(Duration::default()/* use setters */));
9513    /// let x = Version::new().set_or_clear_default_expiration(None::<Duration>);
9514    /// ```
9515    pub fn set_or_clear_default_expiration<T>(mut self, v: std::option::Option<T>) -> Self
9516    where
9517        T: std::convert::Into<wkt::Duration>,
9518    {
9519        self.default_expiration = v.map(|x| x.into());
9520        self
9521    }
9522
9523    /// Sets the value of [health_check][crate::model::Version::health_check].
9524    ///
9525    /// # Example
9526    /// ```ignore,no_run
9527    /// # use google_cloud_appengine_v1::model::Version;
9528    /// use google_cloud_appengine_v1::model::HealthCheck;
9529    /// let x = Version::new().set_health_check(HealthCheck::default()/* use setters */);
9530    /// ```
9531    pub fn set_health_check<T>(mut self, v: T) -> Self
9532    where
9533        T: std::convert::Into<crate::model::HealthCheck>,
9534    {
9535        self.health_check = std::option::Option::Some(v.into());
9536        self
9537    }
9538
9539    /// Sets or clears the value of [health_check][crate::model::Version::health_check].
9540    ///
9541    /// # Example
9542    /// ```ignore,no_run
9543    /// # use google_cloud_appengine_v1::model::Version;
9544    /// use google_cloud_appengine_v1::model::HealthCheck;
9545    /// let x = Version::new().set_or_clear_health_check(Some(HealthCheck::default()/* use setters */));
9546    /// let x = Version::new().set_or_clear_health_check(None::<HealthCheck>);
9547    /// ```
9548    pub fn set_or_clear_health_check<T>(mut self, v: std::option::Option<T>) -> Self
9549    where
9550        T: std::convert::Into<crate::model::HealthCheck>,
9551    {
9552        self.health_check = v.map(|x| x.into());
9553        self
9554    }
9555
9556    /// Sets the value of [readiness_check][crate::model::Version::readiness_check].
9557    ///
9558    /// # Example
9559    /// ```ignore,no_run
9560    /// # use google_cloud_appengine_v1::model::Version;
9561    /// use google_cloud_appengine_v1::model::ReadinessCheck;
9562    /// let x = Version::new().set_readiness_check(ReadinessCheck::default()/* use setters */);
9563    /// ```
9564    pub fn set_readiness_check<T>(mut self, v: T) -> Self
9565    where
9566        T: std::convert::Into<crate::model::ReadinessCheck>,
9567    {
9568        self.readiness_check = std::option::Option::Some(v.into());
9569        self
9570    }
9571
9572    /// Sets or clears the value of [readiness_check][crate::model::Version::readiness_check].
9573    ///
9574    /// # Example
9575    /// ```ignore,no_run
9576    /// # use google_cloud_appengine_v1::model::Version;
9577    /// use google_cloud_appengine_v1::model::ReadinessCheck;
9578    /// let x = Version::new().set_or_clear_readiness_check(Some(ReadinessCheck::default()/* use setters */));
9579    /// let x = Version::new().set_or_clear_readiness_check(None::<ReadinessCheck>);
9580    /// ```
9581    pub fn set_or_clear_readiness_check<T>(mut self, v: std::option::Option<T>) -> Self
9582    where
9583        T: std::convert::Into<crate::model::ReadinessCheck>,
9584    {
9585        self.readiness_check = v.map(|x| x.into());
9586        self
9587    }
9588
9589    /// Sets the value of [liveness_check][crate::model::Version::liveness_check].
9590    ///
9591    /// # Example
9592    /// ```ignore,no_run
9593    /// # use google_cloud_appengine_v1::model::Version;
9594    /// use google_cloud_appengine_v1::model::LivenessCheck;
9595    /// let x = Version::new().set_liveness_check(LivenessCheck::default()/* use setters */);
9596    /// ```
9597    pub fn set_liveness_check<T>(mut self, v: T) -> Self
9598    where
9599        T: std::convert::Into<crate::model::LivenessCheck>,
9600    {
9601        self.liveness_check = std::option::Option::Some(v.into());
9602        self
9603    }
9604
9605    /// Sets or clears the value of [liveness_check][crate::model::Version::liveness_check].
9606    ///
9607    /// # Example
9608    /// ```ignore,no_run
9609    /// # use google_cloud_appengine_v1::model::Version;
9610    /// use google_cloud_appengine_v1::model::LivenessCheck;
9611    /// let x = Version::new().set_or_clear_liveness_check(Some(LivenessCheck::default()/* use setters */));
9612    /// let x = Version::new().set_or_clear_liveness_check(None::<LivenessCheck>);
9613    /// ```
9614    pub fn set_or_clear_liveness_check<T>(mut self, v: std::option::Option<T>) -> Self
9615    where
9616        T: std::convert::Into<crate::model::LivenessCheck>,
9617    {
9618        self.liveness_check = v.map(|x| x.into());
9619        self
9620    }
9621
9622    /// Sets the value of [nobuild_files_regex][crate::model::Version::nobuild_files_regex].
9623    ///
9624    /// # Example
9625    /// ```ignore,no_run
9626    /// # use google_cloud_appengine_v1::model::Version;
9627    /// let x = Version::new().set_nobuild_files_regex("example");
9628    /// ```
9629    pub fn set_nobuild_files_regex<T: std::convert::Into<std::string::String>>(
9630        mut self,
9631        v: T,
9632    ) -> Self {
9633        self.nobuild_files_regex = v.into();
9634        self
9635    }
9636
9637    /// Sets the value of [deployment][crate::model::Version::deployment].
9638    ///
9639    /// # Example
9640    /// ```ignore,no_run
9641    /// # use google_cloud_appengine_v1::model::Version;
9642    /// use google_cloud_appengine_v1::model::Deployment;
9643    /// let x = Version::new().set_deployment(Deployment::default()/* use setters */);
9644    /// ```
9645    pub fn set_deployment<T>(mut self, v: T) -> Self
9646    where
9647        T: std::convert::Into<crate::model::Deployment>,
9648    {
9649        self.deployment = std::option::Option::Some(v.into());
9650        self
9651    }
9652
9653    /// Sets or clears the value of [deployment][crate::model::Version::deployment].
9654    ///
9655    /// # Example
9656    /// ```ignore,no_run
9657    /// # use google_cloud_appengine_v1::model::Version;
9658    /// use google_cloud_appengine_v1::model::Deployment;
9659    /// let x = Version::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
9660    /// let x = Version::new().set_or_clear_deployment(None::<Deployment>);
9661    /// ```
9662    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9663    where
9664        T: std::convert::Into<crate::model::Deployment>,
9665    {
9666        self.deployment = v.map(|x| x.into());
9667        self
9668    }
9669
9670    /// Sets the value of [version_url][crate::model::Version::version_url].
9671    ///
9672    /// # Example
9673    /// ```ignore,no_run
9674    /// # use google_cloud_appengine_v1::model::Version;
9675    /// let x = Version::new().set_version_url("example");
9676    /// ```
9677    pub fn set_version_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9678        self.version_url = v.into();
9679        self
9680    }
9681
9682    /// Sets the value of [endpoints_api_service][crate::model::Version::endpoints_api_service].
9683    ///
9684    /// # Example
9685    /// ```ignore,no_run
9686    /// # use google_cloud_appengine_v1::model::Version;
9687    /// use google_cloud_appengine_v1::model::EndpointsApiService;
9688    /// let x = Version::new().set_endpoints_api_service(EndpointsApiService::default()/* use setters */);
9689    /// ```
9690    pub fn set_endpoints_api_service<T>(mut self, v: T) -> Self
9691    where
9692        T: std::convert::Into<crate::model::EndpointsApiService>,
9693    {
9694        self.endpoints_api_service = std::option::Option::Some(v.into());
9695        self
9696    }
9697
9698    /// Sets or clears the value of [endpoints_api_service][crate::model::Version::endpoints_api_service].
9699    ///
9700    /// # Example
9701    /// ```ignore,no_run
9702    /// # use google_cloud_appengine_v1::model::Version;
9703    /// use google_cloud_appengine_v1::model::EndpointsApiService;
9704    /// let x = Version::new().set_or_clear_endpoints_api_service(Some(EndpointsApiService::default()/* use setters */));
9705    /// let x = Version::new().set_or_clear_endpoints_api_service(None::<EndpointsApiService>);
9706    /// ```
9707    pub fn set_or_clear_endpoints_api_service<T>(mut self, v: std::option::Option<T>) -> Self
9708    where
9709        T: std::convert::Into<crate::model::EndpointsApiService>,
9710    {
9711        self.endpoints_api_service = v.map(|x| x.into());
9712        self
9713    }
9714
9715    /// Sets the value of [entrypoint][crate::model::Version::entrypoint].
9716    ///
9717    /// # Example
9718    /// ```ignore,no_run
9719    /// # use google_cloud_appengine_v1::model::Version;
9720    /// use google_cloud_appengine_v1::model::Entrypoint;
9721    /// let x = Version::new().set_entrypoint(Entrypoint::default()/* use setters */);
9722    /// ```
9723    pub fn set_entrypoint<T>(mut self, v: T) -> Self
9724    where
9725        T: std::convert::Into<crate::model::Entrypoint>,
9726    {
9727        self.entrypoint = std::option::Option::Some(v.into());
9728        self
9729    }
9730
9731    /// Sets or clears the value of [entrypoint][crate::model::Version::entrypoint].
9732    ///
9733    /// # Example
9734    /// ```ignore,no_run
9735    /// # use google_cloud_appengine_v1::model::Version;
9736    /// use google_cloud_appengine_v1::model::Entrypoint;
9737    /// let x = Version::new().set_or_clear_entrypoint(Some(Entrypoint::default()/* use setters */));
9738    /// let x = Version::new().set_or_clear_entrypoint(None::<Entrypoint>);
9739    /// ```
9740    pub fn set_or_clear_entrypoint<T>(mut self, v: std::option::Option<T>) -> Self
9741    where
9742        T: std::convert::Into<crate::model::Entrypoint>,
9743    {
9744        self.entrypoint = v.map(|x| x.into());
9745        self
9746    }
9747
9748    /// Sets the value of [vpc_access_connector][crate::model::Version::vpc_access_connector].
9749    ///
9750    /// # Example
9751    /// ```ignore,no_run
9752    /// # use google_cloud_appengine_v1::model::Version;
9753    /// use google_cloud_appengine_v1::model::VpcAccessConnector;
9754    /// let x = Version::new().set_vpc_access_connector(VpcAccessConnector::default()/* use setters */);
9755    /// ```
9756    pub fn set_vpc_access_connector<T>(mut self, v: T) -> Self
9757    where
9758        T: std::convert::Into<crate::model::VpcAccessConnector>,
9759    {
9760        self.vpc_access_connector = std::option::Option::Some(v.into());
9761        self
9762    }
9763
9764    /// Sets or clears the value of [vpc_access_connector][crate::model::Version::vpc_access_connector].
9765    ///
9766    /// # Example
9767    /// ```ignore,no_run
9768    /// # use google_cloud_appengine_v1::model::Version;
9769    /// use google_cloud_appengine_v1::model::VpcAccessConnector;
9770    /// let x = Version::new().set_or_clear_vpc_access_connector(Some(VpcAccessConnector::default()/* use setters */));
9771    /// let x = Version::new().set_or_clear_vpc_access_connector(None::<VpcAccessConnector>);
9772    /// ```
9773    pub fn set_or_clear_vpc_access_connector<T>(mut self, v: std::option::Option<T>) -> Self
9774    where
9775        T: std::convert::Into<crate::model::VpcAccessConnector>,
9776    {
9777        self.vpc_access_connector = v.map(|x| x.into());
9778        self
9779    }
9780
9781    /// Sets the value of [scaling][crate::model::Version::scaling].
9782    ///
9783    /// Note that all the setters affecting `scaling` are mutually
9784    /// exclusive.
9785    ///
9786    /// # Example
9787    /// ```ignore,no_run
9788    /// # use google_cloud_appengine_v1::model::Version;
9789    /// use google_cloud_appengine_v1::model::AutomaticScaling;
9790    /// let x = Version::new().set_scaling(Some(
9791    ///     google_cloud_appengine_v1::model::version::Scaling::AutomaticScaling(AutomaticScaling::default().into())));
9792    /// ```
9793    pub fn set_scaling<
9794        T: std::convert::Into<std::option::Option<crate::model::version::Scaling>>,
9795    >(
9796        mut self,
9797        v: T,
9798    ) -> Self {
9799        self.scaling = v.into();
9800        self
9801    }
9802
9803    /// The value of [scaling][crate::model::Version::scaling]
9804    /// if it holds a `AutomaticScaling`, `None` if the field is not set or
9805    /// holds a different branch.
9806    pub fn automatic_scaling(
9807        &self,
9808    ) -> std::option::Option<&std::boxed::Box<crate::model::AutomaticScaling>> {
9809        #[allow(unreachable_patterns)]
9810        self.scaling.as_ref().and_then(|v| match v {
9811            crate::model::version::Scaling::AutomaticScaling(v) => std::option::Option::Some(v),
9812            _ => std::option::Option::None,
9813        })
9814    }
9815
9816    /// Sets the value of [scaling][crate::model::Version::scaling]
9817    /// to hold a `AutomaticScaling`.
9818    ///
9819    /// Note that all the setters affecting `scaling` are
9820    /// mutually exclusive.
9821    ///
9822    /// # Example
9823    /// ```ignore,no_run
9824    /// # use google_cloud_appengine_v1::model::Version;
9825    /// use google_cloud_appengine_v1::model::AutomaticScaling;
9826    /// let x = Version::new().set_automatic_scaling(AutomaticScaling::default()/* use setters */);
9827    /// assert!(x.automatic_scaling().is_some());
9828    /// assert!(x.basic_scaling().is_none());
9829    /// assert!(x.manual_scaling().is_none());
9830    /// ```
9831    pub fn set_automatic_scaling<
9832        T: std::convert::Into<std::boxed::Box<crate::model::AutomaticScaling>>,
9833    >(
9834        mut self,
9835        v: T,
9836    ) -> Self {
9837        self.scaling =
9838            std::option::Option::Some(crate::model::version::Scaling::AutomaticScaling(v.into()));
9839        self
9840    }
9841
9842    /// The value of [scaling][crate::model::Version::scaling]
9843    /// if it holds a `BasicScaling`, `None` if the field is not set or
9844    /// holds a different branch.
9845    pub fn basic_scaling(
9846        &self,
9847    ) -> std::option::Option<&std::boxed::Box<crate::model::BasicScaling>> {
9848        #[allow(unreachable_patterns)]
9849        self.scaling.as_ref().and_then(|v| match v {
9850            crate::model::version::Scaling::BasicScaling(v) => std::option::Option::Some(v),
9851            _ => std::option::Option::None,
9852        })
9853    }
9854
9855    /// Sets the value of [scaling][crate::model::Version::scaling]
9856    /// to hold a `BasicScaling`.
9857    ///
9858    /// Note that all the setters affecting `scaling` are
9859    /// mutually exclusive.
9860    ///
9861    /// # Example
9862    /// ```ignore,no_run
9863    /// # use google_cloud_appengine_v1::model::Version;
9864    /// use google_cloud_appengine_v1::model::BasicScaling;
9865    /// let x = Version::new().set_basic_scaling(BasicScaling::default()/* use setters */);
9866    /// assert!(x.basic_scaling().is_some());
9867    /// assert!(x.automatic_scaling().is_none());
9868    /// assert!(x.manual_scaling().is_none());
9869    /// ```
9870    pub fn set_basic_scaling<T: std::convert::Into<std::boxed::Box<crate::model::BasicScaling>>>(
9871        mut self,
9872        v: T,
9873    ) -> Self {
9874        self.scaling =
9875            std::option::Option::Some(crate::model::version::Scaling::BasicScaling(v.into()));
9876        self
9877    }
9878
9879    /// The value of [scaling][crate::model::Version::scaling]
9880    /// if it holds a `ManualScaling`, `None` if the field is not set or
9881    /// holds a different branch.
9882    pub fn manual_scaling(
9883        &self,
9884    ) -> std::option::Option<&std::boxed::Box<crate::model::ManualScaling>> {
9885        #[allow(unreachable_patterns)]
9886        self.scaling.as_ref().and_then(|v| match v {
9887            crate::model::version::Scaling::ManualScaling(v) => std::option::Option::Some(v),
9888            _ => std::option::Option::None,
9889        })
9890    }
9891
9892    /// Sets the value of [scaling][crate::model::Version::scaling]
9893    /// to hold a `ManualScaling`.
9894    ///
9895    /// Note that all the setters affecting `scaling` are
9896    /// mutually exclusive.
9897    ///
9898    /// # Example
9899    /// ```ignore,no_run
9900    /// # use google_cloud_appengine_v1::model::Version;
9901    /// use google_cloud_appengine_v1::model::ManualScaling;
9902    /// let x = Version::new().set_manual_scaling(ManualScaling::default()/* use setters */);
9903    /// assert!(x.manual_scaling().is_some());
9904    /// assert!(x.automatic_scaling().is_none());
9905    /// assert!(x.basic_scaling().is_none());
9906    /// ```
9907    pub fn set_manual_scaling<
9908        T: std::convert::Into<std::boxed::Box<crate::model::ManualScaling>>,
9909    >(
9910        mut self,
9911        v: T,
9912    ) -> Self {
9913        self.scaling =
9914            std::option::Option::Some(crate::model::version::Scaling::ManualScaling(v.into()));
9915        self
9916    }
9917}
9918
9919impl wkt::message::Message for Version {
9920    fn typename() -> &'static str {
9921        "type.googleapis.com/google.appengine.v1.Version"
9922    }
9923}
9924
9925/// Defines additional types related to [Version].
9926pub mod version {
9927    #[allow(unused_imports)]
9928    use super::*;
9929
9930    /// Controls how instances are created, scaled, and reaped.
9931    ///
9932    /// Defaults to `AutomaticScaling`.
9933    #[derive(Clone, Debug, PartialEq)]
9934    #[non_exhaustive]
9935    pub enum Scaling {
9936        /// Automatic scaling is based on request rate, response latencies, and other
9937        /// application metrics. Instances are dynamically created and destroyed as
9938        /// needed in order to handle traffic.
9939        AutomaticScaling(std::boxed::Box<crate::model::AutomaticScaling>),
9940        /// A service with basic scaling will create an instance when the application
9941        /// receives a request. The instance will be turned down when the app becomes
9942        /// idle. Basic scaling is ideal for work that is intermittent or driven by
9943        /// user activity.
9944        BasicScaling(std::boxed::Box<crate::model::BasicScaling>),
9945        /// A service with manual scaling runs continuously, allowing you to perform
9946        /// complex initialization and rely on the state of its memory over time.
9947        /// Manually scaled versions are sometimes referred to as "backends".
9948        ManualScaling(std::boxed::Box<crate::model::ManualScaling>),
9949    }
9950}
9951
9952/// [Cloud Endpoints](https://cloud.google.com/endpoints) configuration.
9953/// The Endpoints API Service provides tooling for serving Open API and gRPC
9954/// endpoints via an NGINX proxy. Only valid for App Engine Flexible environment
9955/// deployments.
9956///
9957/// The fields here refer to the name and configuration ID of a "service"
9958/// resource in the [Service Management API](https://cloud.google.com/service-management/overview).
9959#[derive(Clone, Default, PartialEq)]
9960#[non_exhaustive]
9961pub struct EndpointsApiService {
9962    /// Endpoints service name which is the name of the "service" resource in the
9963    /// Service Management API. For example "myapi.endpoints.myproject.cloud.goog"
9964    pub name: std::string::String,
9965
9966    /// Endpoints service configuration ID as specified by the Service Management
9967    /// API. For example "2016-09-19r1".
9968    ///
9969    /// By default, the rollout strategy for Endpoints is `RolloutStrategy.FIXED`.
9970    /// This means that Endpoints starts up with a particular configuration ID.
9971    /// When a new configuration is rolled out, Endpoints must be given the new
9972    /// configuration ID. The `config_id` field is used to give the configuration
9973    /// ID and is required in this case.
9974    ///
9975    /// Endpoints also has a rollout strategy called `RolloutStrategy.MANAGED`.
9976    /// When using this, Endpoints fetches the latest configuration and does not
9977    /// need the configuration ID. In this case, `config_id` must be omitted.
9978    pub config_id: std::string::String,
9979
9980    /// Endpoints rollout strategy. If `FIXED`, `config_id` must be specified. If
9981    /// `MANAGED`, `config_id` must be omitted.
9982    pub rollout_strategy: crate::model::endpoints_api_service::RolloutStrategy,
9983
9984    /// Enable or disable trace sampling. By default, this is set to false for
9985    /// enabled.
9986    pub disable_trace_sampling: bool,
9987
9988    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9989}
9990
9991impl EndpointsApiService {
9992    pub fn new() -> Self {
9993        std::default::Default::default()
9994    }
9995
9996    /// Sets the value of [name][crate::model::EndpointsApiService::name].
9997    ///
9998    /// # Example
9999    /// ```ignore,no_run
10000    /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10001    /// let x = EndpointsApiService::new().set_name("example");
10002    /// ```
10003    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10004        self.name = v.into();
10005        self
10006    }
10007
10008    /// Sets the value of [config_id][crate::model::EndpointsApiService::config_id].
10009    ///
10010    /// # Example
10011    /// ```ignore,no_run
10012    /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10013    /// let x = EndpointsApiService::new().set_config_id("example");
10014    /// ```
10015    pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10016        self.config_id = v.into();
10017        self
10018    }
10019
10020    /// Sets the value of [rollout_strategy][crate::model::EndpointsApiService::rollout_strategy].
10021    ///
10022    /// # Example
10023    /// ```ignore,no_run
10024    /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10025    /// use google_cloud_appengine_v1::model::endpoints_api_service::RolloutStrategy;
10026    /// let x0 = EndpointsApiService::new().set_rollout_strategy(RolloutStrategy::Fixed);
10027    /// let x1 = EndpointsApiService::new().set_rollout_strategy(RolloutStrategy::Managed);
10028    /// ```
10029    pub fn set_rollout_strategy<
10030        T: std::convert::Into<crate::model::endpoints_api_service::RolloutStrategy>,
10031    >(
10032        mut self,
10033        v: T,
10034    ) -> Self {
10035        self.rollout_strategy = v.into();
10036        self
10037    }
10038
10039    /// Sets the value of [disable_trace_sampling][crate::model::EndpointsApiService::disable_trace_sampling].
10040    ///
10041    /// # Example
10042    /// ```ignore,no_run
10043    /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10044    /// let x = EndpointsApiService::new().set_disable_trace_sampling(true);
10045    /// ```
10046    pub fn set_disable_trace_sampling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10047        self.disable_trace_sampling = v.into();
10048        self
10049    }
10050}
10051
10052impl wkt::message::Message for EndpointsApiService {
10053    fn typename() -> &'static str {
10054        "type.googleapis.com/google.appengine.v1.EndpointsApiService"
10055    }
10056}
10057
10058/// Defines additional types related to [EndpointsApiService].
10059pub mod endpoints_api_service {
10060    #[allow(unused_imports)]
10061    use super::*;
10062
10063    /// Available rollout strategies.
10064    ///
10065    /// # Working with unknown values
10066    ///
10067    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10068    /// additional enum variants at any time. Adding new variants is not considered
10069    /// a breaking change. Applications should write their code in anticipation of:
10070    ///
10071    /// - New values appearing in future releases of the client library, **and**
10072    /// - New values received dynamically, without application changes.
10073    ///
10074    /// Please consult the [Working with enums] section in the user guide for some
10075    /// guidelines.
10076    ///
10077    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10078    #[derive(Clone, Debug, PartialEq)]
10079    #[non_exhaustive]
10080    pub enum RolloutStrategy {
10081        /// Not specified. Defaults to `FIXED`.
10082        UnspecifiedRolloutStrategy,
10083        /// Endpoints service configuration ID will be fixed to the configuration ID
10084        /// specified by `config_id`.
10085        Fixed,
10086        /// Endpoints service configuration ID will be updated with each rollout.
10087        Managed,
10088        /// If set, the enum was initialized with an unknown value.
10089        ///
10090        /// Applications can examine the value using [RolloutStrategy::value] or
10091        /// [RolloutStrategy::name].
10092        UnknownValue(rollout_strategy::UnknownValue),
10093    }
10094
10095    #[doc(hidden)]
10096    pub mod rollout_strategy {
10097        #[allow(unused_imports)]
10098        use super::*;
10099        #[derive(Clone, Debug, PartialEq)]
10100        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10101    }
10102
10103    impl RolloutStrategy {
10104        /// Gets the enum value.
10105        ///
10106        /// Returns `None` if the enum contains an unknown value deserialized from
10107        /// the string representation of enums.
10108        pub fn value(&self) -> std::option::Option<i32> {
10109            match self {
10110                Self::UnspecifiedRolloutStrategy => std::option::Option::Some(0),
10111                Self::Fixed => std::option::Option::Some(1),
10112                Self::Managed => std::option::Option::Some(2),
10113                Self::UnknownValue(u) => u.0.value(),
10114            }
10115        }
10116
10117        /// Gets the enum value as a string.
10118        ///
10119        /// Returns `None` if the enum contains an unknown value deserialized from
10120        /// the integer representation of enums.
10121        pub fn name(&self) -> std::option::Option<&str> {
10122            match self {
10123                Self::UnspecifiedRolloutStrategy => {
10124                    std::option::Option::Some("UNSPECIFIED_ROLLOUT_STRATEGY")
10125                }
10126                Self::Fixed => std::option::Option::Some("FIXED"),
10127                Self::Managed => std::option::Option::Some("MANAGED"),
10128                Self::UnknownValue(u) => u.0.name(),
10129            }
10130        }
10131    }
10132
10133    impl std::default::Default for RolloutStrategy {
10134        fn default() -> Self {
10135            use std::convert::From;
10136            Self::from(0)
10137        }
10138    }
10139
10140    impl std::fmt::Display for RolloutStrategy {
10141        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10142            wkt::internal::display_enum(f, self.name(), self.value())
10143        }
10144    }
10145
10146    impl std::convert::From<i32> for RolloutStrategy {
10147        fn from(value: i32) -> Self {
10148            match value {
10149                0 => Self::UnspecifiedRolloutStrategy,
10150                1 => Self::Fixed,
10151                2 => Self::Managed,
10152                _ => Self::UnknownValue(rollout_strategy::UnknownValue(
10153                    wkt::internal::UnknownEnumValue::Integer(value),
10154                )),
10155            }
10156        }
10157    }
10158
10159    impl std::convert::From<&str> for RolloutStrategy {
10160        fn from(value: &str) -> Self {
10161            use std::string::ToString;
10162            match value {
10163                "UNSPECIFIED_ROLLOUT_STRATEGY" => Self::UnspecifiedRolloutStrategy,
10164                "FIXED" => Self::Fixed,
10165                "MANAGED" => Self::Managed,
10166                _ => Self::UnknownValue(rollout_strategy::UnknownValue(
10167                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10168                )),
10169            }
10170        }
10171    }
10172
10173    impl serde::ser::Serialize for RolloutStrategy {
10174        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10175        where
10176            S: serde::Serializer,
10177        {
10178            match self {
10179                Self::UnspecifiedRolloutStrategy => serializer.serialize_i32(0),
10180                Self::Fixed => serializer.serialize_i32(1),
10181                Self::Managed => serializer.serialize_i32(2),
10182                Self::UnknownValue(u) => u.0.serialize(serializer),
10183            }
10184        }
10185    }
10186
10187    impl<'de> serde::de::Deserialize<'de> for RolloutStrategy {
10188        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10189        where
10190            D: serde::Deserializer<'de>,
10191        {
10192            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutStrategy>::new(
10193                ".google.appengine.v1.EndpointsApiService.RolloutStrategy",
10194            ))
10195        }
10196    }
10197}
10198
10199/// Automatic scaling is based on request rate, response latencies, and other
10200/// application metrics.
10201#[derive(Clone, Default, PartialEq)]
10202#[non_exhaustive]
10203pub struct AutomaticScaling {
10204    /// The time period that the
10205    /// [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
10206    /// should wait before it starts collecting information from a new instance.
10207    /// This prevents the autoscaler from collecting information when the instance
10208    /// is initializing, during which the collected usage would not be reliable.
10209    /// Only applicable in the App Engine flexible environment.
10210    pub cool_down_period: std::option::Option<wkt::Duration>,
10211
10212    /// Target scaling by CPU usage.
10213    pub cpu_utilization: std::option::Option<crate::model::CpuUtilization>,
10214
10215    /// Number of concurrent requests an automatic scaling instance can accept
10216    /// before the scheduler spawns a new instance.
10217    ///
10218    /// Defaults to a runtime-specific value.
10219    pub max_concurrent_requests: i32,
10220
10221    /// Maximum number of idle instances that should be maintained for this
10222    /// version.
10223    pub max_idle_instances: i32,
10224
10225    /// Maximum number of instances that should be started to handle requests for
10226    /// this version.
10227    pub max_total_instances: i32,
10228
10229    /// Maximum amount of time that a request should wait in the pending queue
10230    /// before starting a new instance to handle it.
10231    pub max_pending_latency: std::option::Option<wkt::Duration>,
10232
10233    /// Minimum number of idle instances that should be maintained for
10234    /// this version. Only applicable for the default version of a service.
10235    pub min_idle_instances: i32,
10236
10237    /// Minimum number of running instances that should be maintained for this
10238    /// version.
10239    pub min_total_instances: i32,
10240
10241    /// Minimum amount of time a request should wait in the pending queue before
10242    /// starting a new instance to handle it.
10243    pub min_pending_latency: std::option::Option<wkt::Duration>,
10244
10245    /// Target scaling by request utilization.
10246    pub request_utilization: std::option::Option<crate::model::RequestUtilization>,
10247
10248    /// Target scaling by disk usage.
10249    pub disk_utilization: std::option::Option<crate::model::DiskUtilization>,
10250
10251    /// Target scaling by network usage.
10252    pub network_utilization: std::option::Option<crate::model::NetworkUtilization>,
10253
10254    /// Scheduler settings for standard environment.
10255    pub standard_scheduler_settings: std::option::Option<crate::model::StandardSchedulerSettings>,
10256
10257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10258}
10259
10260impl AutomaticScaling {
10261    pub fn new() -> Self {
10262        std::default::Default::default()
10263    }
10264
10265    /// Sets the value of [cool_down_period][crate::model::AutomaticScaling::cool_down_period].
10266    ///
10267    /// # Example
10268    /// ```ignore,no_run
10269    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10270    /// use wkt::Duration;
10271    /// let x = AutomaticScaling::new().set_cool_down_period(Duration::default()/* use setters */);
10272    /// ```
10273    pub fn set_cool_down_period<T>(mut self, v: T) -> Self
10274    where
10275        T: std::convert::Into<wkt::Duration>,
10276    {
10277        self.cool_down_period = std::option::Option::Some(v.into());
10278        self
10279    }
10280
10281    /// Sets or clears the value of [cool_down_period][crate::model::AutomaticScaling::cool_down_period].
10282    ///
10283    /// # Example
10284    /// ```ignore,no_run
10285    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10286    /// use wkt::Duration;
10287    /// let x = AutomaticScaling::new().set_or_clear_cool_down_period(Some(Duration::default()/* use setters */));
10288    /// let x = AutomaticScaling::new().set_or_clear_cool_down_period(None::<Duration>);
10289    /// ```
10290    pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
10291    where
10292        T: std::convert::Into<wkt::Duration>,
10293    {
10294        self.cool_down_period = v.map(|x| x.into());
10295        self
10296    }
10297
10298    /// Sets the value of [cpu_utilization][crate::model::AutomaticScaling::cpu_utilization].
10299    ///
10300    /// # Example
10301    /// ```ignore,no_run
10302    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10303    /// use google_cloud_appengine_v1::model::CpuUtilization;
10304    /// let x = AutomaticScaling::new().set_cpu_utilization(CpuUtilization::default()/* use setters */);
10305    /// ```
10306    pub fn set_cpu_utilization<T>(mut self, v: T) -> Self
10307    where
10308        T: std::convert::Into<crate::model::CpuUtilization>,
10309    {
10310        self.cpu_utilization = std::option::Option::Some(v.into());
10311        self
10312    }
10313
10314    /// Sets or clears the value of [cpu_utilization][crate::model::AutomaticScaling::cpu_utilization].
10315    ///
10316    /// # Example
10317    /// ```ignore,no_run
10318    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10319    /// use google_cloud_appengine_v1::model::CpuUtilization;
10320    /// let x = AutomaticScaling::new().set_or_clear_cpu_utilization(Some(CpuUtilization::default()/* use setters */));
10321    /// let x = AutomaticScaling::new().set_or_clear_cpu_utilization(None::<CpuUtilization>);
10322    /// ```
10323    pub fn set_or_clear_cpu_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10324    where
10325        T: std::convert::Into<crate::model::CpuUtilization>,
10326    {
10327        self.cpu_utilization = v.map(|x| x.into());
10328        self
10329    }
10330
10331    /// Sets the value of [max_concurrent_requests][crate::model::AutomaticScaling::max_concurrent_requests].
10332    ///
10333    /// # Example
10334    /// ```ignore,no_run
10335    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10336    /// let x = AutomaticScaling::new().set_max_concurrent_requests(42);
10337    /// ```
10338    pub fn set_max_concurrent_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10339        self.max_concurrent_requests = v.into();
10340        self
10341    }
10342
10343    /// Sets the value of [max_idle_instances][crate::model::AutomaticScaling::max_idle_instances].
10344    ///
10345    /// # Example
10346    /// ```ignore,no_run
10347    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10348    /// let x = AutomaticScaling::new().set_max_idle_instances(42);
10349    /// ```
10350    pub fn set_max_idle_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10351        self.max_idle_instances = v.into();
10352        self
10353    }
10354
10355    /// Sets the value of [max_total_instances][crate::model::AutomaticScaling::max_total_instances].
10356    ///
10357    /// # Example
10358    /// ```ignore,no_run
10359    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10360    /// let x = AutomaticScaling::new().set_max_total_instances(42);
10361    /// ```
10362    pub fn set_max_total_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10363        self.max_total_instances = v.into();
10364        self
10365    }
10366
10367    /// Sets the value of [max_pending_latency][crate::model::AutomaticScaling::max_pending_latency].
10368    ///
10369    /// # Example
10370    /// ```ignore,no_run
10371    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10372    /// use wkt::Duration;
10373    /// let x = AutomaticScaling::new().set_max_pending_latency(Duration::default()/* use setters */);
10374    /// ```
10375    pub fn set_max_pending_latency<T>(mut self, v: T) -> Self
10376    where
10377        T: std::convert::Into<wkt::Duration>,
10378    {
10379        self.max_pending_latency = std::option::Option::Some(v.into());
10380        self
10381    }
10382
10383    /// Sets or clears the value of [max_pending_latency][crate::model::AutomaticScaling::max_pending_latency].
10384    ///
10385    /// # Example
10386    /// ```ignore,no_run
10387    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10388    /// use wkt::Duration;
10389    /// let x = AutomaticScaling::new().set_or_clear_max_pending_latency(Some(Duration::default()/* use setters */));
10390    /// let x = AutomaticScaling::new().set_or_clear_max_pending_latency(None::<Duration>);
10391    /// ```
10392    pub fn set_or_clear_max_pending_latency<T>(mut self, v: std::option::Option<T>) -> Self
10393    where
10394        T: std::convert::Into<wkt::Duration>,
10395    {
10396        self.max_pending_latency = v.map(|x| x.into());
10397        self
10398    }
10399
10400    /// Sets the value of [min_idle_instances][crate::model::AutomaticScaling::min_idle_instances].
10401    ///
10402    /// # Example
10403    /// ```ignore,no_run
10404    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10405    /// let x = AutomaticScaling::new().set_min_idle_instances(42);
10406    /// ```
10407    pub fn set_min_idle_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10408        self.min_idle_instances = v.into();
10409        self
10410    }
10411
10412    /// Sets the value of [min_total_instances][crate::model::AutomaticScaling::min_total_instances].
10413    ///
10414    /// # Example
10415    /// ```ignore,no_run
10416    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10417    /// let x = AutomaticScaling::new().set_min_total_instances(42);
10418    /// ```
10419    pub fn set_min_total_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10420        self.min_total_instances = v.into();
10421        self
10422    }
10423
10424    /// Sets the value of [min_pending_latency][crate::model::AutomaticScaling::min_pending_latency].
10425    ///
10426    /// # Example
10427    /// ```ignore,no_run
10428    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10429    /// use wkt::Duration;
10430    /// let x = AutomaticScaling::new().set_min_pending_latency(Duration::default()/* use setters */);
10431    /// ```
10432    pub fn set_min_pending_latency<T>(mut self, v: T) -> Self
10433    where
10434        T: std::convert::Into<wkt::Duration>,
10435    {
10436        self.min_pending_latency = std::option::Option::Some(v.into());
10437        self
10438    }
10439
10440    /// Sets or clears the value of [min_pending_latency][crate::model::AutomaticScaling::min_pending_latency].
10441    ///
10442    /// # Example
10443    /// ```ignore,no_run
10444    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10445    /// use wkt::Duration;
10446    /// let x = AutomaticScaling::new().set_or_clear_min_pending_latency(Some(Duration::default()/* use setters */));
10447    /// let x = AutomaticScaling::new().set_or_clear_min_pending_latency(None::<Duration>);
10448    /// ```
10449    pub fn set_or_clear_min_pending_latency<T>(mut self, v: std::option::Option<T>) -> Self
10450    where
10451        T: std::convert::Into<wkt::Duration>,
10452    {
10453        self.min_pending_latency = v.map(|x| x.into());
10454        self
10455    }
10456
10457    /// Sets the value of [request_utilization][crate::model::AutomaticScaling::request_utilization].
10458    ///
10459    /// # Example
10460    /// ```ignore,no_run
10461    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10462    /// use google_cloud_appengine_v1::model::RequestUtilization;
10463    /// let x = AutomaticScaling::new().set_request_utilization(RequestUtilization::default()/* use setters */);
10464    /// ```
10465    pub fn set_request_utilization<T>(mut self, v: T) -> Self
10466    where
10467        T: std::convert::Into<crate::model::RequestUtilization>,
10468    {
10469        self.request_utilization = std::option::Option::Some(v.into());
10470        self
10471    }
10472
10473    /// Sets or clears the value of [request_utilization][crate::model::AutomaticScaling::request_utilization].
10474    ///
10475    /// # Example
10476    /// ```ignore,no_run
10477    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10478    /// use google_cloud_appengine_v1::model::RequestUtilization;
10479    /// let x = AutomaticScaling::new().set_or_clear_request_utilization(Some(RequestUtilization::default()/* use setters */));
10480    /// let x = AutomaticScaling::new().set_or_clear_request_utilization(None::<RequestUtilization>);
10481    /// ```
10482    pub fn set_or_clear_request_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10483    where
10484        T: std::convert::Into<crate::model::RequestUtilization>,
10485    {
10486        self.request_utilization = v.map(|x| x.into());
10487        self
10488    }
10489
10490    /// Sets the value of [disk_utilization][crate::model::AutomaticScaling::disk_utilization].
10491    ///
10492    /// # Example
10493    /// ```ignore,no_run
10494    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10495    /// use google_cloud_appengine_v1::model::DiskUtilization;
10496    /// let x = AutomaticScaling::new().set_disk_utilization(DiskUtilization::default()/* use setters */);
10497    /// ```
10498    pub fn set_disk_utilization<T>(mut self, v: T) -> Self
10499    where
10500        T: std::convert::Into<crate::model::DiskUtilization>,
10501    {
10502        self.disk_utilization = std::option::Option::Some(v.into());
10503        self
10504    }
10505
10506    /// Sets or clears the value of [disk_utilization][crate::model::AutomaticScaling::disk_utilization].
10507    ///
10508    /// # Example
10509    /// ```ignore,no_run
10510    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10511    /// use google_cloud_appengine_v1::model::DiskUtilization;
10512    /// let x = AutomaticScaling::new().set_or_clear_disk_utilization(Some(DiskUtilization::default()/* use setters */));
10513    /// let x = AutomaticScaling::new().set_or_clear_disk_utilization(None::<DiskUtilization>);
10514    /// ```
10515    pub fn set_or_clear_disk_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10516    where
10517        T: std::convert::Into<crate::model::DiskUtilization>,
10518    {
10519        self.disk_utilization = v.map(|x| x.into());
10520        self
10521    }
10522
10523    /// Sets the value of [network_utilization][crate::model::AutomaticScaling::network_utilization].
10524    ///
10525    /// # Example
10526    /// ```ignore,no_run
10527    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10528    /// use google_cloud_appengine_v1::model::NetworkUtilization;
10529    /// let x = AutomaticScaling::new().set_network_utilization(NetworkUtilization::default()/* use setters */);
10530    /// ```
10531    pub fn set_network_utilization<T>(mut self, v: T) -> Self
10532    where
10533        T: std::convert::Into<crate::model::NetworkUtilization>,
10534    {
10535        self.network_utilization = std::option::Option::Some(v.into());
10536        self
10537    }
10538
10539    /// Sets or clears the value of [network_utilization][crate::model::AutomaticScaling::network_utilization].
10540    ///
10541    /// # Example
10542    /// ```ignore,no_run
10543    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10544    /// use google_cloud_appengine_v1::model::NetworkUtilization;
10545    /// let x = AutomaticScaling::new().set_or_clear_network_utilization(Some(NetworkUtilization::default()/* use setters */));
10546    /// let x = AutomaticScaling::new().set_or_clear_network_utilization(None::<NetworkUtilization>);
10547    /// ```
10548    pub fn set_or_clear_network_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10549    where
10550        T: std::convert::Into<crate::model::NetworkUtilization>,
10551    {
10552        self.network_utilization = v.map(|x| x.into());
10553        self
10554    }
10555
10556    /// Sets the value of [standard_scheduler_settings][crate::model::AutomaticScaling::standard_scheduler_settings].
10557    ///
10558    /// # Example
10559    /// ```ignore,no_run
10560    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10561    /// use google_cloud_appengine_v1::model::StandardSchedulerSettings;
10562    /// let x = AutomaticScaling::new().set_standard_scheduler_settings(StandardSchedulerSettings::default()/* use setters */);
10563    /// ```
10564    pub fn set_standard_scheduler_settings<T>(mut self, v: T) -> Self
10565    where
10566        T: std::convert::Into<crate::model::StandardSchedulerSettings>,
10567    {
10568        self.standard_scheduler_settings = std::option::Option::Some(v.into());
10569        self
10570    }
10571
10572    /// Sets or clears the value of [standard_scheduler_settings][crate::model::AutomaticScaling::standard_scheduler_settings].
10573    ///
10574    /// # Example
10575    /// ```ignore,no_run
10576    /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10577    /// use google_cloud_appengine_v1::model::StandardSchedulerSettings;
10578    /// let x = AutomaticScaling::new().set_or_clear_standard_scheduler_settings(Some(StandardSchedulerSettings::default()/* use setters */));
10579    /// let x = AutomaticScaling::new().set_or_clear_standard_scheduler_settings(None::<StandardSchedulerSettings>);
10580    /// ```
10581    pub fn set_or_clear_standard_scheduler_settings<T>(mut self, v: std::option::Option<T>) -> Self
10582    where
10583        T: std::convert::Into<crate::model::StandardSchedulerSettings>,
10584    {
10585        self.standard_scheduler_settings = v.map(|x| x.into());
10586        self
10587    }
10588}
10589
10590impl wkt::message::Message for AutomaticScaling {
10591    fn typename() -> &'static str {
10592        "type.googleapis.com/google.appengine.v1.AutomaticScaling"
10593    }
10594}
10595
10596/// A service with basic scaling will create an instance when the application
10597/// receives a request. The instance will be turned down when the app becomes
10598/// idle. Basic scaling is ideal for work that is intermittent or driven by
10599/// user activity.
10600#[derive(Clone, Default, PartialEq)]
10601#[non_exhaustive]
10602pub struct BasicScaling {
10603    /// Duration of time after the last request that an instance must wait before
10604    /// the instance is shut down.
10605    pub idle_timeout: std::option::Option<wkt::Duration>,
10606
10607    /// Maximum number of instances to create for this version.
10608    pub max_instances: i32,
10609
10610    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10611}
10612
10613impl BasicScaling {
10614    pub fn new() -> Self {
10615        std::default::Default::default()
10616    }
10617
10618    /// Sets the value of [idle_timeout][crate::model::BasicScaling::idle_timeout].
10619    ///
10620    /// # Example
10621    /// ```ignore,no_run
10622    /// # use google_cloud_appengine_v1::model::BasicScaling;
10623    /// use wkt::Duration;
10624    /// let x = BasicScaling::new().set_idle_timeout(Duration::default()/* use setters */);
10625    /// ```
10626    pub fn set_idle_timeout<T>(mut self, v: T) -> Self
10627    where
10628        T: std::convert::Into<wkt::Duration>,
10629    {
10630        self.idle_timeout = std::option::Option::Some(v.into());
10631        self
10632    }
10633
10634    /// Sets or clears the value of [idle_timeout][crate::model::BasicScaling::idle_timeout].
10635    ///
10636    /// # Example
10637    /// ```ignore,no_run
10638    /// # use google_cloud_appengine_v1::model::BasicScaling;
10639    /// use wkt::Duration;
10640    /// let x = BasicScaling::new().set_or_clear_idle_timeout(Some(Duration::default()/* use setters */));
10641    /// let x = BasicScaling::new().set_or_clear_idle_timeout(None::<Duration>);
10642    /// ```
10643    pub fn set_or_clear_idle_timeout<T>(mut self, v: std::option::Option<T>) -> Self
10644    where
10645        T: std::convert::Into<wkt::Duration>,
10646    {
10647        self.idle_timeout = v.map(|x| x.into());
10648        self
10649    }
10650
10651    /// Sets the value of [max_instances][crate::model::BasicScaling::max_instances].
10652    ///
10653    /// # Example
10654    /// ```ignore,no_run
10655    /// # use google_cloud_appengine_v1::model::BasicScaling;
10656    /// let x = BasicScaling::new().set_max_instances(42);
10657    /// ```
10658    pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10659        self.max_instances = v.into();
10660        self
10661    }
10662}
10663
10664impl wkt::message::Message for BasicScaling {
10665    fn typename() -> &'static str {
10666        "type.googleapis.com/google.appengine.v1.BasicScaling"
10667    }
10668}
10669
10670/// A service with manual scaling runs continuously, allowing you to perform
10671/// complex initialization and rely on the state of its memory over time.
10672#[derive(Clone, Default, PartialEq)]
10673#[non_exhaustive]
10674pub struct ManualScaling {
10675    /// Number of instances to assign to the service at the start. This number
10676    /// can later be altered by using the
10677    /// [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions)
10678    /// `set_num_instances()` function.
10679    pub instances: i32,
10680
10681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10682}
10683
10684impl ManualScaling {
10685    pub fn new() -> Self {
10686        std::default::Default::default()
10687    }
10688
10689    /// Sets the value of [instances][crate::model::ManualScaling::instances].
10690    ///
10691    /// # Example
10692    /// ```ignore,no_run
10693    /// # use google_cloud_appengine_v1::model::ManualScaling;
10694    /// let x = ManualScaling::new().set_instances(42);
10695    /// ```
10696    pub fn set_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10697        self.instances = v.into();
10698        self
10699    }
10700}
10701
10702impl wkt::message::Message for ManualScaling {
10703    fn typename() -> &'static str {
10704        "type.googleapis.com/google.appengine.v1.ManualScaling"
10705    }
10706}
10707
10708/// Target scaling by CPU usage.
10709#[derive(Clone, Default, PartialEq)]
10710#[non_exhaustive]
10711pub struct CpuUtilization {
10712    /// Period of time over which CPU utilization is calculated.
10713    pub aggregation_window_length: std::option::Option<wkt::Duration>,
10714
10715    /// Target CPU utilization ratio to maintain when scaling. Must be between 0
10716    /// and 1.
10717    pub target_utilization: f64,
10718
10719    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10720}
10721
10722impl CpuUtilization {
10723    pub fn new() -> Self {
10724        std::default::Default::default()
10725    }
10726
10727    /// Sets the value of [aggregation_window_length][crate::model::CpuUtilization::aggregation_window_length].
10728    ///
10729    /// # Example
10730    /// ```ignore,no_run
10731    /// # use google_cloud_appengine_v1::model::CpuUtilization;
10732    /// use wkt::Duration;
10733    /// let x = CpuUtilization::new().set_aggregation_window_length(Duration::default()/* use setters */);
10734    /// ```
10735    pub fn set_aggregation_window_length<T>(mut self, v: T) -> Self
10736    where
10737        T: std::convert::Into<wkt::Duration>,
10738    {
10739        self.aggregation_window_length = std::option::Option::Some(v.into());
10740        self
10741    }
10742
10743    /// Sets or clears the value of [aggregation_window_length][crate::model::CpuUtilization::aggregation_window_length].
10744    ///
10745    /// # Example
10746    /// ```ignore,no_run
10747    /// # use google_cloud_appengine_v1::model::CpuUtilization;
10748    /// use wkt::Duration;
10749    /// let x = CpuUtilization::new().set_or_clear_aggregation_window_length(Some(Duration::default()/* use setters */));
10750    /// let x = CpuUtilization::new().set_or_clear_aggregation_window_length(None::<Duration>);
10751    /// ```
10752    pub fn set_or_clear_aggregation_window_length<T>(mut self, v: std::option::Option<T>) -> Self
10753    where
10754        T: std::convert::Into<wkt::Duration>,
10755    {
10756        self.aggregation_window_length = v.map(|x| x.into());
10757        self
10758    }
10759
10760    /// Sets the value of [target_utilization][crate::model::CpuUtilization::target_utilization].
10761    ///
10762    /// # Example
10763    /// ```ignore,no_run
10764    /// # use google_cloud_appengine_v1::model::CpuUtilization;
10765    /// let x = CpuUtilization::new().set_target_utilization(42.0);
10766    /// ```
10767    pub fn set_target_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10768        self.target_utilization = v.into();
10769        self
10770    }
10771}
10772
10773impl wkt::message::Message for CpuUtilization {
10774    fn typename() -> &'static str {
10775        "type.googleapis.com/google.appengine.v1.CpuUtilization"
10776    }
10777}
10778
10779/// Target scaling by request utilization.
10780/// Only applicable in the App Engine flexible environment.
10781#[derive(Clone, Default, PartialEq)]
10782#[non_exhaustive]
10783pub struct RequestUtilization {
10784    /// Target requests per second.
10785    pub target_request_count_per_second: i32,
10786
10787    /// Target number of concurrent requests.
10788    pub target_concurrent_requests: i32,
10789
10790    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10791}
10792
10793impl RequestUtilization {
10794    pub fn new() -> Self {
10795        std::default::Default::default()
10796    }
10797
10798    /// Sets the value of [target_request_count_per_second][crate::model::RequestUtilization::target_request_count_per_second].
10799    ///
10800    /// # Example
10801    /// ```ignore,no_run
10802    /// # use google_cloud_appengine_v1::model::RequestUtilization;
10803    /// let x = RequestUtilization::new().set_target_request_count_per_second(42);
10804    /// ```
10805    pub fn set_target_request_count_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10806        self.target_request_count_per_second = v.into();
10807        self
10808    }
10809
10810    /// Sets the value of [target_concurrent_requests][crate::model::RequestUtilization::target_concurrent_requests].
10811    ///
10812    /// # Example
10813    /// ```ignore,no_run
10814    /// # use google_cloud_appengine_v1::model::RequestUtilization;
10815    /// let x = RequestUtilization::new().set_target_concurrent_requests(42);
10816    /// ```
10817    pub fn set_target_concurrent_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10818        self.target_concurrent_requests = v.into();
10819        self
10820    }
10821}
10822
10823impl wkt::message::Message for RequestUtilization {
10824    fn typename() -> &'static str {
10825        "type.googleapis.com/google.appengine.v1.RequestUtilization"
10826    }
10827}
10828
10829/// Target scaling by disk usage.
10830/// Only applicable in the App Engine flexible environment.
10831#[derive(Clone, Default, PartialEq)]
10832#[non_exhaustive]
10833pub struct DiskUtilization {
10834    /// Target bytes written per second.
10835    pub target_write_bytes_per_second: i32,
10836
10837    /// Target ops written per second.
10838    pub target_write_ops_per_second: i32,
10839
10840    /// Target bytes read per second.
10841    pub target_read_bytes_per_second: i32,
10842
10843    /// Target ops read per seconds.
10844    pub target_read_ops_per_second: i32,
10845
10846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10847}
10848
10849impl DiskUtilization {
10850    pub fn new() -> Self {
10851        std::default::Default::default()
10852    }
10853
10854    /// Sets the value of [target_write_bytes_per_second][crate::model::DiskUtilization::target_write_bytes_per_second].
10855    ///
10856    /// # Example
10857    /// ```ignore,no_run
10858    /// # use google_cloud_appengine_v1::model::DiskUtilization;
10859    /// let x = DiskUtilization::new().set_target_write_bytes_per_second(42);
10860    /// ```
10861    pub fn set_target_write_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10862        self.target_write_bytes_per_second = v.into();
10863        self
10864    }
10865
10866    /// Sets the value of [target_write_ops_per_second][crate::model::DiskUtilization::target_write_ops_per_second].
10867    ///
10868    /// # Example
10869    /// ```ignore,no_run
10870    /// # use google_cloud_appengine_v1::model::DiskUtilization;
10871    /// let x = DiskUtilization::new().set_target_write_ops_per_second(42);
10872    /// ```
10873    pub fn set_target_write_ops_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10874        self.target_write_ops_per_second = v.into();
10875        self
10876    }
10877
10878    /// Sets the value of [target_read_bytes_per_second][crate::model::DiskUtilization::target_read_bytes_per_second].
10879    ///
10880    /// # Example
10881    /// ```ignore,no_run
10882    /// # use google_cloud_appengine_v1::model::DiskUtilization;
10883    /// let x = DiskUtilization::new().set_target_read_bytes_per_second(42);
10884    /// ```
10885    pub fn set_target_read_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10886        self.target_read_bytes_per_second = v.into();
10887        self
10888    }
10889
10890    /// Sets the value of [target_read_ops_per_second][crate::model::DiskUtilization::target_read_ops_per_second].
10891    ///
10892    /// # Example
10893    /// ```ignore,no_run
10894    /// # use google_cloud_appengine_v1::model::DiskUtilization;
10895    /// let x = DiskUtilization::new().set_target_read_ops_per_second(42);
10896    /// ```
10897    pub fn set_target_read_ops_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10898        self.target_read_ops_per_second = v.into();
10899        self
10900    }
10901}
10902
10903impl wkt::message::Message for DiskUtilization {
10904    fn typename() -> &'static str {
10905        "type.googleapis.com/google.appengine.v1.DiskUtilization"
10906    }
10907}
10908
10909/// Target scaling by network usage.
10910/// Only applicable in the App Engine flexible environment.
10911#[derive(Clone, Default, PartialEq)]
10912#[non_exhaustive]
10913pub struct NetworkUtilization {
10914    /// Target bytes sent per second.
10915    pub target_sent_bytes_per_second: i32,
10916
10917    /// Target packets sent per second.
10918    pub target_sent_packets_per_second: i32,
10919
10920    /// Target bytes received per second.
10921    pub target_received_bytes_per_second: i32,
10922
10923    /// Target packets received per second.
10924    pub target_received_packets_per_second: i32,
10925
10926    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10927}
10928
10929impl NetworkUtilization {
10930    pub fn new() -> Self {
10931        std::default::Default::default()
10932    }
10933
10934    /// Sets the value of [target_sent_bytes_per_second][crate::model::NetworkUtilization::target_sent_bytes_per_second].
10935    ///
10936    /// # Example
10937    /// ```ignore,no_run
10938    /// # use google_cloud_appengine_v1::model::NetworkUtilization;
10939    /// let x = NetworkUtilization::new().set_target_sent_bytes_per_second(42);
10940    /// ```
10941    pub fn set_target_sent_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10942        self.target_sent_bytes_per_second = v.into();
10943        self
10944    }
10945
10946    /// Sets the value of [target_sent_packets_per_second][crate::model::NetworkUtilization::target_sent_packets_per_second].
10947    ///
10948    /// # Example
10949    /// ```ignore,no_run
10950    /// # use google_cloud_appengine_v1::model::NetworkUtilization;
10951    /// let x = NetworkUtilization::new().set_target_sent_packets_per_second(42);
10952    /// ```
10953    pub fn set_target_sent_packets_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10954        self.target_sent_packets_per_second = v.into();
10955        self
10956    }
10957
10958    /// Sets the value of [target_received_bytes_per_second][crate::model::NetworkUtilization::target_received_bytes_per_second].
10959    ///
10960    /// # Example
10961    /// ```ignore,no_run
10962    /// # use google_cloud_appengine_v1::model::NetworkUtilization;
10963    /// let x = NetworkUtilization::new().set_target_received_bytes_per_second(42);
10964    /// ```
10965    pub fn set_target_received_bytes_per_second<T: std::convert::Into<i32>>(
10966        mut self,
10967        v: T,
10968    ) -> Self {
10969        self.target_received_bytes_per_second = v.into();
10970        self
10971    }
10972
10973    /// Sets the value of [target_received_packets_per_second][crate::model::NetworkUtilization::target_received_packets_per_second].
10974    ///
10975    /// # Example
10976    /// ```ignore,no_run
10977    /// # use google_cloud_appengine_v1::model::NetworkUtilization;
10978    /// let x = NetworkUtilization::new().set_target_received_packets_per_second(42);
10979    /// ```
10980    pub fn set_target_received_packets_per_second<T: std::convert::Into<i32>>(
10981        mut self,
10982        v: T,
10983    ) -> Self {
10984        self.target_received_packets_per_second = v.into();
10985        self
10986    }
10987}
10988
10989impl wkt::message::Message for NetworkUtilization {
10990    fn typename() -> &'static str {
10991        "type.googleapis.com/google.appengine.v1.NetworkUtilization"
10992    }
10993}
10994
10995/// Scheduler settings for standard environment.
10996#[derive(Clone, Default, PartialEq)]
10997#[non_exhaustive]
10998pub struct StandardSchedulerSettings {
10999    /// Target CPU utilization ratio to maintain when scaling.
11000    pub target_cpu_utilization: f64,
11001
11002    /// Target throughput utilization ratio to maintain when scaling
11003    pub target_throughput_utilization: f64,
11004
11005    /// Minimum number of instances to run for this version. Set to zero to disable
11006    /// `min_instances` configuration.
11007    pub min_instances: i32,
11008
11009    /// Maximum number of instances to run for this version. Set to zero to disable
11010    /// `max_instances` configuration.
11011    pub max_instances: i32,
11012
11013    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11014}
11015
11016impl StandardSchedulerSettings {
11017    pub fn new() -> Self {
11018        std::default::Default::default()
11019    }
11020
11021    /// Sets the value of [target_cpu_utilization][crate::model::StandardSchedulerSettings::target_cpu_utilization].
11022    ///
11023    /// # Example
11024    /// ```ignore,no_run
11025    /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11026    /// let x = StandardSchedulerSettings::new().set_target_cpu_utilization(42.0);
11027    /// ```
11028    pub fn set_target_cpu_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11029        self.target_cpu_utilization = v.into();
11030        self
11031    }
11032
11033    /// Sets the value of [target_throughput_utilization][crate::model::StandardSchedulerSettings::target_throughput_utilization].
11034    ///
11035    /// # Example
11036    /// ```ignore,no_run
11037    /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11038    /// let x = StandardSchedulerSettings::new().set_target_throughput_utilization(42.0);
11039    /// ```
11040    pub fn set_target_throughput_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11041        self.target_throughput_utilization = v.into();
11042        self
11043    }
11044
11045    /// Sets the value of [min_instances][crate::model::StandardSchedulerSettings::min_instances].
11046    ///
11047    /// # Example
11048    /// ```ignore,no_run
11049    /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11050    /// let x = StandardSchedulerSettings::new().set_min_instances(42);
11051    /// ```
11052    pub fn set_min_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11053        self.min_instances = v.into();
11054        self
11055    }
11056
11057    /// Sets the value of [max_instances][crate::model::StandardSchedulerSettings::max_instances].
11058    ///
11059    /// # Example
11060    /// ```ignore,no_run
11061    /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11062    /// let x = StandardSchedulerSettings::new().set_max_instances(42);
11063    /// ```
11064    pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11065        self.max_instances = v.into();
11066        self
11067    }
11068}
11069
11070impl wkt::message::Message for StandardSchedulerSettings {
11071    fn typename() -> &'static str {
11072        "type.googleapis.com/google.appengine.v1.StandardSchedulerSettings"
11073    }
11074}
11075
11076/// Extra network settings.
11077/// Only applicable in the App Engine flexible environment.
11078#[derive(Clone, Default, PartialEq)]
11079#[non_exhaustive]
11080pub struct Network {
11081    /// List of ports, or port pairs, to forward from the virtual machine to the
11082    /// application container.
11083    /// Only applicable in the App Engine flexible environment.
11084    pub forwarded_ports: std::vec::Vec<std::string::String>,
11085
11086    /// Tag to apply to the instance during creation.
11087    /// Only applicable in the App Engine flexible environment.
11088    pub instance_tag: std::string::String,
11089
11090    /// Google Compute Engine network where the virtual machines are created.
11091    /// Specify the short name, not the resource path.
11092    ///
11093    /// Defaults to `default`.
11094    pub name: std::string::String,
11095
11096    /// Google Cloud Platform sub-network where the virtual machines are created.
11097    /// Specify the short name, not the resource path.
11098    ///
11099    /// If a subnetwork name is specified, a network name will also be required
11100    /// unless it is for the default network.
11101    ///
11102    /// * If the network that the instance is being created in is a Legacy network,
11103    ///   then the IP address is allocated from the IPv4Range.
11104    /// * If the network that the instance is being created in is an auto Subnet
11105    ///   Mode Network, then only network name should be specified (not the
11106    ///   subnetwork_name) and the IP address is created from the IPCidrRange of the
11107    ///   subnetwork that exists in that zone for that network.
11108    /// * If the network that the instance is being created in is a custom Subnet
11109    ///   Mode Network, then the subnetwork_name must be specified and the
11110    ///   IP address is created from the IPCidrRange of the subnetwork.
11111    ///
11112    /// If specified, the subnetwork must exist in the same region as the
11113    /// App Engine flexible environment application.
11114    pub subnetwork_name: std::string::String,
11115
11116    /// Enable session affinity.
11117    /// Only applicable in the App Engine flexible environment.
11118    pub session_affinity: bool,
11119
11120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11121}
11122
11123impl Network {
11124    pub fn new() -> Self {
11125        std::default::Default::default()
11126    }
11127
11128    /// Sets the value of [forwarded_ports][crate::model::Network::forwarded_ports].
11129    ///
11130    /// # Example
11131    /// ```ignore,no_run
11132    /// # use google_cloud_appengine_v1::model::Network;
11133    /// let x = Network::new().set_forwarded_ports(["a", "b", "c"]);
11134    /// ```
11135    pub fn set_forwarded_ports<T, V>(mut self, v: T) -> Self
11136    where
11137        T: std::iter::IntoIterator<Item = V>,
11138        V: std::convert::Into<std::string::String>,
11139    {
11140        use std::iter::Iterator;
11141        self.forwarded_ports = v.into_iter().map(|i| i.into()).collect();
11142        self
11143    }
11144
11145    /// Sets the value of [instance_tag][crate::model::Network::instance_tag].
11146    ///
11147    /// # Example
11148    /// ```ignore,no_run
11149    /// # use google_cloud_appengine_v1::model::Network;
11150    /// let x = Network::new().set_instance_tag("example");
11151    /// ```
11152    pub fn set_instance_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11153        self.instance_tag = v.into();
11154        self
11155    }
11156
11157    /// Sets the value of [name][crate::model::Network::name].
11158    ///
11159    /// # Example
11160    /// ```ignore,no_run
11161    /// # use google_cloud_appengine_v1::model::Network;
11162    /// let x = Network::new().set_name("example");
11163    /// ```
11164    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11165        self.name = v.into();
11166        self
11167    }
11168
11169    /// Sets the value of [subnetwork_name][crate::model::Network::subnetwork_name].
11170    ///
11171    /// # Example
11172    /// ```ignore,no_run
11173    /// # use google_cloud_appengine_v1::model::Network;
11174    /// let x = Network::new().set_subnetwork_name("example");
11175    /// ```
11176    pub fn set_subnetwork_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11177        self.subnetwork_name = v.into();
11178        self
11179    }
11180
11181    /// Sets the value of [session_affinity][crate::model::Network::session_affinity].
11182    ///
11183    /// # Example
11184    /// ```ignore,no_run
11185    /// # use google_cloud_appengine_v1::model::Network;
11186    /// let x = Network::new().set_session_affinity(true);
11187    /// ```
11188    pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11189        self.session_affinity = v.into();
11190        self
11191    }
11192}
11193
11194impl wkt::message::Message for Network {
11195    fn typename() -> &'static str {
11196        "type.googleapis.com/google.appengine.v1.Network"
11197    }
11198}
11199
11200/// Volumes mounted within the app container.
11201/// Only applicable in the App Engine flexible environment.
11202#[derive(Clone, Default, PartialEq)]
11203#[non_exhaustive]
11204pub struct Volume {
11205    /// Unique name for the volume.
11206    pub name: std::string::String,
11207
11208    /// Underlying volume type, e.g. 'tmpfs'.
11209    pub volume_type: std::string::String,
11210
11211    /// Volume size in gigabytes.
11212    pub size_gb: f64,
11213
11214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11215}
11216
11217impl Volume {
11218    pub fn new() -> Self {
11219        std::default::Default::default()
11220    }
11221
11222    /// Sets the value of [name][crate::model::Volume::name].
11223    ///
11224    /// # Example
11225    /// ```ignore,no_run
11226    /// # use google_cloud_appengine_v1::model::Volume;
11227    /// let x = Volume::new().set_name("example");
11228    /// ```
11229    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11230        self.name = v.into();
11231        self
11232    }
11233
11234    /// Sets the value of [volume_type][crate::model::Volume::volume_type].
11235    ///
11236    /// # Example
11237    /// ```ignore,no_run
11238    /// # use google_cloud_appengine_v1::model::Volume;
11239    /// let x = Volume::new().set_volume_type("example");
11240    /// ```
11241    pub fn set_volume_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11242        self.volume_type = v.into();
11243        self
11244    }
11245
11246    /// Sets the value of [size_gb][crate::model::Volume::size_gb].
11247    ///
11248    /// # Example
11249    /// ```ignore,no_run
11250    /// # use google_cloud_appengine_v1::model::Volume;
11251    /// let x = Volume::new().set_size_gb(42.0);
11252    /// ```
11253    pub fn set_size_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11254        self.size_gb = v.into();
11255        self
11256    }
11257}
11258
11259impl wkt::message::Message for Volume {
11260    fn typename() -> &'static str {
11261        "type.googleapis.com/google.appengine.v1.Volume"
11262    }
11263}
11264
11265/// Machine resources for a version.
11266#[derive(Clone, Default, PartialEq)]
11267#[non_exhaustive]
11268pub struct Resources {
11269    /// Number of CPU cores needed.
11270    pub cpu: f64,
11271
11272    /// Disk size (GB) needed.
11273    pub disk_gb: f64,
11274
11275    /// Memory (GB) needed.
11276    pub memory_gb: f64,
11277
11278    /// User specified volumes.
11279    pub volumes: std::vec::Vec<crate::model::Volume>,
11280
11281    /// The name of the encryption key that is stored in Google Cloud KMS.
11282    /// Only should be used by Cloud Composer to encrypt the vm disk
11283    pub kms_key_reference: std::string::String,
11284
11285    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11286}
11287
11288impl Resources {
11289    pub fn new() -> Self {
11290        std::default::Default::default()
11291    }
11292
11293    /// Sets the value of [cpu][crate::model::Resources::cpu].
11294    ///
11295    /// # Example
11296    /// ```ignore,no_run
11297    /// # use google_cloud_appengine_v1::model::Resources;
11298    /// let x = Resources::new().set_cpu(42.0);
11299    /// ```
11300    pub fn set_cpu<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11301        self.cpu = v.into();
11302        self
11303    }
11304
11305    /// Sets the value of [disk_gb][crate::model::Resources::disk_gb].
11306    ///
11307    /// # Example
11308    /// ```ignore,no_run
11309    /// # use google_cloud_appengine_v1::model::Resources;
11310    /// let x = Resources::new().set_disk_gb(42.0);
11311    /// ```
11312    pub fn set_disk_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11313        self.disk_gb = v.into();
11314        self
11315    }
11316
11317    /// Sets the value of [memory_gb][crate::model::Resources::memory_gb].
11318    ///
11319    /// # Example
11320    /// ```ignore,no_run
11321    /// # use google_cloud_appengine_v1::model::Resources;
11322    /// let x = Resources::new().set_memory_gb(42.0);
11323    /// ```
11324    pub fn set_memory_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11325        self.memory_gb = v.into();
11326        self
11327    }
11328
11329    /// Sets the value of [volumes][crate::model::Resources::volumes].
11330    ///
11331    /// # Example
11332    /// ```ignore,no_run
11333    /// # use google_cloud_appengine_v1::model::Resources;
11334    /// use google_cloud_appengine_v1::model::Volume;
11335    /// let x = Resources::new()
11336    ///     .set_volumes([
11337    ///         Volume::default()/* use setters */,
11338    ///         Volume::default()/* use (different) setters */,
11339    ///     ]);
11340    /// ```
11341    pub fn set_volumes<T, V>(mut self, v: T) -> Self
11342    where
11343        T: std::iter::IntoIterator<Item = V>,
11344        V: std::convert::Into<crate::model::Volume>,
11345    {
11346        use std::iter::Iterator;
11347        self.volumes = v.into_iter().map(|i| i.into()).collect();
11348        self
11349    }
11350
11351    /// Sets the value of [kms_key_reference][crate::model::Resources::kms_key_reference].
11352    ///
11353    /// # Example
11354    /// ```ignore,no_run
11355    /// # use google_cloud_appengine_v1::model::Resources;
11356    /// let x = Resources::new().set_kms_key_reference("example");
11357    /// ```
11358    pub fn set_kms_key_reference<T: std::convert::Into<std::string::String>>(
11359        mut self,
11360        v: T,
11361    ) -> Self {
11362        self.kms_key_reference = v.into();
11363        self
11364    }
11365}
11366
11367impl wkt::message::Message for Resources {
11368    fn typename() -> &'static str {
11369        "type.googleapis.com/google.appengine.v1.Resources"
11370    }
11371}
11372
11373/// VPC access connector specification.
11374#[derive(Clone, Default, PartialEq)]
11375#[non_exhaustive]
11376pub struct VpcAccessConnector {
11377    /// Full Serverless VPC Access Connector name e.g.
11378    /// /projects/my-project/locations/us-central1/connectors/c1.
11379    pub name: std::string::String,
11380
11381    /// The egress setting for the connector, controlling what traffic is diverted
11382    /// through it.
11383    pub egress_setting: crate::model::vpc_access_connector::EgressSetting,
11384
11385    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11386}
11387
11388impl VpcAccessConnector {
11389    pub fn new() -> Self {
11390        std::default::Default::default()
11391    }
11392
11393    /// Sets the value of [name][crate::model::VpcAccessConnector::name].
11394    ///
11395    /// # Example
11396    /// ```ignore,no_run
11397    /// # use google_cloud_appengine_v1::model::VpcAccessConnector;
11398    /// let x = VpcAccessConnector::new().set_name("example");
11399    /// ```
11400    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11401        self.name = v.into();
11402        self
11403    }
11404
11405    /// Sets the value of [egress_setting][crate::model::VpcAccessConnector::egress_setting].
11406    ///
11407    /// # Example
11408    /// ```ignore,no_run
11409    /// # use google_cloud_appengine_v1::model::VpcAccessConnector;
11410    /// use google_cloud_appengine_v1::model::vpc_access_connector::EgressSetting;
11411    /// let x0 = VpcAccessConnector::new().set_egress_setting(EgressSetting::AllTraffic);
11412    /// let x1 = VpcAccessConnector::new().set_egress_setting(EgressSetting::PrivateIpRanges);
11413    /// ```
11414    pub fn set_egress_setting<
11415        T: std::convert::Into<crate::model::vpc_access_connector::EgressSetting>,
11416    >(
11417        mut self,
11418        v: T,
11419    ) -> Self {
11420        self.egress_setting = v.into();
11421        self
11422    }
11423}
11424
11425impl wkt::message::Message for VpcAccessConnector {
11426    fn typename() -> &'static str {
11427        "type.googleapis.com/google.appengine.v1.VpcAccessConnector"
11428    }
11429}
11430
11431/// Defines additional types related to [VpcAccessConnector].
11432pub mod vpc_access_connector {
11433    #[allow(unused_imports)]
11434    use super::*;
11435
11436    /// Available egress settings.
11437    ///
11438    /// This controls what traffic is diverted through the VPC Access Connector
11439    /// resource. By default PRIVATE_IP_RANGES will be used.
11440    ///
11441    /// # Working with unknown values
11442    ///
11443    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11444    /// additional enum variants at any time. Adding new variants is not considered
11445    /// a breaking change. Applications should write their code in anticipation of:
11446    ///
11447    /// - New values appearing in future releases of the client library, **and**
11448    /// - New values received dynamically, without application changes.
11449    ///
11450    /// Please consult the [Working with enums] section in the user guide for some
11451    /// guidelines.
11452    ///
11453    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11454    #[derive(Clone, Debug, PartialEq)]
11455    #[non_exhaustive]
11456    pub enum EgressSetting {
11457        Unspecified,
11458        /// Force the use of VPC Access for all egress traffic from the function.
11459        AllTraffic,
11460        /// Use the VPC Access Connector for private IP space from RFC1918.
11461        PrivateIpRanges,
11462        /// If set, the enum was initialized with an unknown value.
11463        ///
11464        /// Applications can examine the value using [EgressSetting::value] or
11465        /// [EgressSetting::name].
11466        UnknownValue(egress_setting::UnknownValue),
11467    }
11468
11469    #[doc(hidden)]
11470    pub mod egress_setting {
11471        #[allow(unused_imports)]
11472        use super::*;
11473        #[derive(Clone, Debug, PartialEq)]
11474        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11475    }
11476
11477    impl EgressSetting {
11478        /// Gets the enum value.
11479        ///
11480        /// Returns `None` if the enum contains an unknown value deserialized from
11481        /// the string representation of enums.
11482        pub fn value(&self) -> std::option::Option<i32> {
11483            match self {
11484                Self::Unspecified => std::option::Option::Some(0),
11485                Self::AllTraffic => std::option::Option::Some(1),
11486                Self::PrivateIpRanges => std::option::Option::Some(2),
11487                Self::UnknownValue(u) => u.0.value(),
11488            }
11489        }
11490
11491        /// Gets the enum value as a string.
11492        ///
11493        /// Returns `None` if the enum contains an unknown value deserialized from
11494        /// the integer representation of enums.
11495        pub fn name(&self) -> std::option::Option<&str> {
11496            match self {
11497                Self::Unspecified => std::option::Option::Some("EGRESS_SETTING_UNSPECIFIED"),
11498                Self::AllTraffic => std::option::Option::Some("ALL_TRAFFIC"),
11499                Self::PrivateIpRanges => std::option::Option::Some("PRIVATE_IP_RANGES"),
11500                Self::UnknownValue(u) => u.0.name(),
11501            }
11502        }
11503    }
11504
11505    impl std::default::Default for EgressSetting {
11506        fn default() -> Self {
11507            use std::convert::From;
11508            Self::from(0)
11509        }
11510    }
11511
11512    impl std::fmt::Display for EgressSetting {
11513        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11514            wkt::internal::display_enum(f, self.name(), self.value())
11515        }
11516    }
11517
11518    impl std::convert::From<i32> for EgressSetting {
11519        fn from(value: i32) -> Self {
11520            match value {
11521                0 => Self::Unspecified,
11522                1 => Self::AllTraffic,
11523                2 => Self::PrivateIpRanges,
11524                _ => Self::UnknownValue(egress_setting::UnknownValue(
11525                    wkt::internal::UnknownEnumValue::Integer(value),
11526                )),
11527            }
11528        }
11529    }
11530
11531    impl std::convert::From<&str> for EgressSetting {
11532        fn from(value: &str) -> Self {
11533            use std::string::ToString;
11534            match value {
11535                "EGRESS_SETTING_UNSPECIFIED" => Self::Unspecified,
11536                "ALL_TRAFFIC" => Self::AllTraffic,
11537                "PRIVATE_IP_RANGES" => Self::PrivateIpRanges,
11538                _ => Self::UnknownValue(egress_setting::UnknownValue(
11539                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11540                )),
11541            }
11542        }
11543    }
11544
11545    impl serde::ser::Serialize for EgressSetting {
11546        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11547        where
11548            S: serde::Serializer,
11549        {
11550            match self {
11551                Self::Unspecified => serializer.serialize_i32(0),
11552                Self::AllTraffic => serializer.serialize_i32(1),
11553                Self::PrivateIpRanges => serializer.serialize_i32(2),
11554                Self::UnknownValue(u) => u.0.serialize(serializer),
11555            }
11556        }
11557    }
11558
11559    impl<'de> serde::de::Deserialize<'de> for EgressSetting {
11560        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11561        where
11562            D: serde::Deserializer<'de>,
11563        {
11564            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EgressSetting>::new(
11565                ".google.appengine.v1.VpcAccessConnector.EgressSetting",
11566            ))
11567        }
11568    }
11569}
11570
11571/// The entrypoint for the application.
11572#[derive(Clone, Default, PartialEq)]
11573#[non_exhaustive]
11574pub struct Entrypoint {
11575    /// The command to run.
11576    pub command: std::option::Option<crate::model::entrypoint::Command>,
11577
11578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11579}
11580
11581impl Entrypoint {
11582    pub fn new() -> Self {
11583        std::default::Default::default()
11584    }
11585
11586    /// Sets the value of [command][crate::model::Entrypoint::command].
11587    ///
11588    /// Note that all the setters affecting `command` are mutually
11589    /// exclusive.
11590    ///
11591    /// # Example
11592    /// ```ignore,no_run
11593    /// # use google_cloud_appengine_v1::model::Entrypoint;
11594    /// use google_cloud_appengine_v1::model::entrypoint::Command;
11595    /// let x = Entrypoint::new().set_command(Some(Command::Shell("example".to_string())));
11596    /// ```
11597    pub fn set_command<
11598        T: std::convert::Into<std::option::Option<crate::model::entrypoint::Command>>,
11599    >(
11600        mut self,
11601        v: T,
11602    ) -> Self {
11603        self.command = v.into();
11604        self
11605    }
11606
11607    /// The value of [command][crate::model::Entrypoint::command]
11608    /// if it holds a `Shell`, `None` if the field is not set or
11609    /// holds a different branch.
11610    pub fn shell(&self) -> std::option::Option<&std::string::String> {
11611        #[allow(unreachable_patterns)]
11612        self.command.as_ref().and_then(|v| match v {
11613            crate::model::entrypoint::Command::Shell(v) => std::option::Option::Some(v),
11614            _ => std::option::Option::None,
11615        })
11616    }
11617
11618    /// Sets the value of [command][crate::model::Entrypoint::command]
11619    /// to hold a `Shell`.
11620    ///
11621    /// Note that all the setters affecting `command` are
11622    /// mutually exclusive.
11623    ///
11624    /// # Example
11625    /// ```ignore,no_run
11626    /// # use google_cloud_appengine_v1::model::Entrypoint;
11627    /// let x = Entrypoint::new().set_shell("example");
11628    /// assert!(x.shell().is_some());
11629    /// ```
11630    pub fn set_shell<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11631        self.command =
11632            std::option::Option::Some(crate::model::entrypoint::Command::Shell(v.into()));
11633        self
11634    }
11635}
11636
11637impl wkt::message::Message for Entrypoint {
11638    fn typename() -> &'static str {
11639        "type.googleapis.com/google.appengine.v1.Entrypoint"
11640    }
11641}
11642
11643/// Defines additional types related to [Entrypoint].
11644pub mod entrypoint {
11645    #[allow(unused_imports)]
11646    use super::*;
11647
11648    /// The command to run.
11649    #[derive(Clone, Debug, PartialEq)]
11650    #[non_exhaustive]
11651    pub enum Command {
11652        /// The format should be a shell command that can be fed to `bash -c`.
11653        Shell(std::string::String),
11654    }
11655}
11656
11657/// Actions to take when the user is not logged in.
11658///
11659/// # Working with unknown values
11660///
11661/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11662/// additional enum variants at any time. Adding new variants is not considered
11663/// a breaking change. Applications should write their code in anticipation of:
11664///
11665/// - New values appearing in future releases of the client library, **and**
11666/// - New values received dynamically, without application changes.
11667///
11668/// Please consult the [Working with enums] section in the user guide for some
11669/// guidelines.
11670///
11671/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11672#[derive(Clone, Debug, PartialEq)]
11673#[non_exhaustive]
11674pub enum AuthFailAction {
11675    /// Not specified. `AUTH_FAIL_ACTION_REDIRECT` is assumed.
11676    Unspecified,
11677    /// Redirects user to "accounts.google.com". The user is redirected back to the
11678    /// application URL after signing in or creating an account.
11679    Redirect,
11680    /// Rejects request with a `401` HTTP status code and an error
11681    /// message.
11682    Unauthorized,
11683    /// If set, the enum was initialized with an unknown value.
11684    ///
11685    /// Applications can examine the value using [AuthFailAction::value] or
11686    /// [AuthFailAction::name].
11687    UnknownValue(auth_fail_action::UnknownValue),
11688}
11689
11690#[doc(hidden)]
11691pub mod auth_fail_action {
11692    #[allow(unused_imports)]
11693    use super::*;
11694    #[derive(Clone, Debug, PartialEq)]
11695    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11696}
11697
11698impl AuthFailAction {
11699    /// Gets the enum value.
11700    ///
11701    /// Returns `None` if the enum contains an unknown value deserialized from
11702    /// the string representation of enums.
11703    pub fn value(&self) -> std::option::Option<i32> {
11704        match self {
11705            Self::Unspecified => std::option::Option::Some(0),
11706            Self::Redirect => std::option::Option::Some(1),
11707            Self::Unauthorized => std::option::Option::Some(2),
11708            Self::UnknownValue(u) => u.0.value(),
11709        }
11710    }
11711
11712    /// Gets the enum value as a string.
11713    ///
11714    /// Returns `None` if the enum contains an unknown value deserialized from
11715    /// the integer representation of enums.
11716    pub fn name(&self) -> std::option::Option<&str> {
11717        match self {
11718            Self::Unspecified => std::option::Option::Some("AUTH_FAIL_ACTION_UNSPECIFIED"),
11719            Self::Redirect => std::option::Option::Some("AUTH_FAIL_ACTION_REDIRECT"),
11720            Self::Unauthorized => std::option::Option::Some("AUTH_FAIL_ACTION_UNAUTHORIZED"),
11721            Self::UnknownValue(u) => u.0.name(),
11722        }
11723    }
11724}
11725
11726impl std::default::Default for AuthFailAction {
11727    fn default() -> Self {
11728        use std::convert::From;
11729        Self::from(0)
11730    }
11731}
11732
11733impl std::fmt::Display for AuthFailAction {
11734    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11735        wkt::internal::display_enum(f, self.name(), self.value())
11736    }
11737}
11738
11739impl std::convert::From<i32> for AuthFailAction {
11740    fn from(value: i32) -> Self {
11741        match value {
11742            0 => Self::Unspecified,
11743            1 => Self::Redirect,
11744            2 => Self::Unauthorized,
11745            _ => Self::UnknownValue(auth_fail_action::UnknownValue(
11746                wkt::internal::UnknownEnumValue::Integer(value),
11747            )),
11748        }
11749    }
11750}
11751
11752impl std::convert::From<&str> for AuthFailAction {
11753    fn from(value: &str) -> Self {
11754        use std::string::ToString;
11755        match value {
11756            "AUTH_FAIL_ACTION_UNSPECIFIED" => Self::Unspecified,
11757            "AUTH_FAIL_ACTION_REDIRECT" => Self::Redirect,
11758            "AUTH_FAIL_ACTION_UNAUTHORIZED" => Self::Unauthorized,
11759            _ => Self::UnknownValue(auth_fail_action::UnknownValue(
11760                wkt::internal::UnknownEnumValue::String(value.to_string()),
11761            )),
11762        }
11763    }
11764}
11765
11766impl serde::ser::Serialize for AuthFailAction {
11767    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11768    where
11769        S: serde::Serializer,
11770    {
11771        match self {
11772            Self::Unspecified => serializer.serialize_i32(0),
11773            Self::Redirect => serializer.serialize_i32(1),
11774            Self::Unauthorized => serializer.serialize_i32(2),
11775            Self::UnknownValue(u) => u.0.serialize(serializer),
11776        }
11777    }
11778}
11779
11780impl<'de> serde::de::Deserialize<'de> for AuthFailAction {
11781    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11782    where
11783        D: serde::Deserializer<'de>,
11784    {
11785        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthFailAction>::new(
11786            ".google.appengine.v1.AuthFailAction",
11787        ))
11788    }
11789}
11790
11791/// Methods to restrict access to a URL based on login status.
11792///
11793/// # Working with unknown values
11794///
11795/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11796/// additional enum variants at any time. Adding new variants is not considered
11797/// a breaking change. Applications should write their code in anticipation of:
11798///
11799/// - New values appearing in future releases of the client library, **and**
11800/// - New values received dynamically, without application changes.
11801///
11802/// Please consult the [Working with enums] section in the user guide for some
11803/// guidelines.
11804///
11805/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11806#[derive(Clone, Debug, PartialEq)]
11807#[non_exhaustive]
11808pub enum LoginRequirement {
11809    /// Not specified. `LOGIN_OPTIONAL` is assumed.
11810    LoginUnspecified,
11811    /// Does not require that the user is signed in.
11812    LoginOptional,
11813    /// If the user is not signed in, the `auth_fail_action` is taken.
11814    /// In addition, if the user is not an administrator for the
11815    /// application, they are given an error message regardless of
11816    /// `auth_fail_action`. If the user is an administrator, the handler
11817    /// proceeds.
11818    LoginAdmin,
11819    /// If the user has signed in, the handler proceeds normally. Otherwise, the
11820    /// auth_fail_action is taken.
11821    LoginRequired,
11822    /// If set, the enum was initialized with an unknown value.
11823    ///
11824    /// Applications can examine the value using [LoginRequirement::value] or
11825    /// [LoginRequirement::name].
11826    UnknownValue(login_requirement::UnknownValue),
11827}
11828
11829#[doc(hidden)]
11830pub mod login_requirement {
11831    #[allow(unused_imports)]
11832    use super::*;
11833    #[derive(Clone, Debug, PartialEq)]
11834    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11835}
11836
11837impl LoginRequirement {
11838    /// Gets the enum value.
11839    ///
11840    /// Returns `None` if the enum contains an unknown value deserialized from
11841    /// the string representation of enums.
11842    pub fn value(&self) -> std::option::Option<i32> {
11843        match self {
11844            Self::LoginUnspecified => std::option::Option::Some(0),
11845            Self::LoginOptional => std::option::Option::Some(1),
11846            Self::LoginAdmin => std::option::Option::Some(2),
11847            Self::LoginRequired => std::option::Option::Some(3),
11848            Self::UnknownValue(u) => u.0.value(),
11849        }
11850    }
11851
11852    /// Gets the enum value as a string.
11853    ///
11854    /// Returns `None` if the enum contains an unknown value deserialized from
11855    /// the integer representation of enums.
11856    pub fn name(&self) -> std::option::Option<&str> {
11857        match self {
11858            Self::LoginUnspecified => std::option::Option::Some("LOGIN_UNSPECIFIED"),
11859            Self::LoginOptional => std::option::Option::Some("LOGIN_OPTIONAL"),
11860            Self::LoginAdmin => std::option::Option::Some("LOGIN_ADMIN"),
11861            Self::LoginRequired => std::option::Option::Some("LOGIN_REQUIRED"),
11862            Self::UnknownValue(u) => u.0.name(),
11863        }
11864    }
11865}
11866
11867impl std::default::Default for LoginRequirement {
11868    fn default() -> Self {
11869        use std::convert::From;
11870        Self::from(0)
11871    }
11872}
11873
11874impl std::fmt::Display for LoginRequirement {
11875    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11876        wkt::internal::display_enum(f, self.name(), self.value())
11877    }
11878}
11879
11880impl std::convert::From<i32> for LoginRequirement {
11881    fn from(value: i32) -> Self {
11882        match value {
11883            0 => Self::LoginUnspecified,
11884            1 => Self::LoginOptional,
11885            2 => Self::LoginAdmin,
11886            3 => Self::LoginRequired,
11887            _ => Self::UnknownValue(login_requirement::UnknownValue(
11888                wkt::internal::UnknownEnumValue::Integer(value),
11889            )),
11890        }
11891    }
11892}
11893
11894impl std::convert::From<&str> for LoginRequirement {
11895    fn from(value: &str) -> Self {
11896        use std::string::ToString;
11897        match value {
11898            "LOGIN_UNSPECIFIED" => Self::LoginUnspecified,
11899            "LOGIN_OPTIONAL" => Self::LoginOptional,
11900            "LOGIN_ADMIN" => Self::LoginAdmin,
11901            "LOGIN_REQUIRED" => Self::LoginRequired,
11902            _ => Self::UnknownValue(login_requirement::UnknownValue(
11903                wkt::internal::UnknownEnumValue::String(value.to_string()),
11904            )),
11905        }
11906    }
11907}
11908
11909impl serde::ser::Serialize for LoginRequirement {
11910    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11911    where
11912        S: serde::Serializer,
11913    {
11914        match self {
11915            Self::LoginUnspecified => serializer.serialize_i32(0),
11916            Self::LoginOptional => serializer.serialize_i32(1),
11917            Self::LoginAdmin => serializer.serialize_i32(2),
11918            Self::LoginRequired => serializer.serialize_i32(3),
11919            Self::UnknownValue(u) => u.0.serialize(serializer),
11920        }
11921    }
11922}
11923
11924impl<'de> serde::de::Deserialize<'de> for LoginRequirement {
11925    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11926    where
11927        D: serde::Deserializer<'de>,
11928    {
11929        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoginRequirement>::new(
11930            ".google.appengine.v1.LoginRequirement",
11931        ))
11932    }
11933}
11934
11935/// Methods to enforce security (HTTPS) on a URL.
11936///
11937/// # Working with unknown values
11938///
11939/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11940/// additional enum variants at any time. Adding new variants is not considered
11941/// a breaking change. Applications should write their code in anticipation of:
11942///
11943/// - New values appearing in future releases of the client library, **and**
11944/// - New values received dynamically, without application changes.
11945///
11946/// Please consult the [Working with enums] section in the user guide for some
11947/// guidelines.
11948///
11949/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11950#[derive(Clone, Debug, PartialEq)]
11951#[non_exhaustive]
11952pub enum SecurityLevel {
11953    /// Not specified.
11954    SecureUnspecified,
11955    /// Both HTTP and HTTPS requests with URLs that match the handler succeed
11956    /// without redirects. The application can examine the request to determine
11957    /// which protocol was used, and respond accordingly.
11958    SecureDefault,
11959    /// Requests for a URL that match this handler that use HTTPS are automatically
11960    /// redirected to the HTTP equivalent URL.
11961    SecureNever,
11962    /// Both HTTP and HTTPS requests with URLs that match the handler succeed
11963    /// without redirects. The application can examine the request to determine
11964    /// which protocol was used and respond accordingly.
11965    SecureOptional,
11966    /// Requests for a URL that match this handler that do not use HTTPS are
11967    /// automatically redirected to the HTTPS URL with the same path. Query
11968    /// parameters are reserved for the redirect.
11969    SecureAlways,
11970    /// If set, the enum was initialized with an unknown value.
11971    ///
11972    /// Applications can examine the value using [SecurityLevel::value] or
11973    /// [SecurityLevel::name].
11974    UnknownValue(security_level::UnknownValue),
11975}
11976
11977#[doc(hidden)]
11978pub mod security_level {
11979    #[allow(unused_imports)]
11980    use super::*;
11981    #[derive(Clone, Debug, PartialEq)]
11982    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11983}
11984
11985impl SecurityLevel {
11986    /// Gets the enum value.
11987    ///
11988    /// Returns `None` if the enum contains an unknown value deserialized from
11989    /// the string representation of enums.
11990    pub fn value(&self) -> std::option::Option<i32> {
11991        match self {
11992            Self::SecureUnspecified => std::option::Option::Some(0),
11993            Self::SecureDefault => std::option::Option::Some(0),
11994            Self::SecureNever => std::option::Option::Some(1),
11995            Self::SecureOptional => std::option::Option::Some(2),
11996            Self::SecureAlways => std::option::Option::Some(3),
11997            Self::UnknownValue(u) => u.0.value(),
11998        }
11999    }
12000
12001    /// Gets the enum value as a string.
12002    ///
12003    /// Returns `None` if the enum contains an unknown value deserialized from
12004    /// the integer representation of enums.
12005    pub fn name(&self) -> std::option::Option<&str> {
12006        match self {
12007            Self::SecureUnspecified => std::option::Option::Some("SECURE_UNSPECIFIED"),
12008            Self::SecureDefault => std::option::Option::Some("SECURE_DEFAULT"),
12009            Self::SecureNever => std::option::Option::Some("SECURE_NEVER"),
12010            Self::SecureOptional => std::option::Option::Some("SECURE_OPTIONAL"),
12011            Self::SecureAlways => std::option::Option::Some("SECURE_ALWAYS"),
12012            Self::UnknownValue(u) => u.0.name(),
12013        }
12014    }
12015}
12016
12017impl std::default::Default for SecurityLevel {
12018    fn default() -> Self {
12019        use std::convert::From;
12020        Self::from(0)
12021    }
12022}
12023
12024impl std::fmt::Display for SecurityLevel {
12025    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12026        wkt::internal::display_enum(f, self.name(), self.value())
12027    }
12028}
12029
12030impl std::convert::From<i32> for SecurityLevel {
12031    fn from(value: i32) -> Self {
12032        match value {
12033            0 => Self::SecureDefault,
12034            1 => Self::SecureNever,
12035            2 => Self::SecureOptional,
12036            3 => Self::SecureAlways,
12037            _ => Self::UnknownValue(security_level::UnknownValue(
12038                wkt::internal::UnknownEnumValue::Integer(value),
12039            )),
12040        }
12041    }
12042}
12043
12044impl std::convert::From<&str> for SecurityLevel {
12045    fn from(value: &str) -> Self {
12046        use std::string::ToString;
12047        match value {
12048            "SECURE_UNSPECIFIED" => Self::SecureUnspecified,
12049            "SECURE_DEFAULT" => Self::SecureDefault,
12050            "SECURE_NEVER" => Self::SecureNever,
12051            "SECURE_OPTIONAL" => Self::SecureOptional,
12052            "SECURE_ALWAYS" => Self::SecureAlways,
12053            _ => Self::UnknownValue(security_level::UnknownValue(
12054                wkt::internal::UnknownEnumValue::String(value.to_string()),
12055            )),
12056        }
12057    }
12058}
12059
12060impl serde::ser::Serialize for SecurityLevel {
12061    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12062    where
12063        S: serde::Serializer,
12064    {
12065        match self {
12066            Self::SecureUnspecified => serializer.serialize_i32(0),
12067            Self::SecureDefault => serializer.serialize_i32(0),
12068            Self::SecureNever => serializer.serialize_i32(1),
12069            Self::SecureOptional => serializer.serialize_i32(2),
12070            Self::SecureAlways => serializer.serialize_i32(3),
12071            Self::UnknownValue(u) => u.0.serialize(serializer),
12072        }
12073    }
12074}
12075
12076impl<'de> serde::de::Deserialize<'de> for SecurityLevel {
12077    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12078    where
12079        D: serde::Deserializer<'de>,
12080    {
12081        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityLevel>::new(
12082            ".google.appengine.v1.SecurityLevel",
12083        ))
12084    }
12085}
12086
12087/// Fields that should be returned when [Version][google.appengine.v1.Version] resources
12088/// are retrieved.
12089///
12090/// [google.appengine.v1.Version]: crate::model::Version
12091///
12092/// # Working with unknown values
12093///
12094/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12095/// additional enum variants at any time. Adding new variants is not considered
12096/// a breaking change. Applications should write their code in anticipation of:
12097///
12098/// - New values appearing in future releases of the client library, **and**
12099/// - New values received dynamically, without application changes.
12100///
12101/// Please consult the [Working with enums] section in the user guide for some
12102/// guidelines.
12103///
12104/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12105#[derive(Clone, Debug, PartialEq)]
12106#[non_exhaustive]
12107pub enum VersionView {
12108    /// Basic version information including scaling and inbound services,
12109    /// but not detailed deployment information.
12110    Basic,
12111    /// The information from `BASIC`, plus detailed information about the
12112    /// deployment. This format is required when creating resources, but
12113    /// is not returned in `Get` or `List` by default.
12114    Full,
12115    /// If set, the enum was initialized with an unknown value.
12116    ///
12117    /// Applications can examine the value using [VersionView::value] or
12118    /// [VersionView::name].
12119    UnknownValue(version_view::UnknownValue),
12120}
12121
12122#[doc(hidden)]
12123pub mod version_view {
12124    #[allow(unused_imports)]
12125    use super::*;
12126    #[derive(Clone, Debug, PartialEq)]
12127    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12128}
12129
12130impl VersionView {
12131    /// Gets the enum value.
12132    ///
12133    /// Returns `None` if the enum contains an unknown value deserialized from
12134    /// the string representation of enums.
12135    pub fn value(&self) -> std::option::Option<i32> {
12136        match self {
12137            Self::Basic => std::option::Option::Some(0),
12138            Self::Full => std::option::Option::Some(1),
12139            Self::UnknownValue(u) => u.0.value(),
12140        }
12141    }
12142
12143    /// Gets the enum value as a string.
12144    ///
12145    /// Returns `None` if the enum contains an unknown value deserialized from
12146    /// the integer representation of enums.
12147    pub fn name(&self) -> std::option::Option<&str> {
12148        match self {
12149            Self::Basic => std::option::Option::Some("BASIC"),
12150            Self::Full => std::option::Option::Some("FULL"),
12151            Self::UnknownValue(u) => u.0.name(),
12152        }
12153    }
12154}
12155
12156impl std::default::Default for VersionView {
12157    fn default() -> Self {
12158        use std::convert::From;
12159        Self::from(0)
12160    }
12161}
12162
12163impl std::fmt::Display for VersionView {
12164    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12165        wkt::internal::display_enum(f, self.name(), self.value())
12166    }
12167}
12168
12169impl std::convert::From<i32> for VersionView {
12170    fn from(value: i32) -> Self {
12171        match value {
12172            0 => Self::Basic,
12173            1 => Self::Full,
12174            _ => Self::UnknownValue(version_view::UnknownValue(
12175                wkt::internal::UnknownEnumValue::Integer(value),
12176            )),
12177        }
12178    }
12179}
12180
12181impl std::convert::From<&str> for VersionView {
12182    fn from(value: &str) -> Self {
12183        use std::string::ToString;
12184        match value {
12185            "BASIC" => Self::Basic,
12186            "FULL" => Self::Full,
12187            _ => Self::UnknownValue(version_view::UnknownValue(
12188                wkt::internal::UnknownEnumValue::String(value.to_string()),
12189            )),
12190        }
12191    }
12192}
12193
12194impl serde::ser::Serialize for VersionView {
12195    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12196    where
12197        S: serde::Serializer,
12198    {
12199        match self {
12200            Self::Basic => serializer.serialize_i32(0),
12201            Self::Full => serializer.serialize_i32(1),
12202            Self::UnknownValue(u) => u.0.serialize(serializer),
12203        }
12204    }
12205}
12206
12207impl<'de> serde::de::Deserialize<'de> for VersionView {
12208    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12209    where
12210        D: serde::Deserializer<'de>,
12211    {
12212        deserializer.deserialize_any(wkt::internal::EnumVisitor::<VersionView>::new(
12213            ".google.appengine.v1.VersionView",
12214        ))
12215    }
12216}
12217
12218/// Fields that should be returned when an AuthorizedCertificate resource is
12219/// retrieved.
12220///
12221/// # Working with unknown values
12222///
12223/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12224/// additional enum variants at any time. Adding new variants is not considered
12225/// a breaking change. Applications should write their code in anticipation of:
12226///
12227/// - New values appearing in future releases of the client library, **and**
12228/// - New values received dynamically, without application changes.
12229///
12230/// Please consult the [Working with enums] section in the user guide for some
12231/// guidelines.
12232///
12233/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12234#[derive(Clone, Debug, PartialEq)]
12235#[non_exhaustive]
12236pub enum AuthorizedCertificateView {
12237    /// Basic certificate information, including applicable domains and expiration
12238    /// date.
12239    BasicCertificate,
12240    /// The information from `BASIC_CERTIFICATE`, plus detailed information on the
12241    /// domain mappings that have this certificate mapped.
12242    FullCertificate,
12243    /// If set, the enum was initialized with an unknown value.
12244    ///
12245    /// Applications can examine the value using [AuthorizedCertificateView::value] or
12246    /// [AuthorizedCertificateView::name].
12247    UnknownValue(authorized_certificate_view::UnknownValue),
12248}
12249
12250#[doc(hidden)]
12251pub mod authorized_certificate_view {
12252    #[allow(unused_imports)]
12253    use super::*;
12254    #[derive(Clone, Debug, PartialEq)]
12255    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12256}
12257
12258impl AuthorizedCertificateView {
12259    /// Gets the enum value.
12260    ///
12261    /// Returns `None` if the enum contains an unknown value deserialized from
12262    /// the string representation of enums.
12263    pub fn value(&self) -> std::option::Option<i32> {
12264        match self {
12265            Self::BasicCertificate => std::option::Option::Some(0),
12266            Self::FullCertificate => std::option::Option::Some(1),
12267            Self::UnknownValue(u) => u.0.value(),
12268        }
12269    }
12270
12271    /// Gets the enum value as a string.
12272    ///
12273    /// Returns `None` if the enum contains an unknown value deserialized from
12274    /// the integer representation of enums.
12275    pub fn name(&self) -> std::option::Option<&str> {
12276        match self {
12277            Self::BasicCertificate => std::option::Option::Some("BASIC_CERTIFICATE"),
12278            Self::FullCertificate => std::option::Option::Some("FULL_CERTIFICATE"),
12279            Self::UnknownValue(u) => u.0.name(),
12280        }
12281    }
12282}
12283
12284impl std::default::Default for AuthorizedCertificateView {
12285    fn default() -> Self {
12286        use std::convert::From;
12287        Self::from(0)
12288    }
12289}
12290
12291impl std::fmt::Display for AuthorizedCertificateView {
12292    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12293        wkt::internal::display_enum(f, self.name(), self.value())
12294    }
12295}
12296
12297impl std::convert::From<i32> for AuthorizedCertificateView {
12298    fn from(value: i32) -> Self {
12299        match value {
12300            0 => Self::BasicCertificate,
12301            1 => Self::FullCertificate,
12302            _ => Self::UnknownValue(authorized_certificate_view::UnknownValue(
12303                wkt::internal::UnknownEnumValue::Integer(value),
12304            )),
12305        }
12306    }
12307}
12308
12309impl std::convert::From<&str> for AuthorizedCertificateView {
12310    fn from(value: &str) -> Self {
12311        use std::string::ToString;
12312        match value {
12313            "BASIC_CERTIFICATE" => Self::BasicCertificate,
12314            "FULL_CERTIFICATE" => Self::FullCertificate,
12315            _ => Self::UnknownValue(authorized_certificate_view::UnknownValue(
12316                wkt::internal::UnknownEnumValue::String(value.to_string()),
12317            )),
12318        }
12319    }
12320}
12321
12322impl serde::ser::Serialize for AuthorizedCertificateView {
12323    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12324    where
12325        S: serde::Serializer,
12326    {
12327        match self {
12328            Self::BasicCertificate => serializer.serialize_i32(0),
12329            Self::FullCertificate => serializer.serialize_i32(1),
12330            Self::UnknownValue(u) => u.0.serialize(serializer),
12331        }
12332    }
12333}
12334
12335impl<'de> serde::de::Deserialize<'de> for AuthorizedCertificateView {
12336    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12337    where
12338        D: serde::Deserializer<'de>,
12339    {
12340        deserializer.deserialize_any(
12341            wkt::internal::EnumVisitor::<AuthorizedCertificateView>::new(
12342                ".google.appengine.v1.AuthorizedCertificateView",
12343            ),
12344        )
12345    }
12346}
12347
12348/// Override strategy for mutating an existing mapping.
12349///
12350/// # Working with unknown values
12351///
12352/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12353/// additional enum variants at any time. Adding new variants is not considered
12354/// a breaking change. Applications should write their code in anticipation of:
12355///
12356/// - New values appearing in future releases of the client library, **and**
12357/// - New values received dynamically, without application changes.
12358///
12359/// Please consult the [Working with enums] section in the user guide for some
12360/// guidelines.
12361///
12362/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12363#[derive(Clone, Debug, PartialEq)]
12364#[non_exhaustive]
12365pub enum DomainOverrideStrategy {
12366    /// Strategy unspecified. Defaults to `STRICT`.
12367    UnspecifiedDomainOverrideStrategy,
12368    /// Overrides not allowed. If a mapping already exists for the
12369    /// specified domain, the request will return an ALREADY_EXISTS (409).
12370    Strict,
12371    /// Overrides allowed. If a mapping already exists for the specified domain,
12372    /// the request will overwrite it. Note that this might stop another
12373    /// Google product from serving. For example, if the domain is
12374    /// mapped to another App Engine application, that app will no
12375    /// longer serve from that domain.
12376    Override,
12377    /// If set, the enum was initialized with an unknown value.
12378    ///
12379    /// Applications can examine the value using [DomainOverrideStrategy::value] or
12380    /// [DomainOverrideStrategy::name].
12381    UnknownValue(domain_override_strategy::UnknownValue),
12382}
12383
12384#[doc(hidden)]
12385pub mod domain_override_strategy {
12386    #[allow(unused_imports)]
12387    use super::*;
12388    #[derive(Clone, Debug, PartialEq)]
12389    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12390}
12391
12392impl DomainOverrideStrategy {
12393    /// Gets the enum value.
12394    ///
12395    /// Returns `None` if the enum contains an unknown value deserialized from
12396    /// the string representation of enums.
12397    pub fn value(&self) -> std::option::Option<i32> {
12398        match self {
12399            Self::UnspecifiedDomainOverrideStrategy => std::option::Option::Some(0),
12400            Self::Strict => std::option::Option::Some(1),
12401            Self::Override => std::option::Option::Some(2),
12402            Self::UnknownValue(u) => u.0.value(),
12403        }
12404    }
12405
12406    /// Gets the enum value as a string.
12407    ///
12408    /// Returns `None` if the enum contains an unknown value deserialized from
12409    /// the integer representation of enums.
12410    pub fn name(&self) -> std::option::Option<&str> {
12411        match self {
12412            Self::UnspecifiedDomainOverrideStrategy => {
12413                std::option::Option::Some("UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY")
12414            }
12415            Self::Strict => std::option::Option::Some("STRICT"),
12416            Self::Override => std::option::Option::Some("OVERRIDE"),
12417            Self::UnknownValue(u) => u.0.name(),
12418        }
12419    }
12420}
12421
12422impl std::default::Default for DomainOverrideStrategy {
12423    fn default() -> Self {
12424        use std::convert::From;
12425        Self::from(0)
12426    }
12427}
12428
12429impl std::fmt::Display for DomainOverrideStrategy {
12430    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12431        wkt::internal::display_enum(f, self.name(), self.value())
12432    }
12433}
12434
12435impl std::convert::From<i32> for DomainOverrideStrategy {
12436    fn from(value: i32) -> Self {
12437        match value {
12438            0 => Self::UnspecifiedDomainOverrideStrategy,
12439            1 => Self::Strict,
12440            2 => Self::Override,
12441            _ => Self::UnknownValue(domain_override_strategy::UnknownValue(
12442                wkt::internal::UnknownEnumValue::Integer(value),
12443            )),
12444        }
12445    }
12446}
12447
12448impl std::convert::From<&str> for DomainOverrideStrategy {
12449    fn from(value: &str) -> Self {
12450        use std::string::ToString;
12451        match value {
12452            "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY" => Self::UnspecifiedDomainOverrideStrategy,
12453            "STRICT" => Self::Strict,
12454            "OVERRIDE" => Self::Override,
12455            _ => Self::UnknownValue(domain_override_strategy::UnknownValue(
12456                wkt::internal::UnknownEnumValue::String(value.to_string()),
12457            )),
12458        }
12459    }
12460}
12461
12462impl serde::ser::Serialize for DomainOverrideStrategy {
12463    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12464    where
12465        S: serde::Serializer,
12466    {
12467        match self {
12468            Self::UnspecifiedDomainOverrideStrategy => serializer.serialize_i32(0),
12469            Self::Strict => serializer.serialize_i32(1),
12470            Self::Override => serializer.serialize_i32(2),
12471            Self::UnknownValue(u) => u.0.serialize(serializer),
12472        }
12473    }
12474}
12475
12476impl<'de> serde::de::Deserialize<'de> for DomainOverrideStrategy {
12477    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12478    where
12479        D: serde::Deserializer<'de>,
12480    {
12481        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DomainOverrideStrategy>::new(
12482            ".google.appengine.v1.DomainOverrideStrategy",
12483        ))
12484    }
12485}
12486
12487/// State of certificate management. Refers to the most recent certificate
12488/// acquisition or renewal attempt.
12489///
12490/// # Working with unknown values
12491///
12492/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12493/// additional enum variants at any time. Adding new variants is not considered
12494/// a breaking change. Applications should write their code in anticipation of:
12495///
12496/// - New values appearing in future releases of the client library, **and**
12497/// - New values received dynamically, without application changes.
12498///
12499/// Please consult the [Working with enums] section in the user guide for some
12500/// guidelines.
12501///
12502/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12503#[derive(Clone, Debug, PartialEq)]
12504#[non_exhaustive]
12505pub enum ManagementStatus {
12506    Unspecified,
12507    /// Certificate was successfully obtained and inserted into the serving
12508    /// system.
12509    Ok,
12510    /// Certificate is under active attempts to acquire or renew.
12511    Pending,
12512    /// Most recent renewal failed due to an invalid DNS setup and will be
12513    /// retried. Renewal attempts will continue to fail until the certificate
12514    /// domain's DNS configuration is fixed. The last successfully provisioned
12515    /// certificate may still be serving.
12516    FailedRetryingNotVisible,
12517    /// All renewal attempts have been exhausted, likely due to an invalid DNS
12518    /// setup.
12519    FailedPermanent,
12520    /// Most recent renewal failed due to an explicit CAA record that does not
12521    /// include one of the in-use CAs (Google CA and Let's Encrypt). Renewals will
12522    /// continue to fail until the CAA is reconfigured. The last successfully
12523    /// provisioned certificate may still be serving.
12524    FailedRetryingCaaForbidden,
12525    /// Most recent renewal failed due to a CAA retrieval failure. This means that
12526    /// the domain's DNS provider does not properly handle CAA records, failing
12527    /// requests for CAA records when no CAA records are defined. Renewals will
12528    /// continue to fail until the DNS provider is changed or a CAA record is
12529    /// added for the given domain. The last successfully provisioned certificate
12530    /// may still be serving.
12531    FailedRetryingCaaChecking,
12532    /// If set, the enum was initialized with an unknown value.
12533    ///
12534    /// Applications can examine the value using [ManagementStatus::value] or
12535    /// [ManagementStatus::name].
12536    UnknownValue(management_status::UnknownValue),
12537}
12538
12539#[doc(hidden)]
12540pub mod management_status {
12541    #[allow(unused_imports)]
12542    use super::*;
12543    #[derive(Clone, Debug, PartialEq)]
12544    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12545}
12546
12547impl ManagementStatus {
12548    /// Gets the enum value.
12549    ///
12550    /// Returns `None` if the enum contains an unknown value deserialized from
12551    /// the string representation of enums.
12552    pub fn value(&self) -> std::option::Option<i32> {
12553        match self {
12554            Self::Unspecified => std::option::Option::Some(0),
12555            Self::Ok => std::option::Option::Some(1),
12556            Self::Pending => std::option::Option::Some(2),
12557            Self::FailedRetryingNotVisible => std::option::Option::Some(4),
12558            Self::FailedPermanent => std::option::Option::Some(6),
12559            Self::FailedRetryingCaaForbidden => std::option::Option::Some(7),
12560            Self::FailedRetryingCaaChecking => std::option::Option::Some(8),
12561            Self::UnknownValue(u) => u.0.value(),
12562        }
12563    }
12564
12565    /// Gets the enum value as a string.
12566    ///
12567    /// Returns `None` if the enum contains an unknown value deserialized from
12568    /// the integer representation of enums.
12569    pub fn name(&self) -> std::option::Option<&str> {
12570        match self {
12571            Self::Unspecified => std::option::Option::Some("MANAGEMENT_STATUS_UNSPECIFIED"),
12572            Self::Ok => std::option::Option::Some("OK"),
12573            Self::Pending => std::option::Option::Some("PENDING"),
12574            Self::FailedRetryingNotVisible => {
12575                std::option::Option::Some("FAILED_RETRYING_NOT_VISIBLE")
12576            }
12577            Self::FailedPermanent => std::option::Option::Some("FAILED_PERMANENT"),
12578            Self::FailedRetryingCaaForbidden => {
12579                std::option::Option::Some("FAILED_RETRYING_CAA_FORBIDDEN")
12580            }
12581            Self::FailedRetryingCaaChecking => {
12582                std::option::Option::Some("FAILED_RETRYING_CAA_CHECKING")
12583            }
12584            Self::UnknownValue(u) => u.0.name(),
12585        }
12586    }
12587}
12588
12589impl std::default::Default for ManagementStatus {
12590    fn default() -> Self {
12591        use std::convert::From;
12592        Self::from(0)
12593    }
12594}
12595
12596impl std::fmt::Display for ManagementStatus {
12597    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12598        wkt::internal::display_enum(f, self.name(), self.value())
12599    }
12600}
12601
12602impl std::convert::From<i32> for ManagementStatus {
12603    fn from(value: i32) -> Self {
12604        match value {
12605            0 => Self::Unspecified,
12606            1 => Self::Ok,
12607            2 => Self::Pending,
12608            4 => Self::FailedRetryingNotVisible,
12609            6 => Self::FailedPermanent,
12610            7 => Self::FailedRetryingCaaForbidden,
12611            8 => Self::FailedRetryingCaaChecking,
12612            _ => Self::UnknownValue(management_status::UnknownValue(
12613                wkt::internal::UnknownEnumValue::Integer(value),
12614            )),
12615        }
12616    }
12617}
12618
12619impl std::convert::From<&str> for ManagementStatus {
12620    fn from(value: &str) -> Self {
12621        use std::string::ToString;
12622        match value {
12623            "MANAGEMENT_STATUS_UNSPECIFIED" => Self::Unspecified,
12624            "OK" => Self::Ok,
12625            "PENDING" => Self::Pending,
12626            "FAILED_RETRYING_NOT_VISIBLE" => Self::FailedRetryingNotVisible,
12627            "FAILED_PERMANENT" => Self::FailedPermanent,
12628            "FAILED_RETRYING_CAA_FORBIDDEN" => Self::FailedRetryingCaaForbidden,
12629            "FAILED_RETRYING_CAA_CHECKING" => Self::FailedRetryingCaaChecking,
12630            _ => Self::UnknownValue(management_status::UnknownValue(
12631                wkt::internal::UnknownEnumValue::String(value.to_string()),
12632            )),
12633        }
12634    }
12635}
12636
12637impl serde::ser::Serialize for ManagementStatus {
12638    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12639    where
12640        S: serde::Serializer,
12641    {
12642        match self {
12643            Self::Unspecified => serializer.serialize_i32(0),
12644            Self::Ok => serializer.serialize_i32(1),
12645            Self::Pending => serializer.serialize_i32(2),
12646            Self::FailedRetryingNotVisible => serializer.serialize_i32(4),
12647            Self::FailedPermanent => serializer.serialize_i32(6),
12648            Self::FailedRetryingCaaForbidden => serializer.serialize_i32(7),
12649            Self::FailedRetryingCaaChecking => serializer.serialize_i32(8),
12650            Self::UnknownValue(u) => u.0.serialize(serializer),
12651        }
12652    }
12653}
12654
12655impl<'de> serde::de::Deserialize<'de> for ManagementStatus {
12656    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12657    where
12658        D: serde::Deserializer<'de>,
12659    {
12660        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManagementStatus>::new(
12661            ".google.appengine.v1.ManagementStatus",
12662        ))
12663    }
12664}
12665
12666/// Available inbound services.
12667///
12668/// # Working with unknown values
12669///
12670/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12671/// additional enum variants at any time. Adding new variants is not considered
12672/// a breaking change. Applications should write their code in anticipation of:
12673///
12674/// - New values appearing in future releases of the client library, **and**
12675/// - New values received dynamically, without application changes.
12676///
12677/// Please consult the [Working with enums] section in the user guide for some
12678/// guidelines.
12679///
12680/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12681#[derive(Clone, Debug, PartialEq)]
12682#[non_exhaustive]
12683pub enum InboundServiceType {
12684    /// Not specified.
12685    InboundServiceUnspecified,
12686    /// Allows an application to receive mail.
12687    InboundServiceMail,
12688    /// Allows an application to receive email-bound notifications.
12689    InboundServiceMailBounce,
12690    /// Allows an application to receive error stanzas.
12691    InboundServiceXmppError,
12692    /// Allows an application to receive instant messages.
12693    InboundServiceXmppMessage,
12694    /// Allows an application to receive user subscription POSTs.
12695    InboundServiceXmppSubscribe,
12696    /// Allows an application to receive a user's chat presence.
12697    InboundServiceXmppPresence,
12698    /// Registers an application for notifications when a client connects or
12699    /// disconnects from a channel.
12700    InboundServiceChannelPresence,
12701    /// Enables warmup requests.
12702    InboundServiceWarmup,
12703    /// If set, the enum was initialized with an unknown value.
12704    ///
12705    /// Applications can examine the value using [InboundServiceType::value] or
12706    /// [InboundServiceType::name].
12707    UnknownValue(inbound_service_type::UnknownValue),
12708}
12709
12710#[doc(hidden)]
12711pub mod inbound_service_type {
12712    #[allow(unused_imports)]
12713    use super::*;
12714    #[derive(Clone, Debug, PartialEq)]
12715    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12716}
12717
12718impl InboundServiceType {
12719    /// Gets the enum value.
12720    ///
12721    /// Returns `None` if the enum contains an unknown value deserialized from
12722    /// the string representation of enums.
12723    pub fn value(&self) -> std::option::Option<i32> {
12724        match self {
12725            Self::InboundServiceUnspecified => std::option::Option::Some(0),
12726            Self::InboundServiceMail => std::option::Option::Some(1),
12727            Self::InboundServiceMailBounce => std::option::Option::Some(2),
12728            Self::InboundServiceXmppError => std::option::Option::Some(3),
12729            Self::InboundServiceXmppMessage => std::option::Option::Some(4),
12730            Self::InboundServiceXmppSubscribe => std::option::Option::Some(5),
12731            Self::InboundServiceXmppPresence => std::option::Option::Some(6),
12732            Self::InboundServiceChannelPresence => std::option::Option::Some(7),
12733            Self::InboundServiceWarmup => std::option::Option::Some(9),
12734            Self::UnknownValue(u) => u.0.value(),
12735        }
12736    }
12737
12738    /// Gets the enum value as a string.
12739    ///
12740    /// Returns `None` if the enum contains an unknown value deserialized from
12741    /// the integer representation of enums.
12742    pub fn name(&self) -> std::option::Option<&str> {
12743        match self {
12744            Self::InboundServiceUnspecified => {
12745                std::option::Option::Some("INBOUND_SERVICE_UNSPECIFIED")
12746            }
12747            Self::InboundServiceMail => std::option::Option::Some("INBOUND_SERVICE_MAIL"),
12748            Self::InboundServiceMailBounce => {
12749                std::option::Option::Some("INBOUND_SERVICE_MAIL_BOUNCE")
12750            }
12751            Self::InboundServiceXmppError => {
12752                std::option::Option::Some("INBOUND_SERVICE_XMPP_ERROR")
12753            }
12754            Self::InboundServiceXmppMessage => {
12755                std::option::Option::Some("INBOUND_SERVICE_XMPP_MESSAGE")
12756            }
12757            Self::InboundServiceXmppSubscribe => {
12758                std::option::Option::Some("INBOUND_SERVICE_XMPP_SUBSCRIBE")
12759            }
12760            Self::InboundServiceXmppPresence => {
12761                std::option::Option::Some("INBOUND_SERVICE_XMPP_PRESENCE")
12762            }
12763            Self::InboundServiceChannelPresence => {
12764                std::option::Option::Some("INBOUND_SERVICE_CHANNEL_PRESENCE")
12765            }
12766            Self::InboundServiceWarmup => std::option::Option::Some("INBOUND_SERVICE_WARMUP"),
12767            Self::UnknownValue(u) => u.0.name(),
12768        }
12769    }
12770}
12771
12772impl std::default::Default for InboundServiceType {
12773    fn default() -> Self {
12774        use std::convert::From;
12775        Self::from(0)
12776    }
12777}
12778
12779impl std::fmt::Display for InboundServiceType {
12780    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12781        wkt::internal::display_enum(f, self.name(), self.value())
12782    }
12783}
12784
12785impl std::convert::From<i32> for InboundServiceType {
12786    fn from(value: i32) -> Self {
12787        match value {
12788            0 => Self::InboundServiceUnspecified,
12789            1 => Self::InboundServiceMail,
12790            2 => Self::InboundServiceMailBounce,
12791            3 => Self::InboundServiceXmppError,
12792            4 => Self::InboundServiceXmppMessage,
12793            5 => Self::InboundServiceXmppSubscribe,
12794            6 => Self::InboundServiceXmppPresence,
12795            7 => Self::InboundServiceChannelPresence,
12796            9 => Self::InboundServiceWarmup,
12797            _ => Self::UnknownValue(inbound_service_type::UnknownValue(
12798                wkt::internal::UnknownEnumValue::Integer(value),
12799            )),
12800        }
12801    }
12802}
12803
12804impl std::convert::From<&str> for InboundServiceType {
12805    fn from(value: &str) -> Self {
12806        use std::string::ToString;
12807        match value {
12808            "INBOUND_SERVICE_UNSPECIFIED" => Self::InboundServiceUnspecified,
12809            "INBOUND_SERVICE_MAIL" => Self::InboundServiceMail,
12810            "INBOUND_SERVICE_MAIL_BOUNCE" => Self::InboundServiceMailBounce,
12811            "INBOUND_SERVICE_XMPP_ERROR" => Self::InboundServiceXmppError,
12812            "INBOUND_SERVICE_XMPP_MESSAGE" => Self::InboundServiceXmppMessage,
12813            "INBOUND_SERVICE_XMPP_SUBSCRIBE" => Self::InboundServiceXmppSubscribe,
12814            "INBOUND_SERVICE_XMPP_PRESENCE" => Self::InboundServiceXmppPresence,
12815            "INBOUND_SERVICE_CHANNEL_PRESENCE" => Self::InboundServiceChannelPresence,
12816            "INBOUND_SERVICE_WARMUP" => Self::InboundServiceWarmup,
12817            _ => Self::UnknownValue(inbound_service_type::UnknownValue(
12818                wkt::internal::UnknownEnumValue::String(value.to_string()),
12819            )),
12820        }
12821    }
12822}
12823
12824impl serde::ser::Serialize for InboundServiceType {
12825    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12826    where
12827        S: serde::Serializer,
12828    {
12829        match self {
12830            Self::InboundServiceUnspecified => serializer.serialize_i32(0),
12831            Self::InboundServiceMail => serializer.serialize_i32(1),
12832            Self::InboundServiceMailBounce => serializer.serialize_i32(2),
12833            Self::InboundServiceXmppError => serializer.serialize_i32(3),
12834            Self::InboundServiceXmppMessage => serializer.serialize_i32(4),
12835            Self::InboundServiceXmppSubscribe => serializer.serialize_i32(5),
12836            Self::InboundServiceXmppPresence => serializer.serialize_i32(6),
12837            Self::InboundServiceChannelPresence => serializer.serialize_i32(7),
12838            Self::InboundServiceWarmup => serializer.serialize_i32(9),
12839            Self::UnknownValue(u) => u.0.serialize(serializer),
12840        }
12841    }
12842}
12843
12844impl<'de> serde::de::Deserialize<'de> for InboundServiceType {
12845    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12846    where
12847        D: serde::Deserializer<'de>,
12848    {
12849        deserializer.deserialize_any(wkt::internal::EnumVisitor::<InboundServiceType>::new(
12850            ".google.appengine.v1.InboundServiceType",
12851        ))
12852    }
12853}
12854
12855/// Run states of a version.
12856///
12857/// # Working with unknown values
12858///
12859/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12860/// additional enum variants at any time. Adding new variants is not considered
12861/// a breaking change. Applications should write their code in anticipation of:
12862///
12863/// - New values appearing in future releases of the client library, **and**
12864/// - New values received dynamically, without application changes.
12865///
12866/// Please consult the [Working with enums] section in the user guide for some
12867/// guidelines.
12868///
12869/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12870#[derive(Clone, Debug, PartialEq)]
12871#[non_exhaustive]
12872pub enum ServingStatus {
12873    /// Not specified.
12874    Unspecified,
12875    /// Currently serving. Instances are created according to the
12876    /// scaling settings of the version.
12877    Serving,
12878    /// Disabled. No instances will be created and the scaling
12879    /// settings are ignored until the state of the version changes
12880    /// to `SERVING`.
12881    Stopped,
12882    /// If set, the enum was initialized with an unknown value.
12883    ///
12884    /// Applications can examine the value using [ServingStatus::value] or
12885    /// [ServingStatus::name].
12886    UnknownValue(serving_status::UnknownValue),
12887}
12888
12889#[doc(hidden)]
12890pub mod serving_status {
12891    #[allow(unused_imports)]
12892    use super::*;
12893    #[derive(Clone, Debug, PartialEq)]
12894    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12895}
12896
12897impl ServingStatus {
12898    /// Gets the enum value.
12899    ///
12900    /// Returns `None` if the enum contains an unknown value deserialized from
12901    /// the string representation of enums.
12902    pub fn value(&self) -> std::option::Option<i32> {
12903        match self {
12904            Self::Unspecified => std::option::Option::Some(0),
12905            Self::Serving => std::option::Option::Some(1),
12906            Self::Stopped => std::option::Option::Some(2),
12907            Self::UnknownValue(u) => u.0.value(),
12908        }
12909    }
12910
12911    /// Gets the enum value as a string.
12912    ///
12913    /// Returns `None` if the enum contains an unknown value deserialized from
12914    /// the integer representation of enums.
12915    pub fn name(&self) -> std::option::Option<&str> {
12916        match self {
12917            Self::Unspecified => std::option::Option::Some("SERVING_STATUS_UNSPECIFIED"),
12918            Self::Serving => std::option::Option::Some("SERVING"),
12919            Self::Stopped => std::option::Option::Some("STOPPED"),
12920            Self::UnknownValue(u) => u.0.name(),
12921        }
12922    }
12923}
12924
12925impl std::default::Default for ServingStatus {
12926    fn default() -> Self {
12927        use std::convert::From;
12928        Self::from(0)
12929    }
12930}
12931
12932impl std::fmt::Display for ServingStatus {
12933    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12934        wkt::internal::display_enum(f, self.name(), self.value())
12935    }
12936}
12937
12938impl std::convert::From<i32> for ServingStatus {
12939    fn from(value: i32) -> Self {
12940        match value {
12941            0 => Self::Unspecified,
12942            1 => Self::Serving,
12943            2 => Self::Stopped,
12944            _ => Self::UnknownValue(serving_status::UnknownValue(
12945                wkt::internal::UnknownEnumValue::Integer(value),
12946            )),
12947        }
12948    }
12949}
12950
12951impl std::convert::From<&str> for ServingStatus {
12952    fn from(value: &str) -> Self {
12953        use std::string::ToString;
12954        match value {
12955            "SERVING_STATUS_UNSPECIFIED" => Self::Unspecified,
12956            "SERVING" => Self::Serving,
12957            "STOPPED" => Self::Stopped,
12958            _ => Self::UnknownValue(serving_status::UnknownValue(
12959                wkt::internal::UnknownEnumValue::String(value.to_string()),
12960            )),
12961        }
12962    }
12963}
12964
12965impl serde::ser::Serialize for ServingStatus {
12966    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12967    where
12968        S: serde::Serializer,
12969    {
12970        match self {
12971            Self::Unspecified => serializer.serialize_i32(0),
12972            Self::Serving => serializer.serialize_i32(1),
12973            Self::Stopped => serializer.serialize_i32(2),
12974            Self::UnknownValue(u) => u.0.serialize(serializer),
12975        }
12976    }
12977}
12978
12979impl<'de> serde::de::Deserialize<'de> for ServingStatus {
12980    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12981    where
12982        D: serde::Deserializer<'de>,
12983    {
12984        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServingStatus>::new(
12985            ".google.appengine.v1.ServingStatus",
12986        ))
12987    }
12988}