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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_longrunning;
25extern crate google_cloud_lro;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/)
38/// configuration for API handlers.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct ApiConfigHandler {
42 /// Action to take when users access resources that require
43 /// authentication. Defaults to `redirect`.
44 pub auth_fail_action: crate::model::AuthFailAction,
45
46 /// Level of login required to access this resource. Defaults to
47 /// `optional`.
48 pub login: crate::model::LoginRequirement,
49
50 /// Path to the script from the application root directory.
51 pub script: std::string::String,
52
53 /// Security (HTTPS) enforcement for this URL.
54 pub security_level: crate::model::SecurityLevel,
55
56 /// URL to serve the endpoint at.
57 pub url: std::string::String,
58
59 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl ApiConfigHandler {
63 /// Creates a new default instance.
64 pub fn new() -> Self {
65 std::default::Default::default()
66 }
67
68 /// Sets the value of [auth_fail_action][crate::model::ApiConfigHandler::auth_fail_action].
69 ///
70 /// # Example
71 /// ```ignore,no_run
72 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
73 /// use google_cloud_appengine_v1::model::AuthFailAction;
74 /// let x0 = ApiConfigHandler::new().set_auth_fail_action(AuthFailAction::Redirect);
75 /// let x1 = ApiConfigHandler::new().set_auth_fail_action(AuthFailAction::Unauthorized);
76 /// ```
77 pub fn set_auth_fail_action<T: std::convert::Into<crate::model::AuthFailAction>>(
78 mut self,
79 v: T,
80 ) -> Self {
81 self.auth_fail_action = v.into();
82 self
83 }
84
85 /// Sets the value of [login][crate::model::ApiConfigHandler::login].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
90 /// use google_cloud_appengine_v1::model::LoginRequirement;
91 /// let x0 = ApiConfigHandler::new().set_login(LoginRequirement::LoginOptional);
92 /// let x1 = ApiConfigHandler::new().set_login(LoginRequirement::LoginAdmin);
93 /// let x2 = ApiConfigHandler::new().set_login(LoginRequirement::LoginRequired);
94 /// ```
95 pub fn set_login<T: std::convert::Into<crate::model::LoginRequirement>>(
96 mut self,
97 v: T,
98 ) -> Self {
99 self.login = v.into();
100 self
101 }
102
103 /// Sets the value of [script][crate::model::ApiConfigHandler::script].
104 ///
105 /// # Example
106 /// ```ignore,no_run
107 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
108 /// let x = ApiConfigHandler::new().set_script("example");
109 /// ```
110 pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111 self.script = v.into();
112 self
113 }
114
115 /// Sets the value of [security_level][crate::model::ApiConfigHandler::security_level].
116 ///
117 /// # Example
118 /// ```ignore,no_run
119 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
120 /// use google_cloud_appengine_v1::model::SecurityLevel;
121 /// let x0 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureNever);
122 /// let x1 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureOptional);
123 /// let x2 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureAlways);
124 /// ```
125 pub fn set_security_level<T: std::convert::Into<crate::model::SecurityLevel>>(
126 mut self,
127 v: T,
128 ) -> Self {
129 self.security_level = v.into();
130 self
131 }
132
133 /// Sets the value of [url][crate::model::ApiConfigHandler::url].
134 ///
135 /// # Example
136 /// ```ignore,no_run
137 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
138 /// let x = ApiConfigHandler::new().set_url("example");
139 /// ```
140 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
141 self.url = v.into();
142 self
143 }
144}
145
146impl wkt::message::Message for ApiConfigHandler {
147 fn typename() -> &'static str {
148 "type.googleapis.com/google.appengine.v1.ApiConfigHandler"
149 }
150}
151
152/// Custom static error page to be served when an error occurs.
153#[derive(Clone, Default, PartialEq)]
154#[non_exhaustive]
155pub struct ErrorHandler {
156 /// Error condition this handler applies to.
157 pub error_code: crate::model::error_handler::ErrorCode,
158
159 /// Static file content to be served for this error.
160 pub static_file: std::string::String,
161
162 /// MIME type of file. Defaults to `text/html`.
163 pub mime_type: std::string::String,
164
165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
166}
167
168impl ErrorHandler {
169 /// Creates a new default instance.
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://googleapis.github.io/google-cloud-rust/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 /// Creates a new default instance.
410 pub fn new() -> Self {
411 std::default::Default::default()
412 }
413
414 /// Sets the value of [url_regex][crate::model::UrlMap::url_regex].
415 ///
416 /// # Example
417 /// ```ignore,no_run
418 /// # use google_cloud_appengine_v1::model::UrlMap;
419 /// let x = UrlMap::new().set_url_regex("example");
420 /// ```
421 pub fn set_url_regex<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
422 self.url_regex = v.into();
423 self
424 }
425
426 /// Sets the value of [security_level][crate::model::UrlMap::security_level].
427 ///
428 /// # Example
429 /// ```ignore,no_run
430 /// # use google_cloud_appengine_v1::model::UrlMap;
431 /// use google_cloud_appengine_v1::model::SecurityLevel;
432 /// let x0 = UrlMap::new().set_security_level(SecurityLevel::SecureNever);
433 /// let x1 = UrlMap::new().set_security_level(SecurityLevel::SecureOptional);
434 /// let x2 = UrlMap::new().set_security_level(SecurityLevel::SecureAlways);
435 /// ```
436 pub fn set_security_level<T: std::convert::Into<crate::model::SecurityLevel>>(
437 mut self,
438 v: T,
439 ) -> Self {
440 self.security_level = v.into();
441 self
442 }
443
444 /// Sets the value of [login][crate::model::UrlMap::login].
445 ///
446 /// # Example
447 /// ```ignore,no_run
448 /// # use google_cloud_appengine_v1::model::UrlMap;
449 /// use google_cloud_appengine_v1::model::LoginRequirement;
450 /// let x0 = UrlMap::new().set_login(LoginRequirement::LoginOptional);
451 /// let x1 = UrlMap::new().set_login(LoginRequirement::LoginAdmin);
452 /// let x2 = UrlMap::new().set_login(LoginRequirement::LoginRequired);
453 /// ```
454 pub fn set_login<T: std::convert::Into<crate::model::LoginRequirement>>(
455 mut self,
456 v: T,
457 ) -> Self {
458 self.login = v.into();
459 self
460 }
461
462 /// Sets the value of [auth_fail_action][crate::model::UrlMap::auth_fail_action].
463 ///
464 /// # Example
465 /// ```ignore,no_run
466 /// # use google_cloud_appengine_v1::model::UrlMap;
467 /// use google_cloud_appengine_v1::model::AuthFailAction;
468 /// let x0 = UrlMap::new().set_auth_fail_action(AuthFailAction::Redirect);
469 /// let x1 = UrlMap::new().set_auth_fail_action(AuthFailAction::Unauthorized);
470 /// ```
471 pub fn set_auth_fail_action<T: std::convert::Into<crate::model::AuthFailAction>>(
472 mut self,
473 v: T,
474 ) -> Self {
475 self.auth_fail_action = v.into();
476 self
477 }
478
479 /// Sets the value of [redirect_http_response_code][crate::model::UrlMap::redirect_http_response_code].
480 ///
481 /// # Example
482 /// ```ignore,no_run
483 /// # use google_cloud_appengine_v1::model::UrlMap;
484 /// use google_cloud_appengine_v1::model::url_map::RedirectHttpResponseCode;
485 /// let x0 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode301);
486 /// let x1 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode302);
487 /// let x2 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode303);
488 /// ```
489 pub fn set_redirect_http_response_code<
490 T: std::convert::Into<crate::model::url_map::RedirectHttpResponseCode>,
491 >(
492 mut self,
493 v: T,
494 ) -> Self {
495 self.redirect_http_response_code = v.into();
496 self
497 }
498
499 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type].
500 ///
501 /// Note that all the setters affecting `handler_type` are mutually
502 /// exclusive.
503 ///
504 /// # Example
505 /// ```ignore,no_run
506 /// # use google_cloud_appengine_v1::model::UrlMap;
507 /// use google_cloud_appengine_v1::model::StaticFilesHandler;
508 /// let x = UrlMap::new().set_handler_type(Some(
509 /// google_cloud_appengine_v1::model::url_map::HandlerType::StaticFiles(StaticFilesHandler::default().into())));
510 /// ```
511 pub fn set_handler_type<
512 T: std::convert::Into<std::option::Option<crate::model::url_map::HandlerType>>,
513 >(
514 mut self,
515 v: T,
516 ) -> Self {
517 self.handler_type = v.into();
518 self
519 }
520
521 /// The value of [handler_type][crate::model::UrlMap::handler_type]
522 /// if it holds a `StaticFiles`, `None` if the field is not set or
523 /// holds a different branch.
524 pub fn static_files(
525 &self,
526 ) -> std::option::Option<&std::boxed::Box<crate::model::StaticFilesHandler>> {
527 #[allow(unreachable_patterns)]
528 self.handler_type.as_ref().and_then(|v| match v {
529 crate::model::url_map::HandlerType::StaticFiles(v) => std::option::Option::Some(v),
530 _ => std::option::Option::None,
531 })
532 }
533
534 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
535 /// to hold a `StaticFiles`.
536 ///
537 /// Note that all the setters affecting `handler_type` are
538 /// mutually exclusive.
539 ///
540 /// # Example
541 /// ```ignore,no_run
542 /// # use google_cloud_appengine_v1::model::UrlMap;
543 /// use google_cloud_appengine_v1::model::StaticFilesHandler;
544 /// let x = UrlMap::new().set_static_files(StaticFilesHandler::default()/* use setters */);
545 /// assert!(x.static_files().is_some());
546 /// assert!(x.script().is_none());
547 /// assert!(x.api_endpoint().is_none());
548 /// ```
549 pub fn set_static_files<
550 T: std::convert::Into<std::boxed::Box<crate::model::StaticFilesHandler>>,
551 >(
552 mut self,
553 v: T,
554 ) -> Self {
555 self.handler_type =
556 std::option::Option::Some(crate::model::url_map::HandlerType::StaticFiles(v.into()));
557 self
558 }
559
560 /// The value of [handler_type][crate::model::UrlMap::handler_type]
561 /// if it holds a `Script`, `None` if the field is not set or
562 /// holds a different branch.
563 pub fn script(&self) -> std::option::Option<&std::boxed::Box<crate::model::ScriptHandler>> {
564 #[allow(unreachable_patterns)]
565 self.handler_type.as_ref().and_then(|v| match v {
566 crate::model::url_map::HandlerType::Script(v) => std::option::Option::Some(v),
567 _ => std::option::Option::None,
568 })
569 }
570
571 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
572 /// to hold a `Script`.
573 ///
574 /// Note that all the setters affecting `handler_type` are
575 /// mutually exclusive.
576 ///
577 /// # Example
578 /// ```ignore,no_run
579 /// # use google_cloud_appengine_v1::model::UrlMap;
580 /// use google_cloud_appengine_v1::model::ScriptHandler;
581 /// let x = UrlMap::new().set_script(ScriptHandler::default()/* use setters */);
582 /// assert!(x.script().is_some());
583 /// assert!(x.static_files().is_none());
584 /// assert!(x.api_endpoint().is_none());
585 /// ```
586 pub fn set_script<T: std::convert::Into<std::boxed::Box<crate::model::ScriptHandler>>>(
587 mut self,
588 v: T,
589 ) -> Self {
590 self.handler_type =
591 std::option::Option::Some(crate::model::url_map::HandlerType::Script(v.into()));
592 self
593 }
594
595 /// The value of [handler_type][crate::model::UrlMap::handler_type]
596 /// if it holds a `ApiEndpoint`, `None` if the field is not set or
597 /// holds a different branch.
598 pub fn api_endpoint(
599 &self,
600 ) -> std::option::Option<&std::boxed::Box<crate::model::ApiEndpointHandler>> {
601 #[allow(unreachable_patterns)]
602 self.handler_type.as_ref().and_then(|v| match v {
603 crate::model::url_map::HandlerType::ApiEndpoint(v) => std::option::Option::Some(v),
604 _ => std::option::Option::None,
605 })
606 }
607
608 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
609 /// to hold a `ApiEndpoint`.
610 ///
611 /// Note that all the setters affecting `handler_type` are
612 /// mutually exclusive.
613 ///
614 /// # Example
615 /// ```ignore,no_run
616 /// # use google_cloud_appengine_v1::model::UrlMap;
617 /// use google_cloud_appengine_v1::model::ApiEndpointHandler;
618 /// let x = UrlMap::new().set_api_endpoint(ApiEndpointHandler::default()/* use setters */);
619 /// assert!(x.api_endpoint().is_some());
620 /// assert!(x.static_files().is_none());
621 /// assert!(x.script().is_none());
622 /// ```
623 pub fn set_api_endpoint<
624 T: std::convert::Into<std::boxed::Box<crate::model::ApiEndpointHandler>>,
625 >(
626 mut self,
627 v: T,
628 ) -> Self {
629 self.handler_type =
630 std::option::Option::Some(crate::model::url_map::HandlerType::ApiEndpoint(v.into()));
631 self
632 }
633}
634
635impl wkt::message::Message for UrlMap {
636 fn typename() -> &'static str {
637 "type.googleapis.com/google.appengine.v1.UrlMap"
638 }
639}
640
641/// Defines additional types related to [UrlMap].
642pub mod url_map {
643 #[allow(unused_imports)]
644 use super::*;
645
646 /// Redirect codes.
647 ///
648 /// # Working with unknown values
649 ///
650 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
651 /// additional enum variants at any time. Adding new variants is not considered
652 /// a breaking change. Applications should write their code in anticipation of:
653 ///
654 /// - New values appearing in future releases of the client library, **and**
655 /// - New values received dynamically, without application changes.
656 ///
657 /// Please consult the [Working with enums] section in the user guide for some
658 /// guidelines.
659 ///
660 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
661 #[derive(Clone, Debug, PartialEq)]
662 #[non_exhaustive]
663 pub enum RedirectHttpResponseCode {
664 /// Not specified. `302` is assumed.
665 Unspecified,
666 /// `301 Moved Permanently` code.
667 RedirectHttpResponseCode301,
668 /// `302 Moved Temporarily` code.
669 RedirectHttpResponseCode302,
670 /// `303 See Other` code.
671 RedirectHttpResponseCode303,
672 /// `307 Temporary Redirect` code.
673 RedirectHttpResponseCode307,
674 /// If set, the enum was initialized with an unknown value.
675 ///
676 /// Applications can examine the value using [RedirectHttpResponseCode::value] or
677 /// [RedirectHttpResponseCode::name].
678 UnknownValue(redirect_http_response_code::UnknownValue),
679 }
680
681 #[doc(hidden)]
682 pub mod redirect_http_response_code {
683 #[allow(unused_imports)]
684 use super::*;
685 #[derive(Clone, Debug, PartialEq)]
686 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
687 }
688
689 impl RedirectHttpResponseCode {
690 /// Gets the enum value.
691 ///
692 /// Returns `None` if the enum contains an unknown value deserialized from
693 /// the string representation of enums.
694 pub fn value(&self) -> std::option::Option<i32> {
695 match self {
696 Self::Unspecified => std::option::Option::Some(0),
697 Self::RedirectHttpResponseCode301 => std::option::Option::Some(1),
698 Self::RedirectHttpResponseCode302 => std::option::Option::Some(2),
699 Self::RedirectHttpResponseCode303 => std::option::Option::Some(3),
700 Self::RedirectHttpResponseCode307 => std::option::Option::Some(4),
701 Self::UnknownValue(u) => u.0.value(),
702 }
703 }
704
705 /// Gets the enum value as a string.
706 ///
707 /// Returns `None` if the enum contains an unknown value deserialized from
708 /// the integer representation of enums.
709 pub fn name(&self) -> std::option::Option<&str> {
710 match self {
711 Self::Unspecified => {
712 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED")
713 }
714 Self::RedirectHttpResponseCode301 => {
715 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_301")
716 }
717 Self::RedirectHttpResponseCode302 => {
718 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_302")
719 }
720 Self::RedirectHttpResponseCode303 => {
721 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_303")
722 }
723 Self::RedirectHttpResponseCode307 => {
724 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_307")
725 }
726 Self::UnknownValue(u) => u.0.name(),
727 }
728 }
729 }
730
731 impl std::default::Default for RedirectHttpResponseCode {
732 fn default() -> Self {
733 use std::convert::From;
734 Self::from(0)
735 }
736 }
737
738 impl std::fmt::Display for RedirectHttpResponseCode {
739 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
740 wkt::internal::display_enum(f, self.name(), self.value())
741 }
742 }
743
744 impl std::convert::From<i32> for RedirectHttpResponseCode {
745 fn from(value: i32) -> Self {
746 match value {
747 0 => Self::Unspecified,
748 1 => Self::RedirectHttpResponseCode301,
749 2 => Self::RedirectHttpResponseCode302,
750 3 => Self::RedirectHttpResponseCode303,
751 4 => Self::RedirectHttpResponseCode307,
752 _ => Self::UnknownValue(redirect_http_response_code::UnknownValue(
753 wkt::internal::UnknownEnumValue::Integer(value),
754 )),
755 }
756 }
757 }
758
759 impl std::convert::From<&str> for RedirectHttpResponseCode {
760 fn from(value: &str) -> Self {
761 use std::string::ToString;
762 match value {
763 "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED" => Self::Unspecified,
764 "REDIRECT_HTTP_RESPONSE_CODE_301" => Self::RedirectHttpResponseCode301,
765 "REDIRECT_HTTP_RESPONSE_CODE_302" => Self::RedirectHttpResponseCode302,
766 "REDIRECT_HTTP_RESPONSE_CODE_303" => Self::RedirectHttpResponseCode303,
767 "REDIRECT_HTTP_RESPONSE_CODE_307" => Self::RedirectHttpResponseCode307,
768 _ => Self::UnknownValue(redirect_http_response_code::UnknownValue(
769 wkt::internal::UnknownEnumValue::String(value.to_string()),
770 )),
771 }
772 }
773 }
774
775 impl serde::ser::Serialize for RedirectHttpResponseCode {
776 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
777 where
778 S: serde::Serializer,
779 {
780 match self {
781 Self::Unspecified => serializer.serialize_i32(0),
782 Self::RedirectHttpResponseCode301 => serializer.serialize_i32(1),
783 Self::RedirectHttpResponseCode302 => serializer.serialize_i32(2),
784 Self::RedirectHttpResponseCode303 => serializer.serialize_i32(3),
785 Self::RedirectHttpResponseCode307 => serializer.serialize_i32(4),
786 Self::UnknownValue(u) => u.0.serialize(serializer),
787 }
788 }
789 }
790
791 impl<'de> serde::de::Deserialize<'de> for RedirectHttpResponseCode {
792 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
793 where
794 D: serde::Deserializer<'de>,
795 {
796 deserializer.deserialize_any(
797 wkt::internal::EnumVisitor::<RedirectHttpResponseCode>::new(
798 ".google.appengine.v1.UrlMap.RedirectHttpResponseCode",
799 ),
800 )
801 }
802 }
803
804 /// Type of handler for this URL pattern.
805 #[derive(Clone, Debug, PartialEq)]
806 #[non_exhaustive]
807 pub enum HandlerType {
808 /// Returns the contents of a file, such as an image, as the response.
809 StaticFiles(std::boxed::Box<crate::model::StaticFilesHandler>),
810 /// Executes a script to handle the requests that match this URL
811 /// pattern. Only the `auto` value is supported for Node.js in the
812 /// App Engine standard environment, for example `"script": "auto"`.
813 Script(std::boxed::Box<crate::model::ScriptHandler>),
814 /// Uses API Endpoints to handle requests.
815 ApiEndpoint(std::boxed::Box<crate::model::ApiEndpointHandler>),
816 }
817}
818
819/// Files served directly to the user for a given URL, such as images, CSS
820/// stylesheets, or JavaScript source files. Static file handlers describe which
821/// files in the application directory are static files, and which URLs serve
822/// them.
823#[derive(Clone, Default, PartialEq)]
824#[non_exhaustive]
825pub struct StaticFilesHandler {
826 /// Path to the static files matched by the URL pattern, from the
827 /// application root directory. The path can refer to text matched in groupings
828 /// in the URL pattern.
829 pub path: std::string::String,
830
831 /// Regular expression that matches the file paths for all files that should be
832 /// referenced by this handler.
833 pub upload_path_regex: std::string::String,
834
835 /// HTTP headers to use for all responses from these URLs.
836 pub http_headers: std::collections::HashMap<std::string::String, std::string::String>,
837
838 /// MIME type used to serve all files served by this handler.
839 ///
840 /// Defaults to file-specific MIME types, which are derived from each file's
841 /// filename extension.
842 pub mime_type: std::string::String,
843
844 /// Time a static file served by this handler should be cached
845 /// by web proxies and browsers.
846 pub expiration: std::option::Option<wkt::Duration>,
847
848 /// Whether this handler should match the request if the file
849 /// referenced by the handler does not exist.
850 pub require_matching_file: bool,
851
852 /// Whether files should also be uploaded as code data. By default, files
853 /// declared in static file handlers are uploaded as static
854 /// data and are only served to end users; they cannot be read by the
855 /// application. If enabled, uploads are charged against both your code and
856 /// static data storage resource quotas.
857 pub application_readable: bool,
858
859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
860}
861
862impl StaticFilesHandler {
863 /// Creates a new default instance.
864 pub fn new() -> Self {
865 std::default::Default::default()
866 }
867
868 /// Sets the value of [path][crate::model::StaticFilesHandler::path].
869 ///
870 /// # Example
871 /// ```ignore,no_run
872 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
873 /// let x = StaticFilesHandler::new().set_path("example");
874 /// ```
875 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
876 self.path = v.into();
877 self
878 }
879
880 /// Sets the value of [upload_path_regex][crate::model::StaticFilesHandler::upload_path_regex].
881 ///
882 /// # Example
883 /// ```ignore,no_run
884 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
885 /// let x = StaticFilesHandler::new().set_upload_path_regex("example");
886 /// ```
887 pub fn set_upload_path_regex<T: std::convert::Into<std::string::String>>(
888 mut self,
889 v: T,
890 ) -> Self {
891 self.upload_path_regex = v.into();
892 self
893 }
894
895 /// Sets the value of [http_headers][crate::model::StaticFilesHandler::http_headers].
896 ///
897 /// # Example
898 /// ```ignore,no_run
899 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
900 /// let x = StaticFilesHandler::new().set_http_headers([
901 /// ("key0", "abc"),
902 /// ("key1", "xyz"),
903 /// ]);
904 /// ```
905 pub fn set_http_headers<T, K, V>(mut self, v: T) -> Self
906 where
907 T: std::iter::IntoIterator<Item = (K, V)>,
908 K: std::convert::Into<std::string::String>,
909 V: std::convert::Into<std::string::String>,
910 {
911 use std::iter::Iterator;
912 self.http_headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
913 self
914 }
915
916 /// Sets the value of [mime_type][crate::model::StaticFilesHandler::mime_type].
917 ///
918 /// # Example
919 /// ```ignore,no_run
920 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
921 /// let x = StaticFilesHandler::new().set_mime_type("example");
922 /// ```
923 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
924 self.mime_type = v.into();
925 self
926 }
927
928 /// Sets the value of [expiration][crate::model::StaticFilesHandler::expiration].
929 ///
930 /// # Example
931 /// ```ignore,no_run
932 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
933 /// use wkt::Duration;
934 /// let x = StaticFilesHandler::new().set_expiration(Duration::default()/* use setters */);
935 /// ```
936 pub fn set_expiration<T>(mut self, v: T) -> Self
937 where
938 T: std::convert::Into<wkt::Duration>,
939 {
940 self.expiration = std::option::Option::Some(v.into());
941 self
942 }
943
944 /// Sets or clears the value of [expiration][crate::model::StaticFilesHandler::expiration].
945 ///
946 /// # Example
947 /// ```ignore,no_run
948 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
949 /// use wkt::Duration;
950 /// let x = StaticFilesHandler::new().set_or_clear_expiration(Some(Duration::default()/* use setters */));
951 /// let x = StaticFilesHandler::new().set_or_clear_expiration(None::<Duration>);
952 /// ```
953 pub fn set_or_clear_expiration<T>(mut self, v: std::option::Option<T>) -> Self
954 where
955 T: std::convert::Into<wkt::Duration>,
956 {
957 self.expiration = v.map(|x| x.into());
958 self
959 }
960
961 /// Sets the value of [require_matching_file][crate::model::StaticFilesHandler::require_matching_file].
962 ///
963 /// # Example
964 /// ```ignore,no_run
965 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
966 /// let x = StaticFilesHandler::new().set_require_matching_file(true);
967 /// ```
968 pub fn set_require_matching_file<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
969 self.require_matching_file = v.into();
970 self
971 }
972
973 /// Sets the value of [application_readable][crate::model::StaticFilesHandler::application_readable].
974 ///
975 /// # Example
976 /// ```ignore,no_run
977 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
978 /// let x = StaticFilesHandler::new().set_application_readable(true);
979 /// ```
980 pub fn set_application_readable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
981 self.application_readable = v.into();
982 self
983 }
984}
985
986impl wkt::message::Message for StaticFilesHandler {
987 fn typename() -> &'static str {
988 "type.googleapis.com/google.appengine.v1.StaticFilesHandler"
989 }
990}
991
992/// Executes a script to handle the request that matches the URL pattern.
993#[derive(Clone, Default, PartialEq)]
994#[non_exhaustive]
995pub struct ScriptHandler {
996 /// Path to the script from the application root directory.
997 pub script_path: std::string::String,
998
999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1000}
1001
1002impl ScriptHandler {
1003 /// Creates a new default instance.
1004 pub fn new() -> Self {
1005 std::default::Default::default()
1006 }
1007
1008 /// Sets the value of [script_path][crate::model::ScriptHandler::script_path].
1009 ///
1010 /// # Example
1011 /// ```ignore,no_run
1012 /// # use google_cloud_appengine_v1::model::ScriptHandler;
1013 /// let x = ScriptHandler::new().set_script_path("example");
1014 /// ```
1015 pub fn set_script_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1016 self.script_path = v.into();
1017 self
1018 }
1019}
1020
1021impl wkt::message::Message for ScriptHandler {
1022 fn typename() -> &'static str {
1023 "type.googleapis.com/google.appengine.v1.ScriptHandler"
1024 }
1025}
1026
1027/// Uses Google Cloud Endpoints to handle requests.
1028#[derive(Clone, Default, PartialEq)]
1029#[non_exhaustive]
1030pub struct ApiEndpointHandler {
1031 /// Path to the script from the application root directory.
1032 pub script_path: std::string::String,
1033
1034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1035}
1036
1037impl ApiEndpointHandler {
1038 /// Creates a new default instance.
1039 pub fn new() -> Self {
1040 std::default::Default::default()
1041 }
1042
1043 /// Sets the value of [script_path][crate::model::ApiEndpointHandler::script_path].
1044 ///
1045 /// # Example
1046 /// ```ignore,no_run
1047 /// # use google_cloud_appengine_v1::model::ApiEndpointHandler;
1048 /// let x = ApiEndpointHandler::new().set_script_path("example");
1049 /// ```
1050 pub fn set_script_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1051 self.script_path = v.into();
1052 self
1053 }
1054}
1055
1056impl wkt::message::Message for ApiEndpointHandler {
1057 fn typename() -> &'static str {
1058 "type.googleapis.com/google.appengine.v1.ApiEndpointHandler"
1059 }
1060}
1061
1062/// Health checking configuration for VM instances. Unhealthy instances
1063/// are killed and replaced with new instances. Only applicable for
1064/// instances in App Engine flexible environment.
1065#[derive(Clone, Default, PartialEq)]
1066#[non_exhaustive]
1067pub struct HealthCheck {
1068 /// Whether to explicitly disable health checks for this instance.
1069 pub disable_health_check: bool,
1070
1071 /// Host header to send when performing an HTTP health check.
1072 /// Example: "myapp.appspot.com"
1073 pub host: std::string::String,
1074
1075 /// Number of consecutive successful health checks required before receiving
1076 /// traffic.
1077 pub healthy_threshold: u32,
1078
1079 /// Number of consecutive failed health checks required before removing
1080 /// traffic.
1081 pub unhealthy_threshold: u32,
1082
1083 /// Number of consecutive failed health checks required before an instance is
1084 /// restarted.
1085 pub restart_threshold: u32,
1086
1087 /// Interval between health checks.
1088 pub check_interval: std::option::Option<wkt::Duration>,
1089
1090 /// Time before the health check is considered failed.
1091 pub timeout: std::option::Option<wkt::Duration>,
1092
1093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1094}
1095
1096impl HealthCheck {
1097 /// Creates a new default instance.
1098 pub fn new() -> Self {
1099 std::default::Default::default()
1100 }
1101
1102 /// Sets the value of [disable_health_check][crate::model::HealthCheck::disable_health_check].
1103 ///
1104 /// # Example
1105 /// ```ignore,no_run
1106 /// # use google_cloud_appengine_v1::model::HealthCheck;
1107 /// let x = HealthCheck::new().set_disable_health_check(true);
1108 /// ```
1109 pub fn set_disable_health_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1110 self.disable_health_check = v.into();
1111 self
1112 }
1113
1114 /// Sets the value of [host][crate::model::HealthCheck::host].
1115 ///
1116 /// # Example
1117 /// ```ignore,no_run
1118 /// # use google_cloud_appengine_v1::model::HealthCheck;
1119 /// let x = HealthCheck::new().set_host("example");
1120 /// ```
1121 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1122 self.host = v.into();
1123 self
1124 }
1125
1126 /// Sets the value of [healthy_threshold][crate::model::HealthCheck::healthy_threshold].
1127 ///
1128 /// # Example
1129 /// ```ignore,no_run
1130 /// # use google_cloud_appengine_v1::model::HealthCheck;
1131 /// let x = HealthCheck::new().set_healthy_threshold(42_u32);
1132 /// ```
1133 pub fn set_healthy_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1134 self.healthy_threshold = v.into();
1135 self
1136 }
1137
1138 /// Sets the value of [unhealthy_threshold][crate::model::HealthCheck::unhealthy_threshold].
1139 ///
1140 /// # Example
1141 /// ```ignore,no_run
1142 /// # use google_cloud_appengine_v1::model::HealthCheck;
1143 /// let x = HealthCheck::new().set_unhealthy_threshold(42_u32);
1144 /// ```
1145 pub fn set_unhealthy_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1146 self.unhealthy_threshold = v.into();
1147 self
1148 }
1149
1150 /// Sets the value of [restart_threshold][crate::model::HealthCheck::restart_threshold].
1151 ///
1152 /// # Example
1153 /// ```ignore,no_run
1154 /// # use google_cloud_appengine_v1::model::HealthCheck;
1155 /// let x = HealthCheck::new().set_restart_threshold(42_u32);
1156 /// ```
1157 pub fn set_restart_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1158 self.restart_threshold = v.into();
1159 self
1160 }
1161
1162 /// Sets the value of [check_interval][crate::model::HealthCheck::check_interval].
1163 ///
1164 /// # Example
1165 /// ```ignore,no_run
1166 /// # use google_cloud_appengine_v1::model::HealthCheck;
1167 /// use wkt::Duration;
1168 /// let x = HealthCheck::new().set_check_interval(Duration::default()/* use setters */);
1169 /// ```
1170 pub fn set_check_interval<T>(mut self, v: T) -> Self
1171 where
1172 T: std::convert::Into<wkt::Duration>,
1173 {
1174 self.check_interval = std::option::Option::Some(v.into());
1175 self
1176 }
1177
1178 /// Sets or clears the value of [check_interval][crate::model::HealthCheck::check_interval].
1179 ///
1180 /// # Example
1181 /// ```ignore,no_run
1182 /// # use google_cloud_appengine_v1::model::HealthCheck;
1183 /// use wkt::Duration;
1184 /// let x = HealthCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1185 /// let x = HealthCheck::new().set_or_clear_check_interval(None::<Duration>);
1186 /// ```
1187 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1188 where
1189 T: std::convert::Into<wkt::Duration>,
1190 {
1191 self.check_interval = v.map(|x| x.into());
1192 self
1193 }
1194
1195 /// Sets the value of [timeout][crate::model::HealthCheck::timeout].
1196 ///
1197 /// # Example
1198 /// ```ignore,no_run
1199 /// # use google_cloud_appengine_v1::model::HealthCheck;
1200 /// use wkt::Duration;
1201 /// let x = HealthCheck::new().set_timeout(Duration::default()/* use setters */);
1202 /// ```
1203 pub fn set_timeout<T>(mut self, v: T) -> Self
1204 where
1205 T: std::convert::Into<wkt::Duration>,
1206 {
1207 self.timeout = std::option::Option::Some(v.into());
1208 self
1209 }
1210
1211 /// Sets or clears the value of [timeout][crate::model::HealthCheck::timeout].
1212 ///
1213 /// # Example
1214 /// ```ignore,no_run
1215 /// # use google_cloud_appengine_v1::model::HealthCheck;
1216 /// use wkt::Duration;
1217 /// let x = HealthCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1218 /// let x = HealthCheck::new().set_or_clear_timeout(None::<Duration>);
1219 /// ```
1220 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1221 where
1222 T: std::convert::Into<wkt::Duration>,
1223 {
1224 self.timeout = v.map(|x| x.into());
1225 self
1226 }
1227}
1228
1229impl wkt::message::Message for HealthCheck {
1230 fn typename() -> &'static str {
1231 "type.googleapis.com/google.appengine.v1.HealthCheck"
1232 }
1233}
1234
1235/// Readiness checking configuration for VM instances. Unhealthy instances
1236/// are removed from traffic rotation.
1237#[derive(Clone, Default, PartialEq)]
1238#[non_exhaustive]
1239pub struct ReadinessCheck {
1240 /// The request path.
1241 pub path: std::string::String,
1242
1243 /// Host header to send when performing a HTTP Readiness check.
1244 /// Example: "myapp.appspot.com"
1245 pub host: std::string::String,
1246
1247 /// Number of consecutive failed checks required before removing
1248 /// traffic.
1249 pub failure_threshold: u32,
1250
1251 /// Number of consecutive successful checks required before receiving
1252 /// traffic.
1253 pub success_threshold: u32,
1254
1255 /// Interval between health checks.
1256 pub check_interval: std::option::Option<wkt::Duration>,
1257
1258 /// Time before the check is considered failed.
1259 pub timeout: std::option::Option<wkt::Duration>,
1260
1261 /// A maximum time limit on application initialization, measured from moment
1262 /// the application successfully replies to a healthcheck until it is ready to
1263 /// serve traffic.
1264 pub app_start_timeout: std::option::Option<wkt::Duration>,
1265
1266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1267}
1268
1269impl ReadinessCheck {
1270 /// Creates a new default instance.
1271 pub fn new() -> Self {
1272 std::default::Default::default()
1273 }
1274
1275 /// Sets the value of [path][crate::model::ReadinessCheck::path].
1276 ///
1277 /// # Example
1278 /// ```ignore,no_run
1279 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1280 /// let x = ReadinessCheck::new().set_path("example");
1281 /// ```
1282 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1283 self.path = v.into();
1284 self
1285 }
1286
1287 /// Sets the value of [host][crate::model::ReadinessCheck::host].
1288 ///
1289 /// # Example
1290 /// ```ignore,no_run
1291 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1292 /// let x = ReadinessCheck::new().set_host("example");
1293 /// ```
1294 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1295 self.host = v.into();
1296 self
1297 }
1298
1299 /// Sets the value of [failure_threshold][crate::model::ReadinessCheck::failure_threshold].
1300 ///
1301 /// # Example
1302 /// ```ignore,no_run
1303 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1304 /// let x = ReadinessCheck::new().set_failure_threshold(42_u32);
1305 /// ```
1306 pub fn set_failure_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1307 self.failure_threshold = v.into();
1308 self
1309 }
1310
1311 /// Sets the value of [success_threshold][crate::model::ReadinessCheck::success_threshold].
1312 ///
1313 /// # Example
1314 /// ```ignore,no_run
1315 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1316 /// let x = ReadinessCheck::new().set_success_threshold(42_u32);
1317 /// ```
1318 pub fn set_success_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1319 self.success_threshold = v.into();
1320 self
1321 }
1322
1323 /// Sets the value of [check_interval][crate::model::ReadinessCheck::check_interval].
1324 ///
1325 /// # Example
1326 /// ```ignore,no_run
1327 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1328 /// use wkt::Duration;
1329 /// let x = ReadinessCheck::new().set_check_interval(Duration::default()/* use setters */);
1330 /// ```
1331 pub fn set_check_interval<T>(mut self, v: T) -> Self
1332 where
1333 T: std::convert::Into<wkt::Duration>,
1334 {
1335 self.check_interval = std::option::Option::Some(v.into());
1336 self
1337 }
1338
1339 /// Sets or clears the value of [check_interval][crate::model::ReadinessCheck::check_interval].
1340 ///
1341 /// # Example
1342 /// ```ignore,no_run
1343 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1344 /// use wkt::Duration;
1345 /// let x = ReadinessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1346 /// let x = ReadinessCheck::new().set_or_clear_check_interval(None::<Duration>);
1347 /// ```
1348 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1349 where
1350 T: std::convert::Into<wkt::Duration>,
1351 {
1352 self.check_interval = v.map(|x| x.into());
1353 self
1354 }
1355
1356 /// Sets the value of [timeout][crate::model::ReadinessCheck::timeout].
1357 ///
1358 /// # Example
1359 /// ```ignore,no_run
1360 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1361 /// use wkt::Duration;
1362 /// let x = ReadinessCheck::new().set_timeout(Duration::default()/* use setters */);
1363 /// ```
1364 pub fn set_timeout<T>(mut self, v: T) -> Self
1365 where
1366 T: std::convert::Into<wkt::Duration>,
1367 {
1368 self.timeout = std::option::Option::Some(v.into());
1369 self
1370 }
1371
1372 /// Sets or clears the value of [timeout][crate::model::ReadinessCheck::timeout].
1373 ///
1374 /// # Example
1375 /// ```ignore,no_run
1376 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1377 /// use wkt::Duration;
1378 /// let x = ReadinessCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1379 /// let x = ReadinessCheck::new().set_or_clear_timeout(None::<Duration>);
1380 /// ```
1381 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1382 where
1383 T: std::convert::Into<wkt::Duration>,
1384 {
1385 self.timeout = v.map(|x| x.into());
1386 self
1387 }
1388
1389 /// Sets the value of [app_start_timeout][crate::model::ReadinessCheck::app_start_timeout].
1390 ///
1391 /// # Example
1392 /// ```ignore,no_run
1393 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1394 /// use wkt::Duration;
1395 /// let x = ReadinessCheck::new().set_app_start_timeout(Duration::default()/* use setters */);
1396 /// ```
1397 pub fn set_app_start_timeout<T>(mut self, v: T) -> Self
1398 where
1399 T: std::convert::Into<wkt::Duration>,
1400 {
1401 self.app_start_timeout = std::option::Option::Some(v.into());
1402 self
1403 }
1404
1405 /// Sets or clears the value of [app_start_timeout][crate::model::ReadinessCheck::app_start_timeout].
1406 ///
1407 /// # Example
1408 /// ```ignore,no_run
1409 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1410 /// use wkt::Duration;
1411 /// let x = ReadinessCheck::new().set_or_clear_app_start_timeout(Some(Duration::default()/* use setters */));
1412 /// let x = ReadinessCheck::new().set_or_clear_app_start_timeout(None::<Duration>);
1413 /// ```
1414 pub fn set_or_clear_app_start_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1415 where
1416 T: std::convert::Into<wkt::Duration>,
1417 {
1418 self.app_start_timeout = v.map(|x| x.into());
1419 self
1420 }
1421}
1422
1423impl wkt::message::Message for ReadinessCheck {
1424 fn typename() -> &'static str {
1425 "type.googleapis.com/google.appengine.v1.ReadinessCheck"
1426 }
1427}
1428
1429/// Health checking configuration for VM instances. Unhealthy instances
1430/// are killed and replaced with new instances.
1431#[derive(Clone, Default, PartialEq)]
1432#[non_exhaustive]
1433pub struct LivenessCheck {
1434 /// The request path.
1435 pub path: std::string::String,
1436
1437 /// Host header to send when performing a HTTP Liveness check.
1438 /// Example: "myapp.appspot.com"
1439 pub host: std::string::String,
1440
1441 /// Number of consecutive failed checks required before considering the
1442 /// VM unhealthy.
1443 pub failure_threshold: u32,
1444
1445 /// Number of consecutive successful checks required before considering
1446 /// the VM healthy.
1447 pub success_threshold: u32,
1448
1449 /// Interval between health checks.
1450 pub check_interval: std::option::Option<wkt::Duration>,
1451
1452 /// Time before the check is considered failed.
1453 pub timeout: std::option::Option<wkt::Duration>,
1454
1455 /// The initial delay before starting to execute the checks.
1456 pub initial_delay: std::option::Option<wkt::Duration>,
1457
1458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1459}
1460
1461impl LivenessCheck {
1462 /// Creates a new default instance.
1463 pub fn new() -> Self {
1464 std::default::Default::default()
1465 }
1466
1467 /// Sets the value of [path][crate::model::LivenessCheck::path].
1468 ///
1469 /// # Example
1470 /// ```ignore,no_run
1471 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1472 /// let x = LivenessCheck::new().set_path("example");
1473 /// ```
1474 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1475 self.path = v.into();
1476 self
1477 }
1478
1479 /// Sets the value of [host][crate::model::LivenessCheck::host].
1480 ///
1481 /// # Example
1482 /// ```ignore,no_run
1483 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1484 /// let x = LivenessCheck::new().set_host("example");
1485 /// ```
1486 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1487 self.host = v.into();
1488 self
1489 }
1490
1491 /// Sets the value of [failure_threshold][crate::model::LivenessCheck::failure_threshold].
1492 ///
1493 /// # Example
1494 /// ```ignore,no_run
1495 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1496 /// let x = LivenessCheck::new().set_failure_threshold(42_u32);
1497 /// ```
1498 pub fn set_failure_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1499 self.failure_threshold = v.into();
1500 self
1501 }
1502
1503 /// Sets the value of [success_threshold][crate::model::LivenessCheck::success_threshold].
1504 ///
1505 /// # Example
1506 /// ```ignore,no_run
1507 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1508 /// let x = LivenessCheck::new().set_success_threshold(42_u32);
1509 /// ```
1510 pub fn set_success_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1511 self.success_threshold = v.into();
1512 self
1513 }
1514
1515 /// Sets the value of [check_interval][crate::model::LivenessCheck::check_interval].
1516 ///
1517 /// # Example
1518 /// ```ignore,no_run
1519 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1520 /// use wkt::Duration;
1521 /// let x = LivenessCheck::new().set_check_interval(Duration::default()/* use setters */);
1522 /// ```
1523 pub fn set_check_interval<T>(mut self, v: T) -> Self
1524 where
1525 T: std::convert::Into<wkt::Duration>,
1526 {
1527 self.check_interval = std::option::Option::Some(v.into());
1528 self
1529 }
1530
1531 /// Sets or clears the value of [check_interval][crate::model::LivenessCheck::check_interval].
1532 ///
1533 /// # Example
1534 /// ```ignore,no_run
1535 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1536 /// use wkt::Duration;
1537 /// let x = LivenessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1538 /// let x = LivenessCheck::new().set_or_clear_check_interval(None::<Duration>);
1539 /// ```
1540 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1541 where
1542 T: std::convert::Into<wkt::Duration>,
1543 {
1544 self.check_interval = v.map(|x| x.into());
1545 self
1546 }
1547
1548 /// Sets the value of [timeout][crate::model::LivenessCheck::timeout].
1549 ///
1550 /// # Example
1551 /// ```ignore,no_run
1552 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1553 /// use wkt::Duration;
1554 /// let x = LivenessCheck::new().set_timeout(Duration::default()/* use setters */);
1555 /// ```
1556 pub fn set_timeout<T>(mut self, v: T) -> Self
1557 where
1558 T: std::convert::Into<wkt::Duration>,
1559 {
1560 self.timeout = std::option::Option::Some(v.into());
1561 self
1562 }
1563
1564 /// Sets or clears the value of [timeout][crate::model::LivenessCheck::timeout].
1565 ///
1566 /// # Example
1567 /// ```ignore,no_run
1568 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1569 /// use wkt::Duration;
1570 /// let x = LivenessCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1571 /// let x = LivenessCheck::new().set_or_clear_timeout(None::<Duration>);
1572 /// ```
1573 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1574 where
1575 T: std::convert::Into<wkt::Duration>,
1576 {
1577 self.timeout = v.map(|x| x.into());
1578 self
1579 }
1580
1581 /// Sets the value of [initial_delay][crate::model::LivenessCheck::initial_delay].
1582 ///
1583 /// # Example
1584 /// ```ignore,no_run
1585 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1586 /// use wkt::Duration;
1587 /// let x = LivenessCheck::new().set_initial_delay(Duration::default()/* use setters */);
1588 /// ```
1589 pub fn set_initial_delay<T>(mut self, v: T) -> Self
1590 where
1591 T: std::convert::Into<wkt::Duration>,
1592 {
1593 self.initial_delay = std::option::Option::Some(v.into());
1594 self
1595 }
1596
1597 /// Sets or clears the value of [initial_delay][crate::model::LivenessCheck::initial_delay].
1598 ///
1599 /// # Example
1600 /// ```ignore,no_run
1601 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1602 /// use wkt::Duration;
1603 /// let x = LivenessCheck::new().set_or_clear_initial_delay(Some(Duration::default()/* use setters */));
1604 /// let x = LivenessCheck::new().set_or_clear_initial_delay(None::<Duration>);
1605 /// ```
1606 pub fn set_or_clear_initial_delay<T>(mut self, v: std::option::Option<T>) -> Self
1607 where
1608 T: std::convert::Into<wkt::Duration>,
1609 {
1610 self.initial_delay = v.map(|x| x.into());
1611 self
1612 }
1613}
1614
1615impl wkt::message::Message for LivenessCheck {
1616 fn typename() -> &'static str {
1617 "type.googleapis.com/google.appengine.v1.LivenessCheck"
1618 }
1619}
1620
1621/// Third-party Python runtime library that is required by the application.
1622#[derive(Clone, Default, PartialEq)]
1623#[non_exhaustive]
1624pub struct Library {
1625 /// Name of the library. Example: "django".
1626 pub name: std::string::String,
1627
1628 /// Version of the library to select, or "latest".
1629 pub version: std::string::String,
1630
1631 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1632}
1633
1634impl Library {
1635 /// Creates a new default instance.
1636 pub fn new() -> Self {
1637 std::default::Default::default()
1638 }
1639
1640 /// Sets the value of [name][crate::model::Library::name].
1641 ///
1642 /// # Example
1643 /// ```ignore,no_run
1644 /// # use google_cloud_appengine_v1::model::Library;
1645 /// let x = Library::new().set_name("example");
1646 /// ```
1647 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.name = v.into();
1649 self
1650 }
1651
1652 /// Sets the value of [version][crate::model::Library::version].
1653 ///
1654 /// # Example
1655 /// ```ignore,no_run
1656 /// # use google_cloud_appengine_v1::model::Library;
1657 /// let x = Library::new().set_version("example");
1658 /// ```
1659 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1660 self.version = v.into();
1661 self
1662 }
1663}
1664
1665impl wkt::message::Message for Library {
1666 fn typename() -> &'static str {
1667 "type.googleapis.com/google.appengine.v1.Library"
1668 }
1669}
1670
1671/// Request message for `Applications.GetApplication`.
1672#[derive(Clone, Default, PartialEq)]
1673#[non_exhaustive]
1674pub struct GetApplicationRequest {
1675 /// Name of the Application resource to get. Example: `apps/myapp`.
1676 pub name: std::string::String,
1677
1678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1679}
1680
1681impl GetApplicationRequest {
1682 /// Creates a new default instance.
1683 pub fn new() -> Self {
1684 std::default::Default::default()
1685 }
1686
1687 /// Sets the value of [name][crate::model::GetApplicationRequest::name].
1688 ///
1689 /// # Example
1690 /// ```ignore,no_run
1691 /// # use google_cloud_appengine_v1::model::GetApplicationRequest;
1692 /// let x = GetApplicationRequest::new().set_name("example");
1693 /// ```
1694 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1695 self.name = v.into();
1696 self
1697 }
1698}
1699
1700impl wkt::message::Message for GetApplicationRequest {
1701 fn typename() -> &'static str {
1702 "type.googleapis.com/google.appengine.v1.GetApplicationRequest"
1703 }
1704}
1705
1706/// Request message for `Applications.CreateApplication`.
1707#[derive(Clone, Default, PartialEq)]
1708#[non_exhaustive]
1709pub struct CreateApplicationRequest {
1710 /// Application configuration.
1711 pub application: std::option::Option<crate::model::Application>,
1712
1713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1714}
1715
1716impl CreateApplicationRequest {
1717 /// Creates a new default instance.
1718 pub fn new() -> Self {
1719 std::default::Default::default()
1720 }
1721
1722 /// Sets the value of [application][crate::model::CreateApplicationRequest::application].
1723 ///
1724 /// # Example
1725 /// ```ignore,no_run
1726 /// # use google_cloud_appengine_v1::model::CreateApplicationRequest;
1727 /// use google_cloud_appengine_v1::model::Application;
1728 /// let x = CreateApplicationRequest::new().set_application(Application::default()/* use setters */);
1729 /// ```
1730 pub fn set_application<T>(mut self, v: T) -> Self
1731 where
1732 T: std::convert::Into<crate::model::Application>,
1733 {
1734 self.application = std::option::Option::Some(v.into());
1735 self
1736 }
1737
1738 /// Sets or clears the value of [application][crate::model::CreateApplicationRequest::application].
1739 ///
1740 /// # Example
1741 /// ```ignore,no_run
1742 /// # use google_cloud_appengine_v1::model::CreateApplicationRequest;
1743 /// use google_cloud_appengine_v1::model::Application;
1744 /// let x = CreateApplicationRequest::new().set_or_clear_application(Some(Application::default()/* use setters */));
1745 /// let x = CreateApplicationRequest::new().set_or_clear_application(None::<Application>);
1746 /// ```
1747 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
1748 where
1749 T: std::convert::Into<crate::model::Application>,
1750 {
1751 self.application = v.map(|x| x.into());
1752 self
1753 }
1754}
1755
1756impl wkt::message::Message for CreateApplicationRequest {
1757 fn typename() -> &'static str {
1758 "type.googleapis.com/google.appengine.v1.CreateApplicationRequest"
1759 }
1760}
1761
1762/// Request message for `Applications.UpdateApplication`.
1763#[derive(Clone, Default, PartialEq)]
1764#[non_exhaustive]
1765pub struct UpdateApplicationRequest {
1766 /// Name of the Application resource to update. Example: `apps/myapp`.
1767 pub name: std::string::String,
1768
1769 /// An Application containing the updated resource.
1770 pub application: std::option::Option<crate::model::Application>,
1771
1772 /// Required. Standard field mask for the set of fields to be updated.
1773 pub update_mask: std::option::Option<wkt::FieldMask>,
1774
1775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1776}
1777
1778impl UpdateApplicationRequest {
1779 /// Creates a new default instance.
1780 pub fn new() -> Self {
1781 std::default::Default::default()
1782 }
1783
1784 /// Sets the value of [name][crate::model::UpdateApplicationRequest::name].
1785 ///
1786 /// # Example
1787 /// ```ignore,no_run
1788 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1789 /// let x = UpdateApplicationRequest::new().set_name("example");
1790 /// ```
1791 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1792 self.name = v.into();
1793 self
1794 }
1795
1796 /// Sets the value of [application][crate::model::UpdateApplicationRequest::application].
1797 ///
1798 /// # Example
1799 /// ```ignore,no_run
1800 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1801 /// use google_cloud_appengine_v1::model::Application;
1802 /// let x = UpdateApplicationRequest::new().set_application(Application::default()/* use setters */);
1803 /// ```
1804 pub fn set_application<T>(mut self, v: T) -> Self
1805 where
1806 T: std::convert::Into<crate::model::Application>,
1807 {
1808 self.application = std::option::Option::Some(v.into());
1809 self
1810 }
1811
1812 /// Sets or clears the value of [application][crate::model::UpdateApplicationRequest::application].
1813 ///
1814 /// # Example
1815 /// ```ignore,no_run
1816 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1817 /// use google_cloud_appengine_v1::model::Application;
1818 /// let x = UpdateApplicationRequest::new().set_or_clear_application(Some(Application::default()/* use setters */));
1819 /// let x = UpdateApplicationRequest::new().set_or_clear_application(None::<Application>);
1820 /// ```
1821 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
1822 where
1823 T: std::convert::Into<crate::model::Application>,
1824 {
1825 self.application = v.map(|x| x.into());
1826 self
1827 }
1828
1829 /// Sets the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
1830 ///
1831 /// # Example
1832 /// ```ignore,no_run
1833 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1834 /// use wkt::FieldMask;
1835 /// let x = UpdateApplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1836 /// ```
1837 pub fn set_update_mask<T>(mut self, v: T) -> Self
1838 where
1839 T: std::convert::Into<wkt::FieldMask>,
1840 {
1841 self.update_mask = std::option::Option::Some(v.into());
1842 self
1843 }
1844
1845 /// Sets or clears the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
1846 ///
1847 /// # Example
1848 /// ```ignore,no_run
1849 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1850 /// use wkt::FieldMask;
1851 /// let x = UpdateApplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1852 /// let x = UpdateApplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1853 /// ```
1854 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1855 where
1856 T: std::convert::Into<wkt::FieldMask>,
1857 {
1858 self.update_mask = v.map(|x| x.into());
1859 self
1860 }
1861}
1862
1863impl wkt::message::Message for UpdateApplicationRequest {
1864 fn typename() -> &'static str {
1865 "type.googleapis.com/google.appengine.v1.UpdateApplicationRequest"
1866 }
1867}
1868
1869/// Request message for 'Applications.RepairApplication'.
1870#[derive(Clone, Default, PartialEq)]
1871#[non_exhaustive]
1872pub struct RepairApplicationRequest {
1873 /// Name of the application to repair. Example: `apps/myapp`
1874 pub name: std::string::String,
1875
1876 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1877}
1878
1879impl RepairApplicationRequest {
1880 /// Creates a new default instance.
1881 pub fn new() -> Self {
1882 std::default::Default::default()
1883 }
1884
1885 /// Sets the value of [name][crate::model::RepairApplicationRequest::name].
1886 ///
1887 /// # Example
1888 /// ```ignore,no_run
1889 /// # use google_cloud_appengine_v1::model::RepairApplicationRequest;
1890 /// let x = RepairApplicationRequest::new().set_name("example");
1891 /// ```
1892 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1893 self.name = v.into();
1894 self
1895 }
1896}
1897
1898impl wkt::message::Message for RepairApplicationRequest {
1899 fn typename() -> &'static str {
1900 "type.googleapis.com/google.appengine.v1.RepairApplicationRequest"
1901 }
1902}
1903
1904/// Request message for `Services.ListServices`.
1905#[derive(Clone, Default, PartialEq)]
1906#[non_exhaustive]
1907pub struct ListServicesRequest {
1908 /// Name of the parent Application resource. Example: `apps/myapp`.
1909 pub parent: std::string::String,
1910
1911 /// Maximum results to return per page.
1912 pub page_size: i32,
1913
1914 /// Continuation token for fetching the next page of results.
1915 pub page_token: std::string::String,
1916
1917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1918}
1919
1920impl ListServicesRequest {
1921 /// Creates a new default instance.
1922 pub fn new() -> Self {
1923 std::default::Default::default()
1924 }
1925
1926 /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
1927 ///
1928 /// # Example
1929 /// ```ignore,no_run
1930 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1931 /// let x = ListServicesRequest::new().set_parent("example");
1932 /// ```
1933 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1934 self.parent = v.into();
1935 self
1936 }
1937
1938 /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
1939 ///
1940 /// # Example
1941 /// ```ignore,no_run
1942 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1943 /// let x = ListServicesRequest::new().set_page_size(42);
1944 /// ```
1945 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1946 self.page_size = v.into();
1947 self
1948 }
1949
1950 /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
1951 ///
1952 /// # Example
1953 /// ```ignore,no_run
1954 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1955 /// let x = ListServicesRequest::new().set_page_token("example");
1956 /// ```
1957 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1958 self.page_token = v.into();
1959 self
1960 }
1961}
1962
1963impl wkt::message::Message for ListServicesRequest {
1964 fn typename() -> &'static str {
1965 "type.googleapis.com/google.appengine.v1.ListServicesRequest"
1966 }
1967}
1968
1969/// Response message for `Services.ListServices`.
1970#[derive(Clone, Default, PartialEq)]
1971#[non_exhaustive]
1972pub struct ListServicesResponse {
1973 /// The services belonging to the requested application.
1974 pub services: std::vec::Vec<crate::model::Service>,
1975
1976 /// Continuation token for fetching the next page of results.
1977 pub next_page_token: std::string::String,
1978
1979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1980}
1981
1982impl ListServicesResponse {
1983 /// Creates a new default instance.
1984 pub fn new() -> Self {
1985 std::default::Default::default()
1986 }
1987
1988 /// Sets the value of [services][crate::model::ListServicesResponse::services].
1989 ///
1990 /// # Example
1991 /// ```ignore,no_run
1992 /// # use google_cloud_appengine_v1::model::ListServicesResponse;
1993 /// use google_cloud_appengine_v1::model::Service;
1994 /// let x = ListServicesResponse::new()
1995 /// .set_services([
1996 /// Service::default()/* use setters */,
1997 /// Service::default()/* use (different) setters */,
1998 /// ]);
1999 /// ```
2000 pub fn set_services<T, V>(mut self, v: T) -> Self
2001 where
2002 T: std::iter::IntoIterator<Item = V>,
2003 V: std::convert::Into<crate::model::Service>,
2004 {
2005 use std::iter::Iterator;
2006 self.services = v.into_iter().map(|i| i.into()).collect();
2007 self
2008 }
2009
2010 /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
2011 ///
2012 /// # Example
2013 /// ```ignore,no_run
2014 /// # use google_cloud_appengine_v1::model::ListServicesResponse;
2015 /// let x = ListServicesResponse::new().set_next_page_token("example");
2016 /// ```
2017 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.next_page_token = v.into();
2019 self
2020 }
2021}
2022
2023impl wkt::message::Message for ListServicesResponse {
2024 fn typename() -> &'static str {
2025 "type.googleapis.com/google.appengine.v1.ListServicesResponse"
2026 }
2027}
2028
2029#[doc(hidden)]
2030impl google_cloud_gax::paginator::internal::PageableResponse for ListServicesResponse {
2031 type PageItem = crate::model::Service;
2032
2033 fn items(self) -> std::vec::Vec<Self::PageItem> {
2034 self.services
2035 }
2036
2037 fn next_page_token(&self) -> std::string::String {
2038 use std::clone::Clone;
2039 self.next_page_token.clone()
2040 }
2041}
2042
2043/// Request message for `Services.GetService`.
2044#[derive(Clone, Default, PartialEq)]
2045#[non_exhaustive]
2046pub struct GetServiceRequest {
2047 /// Name of the resource requested. Example: `apps/myapp/services/default`.
2048 pub name: std::string::String,
2049
2050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2051}
2052
2053impl GetServiceRequest {
2054 /// Creates a new default instance.
2055 pub fn new() -> Self {
2056 std::default::Default::default()
2057 }
2058
2059 /// Sets the value of [name][crate::model::GetServiceRequest::name].
2060 ///
2061 /// # Example
2062 /// ```ignore,no_run
2063 /// # use google_cloud_appengine_v1::model::GetServiceRequest;
2064 /// let x = GetServiceRequest::new().set_name("example");
2065 /// ```
2066 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2067 self.name = v.into();
2068 self
2069 }
2070}
2071
2072impl wkt::message::Message for GetServiceRequest {
2073 fn typename() -> &'static str {
2074 "type.googleapis.com/google.appengine.v1.GetServiceRequest"
2075 }
2076}
2077
2078/// Request message for `Services.UpdateService`.
2079#[derive(Clone, Default, PartialEq)]
2080#[non_exhaustive]
2081pub struct UpdateServiceRequest {
2082 /// Name of the resource to update. Example: `apps/myapp/services/default`.
2083 pub name: std::string::String,
2084
2085 /// A Service resource containing the updated service. Only fields set in the
2086 /// field mask will be updated.
2087 pub service: std::option::Option<crate::model::Service>,
2088
2089 /// Required. Standard field mask for the set of fields to be updated.
2090 pub update_mask: std::option::Option<wkt::FieldMask>,
2091
2092 /// Set to `true` to gradually shift traffic to one or more versions that you
2093 /// specify. By default, traffic is shifted immediately.
2094 /// For gradual traffic migration, the target versions
2095 /// must be located within instances that are configured for both
2096 /// [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType)
2097 /// and
2098 /// [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling).
2099 /// You must specify the
2100 /// [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy)
2101 /// field in the Service resource. Gradual traffic migration is not
2102 /// supported in the App Engine flexible environment. For examples, see
2103 /// [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
2104 pub migrate_traffic: bool,
2105
2106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2107}
2108
2109impl UpdateServiceRequest {
2110 /// Creates a new default instance.
2111 pub fn new() -> Self {
2112 std::default::Default::default()
2113 }
2114
2115 /// Sets the value of [name][crate::model::UpdateServiceRequest::name].
2116 ///
2117 /// # Example
2118 /// ```ignore,no_run
2119 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2120 /// let x = UpdateServiceRequest::new().set_name("example");
2121 /// ```
2122 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2123 self.name = v.into();
2124 self
2125 }
2126
2127 /// Sets 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_service(Service::default()/* use setters */);
2134 /// ```
2135 pub fn set_service<T>(mut self, v: T) -> Self
2136 where
2137 T: std::convert::Into<crate::model::Service>,
2138 {
2139 self.service = std::option::Option::Some(v.into());
2140 self
2141 }
2142
2143 /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
2144 ///
2145 /// # Example
2146 /// ```ignore,no_run
2147 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2148 /// use google_cloud_appengine_v1::model::Service;
2149 /// let x = UpdateServiceRequest::new().set_or_clear_service(Some(Service::default()/* use setters */));
2150 /// let x = UpdateServiceRequest::new().set_or_clear_service(None::<Service>);
2151 /// ```
2152 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
2153 where
2154 T: std::convert::Into<crate::model::Service>,
2155 {
2156 self.service = v.map(|x| x.into());
2157 self
2158 }
2159
2160 /// Sets 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_update_mask(FieldMask::default()/* use setters */);
2167 /// ```
2168 pub fn set_update_mask<T>(mut self, v: T) -> Self
2169 where
2170 T: std::convert::Into<wkt::FieldMask>,
2171 {
2172 self.update_mask = std::option::Option::Some(v.into());
2173 self
2174 }
2175
2176 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
2177 ///
2178 /// # Example
2179 /// ```ignore,no_run
2180 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2181 /// use wkt::FieldMask;
2182 /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2183 /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2184 /// ```
2185 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2186 where
2187 T: std::convert::Into<wkt::FieldMask>,
2188 {
2189 self.update_mask = v.map(|x| x.into());
2190 self
2191 }
2192
2193 /// Sets the value of [migrate_traffic][crate::model::UpdateServiceRequest::migrate_traffic].
2194 ///
2195 /// # Example
2196 /// ```ignore,no_run
2197 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2198 /// let x = UpdateServiceRequest::new().set_migrate_traffic(true);
2199 /// ```
2200 pub fn set_migrate_traffic<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2201 self.migrate_traffic = v.into();
2202 self
2203 }
2204}
2205
2206impl wkt::message::Message for UpdateServiceRequest {
2207 fn typename() -> &'static str {
2208 "type.googleapis.com/google.appengine.v1.UpdateServiceRequest"
2209 }
2210}
2211
2212/// Request message for `Services.DeleteService`.
2213#[derive(Clone, Default, PartialEq)]
2214#[non_exhaustive]
2215pub struct DeleteServiceRequest {
2216 /// Name of the resource requested. Example: `apps/myapp/services/default`.
2217 pub name: std::string::String,
2218
2219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2220}
2221
2222impl DeleteServiceRequest {
2223 /// Creates a new default instance.
2224 pub fn new() -> Self {
2225 std::default::Default::default()
2226 }
2227
2228 /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
2229 ///
2230 /// # Example
2231 /// ```ignore,no_run
2232 /// # use google_cloud_appengine_v1::model::DeleteServiceRequest;
2233 /// let x = DeleteServiceRequest::new().set_name("example");
2234 /// ```
2235 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2236 self.name = v.into();
2237 self
2238 }
2239}
2240
2241impl wkt::message::Message for DeleteServiceRequest {
2242 fn typename() -> &'static str {
2243 "type.googleapis.com/google.appengine.v1.DeleteServiceRequest"
2244 }
2245}
2246
2247/// Request message for `Versions.ListVersions`.
2248#[derive(Clone, Default, PartialEq)]
2249#[non_exhaustive]
2250pub struct ListVersionsRequest {
2251 /// Name of the parent Service resource. Example:
2252 /// `apps/myapp/services/default`.
2253 pub parent: std::string::String,
2254
2255 /// Controls the set of fields returned in the `List` response.
2256 pub view: crate::model::VersionView,
2257
2258 /// Maximum results to return per page.
2259 pub page_size: i32,
2260
2261 /// Continuation token for fetching the next page of results.
2262 pub page_token: std::string::String,
2263
2264 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2265}
2266
2267impl ListVersionsRequest {
2268 /// Creates a new default instance.
2269 pub fn new() -> Self {
2270 std::default::Default::default()
2271 }
2272
2273 /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
2274 ///
2275 /// # Example
2276 /// ```ignore,no_run
2277 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2278 /// let x = ListVersionsRequest::new().set_parent("example");
2279 /// ```
2280 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2281 self.parent = v.into();
2282 self
2283 }
2284
2285 /// Sets the value of [view][crate::model::ListVersionsRequest::view].
2286 ///
2287 /// # Example
2288 /// ```ignore,no_run
2289 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2290 /// use google_cloud_appengine_v1::model::VersionView;
2291 /// let x0 = ListVersionsRequest::new().set_view(VersionView::Full);
2292 /// ```
2293 pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
2294 self.view = v.into();
2295 self
2296 }
2297
2298 /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
2299 ///
2300 /// # Example
2301 /// ```ignore,no_run
2302 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2303 /// let x = ListVersionsRequest::new().set_page_size(42);
2304 /// ```
2305 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2306 self.page_size = v.into();
2307 self
2308 }
2309
2310 /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
2311 ///
2312 /// # Example
2313 /// ```ignore,no_run
2314 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2315 /// let x = ListVersionsRequest::new().set_page_token("example");
2316 /// ```
2317 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.page_token = v.into();
2319 self
2320 }
2321}
2322
2323impl wkt::message::Message for ListVersionsRequest {
2324 fn typename() -> &'static str {
2325 "type.googleapis.com/google.appengine.v1.ListVersionsRequest"
2326 }
2327}
2328
2329/// Response message for `Versions.ListVersions`.
2330#[derive(Clone, Default, PartialEq)]
2331#[non_exhaustive]
2332pub struct ListVersionsResponse {
2333 /// The versions belonging to the requested service.
2334 pub versions: std::vec::Vec<crate::model::Version>,
2335
2336 /// Continuation token for fetching the next page of results.
2337 pub next_page_token: std::string::String,
2338
2339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2340}
2341
2342impl ListVersionsResponse {
2343 /// Creates a new default instance.
2344 pub fn new() -> Self {
2345 std::default::Default::default()
2346 }
2347
2348 /// Sets the value of [versions][crate::model::ListVersionsResponse::versions].
2349 ///
2350 /// # Example
2351 /// ```ignore,no_run
2352 /// # use google_cloud_appengine_v1::model::ListVersionsResponse;
2353 /// use google_cloud_appengine_v1::model::Version;
2354 /// let x = ListVersionsResponse::new()
2355 /// .set_versions([
2356 /// Version::default()/* use setters */,
2357 /// Version::default()/* use (different) setters */,
2358 /// ]);
2359 /// ```
2360 pub fn set_versions<T, V>(mut self, v: T) -> Self
2361 where
2362 T: std::iter::IntoIterator<Item = V>,
2363 V: std::convert::Into<crate::model::Version>,
2364 {
2365 use std::iter::Iterator;
2366 self.versions = v.into_iter().map(|i| i.into()).collect();
2367 self
2368 }
2369
2370 /// Sets the value of [next_page_token][crate::model::ListVersionsResponse::next_page_token].
2371 ///
2372 /// # Example
2373 /// ```ignore,no_run
2374 /// # use google_cloud_appengine_v1::model::ListVersionsResponse;
2375 /// let x = ListVersionsResponse::new().set_next_page_token("example");
2376 /// ```
2377 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2378 self.next_page_token = v.into();
2379 self
2380 }
2381}
2382
2383impl wkt::message::Message for ListVersionsResponse {
2384 fn typename() -> &'static str {
2385 "type.googleapis.com/google.appengine.v1.ListVersionsResponse"
2386 }
2387}
2388
2389#[doc(hidden)]
2390impl google_cloud_gax::paginator::internal::PageableResponse for ListVersionsResponse {
2391 type PageItem = crate::model::Version;
2392
2393 fn items(self) -> std::vec::Vec<Self::PageItem> {
2394 self.versions
2395 }
2396
2397 fn next_page_token(&self) -> std::string::String {
2398 use std::clone::Clone;
2399 self.next_page_token.clone()
2400 }
2401}
2402
2403/// Request message for `Versions.GetVersion`.
2404#[derive(Clone, Default, PartialEq)]
2405#[non_exhaustive]
2406pub struct GetVersionRequest {
2407 /// Name of the resource requested. Example:
2408 /// `apps/myapp/services/default/versions/v1`.
2409 pub name: std::string::String,
2410
2411 /// Controls the set of fields returned in the `Get` response.
2412 pub view: crate::model::VersionView,
2413
2414 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2415}
2416
2417impl GetVersionRequest {
2418 /// Creates a new default instance.
2419 pub fn new() -> Self {
2420 std::default::Default::default()
2421 }
2422
2423 /// Sets the value of [name][crate::model::GetVersionRequest::name].
2424 ///
2425 /// # Example
2426 /// ```ignore,no_run
2427 /// # use google_cloud_appengine_v1::model::GetVersionRequest;
2428 /// let x = GetVersionRequest::new().set_name("example");
2429 /// ```
2430 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2431 self.name = v.into();
2432 self
2433 }
2434
2435 /// Sets the value of [view][crate::model::GetVersionRequest::view].
2436 ///
2437 /// # Example
2438 /// ```ignore,no_run
2439 /// # use google_cloud_appengine_v1::model::GetVersionRequest;
2440 /// use google_cloud_appengine_v1::model::VersionView;
2441 /// let x0 = GetVersionRequest::new().set_view(VersionView::Full);
2442 /// ```
2443 pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
2444 self.view = v.into();
2445 self
2446 }
2447}
2448
2449impl wkt::message::Message for GetVersionRequest {
2450 fn typename() -> &'static str {
2451 "type.googleapis.com/google.appengine.v1.GetVersionRequest"
2452 }
2453}
2454
2455/// Request message for `Versions.CreateVersion`.
2456#[derive(Clone, Default, PartialEq)]
2457#[non_exhaustive]
2458pub struct CreateVersionRequest {
2459 /// Name of the parent resource to create this version under. Example:
2460 /// `apps/myapp/services/default`.
2461 pub parent: std::string::String,
2462
2463 /// Application deployment configuration.
2464 pub version: std::option::Option<crate::model::Version>,
2465
2466 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2467}
2468
2469impl CreateVersionRequest {
2470 /// Creates a new default instance.
2471 pub fn new() -> Self {
2472 std::default::Default::default()
2473 }
2474
2475 /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
2476 ///
2477 /// # Example
2478 /// ```ignore,no_run
2479 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2480 /// let x = CreateVersionRequest::new().set_parent("example");
2481 /// ```
2482 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2483 self.parent = v.into();
2484 self
2485 }
2486
2487 /// Sets the value of [version][crate::model::CreateVersionRequest::version].
2488 ///
2489 /// # Example
2490 /// ```ignore,no_run
2491 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2492 /// use google_cloud_appengine_v1::model::Version;
2493 /// let x = CreateVersionRequest::new().set_version(Version::default()/* use setters */);
2494 /// ```
2495 pub fn set_version<T>(mut self, v: T) -> Self
2496 where
2497 T: std::convert::Into<crate::model::Version>,
2498 {
2499 self.version = std::option::Option::Some(v.into());
2500 self
2501 }
2502
2503 /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
2504 ///
2505 /// # Example
2506 /// ```ignore,no_run
2507 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2508 /// use google_cloud_appengine_v1::model::Version;
2509 /// let x = CreateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
2510 /// let x = CreateVersionRequest::new().set_or_clear_version(None::<Version>);
2511 /// ```
2512 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2513 where
2514 T: std::convert::Into<crate::model::Version>,
2515 {
2516 self.version = v.map(|x| x.into());
2517 self
2518 }
2519}
2520
2521impl wkt::message::Message for CreateVersionRequest {
2522 fn typename() -> &'static str {
2523 "type.googleapis.com/google.appengine.v1.CreateVersionRequest"
2524 }
2525}
2526
2527/// Request message for `Versions.UpdateVersion`.
2528#[derive(Clone, Default, PartialEq)]
2529#[non_exhaustive]
2530pub struct UpdateVersionRequest {
2531 /// Name of the resource to update. Example:
2532 /// `apps/myapp/services/default/versions/1`.
2533 pub name: std::string::String,
2534
2535 /// A Version containing the updated resource. Only fields set in the field
2536 /// mask will be updated.
2537 pub version: std::option::Option<crate::model::Version>,
2538
2539 /// Standard field mask for the set of fields to be updated.
2540 pub update_mask: std::option::Option<wkt::FieldMask>,
2541
2542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2543}
2544
2545impl UpdateVersionRequest {
2546 /// Creates a new default instance.
2547 pub fn new() -> Self {
2548 std::default::Default::default()
2549 }
2550
2551 /// Sets the value of [name][crate::model::UpdateVersionRequest::name].
2552 ///
2553 /// # Example
2554 /// ```ignore,no_run
2555 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2556 /// let x = UpdateVersionRequest::new().set_name("example");
2557 /// ```
2558 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2559 self.name = v.into();
2560 self
2561 }
2562
2563 /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
2564 ///
2565 /// # Example
2566 /// ```ignore,no_run
2567 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2568 /// use google_cloud_appengine_v1::model::Version;
2569 /// let x = UpdateVersionRequest::new().set_version(Version::default()/* use setters */);
2570 /// ```
2571 pub fn set_version<T>(mut self, v: T) -> Self
2572 where
2573 T: std::convert::Into<crate::model::Version>,
2574 {
2575 self.version = std::option::Option::Some(v.into());
2576 self
2577 }
2578
2579 /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
2580 ///
2581 /// # Example
2582 /// ```ignore,no_run
2583 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2584 /// use google_cloud_appengine_v1::model::Version;
2585 /// let x = UpdateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
2586 /// let x = UpdateVersionRequest::new().set_or_clear_version(None::<Version>);
2587 /// ```
2588 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2589 where
2590 T: std::convert::Into<crate::model::Version>,
2591 {
2592 self.version = v.map(|x| x.into());
2593 self
2594 }
2595
2596 /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
2597 ///
2598 /// # Example
2599 /// ```ignore,no_run
2600 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2601 /// use wkt::FieldMask;
2602 /// let x = UpdateVersionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2603 /// ```
2604 pub fn set_update_mask<T>(mut self, v: T) -> Self
2605 where
2606 T: std::convert::Into<wkt::FieldMask>,
2607 {
2608 self.update_mask = std::option::Option::Some(v.into());
2609 self
2610 }
2611
2612 /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
2613 ///
2614 /// # Example
2615 /// ```ignore,no_run
2616 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2617 /// use wkt::FieldMask;
2618 /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2619 /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2620 /// ```
2621 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2622 where
2623 T: std::convert::Into<wkt::FieldMask>,
2624 {
2625 self.update_mask = v.map(|x| x.into());
2626 self
2627 }
2628}
2629
2630impl wkt::message::Message for UpdateVersionRequest {
2631 fn typename() -> &'static str {
2632 "type.googleapis.com/google.appengine.v1.UpdateVersionRequest"
2633 }
2634}
2635
2636/// Request message for `Versions.DeleteVersion`.
2637#[derive(Clone, Default, PartialEq)]
2638#[non_exhaustive]
2639pub struct DeleteVersionRequest {
2640 /// Name of the resource requested. Example:
2641 /// `apps/myapp/services/default/versions/v1`.
2642 pub name: std::string::String,
2643
2644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2645}
2646
2647impl DeleteVersionRequest {
2648 /// Creates a new default instance.
2649 pub fn new() -> Self {
2650 std::default::Default::default()
2651 }
2652
2653 /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
2654 ///
2655 /// # Example
2656 /// ```ignore,no_run
2657 /// # use google_cloud_appengine_v1::model::DeleteVersionRequest;
2658 /// let x = DeleteVersionRequest::new().set_name("example");
2659 /// ```
2660 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2661 self.name = v.into();
2662 self
2663 }
2664}
2665
2666impl wkt::message::Message for DeleteVersionRequest {
2667 fn typename() -> &'static str {
2668 "type.googleapis.com/google.appengine.v1.DeleteVersionRequest"
2669 }
2670}
2671
2672/// Request message for `Instances.ListInstances`.
2673#[derive(Clone, Default, PartialEq)]
2674#[non_exhaustive]
2675pub struct ListInstancesRequest {
2676 /// Name of the parent Version resource. Example:
2677 /// `apps/myapp/services/default/versions/v1`.
2678 pub parent: std::string::String,
2679
2680 /// Maximum results to return per page.
2681 pub page_size: i32,
2682
2683 /// Continuation token for fetching the next page of results.
2684 pub page_token: std::string::String,
2685
2686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2687}
2688
2689impl ListInstancesRequest {
2690 /// Creates a new default instance.
2691 pub fn new() -> Self {
2692 std::default::Default::default()
2693 }
2694
2695 /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
2696 ///
2697 /// # Example
2698 /// ```ignore,no_run
2699 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2700 /// let x = ListInstancesRequest::new().set_parent("example");
2701 /// ```
2702 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2703 self.parent = v.into();
2704 self
2705 }
2706
2707 /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
2708 ///
2709 /// # Example
2710 /// ```ignore,no_run
2711 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2712 /// let x = ListInstancesRequest::new().set_page_size(42);
2713 /// ```
2714 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2715 self.page_size = v.into();
2716 self
2717 }
2718
2719 /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
2720 ///
2721 /// # Example
2722 /// ```ignore,no_run
2723 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2724 /// let x = ListInstancesRequest::new().set_page_token("example");
2725 /// ```
2726 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2727 self.page_token = v.into();
2728 self
2729 }
2730}
2731
2732impl wkt::message::Message for ListInstancesRequest {
2733 fn typename() -> &'static str {
2734 "type.googleapis.com/google.appengine.v1.ListInstancesRequest"
2735 }
2736}
2737
2738/// Response message for `Instances.ListInstances`.
2739#[derive(Clone, Default, PartialEq)]
2740#[non_exhaustive]
2741pub struct ListInstancesResponse {
2742 /// The instances belonging to the requested version.
2743 pub instances: std::vec::Vec<crate::model::Instance>,
2744
2745 /// Continuation token for fetching the next page of results.
2746 pub next_page_token: std::string::String,
2747
2748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2749}
2750
2751impl ListInstancesResponse {
2752 /// Creates a new default instance.
2753 pub fn new() -> Self {
2754 std::default::Default::default()
2755 }
2756
2757 /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
2758 ///
2759 /// # Example
2760 /// ```ignore,no_run
2761 /// # use google_cloud_appengine_v1::model::ListInstancesResponse;
2762 /// use google_cloud_appengine_v1::model::Instance;
2763 /// let x = ListInstancesResponse::new()
2764 /// .set_instances([
2765 /// Instance::default()/* use setters */,
2766 /// Instance::default()/* use (different) setters */,
2767 /// ]);
2768 /// ```
2769 pub fn set_instances<T, V>(mut self, v: T) -> Self
2770 where
2771 T: std::iter::IntoIterator<Item = V>,
2772 V: std::convert::Into<crate::model::Instance>,
2773 {
2774 use std::iter::Iterator;
2775 self.instances = v.into_iter().map(|i| i.into()).collect();
2776 self
2777 }
2778
2779 /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
2780 ///
2781 /// # Example
2782 /// ```ignore,no_run
2783 /// # use google_cloud_appengine_v1::model::ListInstancesResponse;
2784 /// let x = ListInstancesResponse::new().set_next_page_token("example");
2785 /// ```
2786 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2787 self.next_page_token = v.into();
2788 self
2789 }
2790}
2791
2792impl wkt::message::Message for ListInstancesResponse {
2793 fn typename() -> &'static str {
2794 "type.googleapis.com/google.appengine.v1.ListInstancesResponse"
2795 }
2796}
2797
2798#[doc(hidden)]
2799impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
2800 type PageItem = crate::model::Instance;
2801
2802 fn items(self) -> std::vec::Vec<Self::PageItem> {
2803 self.instances
2804 }
2805
2806 fn next_page_token(&self) -> std::string::String {
2807 use std::clone::Clone;
2808 self.next_page_token.clone()
2809 }
2810}
2811
2812/// Request message for `Instances.GetInstance`.
2813#[derive(Clone, Default, PartialEq)]
2814#[non_exhaustive]
2815pub struct GetInstanceRequest {
2816 /// Name of the resource requested. Example:
2817 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2818 pub name: std::string::String,
2819
2820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2821}
2822
2823impl GetInstanceRequest {
2824 /// Creates a new default instance.
2825 pub fn new() -> Self {
2826 std::default::Default::default()
2827 }
2828
2829 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2830 ///
2831 /// # Example
2832 /// ```ignore,no_run
2833 /// # use google_cloud_appengine_v1::model::GetInstanceRequest;
2834 /// let x = GetInstanceRequest::new().set_name("example");
2835 /// ```
2836 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2837 self.name = v.into();
2838 self
2839 }
2840}
2841
2842impl wkt::message::Message for GetInstanceRequest {
2843 fn typename() -> &'static str {
2844 "type.googleapis.com/google.appengine.v1.GetInstanceRequest"
2845 }
2846}
2847
2848/// Request message for `Instances.DeleteInstance`.
2849#[derive(Clone, Default, PartialEq)]
2850#[non_exhaustive]
2851pub struct DeleteInstanceRequest {
2852 /// Name of the resource requested. Example:
2853 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2854 pub name: std::string::String,
2855
2856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2857}
2858
2859impl DeleteInstanceRequest {
2860 /// Creates a new default instance.
2861 pub fn new() -> Self {
2862 std::default::Default::default()
2863 }
2864
2865 /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
2866 ///
2867 /// # Example
2868 /// ```ignore,no_run
2869 /// # use google_cloud_appengine_v1::model::DeleteInstanceRequest;
2870 /// let x = DeleteInstanceRequest::new().set_name("example");
2871 /// ```
2872 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2873 self.name = v.into();
2874 self
2875 }
2876}
2877
2878impl wkt::message::Message for DeleteInstanceRequest {
2879 fn typename() -> &'static str {
2880 "type.googleapis.com/google.appengine.v1.DeleteInstanceRequest"
2881 }
2882}
2883
2884/// Request message for `Instances.DebugInstance`.
2885#[derive(Clone, Default, PartialEq)]
2886#[non_exhaustive]
2887pub struct DebugInstanceRequest {
2888 /// Name of the resource requested. Example:
2889 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2890 pub name: std::string::String,
2891
2892 /// Public SSH key to add to the instance. Examples:
2893 ///
2894 /// * `[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]`
2895 /// * `[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}`
2896 ///
2897 /// For more information, see
2898 /// [Adding and Removing SSH Keys](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).
2899 pub ssh_key: std::string::String,
2900
2901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2902}
2903
2904impl DebugInstanceRequest {
2905 /// Creates a new default instance.
2906 pub fn new() -> Self {
2907 std::default::Default::default()
2908 }
2909
2910 /// Sets the value of [name][crate::model::DebugInstanceRequest::name].
2911 ///
2912 /// # Example
2913 /// ```ignore,no_run
2914 /// # use google_cloud_appengine_v1::model::DebugInstanceRequest;
2915 /// let x = DebugInstanceRequest::new().set_name("example");
2916 /// ```
2917 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2918 self.name = v.into();
2919 self
2920 }
2921
2922 /// Sets the value of [ssh_key][crate::model::DebugInstanceRequest::ssh_key].
2923 ///
2924 /// # Example
2925 /// ```ignore,no_run
2926 /// # use google_cloud_appengine_v1::model::DebugInstanceRequest;
2927 /// let x = DebugInstanceRequest::new().set_ssh_key("example");
2928 /// ```
2929 pub fn set_ssh_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2930 self.ssh_key = v.into();
2931 self
2932 }
2933}
2934
2935impl wkt::message::Message for DebugInstanceRequest {
2936 fn typename() -> &'static str {
2937 "type.googleapis.com/google.appengine.v1.DebugInstanceRequest"
2938 }
2939}
2940
2941/// Request message for `Firewall.ListIngressRules`.
2942#[derive(Clone, Default, PartialEq)]
2943#[non_exhaustive]
2944pub struct ListIngressRulesRequest {
2945 /// Name of the Firewall collection to retrieve.
2946 /// Example: `apps/myapp/firewall/ingressRules`.
2947 pub parent: std::string::String,
2948
2949 /// Maximum results to return per page.
2950 pub page_size: i32,
2951
2952 /// Continuation token for fetching the next page of results.
2953 pub page_token: std::string::String,
2954
2955 /// A valid IP Address. If set, only rules matching this address will be
2956 /// returned. The first returned rule will be the rule that fires on requests
2957 /// from this IP.
2958 pub matching_address: std::string::String,
2959
2960 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2961}
2962
2963impl ListIngressRulesRequest {
2964 /// Creates a new default instance.
2965 pub fn new() -> Self {
2966 std::default::Default::default()
2967 }
2968
2969 /// Sets the value of [parent][crate::model::ListIngressRulesRequest::parent].
2970 ///
2971 /// # Example
2972 /// ```ignore,no_run
2973 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2974 /// let x = ListIngressRulesRequest::new().set_parent("example");
2975 /// ```
2976 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2977 self.parent = v.into();
2978 self
2979 }
2980
2981 /// Sets the value of [page_size][crate::model::ListIngressRulesRequest::page_size].
2982 ///
2983 /// # Example
2984 /// ```ignore,no_run
2985 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2986 /// let x = ListIngressRulesRequest::new().set_page_size(42);
2987 /// ```
2988 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2989 self.page_size = v.into();
2990 self
2991 }
2992
2993 /// Sets the value of [page_token][crate::model::ListIngressRulesRequest::page_token].
2994 ///
2995 /// # Example
2996 /// ```ignore,no_run
2997 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2998 /// let x = ListIngressRulesRequest::new().set_page_token("example");
2999 /// ```
3000 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3001 self.page_token = v.into();
3002 self
3003 }
3004
3005 /// Sets the value of [matching_address][crate::model::ListIngressRulesRequest::matching_address].
3006 ///
3007 /// # Example
3008 /// ```ignore,no_run
3009 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
3010 /// let x = ListIngressRulesRequest::new().set_matching_address("example");
3011 /// ```
3012 pub fn set_matching_address<T: std::convert::Into<std::string::String>>(
3013 mut self,
3014 v: T,
3015 ) -> Self {
3016 self.matching_address = v.into();
3017 self
3018 }
3019}
3020
3021impl wkt::message::Message for ListIngressRulesRequest {
3022 fn typename() -> &'static str {
3023 "type.googleapis.com/google.appengine.v1.ListIngressRulesRequest"
3024 }
3025}
3026
3027/// Response message for `Firewall.ListIngressRules`.
3028#[derive(Clone, Default, PartialEq)]
3029#[non_exhaustive]
3030pub struct ListIngressRulesResponse {
3031 /// The ingress FirewallRules for this application.
3032 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3033
3034 /// Continuation token for fetching the next page of results.
3035 pub next_page_token: std::string::String,
3036
3037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3038}
3039
3040impl ListIngressRulesResponse {
3041 /// Creates a new default instance.
3042 pub fn new() -> Self {
3043 std::default::Default::default()
3044 }
3045
3046 /// Sets the value of [ingress_rules][crate::model::ListIngressRulesResponse::ingress_rules].
3047 ///
3048 /// # Example
3049 /// ```ignore,no_run
3050 /// # use google_cloud_appengine_v1::model::ListIngressRulesResponse;
3051 /// use google_cloud_appengine_v1::model::FirewallRule;
3052 /// let x = ListIngressRulesResponse::new()
3053 /// .set_ingress_rules([
3054 /// FirewallRule::default()/* use setters */,
3055 /// FirewallRule::default()/* use (different) setters */,
3056 /// ]);
3057 /// ```
3058 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3059 where
3060 T: std::iter::IntoIterator<Item = V>,
3061 V: std::convert::Into<crate::model::FirewallRule>,
3062 {
3063 use std::iter::Iterator;
3064 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3065 self
3066 }
3067
3068 /// Sets the value of [next_page_token][crate::model::ListIngressRulesResponse::next_page_token].
3069 ///
3070 /// # Example
3071 /// ```ignore,no_run
3072 /// # use google_cloud_appengine_v1::model::ListIngressRulesResponse;
3073 /// let x = ListIngressRulesResponse::new().set_next_page_token("example");
3074 /// ```
3075 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3076 self.next_page_token = v.into();
3077 self
3078 }
3079}
3080
3081impl wkt::message::Message for ListIngressRulesResponse {
3082 fn typename() -> &'static str {
3083 "type.googleapis.com/google.appengine.v1.ListIngressRulesResponse"
3084 }
3085}
3086
3087#[doc(hidden)]
3088impl google_cloud_gax::paginator::internal::PageableResponse for ListIngressRulesResponse {
3089 type PageItem = crate::model::FirewallRule;
3090
3091 fn items(self) -> std::vec::Vec<Self::PageItem> {
3092 self.ingress_rules
3093 }
3094
3095 fn next_page_token(&self) -> std::string::String {
3096 use std::clone::Clone;
3097 self.next_page_token.clone()
3098 }
3099}
3100
3101/// Request message for `Firewall.BatchUpdateIngressRules`.
3102#[derive(Clone, Default, PartialEq)]
3103#[non_exhaustive]
3104pub struct BatchUpdateIngressRulesRequest {
3105 /// Name of the Firewall collection to set.
3106 /// Example: `apps/myapp/firewall/ingressRules`.
3107 pub name: std::string::String,
3108
3109 /// A list of FirewallRules to replace the existing set.
3110 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3111
3112 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3113}
3114
3115impl BatchUpdateIngressRulesRequest {
3116 /// Creates a new default instance.
3117 pub fn new() -> Self {
3118 std::default::Default::default()
3119 }
3120
3121 /// Sets the value of [name][crate::model::BatchUpdateIngressRulesRequest::name].
3122 ///
3123 /// # Example
3124 /// ```ignore,no_run
3125 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesRequest;
3126 /// let x = BatchUpdateIngressRulesRequest::new().set_name("example");
3127 /// ```
3128 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3129 self.name = v.into();
3130 self
3131 }
3132
3133 /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesRequest::ingress_rules].
3134 ///
3135 /// # Example
3136 /// ```ignore,no_run
3137 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesRequest;
3138 /// use google_cloud_appengine_v1::model::FirewallRule;
3139 /// let x = BatchUpdateIngressRulesRequest::new()
3140 /// .set_ingress_rules([
3141 /// FirewallRule::default()/* use setters */,
3142 /// FirewallRule::default()/* use (different) setters */,
3143 /// ]);
3144 /// ```
3145 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3146 where
3147 T: std::iter::IntoIterator<Item = V>,
3148 V: std::convert::Into<crate::model::FirewallRule>,
3149 {
3150 use std::iter::Iterator;
3151 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3152 self
3153 }
3154}
3155
3156impl wkt::message::Message for BatchUpdateIngressRulesRequest {
3157 fn typename() -> &'static str {
3158 "type.googleapis.com/google.appengine.v1.BatchUpdateIngressRulesRequest"
3159 }
3160}
3161
3162/// Response message for `Firewall.UpdateAllIngressRules`.
3163#[derive(Clone, Default, PartialEq)]
3164#[non_exhaustive]
3165pub struct BatchUpdateIngressRulesResponse {
3166 /// The full list of ingress FirewallRules for this application.
3167 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3168
3169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3170}
3171
3172impl BatchUpdateIngressRulesResponse {
3173 /// Creates a new default instance.
3174 pub fn new() -> Self {
3175 std::default::Default::default()
3176 }
3177
3178 /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesResponse::ingress_rules].
3179 ///
3180 /// # Example
3181 /// ```ignore,no_run
3182 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesResponse;
3183 /// use google_cloud_appengine_v1::model::FirewallRule;
3184 /// let x = BatchUpdateIngressRulesResponse::new()
3185 /// .set_ingress_rules([
3186 /// FirewallRule::default()/* use setters */,
3187 /// FirewallRule::default()/* use (different) setters */,
3188 /// ]);
3189 /// ```
3190 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3191 where
3192 T: std::iter::IntoIterator<Item = V>,
3193 V: std::convert::Into<crate::model::FirewallRule>,
3194 {
3195 use std::iter::Iterator;
3196 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3197 self
3198 }
3199}
3200
3201impl wkt::message::Message for BatchUpdateIngressRulesResponse {
3202 fn typename() -> &'static str {
3203 "type.googleapis.com/google.appengine.v1.BatchUpdateIngressRulesResponse"
3204 }
3205}
3206
3207/// Request message for `Firewall.CreateIngressRule`.
3208#[derive(Clone, Default, PartialEq)]
3209#[non_exhaustive]
3210pub struct CreateIngressRuleRequest {
3211 /// Name of the parent Firewall collection in which to create a new rule.
3212 /// Example: `apps/myapp/firewall/ingressRules`.
3213 pub parent: std::string::String,
3214
3215 /// A FirewallRule containing the new resource.
3216 ///
3217 /// The user may optionally provide a position at which the new rule will be
3218 /// placed. The positions define a sequential list starting at 1. If a rule
3219 /// already exists at the given position, rules greater than the provided
3220 /// position will be moved forward by one.
3221 ///
3222 /// If no position is provided, the server will place the rule as the second to
3223 /// last rule in the sequence before the required default allow-all or deny-all
3224 /// rule.
3225 pub rule: std::option::Option<crate::model::FirewallRule>,
3226
3227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3228}
3229
3230impl CreateIngressRuleRequest {
3231 /// Creates a new default instance.
3232 pub fn new() -> Self {
3233 std::default::Default::default()
3234 }
3235
3236 /// Sets the value of [parent][crate::model::CreateIngressRuleRequest::parent].
3237 ///
3238 /// # Example
3239 /// ```ignore,no_run
3240 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3241 /// let x = CreateIngressRuleRequest::new().set_parent("example");
3242 /// ```
3243 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3244 self.parent = v.into();
3245 self
3246 }
3247
3248 /// Sets the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3249 ///
3250 /// # Example
3251 /// ```ignore,no_run
3252 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3253 /// use google_cloud_appengine_v1::model::FirewallRule;
3254 /// let x = CreateIngressRuleRequest::new().set_rule(FirewallRule::default()/* use setters */);
3255 /// ```
3256 pub fn set_rule<T>(mut self, v: T) -> Self
3257 where
3258 T: std::convert::Into<crate::model::FirewallRule>,
3259 {
3260 self.rule = std::option::Option::Some(v.into());
3261 self
3262 }
3263
3264 /// Sets or clears the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3265 ///
3266 /// # Example
3267 /// ```ignore,no_run
3268 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3269 /// use google_cloud_appengine_v1::model::FirewallRule;
3270 /// let x = CreateIngressRuleRequest::new().set_or_clear_rule(Some(FirewallRule::default()/* use setters */));
3271 /// let x = CreateIngressRuleRequest::new().set_or_clear_rule(None::<FirewallRule>);
3272 /// ```
3273 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3274 where
3275 T: std::convert::Into<crate::model::FirewallRule>,
3276 {
3277 self.rule = v.map(|x| x.into());
3278 self
3279 }
3280}
3281
3282impl wkt::message::Message for CreateIngressRuleRequest {
3283 fn typename() -> &'static str {
3284 "type.googleapis.com/google.appengine.v1.CreateIngressRuleRequest"
3285 }
3286}
3287
3288/// Request message for `Firewall.GetIngressRule`.
3289#[derive(Clone, Default, PartialEq)]
3290#[non_exhaustive]
3291pub struct GetIngressRuleRequest {
3292 /// Name of the Firewall resource to retrieve.
3293 /// Example: `apps/myapp/firewall/ingressRules/100`.
3294 pub name: std::string::String,
3295
3296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3297}
3298
3299impl GetIngressRuleRequest {
3300 /// Creates a new default instance.
3301 pub fn new() -> Self {
3302 std::default::Default::default()
3303 }
3304
3305 /// Sets the value of [name][crate::model::GetIngressRuleRequest::name].
3306 ///
3307 /// # Example
3308 /// ```ignore,no_run
3309 /// # use google_cloud_appengine_v1::model::GetIngressRuleRequest;
3310 /// let x = GetIngressRuleRequest::new().set_name("example");
3311 /// ```
3312 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3313 self.name = v.into();
3314 self
3315 }
3316}
3317
3318impl wkt::message::Message for GetIngressRuleRequest {
3319 fn typename() -> &'static str {
3320 "type.googleapis.com/google.appengine.v1.GetIngressRuleRequest"
3321 }
3322}
3323
3324/// Request message for `Firewall.UpdateIngressRule`.
3325#[derive(Clone, Default, PartialEq)]
3326#[non_exhaustive]
3327pub struct UpdateIngressRuleRequest {
3328 /// Name of the Firewall resource to update.
3329 /// Example: `apps/myapp/firewall/ingressRules/100`.
3330 pub name: std::string::String,
3331
3332 /// A FirewallRule containing the updated resource
3333 pub rule: std::option::Option<crate::model::FirewallRule>,
3334
3335 /// Standard field mask for the set of fields to be updated.
3336 pub update_mask: std::option::Option<wkt::FieldMask>,
3337
3338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3339}
3340
3341impl UpdateIngressRuleRequest {
3342 /// Creates a new default instance.
3343 pub fn new() -> Self {
3344 std::default::Default::default()
3345 }
3346
3347 /// Sets the value of [name][crate::model::UpdateIngressRuleRequest::name].
3348 ///
3349 /// # Example
3350 /// ```ignore,no_run
3351 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3352 /// let x = UpdateIngressRuleRequest::new().set_name("example");
3353 /// ```
3354 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3355 self.name = v.into();
3356 self
3357 }
3358
3359 /// Sets the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3360 ///
3361 /// # Example
3362 /// ```ignore,no_run
3363 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3364 /// use google_cloud_appengine_v1::model::FirewallRule;
3365 /// let x = UpdateIngressRuleRequest::new().set_rule(FirewallRule::default()/* use setters */);
3366 /// ```
3367 pub fn set_rule<T>(mut self, v: T) -> Self
3368 where
3369 T: std::convert::Into<crate::model::FirewallRule>,
3370 {
3371 self.rule = std::option::Option::Some(v.into());
3372 self
3373 }
3374
3375 /// Sets or clears the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3376 ///
3377 /// # Example
3378 /// ```ignore,no_run
3379 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3380 /// use google_cloud_appengine_v1::model::FirewallRule;
3381 /// let x = UpdateIngressRuleRequest::new().set_or_clear_rule(Some(FirewallRule::default()/* use setters */));
3382 /// let x = UpdateIngressRuleRequest::new().set_or_clear_rule(None::<FirewallRule>);
3383 /// ```
3384 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3385 where
3386 T: std::convert::Into<crate::model::FirewallRule>,
3387 {
3388 self.rule = v.map(|x| x.into());
3389 self
3390 }
3391
3392 /// Sets the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3393 ///
3394 /// # Example
3395 /// ```ignore,no_run
3396 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3397 /// use wkt::FieldMask;
3398 /// let x = UpdateIngressRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3399 /// ```
3400 pub fn set_update_mask<T>(mut self, v: T) -> Self
3401 where
3402 T: std::convert::Into<wkt::FieldMask>,
3403 {
3404 self.update_mask = std::option::Option::Some(v.into());
3405 self
3406 }
3407
3408 /// Sets or clears the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3409 ///
3410 /// # Example
3411 /// ```ignore,no_run
3412 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3413 /// use wkt::FieldMask;
3414 /// let x = UpdateIngressRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3415 /// let x = UpdateIngressRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3416 /// ```
3417 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3418 where
3419 T: std::convert::Into<wkt::FieldMask>,
3420 {
3421 self.update_mask = v.map(|x| x.into());
3422 self
3423 }
3424}
3425
3426impl wkt::message::Message for UpdateIngressRuleRequest {
3427 fn typename() -> &'static str {
3428 "type.googleapis.com/google.appengine.v1.UpdateIngressRuleRequest"
3429 }
3430}
3431
3432/// Request message for `Firewall.DeleteIngressRule`.
3433#[derive(Clone, Default, PartialEq)]
3434#[non_exhaustive]
3435pub struct DeleteIngressRuleRequest {
3436 /// Name of the Firewall resource to delete.
3437 /// Example: `apps/myapp/firewall/ingressRules/100`.
3438 pub name: std::string::String,
3439
3440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3441}
3442
3443impl DeleteIngressRuleRequest {
3444 /// Creates a new default instance.
3445 pub fn new() -> Self {
3446 std::default::Default::default()
3447 }
3448
3449 /// Sets the value of [name][crate::model::DeleteIngressRuleRequest::name].
3450 ///
3451 /// # Example
3452 /// ```ignore,no_run
3453 /// # use google_cloud_appengine_v1::model::DeleteIngressRuleRequest;
3454 /// let x = DeleteIngressRuleRequest::new().set_name("example");
3455 /// ```
3456 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3457 self.name = v.into();
3458 self
3459 }
3460}
3461
3462impl wkt::message::Message for DeleteIngressRuleRequest {
3463 fn typename() -> &'static str {
3464 "type.googleapis.com/google.appengine.v1.DeleteIngressRuleRequest"
3465 }
3466}
3467
3468/// Request message for `AuthorizedDomains.ListAuthorizedDomains`.
3469#[derive(Clone, Default, PartialEq)]
3470#[non_exhaustive]
3471pub struct ListAuthorizedDomainsRequest {
3472 /// Name of the parent Application resource. Example: `apps/myapp`.
3473 pub parent: std::string::String,
3474
3475 /// Maximum results to return per page.
3476 pub page_size: i32,
3477
3478 /// Continuation token for fetching the next page of results.
3479 pub page_token: std::string::String,
3480
3481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3482}
3483
3484impl ListAuthorizedDomainsRequest {
3485 /// Creates a new default instance.
3486 pub fn new() -> Self {
3487 std::default::Default::default()
3488 }
3489
3490 /// Sets the value of [parent][crate::model::ListAuthorizedDomainsRequest::parent].
3491 ///
3492 /// # Example
3493 /// ```ignore,no_run
3494 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3495 /// let x = ListAuthorizedDomainsRequest::new().set_parent("example");
3496 /// ```
3497 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3498 self.parent = v.into();
3499 self
3500 }
3501
3502 /// Sets the value of [page_size][crate::model::ListAuthorizedDomainsRequest::page_size].
3503 ///
3504 /// # Example
3505 /// ```ignore,no_run
3506 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3507 /// let x = ListAuthorizedDomainsRequest::new().set_page_size(42);
3508 /// ```
3509 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3510 self.page_size = v.into();
3511 self
3512 }
3513
3514 /// Sets the value of [page_token][crate::model::ListAuthorizedDomainsRequest::page_token].
3515 ///
3516 /// # Example
3517 /// ```ignore,no_run
3518 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3519 /// let x = ListAuthorizedDomainsRequest::new().set_page_token("example");
3520 /// ```
3521 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3522 self.page_token = v.into();
3523 self
3524 }
3525}
3526
3527impl wkt::message::Message for ListAuthorizedDomainsRequest {
3528 fn typename() -> &'static str {
3529 "type.googleapis.com/google.appengine.v1.ListAuthorizedDomainsRequest"
3530 }
3531}
3532
3533/// Response message for `AuthorizedDomains.ListAuthorizedDomains`.
3534#[derive(Clone, Default, PartialEq)]
3535#[non_exhaustive]
3536pub struct ListAuthorizedDomainsResponse {
3537 /// The authorized domains belonging to the user.
3538 pub domains: std::vec::Vec<crate::model::AuthorizedDomain>,
3539
3540 /// Continuation token for fetching the next page of results.
3541 pub next_page_token: std::string::String,
3542
3543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3544}
3545
3546impl ListAuthorizedDomainsResponse {
3547 /// Creates a new default instance.
3548 pub fn new() -> Self {
3549 std::default::Default::default()
3550 }
3551
3552 /// Sets the value of [domains][crate::model::ListAuthorizedDomainsResponse::domains].
3553 ///
3554 /// # Example
3555 /// ```ignore,no_run
3556 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsResponse;
3557 /// use google_cloud_appengine_v1::model::AuthorizedDomain;
3558 /// let x = ListAuthorizedDomainsResponse::new()
3559 /// .set_domains([
3560 /// AuthorizedDomain::default()/* use setters */,
3561 /// AuthorizedDomain::default()/* use (different) setters */,
3562 /// ]);
3563 /// ```
3564 pub fn set_domains<T, V>(mut self, v: T) -> Self
3565 where
3566 T: std::iter::IntoIterator<Item = V>,
3567 V: std::convert::Into<crate::model::AuthorizedDomain>,
3568 {
3569 use std::iter::Iterator;
3570 self.domains = v.into_iter().map(|i| i.into()).collect();
3571 self
3572 }
3573
3574 /// Sets the value of [next_page_token][crate::model::ListAuthorizedDomainsResponse::next_page_token].
3575 ///
3576 /// # Example
3577 /// ```ignore,no_run
3578 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsResponse;
3579 /// let x = ListAuthorizedDomainsResponse::new().set_next_page_token("example");
3580 /// ```
3581 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3582 self.next_page_token = v.into();
3583 self
3584 }
3585}
3586
3587impl wkt::message::Message for ListAuthorizedDomainsResponse {
3588 fn typename() -> &'static str {
3589 "type.googleapis.com/google.appengine.v1.ListAuthorizedDomainsResponse"
3590 }
3591}
3592
3593#[doc(hidden)]
3594impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizedDomainsResponse {
3595 type PageItem = crate::model::AuthorizedDomain;
3596
3597 fn items(self) -> std::vec::Vec<Self::PageItem> {
3598 self.domains
3599 }
3600
3601 fn next_page_token(&self) -> std::string::String {
3602 use std::clone::Clone;
3603 self.next_page_token.clone()
3604 }
3605}
3606
3607/// Request message for `AuthorizedCertificates.ListAuthorizedCertificates`.
3608#[derive(Clone, Default, PartialEq)]
3609#[non_exhaustive]
3610pub struct ListAuthorizedCertificatesRequest {
3611 /// Name of the parent `Application` resource. Example: `apps/myapp`.
3612 pub parent: std::string::String,
3613
3614 /// Controls the set of fields returned in the `LIST` response.
3615 pub view: crate::model::AuthorizedCertificateView,
3616
3617 /// Maximum results to return per page.
3618 pub page_size: i32,
3619
3620 /// Continuation token for fetching the next page of results.
3621 pub page_token: std::string::String,
3622
3623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3624}
3625
3626impl ListAuthorizedCertificatesRequest {
3627 /// Creates a new default instance.
3628 pub fn new() -> Self {
3629 std::default::Default::default()
3630 }
3631
3632 /// Sets the value of [parent][crate::model::ListAuthorizedCertificatesRequest::parent].
3633 ///
3634 /// # Example
3635 /// ```ignore,no_run
3636 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3637 /// let x = ListAuthorizedCertificatesRequest::new().set_parent("example");
3638 /// ```
3639 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3640 self.parent = v.into();
3641 self
3642 }
3643
3644 /// Sets the value of [view][crate::model::ListAuthorizedCertificatesRequest::view].
3645 ///
3646 /// # Example
3647 /// ```ignore,no_run
3648 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3649 /// use google_cloud_appengine_v1::model::AuthorizedCertificateView;
3650 /// let x0 = ListAuthorizedCertificatesRequest::new().set_view(AuthorizedCertificateView::FullCertificate);
3651 /// ```
3652 pub fn set_view<T: std::convert::Into<crate::model::AuthorizedCertificateView>>(
3653 mut self,
3654 v: T,
3655 ) -> Self {
3656 self.view = v.into();
3657 self
3658 }
3659
3660 /// Sets the value of [page_size][crate::model::ListAuthorizedCertificatesRequest::page_size].
3661 ///
3662 /// # Example
3663 /// ```ignore,no_run
3664 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3665 /// let x = ListAuthorizedCertificatesRequest::new().set_page_size(42);
3666 /// ```
3667 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3668 self.page_size = v.into();
3669 self
3670 }
3671
3672 /// Sets the value of [page_token][crate::model::ListAuthorizedCertificatesRequest::page_token].
3673 ///
3674 /// # Example
3675 /// ```ignore,no_run
3676 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3677 /// let x = ListAuthorizedCertificatesRequest::new().set_page_token("example");
3678 /// ```
3679 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3680 self.page_token = v.into();
3681 self
3682 }
3683}
3684
3685impl wkt::message::Message for ListAuthorizedCertificatesRequest {
3686 fn typename() -> &'static str {
3687 "type.googleapis.com/google.appengine.v1.ListAuthorizedCertificatesRequest"
3688 }
3689}
3690
3691/// Response message for `AuthorizedCertificates.ListAuthorizedCertificates`.
3692#[derive(Clone, Default, PartialEq)]
3693#[non_exhaustive]
3694pub struct ListAuthorizedCertificatesResponse {
3695 /// The SSL certificates the user is authorized to administer.
3696 pub certificates: std::vec::Vec<crate::model::AuthorizedCertificate>,
3697
3698 /// Continuation token for fetching the next page of results.
3699 pub next_page_token: std::string::String,
3700
3701 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3702}
3703
3704impl ListAuthorizedCertificatesResponse {
3705 /// Creates a new default instance.
3706 pub fn new() -> Self {
3707 std::default::Default::default()
3708 }
3709
3710 /// Sets the value of [certificates][crate::model::ListAuthorizedCertificatesResponse::certificates].
3711 ///
3712 /// # Example
3713 /// ```ignore,no_run
3714 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesResponse;
3715 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3716 /// let x = ListAuthorizedCertificatesResponse::new()
3717 /// .set_certificates([
3718 /// AuthorizedCertificate::default()/* use setters */,
3719 /// AuthorizedCertificate::default()/* use (different) setters */,
3720 /// ]);
3721 /// ```
3722 pub fn set_certificates<T, V>(mut self, v: T) -> Self
3723 where
3724 T: std::iter::IntoIterator<Item = V>,
3725 V: std::convert::Into<crate::model::AuthorizedCertificate>,
3726 {
3727 use std::iter::Iterator;
3728 self.certificates = v.into_iter().map(|i| i.into()).collect();
3729 self
3730 }
3731
3732 /// Sets the value of [next_page_token][crate::model::ListAuthorizedCertificatesResponse::next_page_token].
3733 ///
3734 /// # Example
3735 /// ```ignore,no_run
3736 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesResponse;
3737 /// let x = ListAuthorizedCertificatesResponse::new().set_next_page_token("example");
3738 /// ```
3739 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3740 self.next_page_token = v.into();
3741 self
3742 }
3743}
3744
3745impl wkt::message::Message for ListAuthorizedCertificatesResponse {
3746 fn typename() -> &'static str {
3747 "type.googleapis.com/google.appengine.v1.ListAuthorizedCertificatesResponse"
3748 }
3749}
3750
3751#[doc(hidden)]
3752impl google_cloud_gax::paginator::internal::PageableResponse
3753 for ListAuthorizedCertificatesResponse
3754{
3755 type PageItem = crate::model::AuthorizedCertificate;
3756
3757 fn items(self) -> std::vec::Vec<Self::PageItem> {
3758 self.certificates
3759 }
3760
3761 fn next_page_token(&self) -> std::string::String {
3762 use std::clone::Clone;
3763 self.next_page_token.clone()
3764 }
3765}
3766
3767/// Request message for `AuthorizedCertificates.GetAuthorizedCertificate`.
3768#[derive(Clone, Default, PartialEq)]
3769#[non_exhaustive]
3770pub struct GetAuthorizedCertificateRequest {
3771 /// Name of the resource requested. Example:
3772 /// `apps/myapp/authorizedCertificates/12345`.
3773 pub name: std::string::String,
3774
3775 /// Controls the set of fields returned in the `GET` response.
3776 pub view: crate::model::AuthorizedCertificateView,
3777
3778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3779}
3780
3781impl GetAuthorizedCertificateRequest {
3782 /// Creates a new default instance.
3783 pub fn new() -> Self {
3784 std::default::Default::default()
3785 }
3786
3787 /// Sets the value of [name][crate::model::GetAuthorizedCertificateRequest::name].
3788 ///
3789 /// # Example
3790 /// ```ignore,no_run
3791 /// # use google_cloud_appengine_v1::model::GetAuthorizedCertificateRequest;
3792 /// let x = GetAuthorizedCertificateRequest::new().set_name("example");
3793 /// ```
3794 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3795 self.name = v.into();
3796 self
3797 }
3798
3799 /// Sets the value of [view][crate::model::GetAuthorizedCertificateRequest::view].
3800 ///
3801 /// # Example
3802 /// ```ignore,no_run
3803 /// # use google_cloud_appengine_v1::model::GetAuthorizedCertificateRequest;
3804 /// use google_cloud_appengine_v1::model::AuthorizedCertificateView;
3805 /// let x0 = GetAuthorizedCertificateRequest::new().set_view(AuthorizedCertificateView::FullCertificate);
3806 /// ```
3807 pub fn set_view<T: std::convert::Into<crate::model::AuthorizedCertificateView>>(
3808 mut self,
3809 v: T,
3810 ) -> Self {
3811 self.view = v.into();
3812 self
3813 }
3814}
3815
3816impl wkt::message::Message for GetAuthorizedCertificateRequest {
3817 fn typename() -> &'static str {
3818 "type.googleapis.com/google.appengine.v1.GetAuthorizedCertificateRequest"
3819 }
3820}
3821
3822/// Request message for `AuthorizedCertificates.CreateAuthorizedCertificate`.
3823#[derive(Clone, Default, PartialEq)]
3824#[non_exhaustive]
3825pub struct CreateAuthorizedCertificateRequest {
3826 /// Name of the parent `Application` resource. Example: `apps/myapp`.
3827 pub parent: std::string::String,
3828
3829 /// SSL certificate data.
3830 pub certificate: std::option::Option<crate::model::AuthorizedCertificate>,
3831
3832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3833}
3834
3835impl CreateAuthorizedCertificateRequest {
3836 /// Creates a new default instance.
3837 pub fn new() -> Self {
3838 std::default::Default::default()
3839 }
3840
3841 /// Sets the value of [parent][crate::model::CreateAuthorizedCertificateRequest::parent].
3842 ///
3843 /// # Example
3844 /// ```ignore,no_run
3845 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3846 /// let x = CreateAuthorizedCertificateRequest::new().set_parent("example");
3847 /// ```
3848 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3849 self.parent = v.into();
3850 self
3851 }
3852
3853 /// Sets the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
3854 ///
3855 /// # Example
3856 /// ```ignore,no_run
3857 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3858 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3859 /// let x = CreateAuthorizedCertificateRequest::new().set_certificate(AuthorizedCertificate::default()/* use setters */);
3860 /// ```
3861 pub fn set_certificate<T>(mut self, v: T) -> Self
3862 where
3863 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3864 {
3865 self.certificate = std::option::Option::Some(v.into());
3866 self
3867 }
3868
3869 /// Sets or clears the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
3870 ///
3871 /// # Example
3872 /// ```ignore,no_run
3873 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3874 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3875 /// let x = CreateAuthorizedCertificateRequest::new().set_or_clear_certificate(Some(AuthorizedCertificate::default()/* use setters */));
3876 /// let x = CreateAuthorizedCertificateRequest::new().set_or_clear_certificate(None::<AuthorizedCertificate>);
3877 /// ```
3878 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
3879 where
3880 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3881 {
3882 self.certificate = v.map(|x| x.into());
3883 self
3884 }
3885}
3886
3887impl wkt::message::Message for CreateAuthorizedCertificateRequest {
3888 fn typename() -> &'static str {
3889 "type.googleapis.com/google.appengine.v1.CreateAuthorizedCertificateRequest"
3890 }
3891}
3892
3893/// Request message for `AuthorizedCertificates.UpdateAuthorizedCertificate`.
3894#[derive(Clone, Default, PartialEq)]
3895#[non_exhaustive]
3896pub struct UpdateAuthorizedCertificateRequest {
3897 /// Name of the resource to update. Example:
3898 /// `apps/myapp/authorizedCertificates/12345`.
3899 pub name: std::string::String,
3900
3901 /// An `AuthorizedCertificate` containing the updated resource. Only fields set
3902 /// in the field mask will be updated.
3903 pub certificate: std::option::Option<crate::model::AuthorizedCertificate>,
3904
3905 /// Standard field mask for the set of fields to be updated. Updates are only
3906 /// supported on the `certificate_raw_data` and `display_name` fields.
3907 pub update_mask: std::option::Option<wkt::FieldMask>,
3908
3909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3910}
3911
3912impl UpdateAuthorizedCertificateRequest {
3913 /// Creates a new default instance.
3914 pub fn new() -> Self {
3915 std::default::Default::default()
3916 }
3917
3918 /// Sets the value of [name][crate::model::UpdateAuthorizedCertificateRequest::name].
3919 ///
3920 /// # Example
3921 /// ```ignore,no_run
3922 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3923 /// let x = UpdateAuthorizedCertificateRequest::new().set_name("example");
3924 /// ```
3925 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3926 self.name = v.into();
3927 self
3928 }
3929
3930 /// Sets the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
3931 ///
3932 /// # Example
3933 /// ```ignore,no_run
3934 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3935 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3936 /// let x = UpdateAuthorizedCertificateRequest::new().set_certificate(AuthorizedCertificate::default()/* use setters */);
3937 /// ```
3938 pub fn set_certificate<T>(mut self, v: T) -> Self
3939 where
3940 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3941 {
3942 self.certificate = std::option::Option::Some(v.into());
3943 self
3944 }
3945
3946 /// Sets or clears the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
3947 ///
3948 /// # Example
3949 /// ```ignore,no_run
3950 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3951 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3952 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_certificate(Some(AuthorizedCertificate::default()/* use setters */));
3953 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_certificate(None::<AuthorizedCertificate>);
3954 /// ```
3955 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
3956 where
3957 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3958 {
3959 self.certificate = v.map(|x| x.into());
3960 self
3961 }
3962
3963 /// Sets the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
3964 ///
3965 /// # Example
3966 /// ```ignore,no_run
3967 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3968 /// use wkt::FieldMask;
3969 /// let x = UpdateAuthorizedCertificateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3970 /// ```
3971 pub fn set_update_mask<T>(mut self, v: T) -> Self
3972 where
3973 T: std::convert::Into<wkt::FieldMask>,
3974 {
3975 self.update_mask = std::option::Option::Some(v.into());
3976 self
3977 }
3978
3979 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
3980 ///
3981 /// # Example
3982 /// ```ignore,no_run
3983 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3984 /// use wkt::FieldMask;
3985 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3986 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3987 /// ```
3988 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3989 where
3990 T: std::convert::Into<wkt::FieldMask>,
3991 {
3992 self.update_mask = v.map(|x| x.into());
3993 self
3994 }
3995}
3996
3997impl wkt::message::Message for UpdateAuthorizedCertificateRequest {
3998 fn typename() -> &'static str {
3999 "type.googleapis.com/google.appengine.v1.UpdateAuthorizedCertificateRequest"
4000 }
4001}
4002
4003/// Request message for `AuthorizedCertificates.DeleteAuthorizedCertificate`.
4004#[derive(Clone, Default, PartialEq)]
4005#[non_exhaustive]
4006pub struct DeleteAuthorizedCertificateRequest {
4007 /// Name of the resource to delete. Example:
4008 /// `apps/myapp/authorizedCertificates/12345`.
4009 pub name: std::string::String,
4010
4011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4012}
4013
4014impl DeleteAuthorizedCertificateRequest {
4015 /// Creates a new default instance.
4016 pub fn new() -> Self {
4017 std::default::Default::default()
4018 }
4019
4020 /// Sets the value of [name][crate::model::DeleteAuthorizedCertificateRequest::name].
4021 ///
4022 /// # Example
4023 /// ```ignore,no_run
4024 /// # use google_cloud_appengine_v1::model::DeleteAuthorizedCertificateRequest;
4025 /// let x = DeleteAuthorizedCertificateRequest::new().set_name("example");
4026 /// ```
4027 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4028 self.name = v.into();
4029 self
4030 }
4031}
4032
4033impl wkt::message::Message for DeleteAuthorizedCertificateRequest {
4034 fn typename() -> &'static str {
4035 "type.googleapis.com/google.appengine.v1.DeleteAuthorizedCertificateRequest"
4036 }
4037}
4038
4039/// Request message for `DomainMappings.ListDomainMappings`.
4040#[derive(Clone, Default, PartialEq)]
4041#[non_exhaustive]
4042pub struct ListDomainMappingsRequest {
4043 /// Name of the parent Application resource. Example: `apps/myapp`.
4044 pub parent: std::string::String,
4045
4046 /// Maximum results to return per page.
4047 pub page_size: i32,
4048
4049 /// Continuation token for fetching the next page of results.
4050 pub page_token: std::string::String,
4051
4052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4053}
4054
4055impl ListDomainMappingsRequest {
4056 /// Creates a new default instance.
4057 pub fn new() -> Self {
4058 std::default::Default::default()
4059 }
4060
4061 /// Sets the value of [parent][crate::model::ListDomainMappingsRequest::parent].
4062 ///
4063 /// # Example
4064 /// ```ignore,no_run
4065 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4066 /// let x = ListDomainMappingsRequest::new().set_parent("example");
4067 /// ```
4068 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4069 self.parent = v.into();
4070 self
4071 }
4072
4073 /// Sets the value of [page_size][crate::model::ListDomainMappingsRequest::page_size].
4074 ///
4075 /// # Example
4076 /// ```ignore,no_run
4077 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4078 /// let x = ListDomainMappingsRequest::new().set_page_size(42);
4079 /// ```
4080 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4081 self.page_size = v.into();
4082 self
4083 }
4084
4085 /// Sets the value of [page_token][crate::model::ListDomainMappingsRequest::page_token].
4086 ///
4087 /// # Example
4088 /// ```ignore,no_run
4089 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4090 /// let x = ListDomainMappingsRequest::new().set_page_token("example");
4091 /// ```
4092 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4093 self.page_token = v.into();
4094 self
4095 }
4096}
4097
4098impl wkt::message::Message for ListDomainMappingsRequest {
4099 fn typename() -> &'static str {
4100 "type.googleapis.com/google.appengine.v1.ListDomainMappingsRequest"
4101 }
4102}
4103
4104/// Response message for `DomainMappings.ListDomainMappings`.
4105#[derive(Clone, Default, PartialEq)]
4106#[non_exhaustive]
4107pub struct ListDomainMappingsResponse {
4108 /// The domain mappings for the application.
4109 pub domain_mappings: std::vec::Vec<crate::model::DomainMapping>,
4110
4111 /// Continuation token for fetching the next page of results.
4112 pub next_page_token: std::string::String,
4113
4114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4115}
4116
4117impl ListDomainMappingsResponse {
4118 /// Creates a new default instance.
4119 pub fn new() -> Self {
4120 std::default::Default::default()
4121 }
4122
4123 /// Sets the value of [domain_mappings][crate::model::ListDomainMappingsResponse::domain_mappings].
4124 ///
4125 /// # Example
4126 /// ```ignore,no_run
4127 /// # use google_cloud_appengine_v1::model::ListDomainMappingsResponse;
4128 /// use google_cloud_appengine_v1::model::DomainMapping;
4129 /// let x = ListDomainMappingsResponse::new()
4130 /// .set_domain_mappings([
4131 /// DomainMapping::default()/* use setters */,
4132 /// DomainMapping::default()/* use (different) setters */,
4133 /// ]);
4134 /// ```
4135 pub fn set_domain_mappings<T, V>(mut self, v: T) -> Self
4136 where
4137 T: std::iter::IntoIterator<Item = V>,
4138 V: std::convert::Into<crate::model::DomainMapping>,
4139 {
4140 use std::iter::Iterator;
4141 self.domain_mappings = v.into_iter().map(|i| i.into()).collect();
4142 self
4143 }
4144
4145 /// Sets the value of [next_page_token][crate::model::ListDomainMappingsResponse::next_page_token].
4146 ///
4147 /// # Example
4148 /// ```ignore,no_run
4149 /// # use google_cloud_appengine_v1::model::ListDomainMappingsResponse;
4150 /// let x = ListDomainMappingsResponse::new().set_next_page_token("example");
4151 /// ```
4152 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4153 self.next_page_token = v.into();
4154 self
4155 }
4156}
4157
4158impl wkt::message::Message for ListDomainMappingsResponse {
4159 fn typename() -> &'static str {
4160 "type.googleapis.com/google.appengine.v1.ListDomainMappingsResponse"
4161 }
4162}
4163
4164#[doc(hidden)]
4165impl google_cloud_gax::paginator::internal::PageableResponse for ListDomainMappingsResponse {
4166 type PageItem = crate::model::DomainMapping;
4167
4168 fn items(self) -> std::vec::Vec<Self::PageItem> {
4169 self.domain_mappings
4170 }
4171
4172 fn next_page_token(&self) -> std::string::String {
4173 use std::clone::Clone;
4174 self.next_page_token.clone()
4175 }
4176}
4177
4178/// Request message for `DomainMappings.GetDomainMapping`.
4179#[derive(Clone, Default, PartialEq)]
4180#[non_exhaustive]
4181pub struct GetDomainMappingRequest {
4182 /// Name of the resource requested. Example:
4183 /// `apps/myapp/domainMappings/example.com`.
4184 pub name: std::string::String,
4185
4186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4187}
4188
4189impl GetDomainMappingRequest {
4190 /// Creates a new default instance.
4191 pub fn new() -> Self {
4192 std::default::Default::default()
4193 }
4194
4195 /// Sets the value of [name][crate::model::GetDomainMappingRequest::name].
4196 ///
4197 /// # Example
4198 /// ```ignore,no_run
4199 /// # use google_cloud_appengine_v1::model::GetDomainMappingRequest;
4200 /// let x = GetDomainMappingRequest::new().set_name("example");
4201 /// ```
4202 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4203 self.name = v.into();
4204 self
4205 }
4206}
4207
4208impl wkt::message::Message for GetDomainMappingRequest {
4209 fn typename() -> &'static str {
4210 "type.googleapis.com/google.appengine.v1.GetDomainMappingRequest"
4211 }
4212}
4213
4214/// Request message for `DomainMappings.CreateDomainMapping`.
4215#[derive(Clone, Default, PartialEq)]
4216#[non_exhaustive]
4217pub struct CreateDomainMappingRequest {
4218 /// Name of the parent Application resource. Example: `apps/myapp`.
4219 pub parent: std::string::String,
4220
4221 /// Domain mapping configuration.
4222 pub domain_mapping: std::option::Option<crate::model::DomainMapping>,
4223
4224 /// Whether the domain creation should override any existing mappings for this
4225 /// domain. By default, overrides are rejected.
4226 pub override_strategy: crate::model::DomainOverrideStrategy,
4227
4228 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4229}
4230
4231impl CreateDomainMappingRequest {
4232 /// Creates a new default instance.
4233 pub fn new() -> Self {
4234 std::default::Default::default()
4235 }
4236
4237 /// Sets the value of [parent][crate::model::CreateDomainMappingRequest::parent].
4238 ///
4239 /// # Example
4240 /// ```ignore,no_run
4241 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4242 /// let x = CreateDomainMappingRequest::new().set_parent("example");
4243 /// ```
4244 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4245 self.parent = v.into();
4246 self
4247 }
4248
4249 /// Sets the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4250 ///
4251 /// # Example
4252 /// ```ignore,no_run
4253 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4254 /// use google_cloud_appengine_v1::model::DomainMapping;
4255 /// let x = CreateDomainMappingRequest::new().set_domain_mapping(DomainMapping::default()/* use setters */);
4256 /// ```
4257 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4258 where
4259 T: std::convert::Into<crate::model::DomainMapping>,
4260 {
4261 self.domain_mapping = std::option::Option::Some(v.into());
4262 self
4263 }
4264
4265 /// Sets or clears the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4266 ///
4267 /// # Example
4268 /// ```ignore,no_run
4269 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4270 /// use google_cloud_appengine_v1::model::DomainMapping;
4271 /// let x = CreateDomainMappingRequest::new().set_or_clear_domain_mapping(Some(DomainMapping::default()/* use setters */));
4272 /// let x = CreateDomainMappingRequest::new().set_or_clear_domain_mapping(None::<DomainMapping>);
4273 /// ```
4274 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4275 where
4276 T: std::convert::Into<crate::model::DomainMapping>,
4277 {
4278 self.domain_mapping = v.map(|x| x.into());
4279 self
4280 }
4281
4282 /// Sets the value of [override_strategy][crate::model::CreateDomainMappingRequest::override_strategy].
4283 ///
4284 /// # Example
4285 /// ```ignore,no_run
4286 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4287 /// use google_cloud_appengine_v1::model::DomainOverrideStrategy;
4288 /// let x0 = CreateDomainMappingRequest::new().set_override_strategy(DomainOverrideStrategy::Strict);
4289 /// let x1 = CreateDomainMappingRequest::new().set_override_strategy(DomainOverrideStrategy::Override);
4290 /// ```
4291 pub fn set_override_strategy<T: std::convert::Into<crate::model::DomainOverrideStrategy>>(
4292 mut self,
4293 v: T,
4294 ) -> Self {
4295 self.override_strategy = v.into();
4296 self
4297 }
4298}
4299
4300impl wkt::message::Message for CreateDomainMappingRequest {
4301 fn typename() -> &'static str {
4302 "type.googleapis.com/google.appengine.v1.CreateDomainMappingRequest"
4303 }
4304}
4305
4306/// Request message for `DomainMappings.UpdateDomainMapping`.
4307#[derive(Clone, Default, PartialEq)]
4308#[non_exhaustive]
4309pub struct UpdateDomainMappingRequest {
4310 /// Name of the resource to update. Example:
4311 /// `apps/myapp/domainMappings/example.com`.
4312 pub name: std::string::String,
4313
4314 /// A domain mapping containing the updated resource. Only fields set
4315 /// in the field mask will be updated.
4316 pub domain_mapping: std::option::Option<crate::model::DomainMapping>,
4317
4318 /// Required. Standard field mask for the set of fields to be updated.
4319 pub update_mask: std::option::Option<wkt::FieldMask>,
4320
4321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4322}
4323
4324impl UpdateDomainMappingRequest {
4325 /// Creates a new default instance.
4326 pub fn new() -> Self {
4327 std::default::Default::default()
4328 }
4329
4330 /// Sets the value of [name][crate::model::UpdateDomainMappingRequest::name].
4331 ///
4332 /// # Example
4333 /// ```ignore,no_run
4334 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4335 /// let x = UpdateDomainMappingRequest::new().set_name("example");
4336 /// ```
4337 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4338 self.name = v.into();
4339 self
4340 }
4341
4342 /// Sets the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
4343 ///
4344 /// # Example
4345 /// ```ignore,no_run
4346 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4347 /// use google_cloud_appengine_v1::model::DomainMapping;
4348 /// let x = UpdateDomainMappingRequest::new().set_domain_mapping(DomainMapping::default()/* use setters */);
4349 /// ```
4350 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4351 where
4352 T: std::convert::Into<crate::model::DomainMapping>,
4353 {
4354 self.domain_mapping = std::option::Option::Some(v.into());
4355 self
4356 }
4357
4358 /// Sets or clears the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
4359 ///
4360 /// # Example
4361 /// ```ignore,no_run
4362 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4363 /// use google_cloud_appengine_v1::model::DomainMapping;
4364 /// let x = UpdateDomainMappingRequest::new().set_or_clear_domain_mapping(Some(DomainMapping::default()/* use setters */));
4365 /// let x = UpdateDomainMappingRequest::new().set_or_clear_domain_mapping(None::<DomainMapping>);
4366 /// ```
4367 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4368 where
4369 T: std::convert::Into<crate::model::DomainMapping>,
4370 {
4371 self.domain_mapping = v.map(|x| x.into());
4372 self
4373 }
4374
4375 /// Sets the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
4376 ///
4377 /// # Example
4378 /// ```ignore,no_run
4379 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4380 /// use wkt::FieldMask;
4381 /// let x = UpdateDomainMappingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4382 /// ```
4383 pub fn set_update_mask<T>(mut self, v: T) -> Self
4384 where
4385 T: std::convert::Into<wkt::FieldMask>,
4386 {
4387 self.update_mask = std::option::Option::Some(v.into());
4388 self
4389 }
4390
4391 /// Sets or clears the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
4392 ///
4393 /// # Example
4394 /// ```ignore,no_run
4395 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4396 /// use wkt::FieldMask;
4397 /// let x = UpdateDomainMappingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4398 /// let x = UpdateDomainMappingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4399 /// ```
4400 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4401 where
4402 T: std::convert::Into<wkt::FieldMask>,
4403 {
4404 self.update_mask = v.map(|x| x.into());
4405 self
4406 }
4407}
4408
4409impl wkt::message::Message for UpdateDomainMappingRequest {
4410 fn typename() -> &'static str {
4411 "type.googleapis.com/google.appengine.v1.UpdateDomainMappingRequest"
4412 }
4413}
4414
4415/// Request message for `DomainMappings.DeleteDomainMapping`.
4416#[derive(Clone, Default, PartialEq)]
4417#[non_exhaustive]
4418pub struct DeleteDomainMappingRequest {
4419 /// Name of the resource to delete. Example:
4420 /// `apps/myapp/domainMappings/example.com`.
4421 pub name: std::string::String,
4422
4423 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4424}
4425
4426impl DeleteDomainMappingRequest {
4427 /// Creates a new default instance.
4428 pub fn new() -> Self {
4429 std::default::Default::default()
4430 }
4431
4432 /// Sets the value of [name][crate::model::DeleteDomainMappingRequest::name].
4433 ///
4434 /// # Example
4435 /// ```ignore,no_run
4436 /// # use google_cloud_appengine_v1::model::DeleteDomainMappingRequest;
4437 /// let x = DeleteDomainMappingRequest::new().set_name("example");
4438 /// ```
4439 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4440 self.name = v.into();
4441 self
4442 }
4443}
4444
4445impl wkt::message::Message for DeleteDomainMappingRequest {
4446 fn typename() -> &'static str {
4447 "type.googleapis.com/google.appengine.v1.DeleteDomainMappingRequest"
4448 }
4449}
4450
4451/// An Application resource contains the top-level configuration of an App
4452/// Engine application.
4453#[derive(Clone, Default, PartialEq)]
4454#[non_exhaustive]
4455pub struct Application {
4456 /// Full path to the Application resource in the API.
4457 /// Example: `apps/myapp`.
4458 ///
4459 /// @OutputOnly
4460 pub name: std::string::String,
4461
4462 /// Identifier of the Application resource. This identifier is equivalent
4463 /// to the project ID of the Google Cloud Platform project where you want to
4464 /// deploy your application.
4465 /// Example: `myapp`.
4466 pub id: std::string::String,
4467
4468 /// HTTP path dispatch rules for requests to the application that do not
4469 /// explicitly target a service or version. Rules are order-dependent.
4470 /// Up to 20 dispatch rules can be supported.
4471 pub dispatch_rules: std::vec::Vec<crate::model::UrlDispatchRule>,
4472
4473 /// Google Apps authentication domain that controls which users can access
4474 /// this application.
4475 ///
4476 /// Defaults to open access for any Google Account.
4477 pub auth_domain: std::string::String,
4478
4479 /// Location from which this application runs. Application instances
4480 /// run out of the data centers in the specified location, which is also where
4481 /// all of the application's end user content is stored.
4482 ///
4483 /// Defaults to `us-central`.
4484 ///
4485 /// View the list of
4486 /// [supported locations](https://cloud.google.com/appengine/docs/locations).
4487 pub location_id: std::string::String,
4488
4489 /// Google Cloud Storage bucket that can be used for storing files
4490 /// associated with this application. This bucket is associated with the
4491 /// application and can be used by the gcloud deployment commands.
4492 ///
4493 /// @OutputOnly
4494 pub code_bucket: std::string::String,
4495
4496 /// Cookie expiration policy for this application.
4497 pub default_cookie_expiration: std::option::Option<wkt::Duration>,
4498
4499 /// Serving status of this application.
4500 pub serving_status: crate::model::application::ServingStatus,
4501
4502 /// Hostname used to reach this application, as resolved by App Engine.
4503 ///
4504 /// @OutputOnly
4505 pub default_hostname: std::string::String,
4506
4507 /// Google Cloud Storage bucket that can be used by this application to store
4508 /// content.
4509 ///
4510 /// @OutputOnly
4511 pub default_bucket: std::string::String,
4512
4513 /// The service account associated with the application.
4514 /// This is the app-level default identity. If no identity provided during
4515 /// create version, Admin API will fallback to this one.
4516 pub service_account: std::string::String,
4517
4518 #[allow(missing_docs)]
4519 pub iap: std::option::Option<crate::model::application::IdentityAwareProxy>,
4520
4521 /// The Google Container Registry domain used for storing managed build docker
4522 /// images for this application.
4523 pub gcr_domain: std::string::String,
4524
4525 /// The type of the Cloud Firestore or Cloud Datastore database associated with
4526 /// this application.
4527 pub database_type: crate::model::application::DatabaseType,
4528
4529 /// The feature specific settings to be used in the application.
4530 pub feature_settings: std::option::Option<crate::model::application::FeatureSettings>,
4531
4532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4533}
4534
4535impl Application {
4536 /// Creates a new default instance.
4537 pub fn new() -> Self {
4538 std::default::Default::default()
4539 }
4540
4541 /// Sets the value of [name][crate::model::Application::name].
4542 ///
4543 /// # Example
4544 /// ```ignore,no_run
4545 /// # use google_cloud_appengine_v1::model::Application;
4546 /// let x = Application::new().set_name("example");
4547 /// ```
4548 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4549 self.name = v.into();
4550 self
4551 }
4552
4553 /// Sets the value of [id][crate::model::Application::id].
4554 ///
4555 /// # Example
4556 /// ```ignore,no_run
4557 /// # use google_cloud_appengine_v1::model::Application;
4558 /// let x = Application::new().set_id("example");
4559 /// ```
4560 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4561 self.id = v.into();
4562 self
4563 }
4564
4565 /// Sets the value of [dispatch_rules][crate::model::Application::dispatch_rules].
4566 ///
4567 /// # Example
4568 /// ```ignore,no_run
4569 /// # use google_cloud_appengine_v1::model::Application;
4570 /// use google_cloud_appengine_v1::model::UrlDispatchRule;
4571 /// let x = Application::new()
4572 /// .set_dispatch_rules([
4573 /// UrlDispatchRule::default()/* use setters */,
4574 /// UrlDispatchRule::default()/* use (different) setters */,
4575 /// ]);
4576 /// ```
4577 pub fn set_dispatch_rules<T, V>(mut self, v: T) -> Self
4578 where
4579 T: std::iter::IntoIterator<Item = V>,
4580 V: std::convert::Into<crate::model::UrlDispatchRule>,
4581 {
4582 use std::iter::Iterator;
4583 self.dispatch_rules = v.into_iter().map(|i| i.into()).collect();
4584 self
4585 }
4586
4587 /// Sets the value of [auth_domain][crate::model::Application::auth_domain].
4588 ///
4589 /// # Example
4590 /// ```ignore,no_run
4591 /// # use google_cloud_appengine_v1::model::Application;
4592 /// let x = Application::new().set_auth_domain("example");
4593 /// ```
4594 pub fn set_auth_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4595 self.auth_domain = v.into();
4596 self
4597 }
4598
4599 /// Sets the value of [location_id][crate::model::Application::location_id].
4600 ///
4601 /// # Example
4602 /// ```ignore,no_run
4603 /// # use google_cloud_appengine_v1::model::Application;
4604 /// let x = Application::new().set_location_id("example");
4605 /// ```
4606 pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4607 self.location_id = v.into();
4608 self
4609 }
4610
4611 /// Sets the value of [code_bucket][crate::model::Application::code_bucket].
4612 ///
4613 /// # Example
4614 /// ```ignore,no_run
4615 /// # use google_cloud_appengine_v1::model::Application;
4616 /// let x = Application::new().set_code_bucket("example");
4617 /// ```
4618 pub fn set_code_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4619 self.code_bucket = v.into();
4620 self
4621 }
4622
4623 /// Sets the value of [default_cookie_expiration][crate::model::Application::default_cookie_expiration].
4624 ///
4625 /// # Example
4626 /// ```ignore,no_run
4627 /// # use google_cloud_appengine_v1::model::Application;
4628 /// use wkt::Duration;
4629 /// let x = Application::new().set_default_cookie_expiration(Duration::default()/* use setters */);
4630 /// ```
4631 pub fn set_default_cookie_expiration<T>(mut self, v: T) -> Self
4632 where
4633 T: std::convert::Into<wkt::Duration>,
4634 {
4635 self.default_cookie_expiration = std::option::Option::Some(v.into());
4636 self
4637 }
4638
4639 /// Sets or clears the value of [default_cookie_expiration][crate::model::Application::default_cookie_expiration].
4640 ///
4641 /// # Example
4642 /// ```ignore,no_run
4643 /// # use google_cloud_appengine_v1::model::Application;
4644 /// use wkt::Duration;
4645 /// let x = Application::new().set_or_clear_default_cookie_expiration(Some(Duration::default()/* use setters */));
4646 /// let x = Application::new().set_or_clear_default_cookie_expiration(None::<Duration>);
4647 /// ```
4648 pub fn set_or_clear_default_cookie_expiration<T>(mut self, v: std::option::Option<T>) -> Self
4649 where
4650 T: std::convert::Into<wkt::Duration>,
4651 {
4652 self.default_cookie_expiration = v.map(|x| x.into());
4653 self
4654 }
4655
4656 /// Sets the value of [serving_status][crate::model::Application::serving_status].
4657 ///
4658 /// # Example
4659 /// ```ignore,no_run
4660 /// # use google_cloud_appengine_v1::model::Application;
4661 /// use google_cloud_appengine_v1::model::application::ServingStatus;
4662 /// let x0 = Application::new().set_serving_status(ServingStatus::Serving);
4663 /// let x1 = Application::new().set_serving_status(ServingStatus::UserDisabled);
4664 /// let x2 = Application::new().set_serving_status(ServingStatus::SystemDisabled);
4665 /// ```
4666 pub fn set_serving_status<T: std::convert::Into<crate::model::application::ServingStatus>>(
4667 mut self,
4668 v: T,
4669 ) -> Self {
4670 self.serving_status = v.into();
4671 self
4672 }
4673
4674 /// Sets the value of [default_hostname][crate::model::Application::default_hostname].
4675 ///
4676 /// # Example
4677 /// ```ignore,no_run
4678 /// # use google_cloud_appengine_v1::model::Application;
4679 /// let x = Application::new().set_default_hostname("example");
4680 /// ```
4681 pub fn set_default_hostname<T: std::convert::Into<std::string::String>>(
4682 mut self,
4683 v: T,
4684 ) -> Self {
4685 self.default_hostname = v.into();
4686 self
4687 }
4688
4689 /// Sets the value of [default_bucket][crate::model::Application::default_bucket].
4690 ///
4691 /// # Example
4692 /// ```ignore,no_run
4693 /// # use google_cloud_appengine_v1::model::Application;
4694 /// let x = Application::new().set_default_bucket("example");
4695 /// ```
4696 pub fn set_default_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4697 self.default_bucket = v.into();
4698 self
4699 }
4700
4701 /// Sets the value of [service_account][crate::model::Application::service_account].
4702 ///
4703 /// # Example
4704 /// ```ignore,no_run
4705 /// # use google_cloud_appengine_v1::model::Application;
4706 /// let x = Application::new().set_service_account("example");
4707 /// ```
4708 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4709 self.service_account = v.into();
4710 self
4711 }
4712
4713 /// Sets the value of [iap][crate::model::Application::iap].
4714 ///
4715 /// # Example
4716 /// ```ignore,no_run
4717 /// # use google_cloud_appengine_v1::model::Application;
4718 /// use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4719 /// let x = Application::new().set_iap(IdentityAwareProxy::default()/* use setters */);
4720 /// ```
4721 pub fn set_iap<T>(mut self, v: T) -> Self
4722 where
4723 T: std::convert::Into<crate::model::application::IdentityAwareProxy>,
4724 {
4725 self.iap = std::option::Option::Some(v.into());
4726 self
4727 }
4728
4729 /// Sets or clears the value of [iap][crate::model::Application::iap].
4730 ///
4731 /// # Example
4732 /// ```ignore,no_run
4733 /// # use google_cloud_appengine_v1::model::Application;
4734 /// use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4735 /// let x = Application::new().set_or_clear_iap(Some(IdentityAwareProxy::default()/* use setters */));
4736 /// let x = Application::new().set_or_clear_iap(None::<IdentityAwareProxy>);
4737 /// ```
4738 pub fn set_or_clear_iap<T>(mut self, v: std::option::Option<T>) -> Self
4739 where
4740 T: std::convert::Into<crate::model::application::IdentityAwareProxy>,
4741 {
4742 self.iap = v.map(|x| x.into());
4743 self
4744 }
4745
4746 /// Sets the value of [gcr_domain][crate::model::Application::gcr_domain].
4747 ///
4748 /// # Example
4749 /// ```ignore,no_run
4750 /// # use google_cloud_appengine_v1::model::Application;
4751 /// let x = Application::new().set_gcr_domain("example");
4752 /// ```
4753 pub fn set_gcr_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4754 self.gcr_domain = v.into();
4755 self
4756 }
4757
4758 /// Sets the value of [database_type][crate::model::Application::database_type].
4759 ///
4760 /// # Example
4761 /// ```ignore,no_run
4762 /// # use google_cloud_appengine_v1::model::Application;
4763 /// use google_cloud_appengine_v1::model::application::DatabaseType;
4764 /// let x0 = Application::new().set_database_type(DatabaseType::CloudDatastore);
4765 /// let x1 = Application::new().set_database_type(DatabaseType::CloudFirestore);
4766 /// let x2 = Application::new().set_database_type(DatabaseType::CloudDatastoreCompatibility);
4767 /// ```
4768 pub fn set_database_type<T: std::convert::Into<crate::model::application::DatabaseType>>(
4769 mut self,
4770 v: T,
4771 ) -> Self {
4772 self.database_type = v.into();
4773 self
4774 }
4775
4776 /// Sets the value of [feature_settings][crate::model::Application::feature_settings].
4777 ///
4778 /// # Example
4779 /// ```ignore,no_run
4780 /// # use google_cloud_appengine_v1::model::Application;
4781 /// use google_cloud_appengine_v1::model::application::FeatureSettings;
4782 /// let x = Application::new().set_feature_settings(FeatureSettings::default()/* use setters */);
4783 /// ```
4784 pub fn set_feature_settings<T>(mut self, v: T) -> Self
4785 where
4786 T: std::convert::Into<crate::model::application::FeatureSettings>,
4787 {
4788 self.feature_settings = std::option::Option::Some(v.into());
4789 self
4790 }
4791
4792 /// Sets or clears the value of [feature_settings][crate::model::Application::feature_settings].
4793 ///
4794 /// # Example
4795 /// ```ignore,no_run
4796 /// # use google_cloud_appengine_v1::model::Application;
4797 /// use google_cloud_appengine_v1::model::application::FeatureSettings;
4798 /// let x = Application::new().set_or_clear_feature_settings(Some(FeatureSettings::default()/* use setters */));
4799 /// let x = Application::new().set_or_clear_feature_settings(None::<FeatureSettings>);
4800 /// ```
4801 pub fn set_or_clear_feature_settings<T>(mut self, v: std::option::Option<T>) -> Self
4802 where
4803 T: std::convert::Into<crate::model::application::FeatureSettings>,
4804 {
4805 self.feature_settings = v.map(|x| x.into());
4806 self
4807 }
4808}
4809
4810impl wkt::message::Message for Application {
4811 fn typename() -> &'static str {
4812 "type.googleapis.com/google.appengine.v1.Application"
4813 }
4814}
4815
4816/// Defines additional types related to [Application].
4817pub mod application {
4818 #[allow(unused_imports)]
4819 use super::*;
4820
4821 /// Identity-Aware Proxy
4822 #[derive(Clone, Default, PartialEq)]
4823 #[non_exhaustive]
4824 pub struct IdentityAwareProxy {
4825 /// Whether the serving infrastructure will authenticate and
4826 /// authorize all incoming requests.
4827 ///
4828 /// If true, the `oauth2_client_id` and `oauth2_client_secret`
4829 /// fields must be non-empty.
4830 pub enabled: bool,
4831
4832 /// OAuth2 client ID to use for the authentication flow.
4833 pub oauth2_client_id: std::string::String,
4834
4835 /// OAuth2 client secret to use for the authentication flow.
4836 ///
4837 /// For security reasons, this value cannot be retrieved via the API.
4838 /// Instead, the SHA-256 hash of the value is returned in the
4839 /// `oauth2_client_secret_sha256` field.
4840 ///
4841 /// @InputOnly
4842 pub oauth2_client_secret: std::string::String,
4843
4844 /// Hex-encoded SHA-256 hash of the client secret.
4845 ///
4846 /// @OutputOnly
4847 pub oauth2_client_secret_sha256: std::string::String,
4848
4849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4850 }
4851
4852 impl IdentityAwareProxy {
4853 /// Creates a new default instance.
4854 pub fn new() -> Self {
4855 std::default::Default::default()
4856 }
4857
4858 /// Sets the value of [enabled][crate::model::application::IdentityAwareProxy::enabled].
4859 ///
4860 /// # Example
4861 /// ```ignore,no_run
4862 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4863 /// let x = IdentityAwareProxy::new().set_enabled(true);
4864 /// ```
4865 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4866 self.enabled = v.into();
4867 self
4868 }
4869
4870 /// Sets the value of [oauth2_client_id][crate::model::application::IdentityAwareProxy::oauth2_client_id].
4871 ///
4872 /// # Example
4873 /// ```ignore,no_run
4874 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4875 /// let x = IdentityAwareProxy::new().set_oauth2_client_id("example");
4876 /// ```
4877 pub fn set_oauth2_client_id<T: std::convert::Into<std::string::String>>(
4878 mut self,
4879 v: T,
4880 ) -> Self {
4881 self.oauth2_client_id = v.into();
4882 self
4883 }
4884
4885 /// Sets the value of [oauth2_client_secret][crate::model::application::IdentityAwareProxy::oauth2_client_secret].
4886 ///
4887 /// # Example
4888 /// ```ignore,no_run
4889 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4890 /// let x = IdentityAwareProxy::new().set_oauth2_client_secret("example");
4891 /// ```
4892 pub fn set_oauth2_client_secret<T: std::convert::Into<std::string::String>>(
4893 mut self,
4894 v: T,
4895 ) -> Self {
4896 self.oauth2_client_secret = v.into();
4897 self
4898 }
4899
4900 /// Sets the value of [oauth2_client_secret_sha256][crate::model::application::IdentityAwareProxy::oauth2_client_secret_sha256].
4901 ///
4902 /// # Example
4903 /// ```ignore,no_run
4904 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4905 /// let x = IdentityAwareProxy::new().set_oauth2_client_secret_sha256("example");
4906 /// ```
4907 pub fn set_oauth2_client_secret_sha256<T: std::convert::Into<std::string::String>>(
4908 mut self,
4909 v: T,
4910 ) -> Self {
4911 self.oauth2_client_secret_sha256 = v.into();
4912 self
4913 }
4914 }
4915
4916 impl wkt::message::Message for IdentityAwareProxy {
4917 fn typename() -> &'static str {
4918 "type.googleapis.com/google.appengine.v1.Application.IdentityAwareProxy"
4919 }
4920 }
4921
4922 /// The feature specific settings to be used in the application. These define
4923 /// behaviors that are user configurable.
4924 #[derive(Clone, Default, PartialEq)]
4925 #[non_exhaustive]
4926 pub struct FeatureSettings {
4927 /// Boolean value indicating if split health checks should be used instead
4928 /// of the legacy health checks. At an app.yaml level, this means defaulting
4929 /// to 'readiness_check' and 'liveness_check' values instead of
4930 /// 'health_check' ones. Once the legacy 'health_check' behavior is
4931 /// deprecated, and this value is always true, this setting can
4932 /// be removed.
4933 pub split_health_checks: bool,
4934
4935 /// If true, use [Container-Optimized OS](https://cloud.google.com/container-optimized-os/)
4936 /// base image for VMs, rather than a base Debian image.
4937 pub use_container_optimized_os: bool,
4938
4939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4940 }
4941
4942 impl FeatureSettings {
4943 /// Creates a new default instance.
4944 pub fn new() -> Self {
4945 std::default::Default::default()
4946 }
4947
4948 /// Sets the value of [split_health_checks][crate::model::application::FeatureSettings::split_health_checks].
4949 ///
4950 /// # Example
4951 /// ```ignore,no_run
4952 /// # use google_cloud_appengine_v1::model::application::FeatureSettings;
4953 /// let x = FeatureSettings::new().set_split_health_checks(true);
4954 /// ```
4955 pub fn set_split_health_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4956 self.split_health_checks = v.into();
4957 self
4958 }
4959
4960 /// Sets the value of [use_container_optimized_os][crate::model::application::FeatureSettings::use_container_optimized_os].
4961 ///
4962 /// # Example
4963 /// ```ignore,no_run
4964 /// # use google_cloud_appengine_v1::model::application::FeatureSettings;
4965 /// let x = FeatureSettings::new().set_use_container_optimized_os(true);
4966 /// ```
4967 pub fn set_use_container_optimized_os<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4968 self.use_container_optimized_os = v.into();
4969 self
4970 }
4971 }
4972
4973 impl wkt::message::Message for FeatureSettings {
4974 fn typename() -> &'static str {
4975 "type.googleapis.com/google.appengine.v1.Application.FeatureSettings"
4976 }
4977 }
4978
4979 /// Enum for [ServingStatus].
4980 ///
4981 /// # Working with unknown values
4982 ///
4983 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4984 /// additional enum variants at any time. Adding new variants is not considered
4985 /// a breaking change. Applications should write their code in anticipation of:
4986 ///
4987 /// - New values appearing in future releases of the client library, **and**
4988 /// - New values received dynamically, without application changes.
4989 ///
4990 /// Please consult the [Working with enums] section in the user guide for some
4991 /// guidelines.
4992 ///
4993 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4994 #[derive(Clone, Debug, PartialEq)]
4995 #[non_exhaustive]
4996 pub enum ServingStatus {
4997 /// Serving status is unspecified.
4998 Unspecified,
4999 /// Application is serving.
5000 Serving,
5001 /// Application has been disabled by the user.
5002 UserDisabled,
5003 /// Application has been disabled by the system.
5004 SystemDisabled,
5005 /// If set, the enum was initialized with an unknown value.
5006 ///
5007 /// Applications can examine the value using [ServingStatus::value] or
5008 /// [ServingStatus::name].
5009 UnknownValue(serving_status::UnknownValue),
5010 }
5011
5012 #[doc(hidden)]
5013 pub mod serving_status {
5014 #[allow(unused_imports)]
5015 use super::*;
5016 #[derive(Clone, Debug, PartialEq)]
5017 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5018 }
5019
5020 impl ServingStatus {
5021 /// Gets the enum value.
5022 ///
5023 /// Returns `None` if the enum contains an unknown value deserialized from
5024 /// the string representation of enums.
5025 pub fn value(&self) -> std::option::Option<i32> {
5026 match self {
5027 Self::Unspecified => std::option::Option::Some(0),
5028 Self::Serving => std::option::Option::Some(1),
5029 Self::UserDisabled => std::option::Option::Some(2),
5030 Self::SystemDisabled => std::option::Option::Some(3),
5031 Self::UnknownValue(u) => u.0.value(),
5032 }
5033 }
5034
5035 /// Gets the enum value as a string.
5036 ///
5037 /// Returns `None` if the enum contains an unknown value deserialized from
5038 /// the integer representation of enums.
5039 pub fn name(&self) -> std::option::Option<&str> {
5040 match self {
5041 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
5042 Self::Serving => std::option::Option::Some("SERVING"),
5043 Self::UserDisabled => std::option::Option::Some("USER_DISABLED"),
5044 Self::SystemDisabled => std::option::Option::Some("SYSTEM_DISABLED"),
5045 Self::UnknownValue(u) => u.0.name(),
5046 }
5047 }
5048 }
5049
5050 impl std::default::Default for ServingStatus {
5051 fn default() -> Self {
5052 use std::convert::From;
5053 Self::from(0)
5054 }
5055 }
5056
5057 impl std::fmt::Display for ServingStatus {
5058 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5059 wkt::internal::display_enum(f, self.name(), self.value())
5060 }
5061 }
5062
5063 impl std::convert::From<i32> for ServingStatus {
5064 fn from(value: i32) -> Self {
5065 match value {
5066 0 => Self::Unspecified,
5067 1 => Self::Serving,
5068 2 => Self::UserDisabled,
5069 3 => Self::SystemDisabled,
5070 _ => Self::UnknownValue(serving_status::UnknownValue(
5071 wkt::internal::UnknownEnumValue::Integer(value),
5072 )),
5073 }
5074 }
5075 }
5076
5077 impl std::convert::From<&str> for ServingStatus {
5078 fn from(value: &str) -> Self {
5079 use std::string::ToString;
5080 match value {
5081 "UNSPECIFIED" => Self::Unspecified,
5082 "SERVING" => Self::Serving,
5083 "USER_DISABLED" => Self::UserDisabled,
5084 "SYSTEM_DISABLED" => Self::SystemDisabled,
5085 _ => Self::UnknownValue(serving_status::UnknownValue(
5086 wkt::internal::UnknownEnumValue::String(value.to_string()),
5087 )),
5088 }
5089 }
5090 }
5091
5092 impl serde::ser::Serialize for ServingStatus {
5093 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5094 where
5095 S: serde::Serializer,
5096 {
5097 match self {
5098 Self::Unspecified => serializer.serialize_i32(0),
5099 Self::Serving => serializer.serialize_i32(1),
5100 Self::UserDisabled => serializer.serialize_i32(2),
5101 Self::SystemDisabled => serializer.serialize_i32(3),
5102 Self::UnknownValue(u) => u.0.serialize(serializer),
5103 }
5104 }
5105 }
5106
5107 impl<'de> serde::de::Deserialize<'de> for ServingStatus {
5108 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5109 where
5110 D: serde::Deserializer<'de>,
5111 {
5112 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServingStatus>::new(
5113 ".google.appengine.v1.Application.ServingStatus",
5114 ))
5115 }
5116 }
5117
5118 /// Enum for [DatabaseType].
5119 ///
5120 /// # Working with unknown values
5121 ///
5122 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5123 /// additional enum variants at any time. Adding new variants is not considered
5124 /// a breaking change. Applications should write their code in anticipation of:
5125 ///
5126 /// - New values appearing in future releases of the client library, **and**
5127 /// - New values received dynamically, without application changes.
5128 ///
5129 /// Please consult the [Working with enums] section in the user guide for some
5130 /// guidelines.
5131 ///
5132 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5133 #[derive(Clone, Debug, PartialEq)]
5134 #[non_exhaustive]
5135 pub enum DatabaseType {
5136 /// Database type is unspecified.
5137 Unspecified,
5138 /// Cloud Datastore
5139 CloudDatastore,
5140 /// Cloud Firestore Native
5141 CloudFirestore,
5142 /// Cloud Firestore in Datastore Mode
5143 CloudDatastoreCompatibility,
5144 /// If set, the enum was initialized with an unknown value.
5145 ///
5146 /// Applications can examine the value using [DatabaseType::value] or
5147 /// [DatabaseType::name].
5148 UnknownValue(database_type::UnknownValue),
5149 }
5150
5151 #[doc(hidden)]
5152 pub mod database_type {
5153 #[allow(unused_imports)]
5154 use super::*;
5155 #[derive(Clone, Debug, PartialEq)]
5156 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5157 }
5158
5159 impl DatabaseType {
5160 /// Gets the enum value.
5161 ///
5162 /// Returns `None` if the enum contains an unknown value deserialized from
5163 /// the string representation of enums.
5164 pub fn value(&self) -> std::option::Option<i32> {
5165 match self {
5166 Self::Unspecified => std::option::Option::Some(0),
5167 Self::CloudDatastore => std::option::Option::Some(1),
5168 Self::CloudFirestore => std::option::Option::Some(2),
5169 Self::CloudDatastoreCompatibility => std::option::Option::Some(3),
5170 Self::UnknownValue(u) => u.0.value(),
5171 }
5172 }
5173
5174 /// Gets the enum value as a string.
5175 ///
5176 /// Returns `None` if the enum contains an unknown value deserialized from
5177 /// the integer representation of enums.
5178 pub fn name(&self) -> std::option::Option<&str> {
5179 match self {
5180 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
5181 Self::CloudDatastore => std::option::Option::Some("CLOUD_DATASTORE"),
5182 Self::CloudFirestore => std::option::Option::Some("CLOUD_FIRESTORE"),
5183 Self::CloudDatastoreCompatibility => {
5184 std::option::Option::Some("CLOUD_DATASTORE_COMPATIBILITY")
5185 }
5186 Self::UnknownValue(u) => u.0.name(),
5187 }
5188 }
5189 }
5190
5191 impl std::default::Default for DatabaseType {
5192 fn default() -> Self {
5193 use std::convert::From;
5194 Self::from(0)
5195 }
5196 }
5197
5198 impl std::fmt::Display for DatabaseType {
5199 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5200 wkt::internal::display_enum(f, self.name(), self.value())
5201 }
5202 }
5203
5204 impl std::convert::From<i32> for DatabaseType {
5205 fn from(value: i32) -> Self {
5206 match value {
5207 0 => Self::Unspecified,
5208 1 => Self::CloudDatastore,
5209 2 => Self::CloudFirestore,
5210 3 => Self::CloudDatastoreCompatibility,
5211 _ => Self::UnknownValue(database_type::UnknownValue(
5212 wkt::internal::UnknownEnumValue::Integer(value),
5213 )),
5214 }
5215 }
5216 }
5217
5218 impl std::convert::From<&str> for DatabaseType {
5219 fn from(value: &str) -> Self {
5220 use std::string::ToString;
5221 match value {
5222 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
5223 "CLOUD_DATASTORE" => Self::CloudDatastore,
5224 "CLOUD_FIRESTORE" => Self::CloudFirestore,
5225 "CLOUD_DATASTORE_COMPATIBILITY" => Self::CloudDatastoreCompatibility,
5226 _ => Self::UnknownValue(database_type::UnknownValue(
5227 wkt::internal::UnknownEnumValue::String(value.to_string()),
5228 )),
5229 }
5230 }
5231 }
5232
5233 impl serde::ser::Serialize for DatabaseType {
5234 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5235 where
5236 S: serde::Serializer,
5237 {
5238 match self {
5239 Self::Unspecified => serializer.serialize_i32(0),
5240 Self::CloudDatastore => serializer.serialize_i32(1),
5241 Self::CloudFirestore => serializer.serialize_i32(2),
5242 Self::CloudDatastoreCompatibility => serializer.serialize_i32(3),
5243 Self::UnknownValue(u) => u.0.serialize(serializer),
5244 }
5245 }
5246 }
5247
5248 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
5249 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5250 where
5251 D: serde::Deserializer<'de>,
5252 {
5253 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
5254 ".google.appengine.v1.Application.DatabaseType",
5255 ))
5256 }
5257 }
5258}
5259
5260/// Rules to match an HTTP request and dispatch that request to a service.
5261#[derive(Clone, Default, PartialEq)]
5262#[non_exhaustive]
5263pub struct UrlDispatchRule {
5264 /// Domain name to match against. The wildcard "`*`" is supported if
5265 /// specified before a period: "`*.`".
5266 ///
5267 /// Defaults to matching all domains: "`*`".
5268 pub domain: std::string::String,
5269
5270 /// Pathname within the host. Must start with a "`/`". A
5271 /// single "`*`" can be included at the end of the path.
5272 ///
5273 /// The sum of the lengths of the domain and path may not
5274 /// exceed 100 characters.
5275 pub path: std::string::String,
5276
5277 /// Resource ID of a service in this application that should
5278 /// serve the matched request. The service must already
5279 /// exist. Example: `default`.
5280 pub service: std::string::String,
5281
5282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5283}
5284
5285impl UrlDispatchRule {
5286 /// Creates a new default instance.
5287 pub fn new() -> Self {
5288 std::default::Default::default()
5289 }
5290
5291 /// Sets the value of [domain][crate::model::UrlDispatchRule::domain].
5292 ///
5293 /// # Example
5294 /// ```ignore,no_run
5295 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5296 /// let x = UrlDispatchRule::new().set_domain("example");
5297 /// ```
5298 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5299 self.domain = v.into();
5300 self
5301 }
5302
5303 /// Sets the value of [path][crate::model::UrlDispatchRule::path].
5304 ///
5305 /// # Example
5306 /// ```ignore,no_run
5307 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5308 /// let x = UrlDispatchRule::new().set_path("example");
5309 /// ```
5310 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5311 self.path = v.into();
5312 self
5313 }
5314
5315 /// Sets the value of [service][crate::model::UrlDispatchRule::service].
5316 ///
5317 /// # Example
5318 /// ```ignore,no_run
5319 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5320 /// let x = UrlDispatchRule::new().set_service("example");
5321 /// ```
5322 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5323 self.service = v.into();
5324 self
5325 }
5326}
5327
5328impl wkt::message::Message for UrlDispatchRule {
5329 fn typename() -> &'static str {
5330 "type.googleapis.com/google.appengine.v1.UrlDispatchRule"
5331 }
5332}
5333
5334/// App Engine admin service audit log.
5335#[derive(Clone, Default, PartialEq)]
5336#[non_exhaustive]
5337pub struct AuditData {
5338 /// Detailed information about methods that require it. Does not include
5339 /// simple Get, List or Delete methods because all significant information
5340 /// (resource name, number of returned elements for List operations) is already
5341 /// included in parent audit log message.
5342 pub method: std::option::Option<crate::model::audit_data::Method>,
5343
5344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5345}
5346
5347impl AuditData {
5348 /// Creates a new default instance.
5349 pub fn new() -> Self {
5350 std::default::Default::default()
5351 }
5352
5353 /// Sets the value of [method][crate::model::AuditData::method].
5354 ///
5355 /// Note that all the setters affecting `method` are mutually
5356 /// exclusive.
5357 ///
5358 /// # Example
5359 /// ```ignore,no_run
5360 /// # use google_cloud_appengine_v1::model::AuditData;
5361 /// use google_cloud_appengine_v1::model::UpdateServiceMethod;
5362 /// let x = AuditData::new().set_method(Some(
5363 /// google_cloud_appengine_v1::model::audit_data::Method::UpdateService(UpdateServiceMethod::default().into())));
5364 /// ```
5365 pub fn set_method<
5366 T: std::convert::Into<std::option::Option<crate::model::audit_data::Method>>,
5367 >(
5368 mut self,
5369 v: T,
5370 ) -> Self {
5371 self.method = v.into();
5372 self
5373 }
5374
5375 /// The value of [method][crate::model::AuditData::method]
5376 /// if it holds a `UpdateService`, `None` if the field is not set or
5377 /// holds a different branch.
5378 pub fn update_service(
5379 &self,
5380 ) -> std::option::Option<&std::boxed::Box<crate::model::UpdateServiceMethod>> {
5381 #[allow(unreachable_patterns)]
5382 self.method.as_ref().and_then(|v| match v {
5383 crate::model::audit_data::Method::UpdateService(v) => std::option::Option::Some(v),
5384 _ => std::option::Option::None,
5385 })
5386 }
5387
5388 /// Sets the value of [method][crate::model::AuditData::method]
5389 /// to hold a `UpdateService`.
5390 ///
5391 /// Note that all the setters affecting `method` are
5392 /// mutually exclusive.
5393 ///
5394 /// # Example
5395 /// ```ignore,no_run
5396 /// # use google_cloud_appengine_v1::model::AuditData;
5397 /// use google_cloud_appengine_v1::model::UpdateServiceMethod;
5398 /// let x = AuditData::new().set_update_service(UpdateServiceMethod::default()/* use setters */);
5399 /// assert!(x.update_service().is_some());
5400 /// assert!(x.create_version().is_none());
5401 /// ```
5402 pub fn set_update_service<
5403 T: std::convert::Into<std::boxed::Box<crate::model::UpdateServiceMethod>>,
5404 >(
5405 mut self,
5406 v: T,
5407 ) -> Self {
5408 self.method =
5409 std::option::Option::Some(crate::model::audit_data::Method::UpdateService(v.into()));
5410 self
5411 }
5412
5413 /// The value of [method][crate::model::AuditData::method]
5414 /// if it holds a `CreateVersion`, `None` if the field is not set or
5415 /// holds a different branch.
5416 pub fn create_version(
5417 &self,
5418 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateVersionMethod>> {
5419 #[allow(unreachable_patterns)]
5420 self.method.as_ref().and_then(|v| match v {
5421 crate::model::audit_data::Method::CreateVersion(v) => std::option::Option::Some(v),
5422 _ => std::option::Option::None,
5423 })
5424 }
5425
5426 /// Sets the value of [method][crate::model::AuditData::method]
5427 /// to hold a `CreateVersion`.
5428 ///
5429 /// Note that all the setters affecting `method` are
5430 /// mutually exclusive.
5431 ///
5432 /// # Example
5433 /// ```ignore,no_run
5434 /// # use google_cloud_appengine_v1::model::AuditData;
5435 /// use google_cloud_appengine_v1::model::CreateVersionMethod;
5436 /// let x = AuditData::new().set_create_version(CreateVersionMethod::default()/* use setters */);
5437 /// assert!(x.create_version().is_some());
5438 /// assert!(x.update_service().is_none());
5439 /// ```
5440 pub fn set_create_version<
5441 T: std::convert::Into<std::boxed::Box<crate::model::CreateVersionMethod>>,
5442 >(
5443 mut self,
5444 v: T,
5445 ) -> Self {
5446 self.method =
5447 std::option::Option::Some(crate::model::audit_data::Method::CreateVersion(v.into()));
5448 self
5449 }
5450}
5451
5452impl wkt::message::Message for AuditData {
5453 fn typename() -> &'static str {
5454 "type.googleapis.com/google.appengine.v1.AuditData"
5455 }
5456}
5457
5458/// Defines additional types related to [AuditData].
5459pub mod audit_data {
5460 #[allow(unused_imports)]
5461 use super::*;
5462
5463 /// Detailed information about methods that require it. Does not include
5464 /// simple Get, List or Delete methods because all significant information
5465 /// (resource name, number of returned elements for List operations) is already
5466 /// included in parent audit log message.
5467 #[derive(Clone, Debug, PartialEq)]
5468 #[non_exhaustive]
5469 pub enum Method {
5470 /// Detailed information about UpdateService call.
5471 UpdateService(std::boxed::Box<crate::model::UpdateServiceMethod>),
5472 /// Detailed information about CreateVersion call.
5473 CreateVersion(std::boxed::Box<crate::model::CreateVersionMethod>),
5474 }
5475}
5476
5477/// Detailed information about UpdateService call.
5478#[derive(Clone, Default, PartialEq)]
5479#[non_exhaustive]
5480pub struct UpdateServiceMethod {
5481 /// Update service request.
5482 pub request: std::option::Option<crate::model::UpdateServiceRequest>,
5483
5484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5485}
5486
5487impl UpdateServiceMethod {
5488 /// Creates a new default instance.
5489 pub fn new() -> Self {
5490 std::default::Default::default()
5491 }
5492
5493 /// Sets the value of [request][crate::model::UpdateServiceMethod::request].
5494 ///
5495 /// # Example
5496 /// ```ignore,no_run
5497 /// # use google_cloud_appengine_v1::model::UpdateServiceMethod;
5498 /// use google_cloud_appengine_v1::model::UpdateServiceRequest;
5499 /// let x = UpdateServiceMethod::new().set_request(UpdateServiceRequest::default()/* use setters */);
5500 /// ```
5501 pub fn set_request<T>(mut self, v: T) -> Self
5502 where
5503 T: std::convert::Into<crate::model::UpdateServiceRequest>,
5504 {
5505 self.request = std::option::Option::Some(v.into());
5506 self
5507 }
5508
5509 /// Sets or clears the value of [request][crate::model::UpdateServiceMethod::request].
5510 ///
5511 /// # Example
5512 /// ```ignore,no_run
5513 /// # use google_cloud_appengine_v1::model::UpdateServiceMethod;
5514 /// use google_cloud_appengine_v1::model::UpdateServiceRequest;
5515 /// let x = UpdateServiceMethod::new().set_or_clear_request(Some(UpdateServiceRequest::default()/* use setters */));
5516 /// let x = UpdateServiceMethod::new().set_or_clear_request(None::<UpdateServiceRequest>);
5517 /// ```
5518 pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5519 where
5520 T: std::convert::Into<crate::model::UpdateServiceRequest>,
5521 {
5522 self.request = v.map(|x| x.into());
5523 self
5524 }
5525}
5526
5527impl wkt::message::Message for UpdateServiceMethod {
5528 fn typename() -> &'static str {
5529 "type.googleapis.com/google.appengine.v1.UpdateServiceMethod"
5530 }
5531}
5532
5533/// Detailed information about CreateVersion call.
5534#[derive(Clone, Default, PartialEq)]
5535#[non_exhaustive]
5536pub struct CreateVersionMethod {
5537 /// Create version request.
5538 pub request: std::option::Option<crate::model::CreateVersionRequest>,
5539
5540 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5541}
5542
5543impl CreateVersionMethod {
5544 /// Creates a new default instance.
5545 pub fn new() -> Self {
5546 std::default::Default::default()
5547 }
5548
5549 /// Sets the value of [request][crate::model::CreateVersionMethod::request].
5550 ///
5551 /// # Example
5552 /// ```ignore,no_run
5553 /// # use google_cloud_appengine_v1::model::CreateVersionMethod;
5554 /// use google_cloud_appengine_v1::model::CreateVersionRequest;
5555 /// let x = CreateVersionMethod::new().set_request(CreateVersionRequest::default()/* use setters */);
5556 /// ```
5557 pub fn set_request<T>(mut self, v: T) -> Self
5558 where
5559 T: std::convert::Into<crate::model::CreateVersionRequest>,
5560 {
5561 self.request = std::option::Option::Some(v.into());
5562 self
5563 }
5564
5565 /// Sets or clears the value of [request][crate::model::CreateVersionMethod::request].
5566 ///
5567 /// # Example
5568 /// ```ignore,no_run
5569 /// # use google_cloud_appengine_v1::model::CreateVersionMethod;
5570 /// use google_cloud_appengine_v1::model::CreateVersionRequest;
5571 /// let x = CreateVersionMethod::new().set_or_clear_request(Some(CreateVersionRequest::default()/* use setters */));
5572 /// let x = CreateVersionMethod::new().set_or_clear_request(None::<CreateVersionRequest>);
5573 /// ```
5574 pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5575 where
5576 T: std::convert::Into<crate::model::CreateVersionRequest>,
5577 {
5578 self.request = v.map(|x| x.into());
5579 self
5580 }
5581}
5582
5583impl wkt::message::Message for CreateVersionMethod {
5584 fn typename() -> &'static str {
5585 "type.googleapis.com/google.appengine.v1.CreateVersionMethod"
5586 }
5587}
5588
5589/// An SSL certificate that a user has been authorized to administer. A user
5590/// is authorized to administer any certificate that applies to one of their
5591/// authorized domains.
5592#[derive(Clone, Default, PartialEq)]
5593#[non_exhaustive]
5594pub struct AuthorizedCertificate {
5595 /// Full path to the `AuthorizedCertificate` resource in the API. Example:
5596 /// `apps/myapp/authorizedCertificates/12345`.
5597 ///
5598 /// @OutputOnly
5599 pub name: std::string::String,
5600
5601 /// Relative name of the certificate. This is a unique value autogenerated
5602 /// on `AuthorizedCertificate` resource creation. Example: `12345`.
5603 ///
5604 /// @OutputOnly
5605 pub id: std::string::String,
5606
5607 /// The user-specified display name of the certificate. This is not
5608 /// guaranteed to be unique. Example: `My Certificate`.
5609 pub display_name: std::string::String,
5610
5611 /// Topmost applicable domains of this certificate. This certificate
5612 /// applies to these domains and their subdomains. Example: `example.com`.
5613 ///
5614 /// @OutputOnly
5615 pub domain_names: std::vec::Vec<std::string::String>,
5616
5617 /// The time when this certificate expires. To update the renewal time on this
5618 /// certificate, upload an SSL certificate with a different expiration time
5619 /// using [`AuthorizedCertificates.UpdateAuthorizedCertificate`]().
5620 ///
5621 /// @OutputOnly
5622 pub expire_time: std::option::Option<wkt::Timestamp>,
5623
5624 /// The SSL certificate serving the `AuthorizedCertificate` resource. This
5625 /// must be obtained independently from a certificate authority.
5626 pub certificate_raw_data: std::option::Option<crate::model::CertificateRawData>,
5627
5628 /// Only applicable if this certificate is managed by App Engine. Managed
5629 /// certificates are tied to the lifecycle of a `DomainMapping` and cannot be
5630 /// updated or deleted via the `AuthorizedCertificates` API. If this
5631 /// certificate is manually administered by the user, this field will be empty.
5632 ///
5633 /// @OutputOnly
5634 pub managed_certificate: std::option::Option<crate::model::ManagedCertificate>,
5635
5636 /// The full paths to user visible Domain Mapping resources that have this
5637 /// certificate mapped. Example: `apps/myapp/domainMappings/example.com`.
5638 ///
5639 /// This may not represent the full list of mapped domain mappings if the user
5640 /// does not have `VIEWER` permissions on all of the applications that have
5641 /// this certificate mapped. See `domain_mappings_count` for a complete count.
5642 ///
5643 /// Only returned by `GET` or `LIST` requests when specifically requested by
5644 /// the `view=FULL_CERTIFICATE` option.
5645 ///
5646 /// @OutputOnly
5647 pub visible_domain_mappings: std::vec::Vec<std::string::String>,
5648
5649 /// Aggregate count of the domain mappings with this certificate mapped. This
5650 /// count includes domain mappings on applications for which the user does not
5651 /// have `VIEWER` permissions.
5652 ///
5653 /// Only returned by `GET` or `LIST` requests when specifically requested by
5654 /// the `view=FULL_CERTIFICATE` option.
5655 ///
5656 /// @OutputOnly
5657 pub domain_mappings_count: i32,
5658
5659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5660}
5661
5662impl AuthorizedCertificate {
5663 /// Creates a new default instance.
5664 pub fn new() -> Self {
5665 std::default::Default::default()
5666 }
5667
5668 /// Sets the value of [name][crate::model::AuthorizedCertificate::name].
5669 ///
5670 /// # Example
5671 /// ```ignore,no_run
5672 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5673 /// let x = AuthorizedCertificate::new().set_name("example");
5674 /// ```
5675 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5676 self.name = v.into();
5677 self
5678 }
5679
5680 /// Sets the value of [id][crate::model::AuthorizedCertificate::id].
5681 ///
5682 /// # Example
5683 /// ```ignore,no_run
5684 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5685 /// let x = AuthorizedCertificate::new().set_id("example");
5686 /// ```
5687 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5688 self.id = v.into();
5689 self
5690 }
5691
5692 /// Sets the value of [display_name][crate::model::AuthorizedCertificate::display_name].
5693 ///
5694 /// # Example
5695 /// ```ignore,no_run
5696 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5697 /// let x = AuthorizedCertificate::new().set_display_name("example");
5698 /// ```
5699 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5700 self.display_name = v.into();
5701 self
5702 }
5703
5704 /// Sets the value of [domain_names][crate::model::AuthorizedCertificate::domain_names].
5705 ///
5706 /// # Example
5707 /// ```ignore,no_run
5708 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5709 /// let x = AuthorizedCertificate::new().set_domain_names(["a", "b", "c"]);
5710 /// ```
5711 pub fn set_domain_names<T, V>(mut self, v: T) -> Self
5712 where
5713 T: std::iter::IntoIterator<Item = V>,
5714 V: std::convert::Into<std::string::String>,
5715 {
5716 use std::iter::Iterator;
5717 self.domain_names = v.into_iter().map(|i| i.into()).collect();
5718 self
5719 }
5720
5721 /// Sets the value of [expire_time][crate::model::AuthorizedCertificate::expire_time].
5722 ///
5723 /// # Example
5724 /// ```ignore,no_run
5725 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5726 /// use wkt::Timestamp;
5727 /// let x = AuthorizedCertificate::new().set_expire_time(Timestamp::default()/* use setters */);
5728 /// ```
5729 pub fn set_expire_time<T>(mut self, v: T) -> Self
5730 where
5731 T: std::convert::Into<wkt::Timestamp>,
5732 {
5733 self.expire_time = std::option::Option::Some(v.into());
5734 self
5735 }
5736
5737 /// Sets or clears the value of [expire_time][crate::model::AuthorizedCertificate::expire_time].
5738 ///
5739 /// # Example
5740 /// ```ignore,no_run
5741 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5742 /// use wkt::Timestamp;
5743 /// let x = AuthorizedCertificate::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
5744 /// let x = AuthorizedCertificate::new().set_or_clear_expire_time(None::<Timestamp>);
5745 /// ```
5746 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
5747 where
5748 T: std::convert::Into<wkt::Timestamp>,
5749 {
5750 self.expire_time = v.map(|x| x.into());
5751 self
5752 }
5753
5754 /// Sets the value of [certificate_raw_data][crate::model::AuthorizedCertificate::certificate_raw_data].
5755 ///
5756 /// # Example
5757 /// ```ignore,no_run
5758 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5759 /// use google_cloud_appengine_v1::model::CertificateRawData;
5760 /// let x = AuthorizedCertificate::new().set_certificate_raw_data(CertificateRawData::default()/* use setters */);
5761 /// ```
5762 pub fn set_certificate_raw_data<T>(mut self, v: T) -> Self
5763 where
5764 T: std::convert::Into<crate::model::CertificateRawData>,
5765 {
5766 self.certificate_raw_data = std::option::Option::Some(v.into());
5767 self
5768 }
5769
5770 /// Sets or clears the value of [certificate_raw_data][crate::model::AuthorizedCertificate::certificate_raw_data].
5771 ///
5772 /// # Example
5773 /// ```ignore,no_run
5774 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5775 /// use google_cloud_appengine_v1::model::CertificateRawData;
5776 /// let x = AuthorizedCertificate::new().set_or_clear_certificate_raw_data(Some(CertificateRawData::default()/* use setters */));
5777 /// let x = AuthorizedCertificate::new().set_or_clear_certificate_raw_data(None::<CertificateRawData>);
5778 /// ```
5779 pub fn set_or_clear_certificate_raw_data<T>(mut self, v: std::option::Option<T>) -> Self
5780 where
5781 T: std::convert::Into<crate::model::CertificateRawData>,
5782 {
5783 self.certificate_raw_data = v.map(|x| x.into());
5784 self
5785 }
5786
5787 /// Sets the value of [managed_certificate][crate::model::AuthorizedCertificate::managed_certificate].
5788 ///
5789 /// # Example
5790 /// ```ignore,no_run
5791 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5792 /// use google_cloud_appengine_v1::model::ManagedCertificate;
5793 /// let x = AuthorizedCertificate::new().set_managed_certificate(ManagedCertificate::default()/* use setters */);
5794 /// ```
5795 pub fn set_managed_certificate<T>(mut self, v: T) -> Self
5796 where
5797 T: std::convert::Into<crate::model::ManagedCertificate>,
5798 {
5799 self.managed_certificate = std::option::Option::Some(v.into());
5800 self
5801 }
5802
5803 /// Sets or clears the value of [managed_certificate][crate::model::AuthorizedCertificate::managed_certificate].
5804 ///
5805 /// # Example
5806 /// ```ignore,no_run
5807 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5808 /// use google_cloud_appengine_v1::model::ManagedCertificate;
5809 /// let x = AuthorizedCertificate::new().set_or_clear_managed_certificate(Some(ManagedCertificate::default()/* use setters */));
5810 /// let x = AuthorizedCertificate::new().set_or_clear_managed_certificate(None::<ManagedCertificate>);
5811 /// ```
5812 pub fn set_or_clear_managed_certificate<T>(mut self, v: std::option::Option<T>) -> Self
5813 where
5814 T: std::convert::Into<crate::model::ManagedCertificate>,
5815 {
5816 self.managed_certificate = v.map(|x| x.into());
5817 self
5818 }
5819
5820 /// Sets the value of [visible_domain_mappings][crate::model::AuthorizedCertificate::visible_domain_mappings].
5821 ///
5822 /// # Example
5823 /// ```ignore,no_run
5824 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5825 /// let x = AuthorizedCertificate::new().set_visible_domain_mappings(["a", "b", "c"]);
5826 /// ```
5827 pub fn set_visible_domain_mappings<T, V>(mut self, v: T) -> Self
5828 where
5829 T: std::iter::IntoIterator<Item = V>,
5830 V: std::convert::Into<std::string::String>,
5831 {
5832 use std::iter::Iterator;
5833 self.visible_domain_mappings = v.into_iter().map(|i| i.into()).collect();
5834 self
5835 }
5836
5837 /// Sets the value of [domain_mappings_count][crate::model::AuthorizedCertificate::domain_mappings_count].
5838 ///
5839 /// # Example
5840 /// ```ignore,no_run
5841 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5842 /// let x = AuthorizedCertificate::new().set_domain_mappings_count(42);
5843 /// ```
5844 pub fn set_domain_mappings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5845 self.domain_mappings_count = v.into();
5846 self
5847 }
5848}
5849
5850impl wkt::message::Message for AuthorizedCertificate {
5851 fn typename() -> &'static str {
5852 "type.googleapis.com/google.appengine.v1.AuthorizedCertificate"
5853 }
5854}
5855
5856/// An SSL certificate obtained from a certificate authority.
5857#[derive(Clone, Default, PartialEq)]
5858#[non_exhaustive]
5859pub struct CertificateRawData {
5860 /// PEM encoded x.509 public key certificate. This field is set once on
5861 /// certificate creation. Must include the header and footer. Example:
5862 pub public_certificate: std::string::String,
5863
5864 /// Unencrypted PEM encoded RSA private key. This field is set once on
5865 /// certificate creation and then encrypted. The key size must be 2048
5866 /// bits or fewer. Must include the header and footer. Example:
5867 ///
5868 /// @InputOnly
5869 pub private_key: std::string::String,
5870
5871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5872}
5873
5874impl CertificateRawData {
5875 /// Creates a new default instance.
5876 pub fn new() -> Self {
5877 std::default::Default::default()
5878 }
5879
5880 /// Sets the value of [public_certificate][crate::model::CertificateRawData::public_certificate].
5881 ///
5882 /// # Example
5883 /// ```ignore,no_run
5884 /// # use google_cloud_appengine_v1::model::CertificateRawData;
5885 /// let x = CertificateRawData::new().set_public_certificate("example");
5886 /// ```
5887 pub fn set_public_certificate<T: std::convert::Into<std::string::String>>(
5888 mut self,
5889 v: T,
5890 ) -> Self {
5891 self.public_certificate = v.into();
5892 self
5893 }
5894
5895 /// Sets the value of [private_key][crate::model::CertificateRawData::private_key].
5896 ///
5897 /// # Example
5898 /// ```ignore,no_run
5899 /// # use google_cloud_appengine_v1::model::CertificateRawData;
5900 /// let x = CertificateRawData::new().set_private_key("example");
5901 /// ```
5902 pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5903 self.private_key = v.into();
5904 self
5905 }
5906}
5907
5908impl wkt::message::Message for CertificateRawData {
5909 fn typename() -> &'static str {
5910 "type.googleapis.com/google.appengine.v1.CertificateRawData"
5911 }
5912}
5913
5914/// A certificate managed by App Engine.
5915#[derive(Clone, Default, PartialEq)]
5916#[non_exhaustive]
5917pub struct ManagedCertificate {
5918 /// Time at which the certificate was last renewed. The renewal process is
5919 /// fully managed. Certificate renewal will automatically occur before the
5920 /// certificate expires. Renewal errors can be tracked via `ManagementStatus`.
5921 ///
5922 /// @OutputOnly
5923 pub last_renewal_time: std::option::Option<wkt::Timestamp>,
5924
5925 /// Status of certificate management. Refers to the most recent certificate
5926 /// acquisition or renewal attempt.
5927 ///
5928 /// @OutputOnly
5929 pub status: crate::model::ManagementStatus,
5930
5931 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5932}
5933
5934impl ManagedCertificate {
5935 /// Creates a new default instance.
5936 pub fn new() -> Self {
5937 std::default::Default::default()
5938 }
5939
5940 /// Sets the value of [last_renewal_time][crate::model::ManagedCertificate::last_renewal_time].
5941 ///
5942 /// # Example
5943 /// ```ignore,no_run
5944 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5945 /// use wkt::Timestamp;
5946 /// let x = ManagedCertificate::new().set_last_renewal_time(Timestamp::default()/* use setters */);
5947 /// ```
5948 pub fn set_last_renewal_time<T>(mut self, v: T) -> Self
5949 where
5950 T: std::convert::Into<wkt::Timestamp>,
5951 {
5952 self.last_renewal_time = std::option::Option::Some(v.into());
5953 self
5954 }
5955
5956 /// Sets or clears the value of [last_renewal_time][crate::model::ManagedCertificate::last_renewal_time].
5957 ///
5958 /// # Example
5959 /// ```ignore,no_run
5960 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5961 /// use wkt::Timestamp;
5962 /// let x = ManagedCertificate::new().set_or_clear_last_renewal_time(Some(Timestamp::default()/* use setters */));
5963 /// let x = ManagedCertificate::new().set_or_clear_last_renewal_time(None::<Timestamp>);
5964 /// ```
5965 pub fn set_or_clear_last_renewal_time<T>(mut self, v: std::option::Option<T>) -> Self
5966 where
5967 T: std::convert::Into<wkt::Timestamp>,
5968 {
5969 self.last_renewal_time = v.map(|x| x.into());
5970 self
5971 }
5972
5973 /// Sets the value of [status][crate::model::ManagedCertificate::status].
5974 ///
5975 /// # Example
5976 /// ```ignore,no_run
5977 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5978 /// use google_cloud_appengine_v1::model::ManagementStatus;
5979 /// let x0 = ManagedCertificate::new().set_status(ManagementStatus::Ok);
5980 /// let x1 = ManagedCertificate::new().set_status(ManagementStatus::Pending);
5981 /// let x2 = ManagedCertificate::new().set_status(ManagementStatus::FailedRetryingNotVisible);
5982 /// ```
5983 pub fn set_status<T: std::convert::Into<crate::model::ManagementStatus>>(
5984 mut self,
5985 v: T,
5986 ) -> Self {
5987 self.status = v.into();
5988 self
5989 }
5990}
5991
5992impl wkt::message::Message for ManagedCertificate {
5993 fn typename() -> &'static str {
5994 "type.googleapis.com/google.appengine.v1.ManagedCertificate"
5995 }
5996}
5997
5998/// Code and application artifacts used to deploy a version to App Engine.
5999#[derive(Clone, Default, PartialEq)]
6000#[non_exhaustive]
6001pub struct Deployment {
6002 /// Manifest of the files stored in Google Cloud Storage that are included
6003 /// as part of this version. All files must be readable using the
6004 /// credentials supplied with this call.
6005 pub files: std::collections::HashMap<std::string::String, crate::model::FileInfo>,
6006
6007 /// The Docker image for the container that runs the version.
6008 /// Only applicable for instances running in the App Engine flexible environment.
6009 pub container: std::option::Option<crate::model::ContainerInfo>,
6010
6011 /// The zip file for this deployment, if this is a zip deployment.
6012 pub zip: std::option::Option<crate::model::ZipInfo>,
6013
6014 /// Options for any Google Cloud Build builds created as a part of this
6015 /// deployment.
6016 ///
6017 /// These options will only be used if a new build is created, such as when
6018 /// deploying to the App Engine flexible environment using files or zip.
6019 pub cloud_build_options: std::option::Option<crate::model::CloudBuildOptions>,
6020
6021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6022}
6023
6024impl Deployment {
6025 /// Creates a new default instance.
6026 pub fn new() -> Self {
6027 std::default::Default::default()
6028 }
6029
6030 /// Sets the value of [files][crate::model::Deployment::files].
6031 ///
6032 /// # Example
6033 /// ```ignore,no_run
6034 /// # use google_cloud_appengine_v1::model::Deployment;
6035 /// use google_cloud_appengine_v1::model::FileInfo;
6036 /// let x = Deployment::new().set_files([
6037 /// ("key0", FileInfo::default()/* use setters */),
6038 /// ("key1", FileInfo::default()/* use (different) setters */),
6039 /// ]);
6040 /// ```
6041 pub fn set_files<T, K, V>(mut self, v: T) -> Self
6042 where
6043 T: std::iter::IntoIterator<Item = (K, V)>,
6044 K: std::convert::Into<std::string::String>,
6045 V: std::convert::Into<crate::model::FileInfo>,
6046 {
6047 use std::iter::Iterator;
6048 self.files = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6049 self
6050 }
6051
6052 /// Sets the value of [container][crate::model::Deployment::container].
6053 ///
6054 /// # Example
6055 /// ```ignore,no_run
6056 /// # use google_cloud_appengine_v1::model::Deployment;
6057 /// use google_cloud_appengine_v1::model::ContainerInfo;
6058 /// let x = Deployment::new().set_container(ContainerInfo::default()/* use setters */);
6059 /// ```
6060 pub fn set_container<T>(mut self, v: T) -> Self
6061 where
6062 T: std::convert::Into<crate::model::ContainerInfo>,
6063 {
6064 self.container = std::option::Option::Some(v.into());
6065 self
6066 }
6067
6068 /// Sets or clears the value of [container][crate::model::Deployment::container].
6069 ///
6070 /// # Example
6071 /// ```ignore,no_run
6072 /// # use google_cloud_appengine_v1::model::Deployment;
6073 /// use google_cloud_appengine_v1::model::ContainerInfo;
6074 /// let x = Deployment::new().set_or_clear_container(Some(ContainerInfo::default()/* use setters */));
6075 /// let x = Deployment::new().set_or_clear_container(None::<ContainerInfo>);
6076 /// ```
6077 pub fn set_or_clear_container<T>(mut self, v: std::option::Option<T>) -> Self
6078 where
6079 T: std::convert::Into<crate::model::ContainerInfo>,
6080 {
6081 self.container = v.map(|x| x.into());
6082 self
6083 }
6084
6085 /// Sets the value of [zip][crate::model::Deployment::zip].
6086 ///
6087 /// # Example
6088 /// ```ignore,no_run
6089 /// # use google_cloud_appengine_v1::model::Deployment;
6090 /// use google_cloud_appengine_v1::model::ZipInfo;
6091 /// let x = Deployment::new().set_zip(ZipInfo::default()/* use setters */);
6092 /// ```
6093 pub fn set_zip<T>(mut self, v: T) -> Self
6094 where
6095 T: std::convert::Into<crate::model::ZipInfo>,
6096 {
6097 self.zip = std::option::Option::Some(v.into());
6098 self
6099 }
6100
6101 /// Sets or clears the value of [zip][crate::model::Deployment::zip].
6102 ///
6103 /// # Example
6104 /// ```ignore,no_run
6105 /// # use google_cloud_appengine_v1::model::Deployment;
6106 /// use google_cloud_appengine_v1::model::ZipInfo;
6107 /// let x = Deployment::new().set_or_clear_zip(Some(ZipInfo::default()/* use setters */));
6108 /// let x = Deployment::new().set_or_clear_zip(None::<ZipInfo>);
6109 /// ```
6110 pub fn set_or_clear_zip<T>(mut self, v: std::option::Option<T>) -> Self
6111 where
6112 T: std::convert::Into<crate::model::ZipInfo>,
6113 {
6114 self.zip = v.map(|x| x.into());
6115 self
6116 }
6117
6118 /// Sets the value of [cloud_build_options][crate::model::Deployment::cloud_build_options].
6119 ///
6120 /// # Example
6121 /// ```ignore,no_run
6122 /// # use google_cloud_appengine_v1::model::Deployment;
6123 /// use google_cloud_appengine_v1::model::CloudBuildOptions;
6124 /// let x = Deployment::new().set_cloud_build_options(CloudBuildOptions::default()/* use setters */);
6125 /// ```
6126 pub fn set_cloud_build_options<T>(mut self, v: T) -> Self
6127 where
6128 T: std::convert::Into<crate::model::CloudBuildOptions>,
6129 {
6130 self.cloud_build_options = std::option::Option::Some(v.into());
6131 self
6132 }
6133
6134 /// Sets or clears the value of [cloud_build_options][crate::model::Deployment::cloud_build_options].
6135 ///
6136 /// # Example
6137 /// ```ignore,no_run
6138 /// # use google_cloud_appengine_v1::model::Deployment;
6139 /// use google_cloud_appengine_v1::model::CloudBuildOptions;
6140 /// let x = Deployment::new().set_or_clear_cloud_build_options(Some(CloudBuildOptions::default()/* use setters */));
6141 /// let x = Deployment::new().set_or_clear_cloud_build_options(None::<CloudBuildOptions>);
6142 /// ```
6143 pub fn set_or_clear_cloud_build_options<T>(mut self, v: std::option::Option<T>) -> Self
6144 where
6145 T: std::convert::Into<crate::model::CloudBuildOptions>,
6146 {
6147 self.cloud_build_options = v.map(|x| x.into());
6148 self
6149 }
6150}
6151
6152impl wkt::message::Message for Deployment {
6153 fn typename() -> &'static str {
6154 "type.googleapis.com/google.appengine.v1.Deployment"
6155 }
6156}
6157
6158/// Single source file that is part of the version to be deployed. Each source
6159/// file that is deployed must be specified separately.
6160#[derive(Clone, Default, PartialEq)]
6161#[non_exhaustive]
6162pub struct FileInfo {
6163 /// URL source to use to fetch this file. Must be a URL to a resource in
6164 /// Google Cloud Storage in the form
6165 /// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
6166 pub source_url: std::string::String,
6167
6168 /// The SHA1 hash of the file, in hex.
6169 pub sha1_sum: std::string::String,
6170
6171 /// The MIME type of the file.
6172 ///
6173 /// Defaults to the value from Google Cloud Storage.
6174 pub mime_type: std::string::String,
6175
6176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6177}
6178
6179impl FileInfo {
6180 /// Creates a new default instance.
6181 pub fn new() -> Self {
6182 std::default::Default::default()
6183 }
6184
6185 /// Sets the value of [source_url][crate::model::FileInfo::source_url].
6186 ///
6187 /// # Example
6188 /// ```ignore,no_run
6189 /// # use google_cloud_appengine_v1::model::FileInfo;
6190 /// let x = FileInfo::new().set_source_url("example");
6191 /// ```
6192 pub fn set_source_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6193 self.source_url = v.into();
6194 self
6195 }
6196
6197 /// Sets the value of [sha1_sum][crate::model::FileInfo::sha1_sum].
6198 ///
6199 /// # Example
6200 /// ```ignore,no_run
6201 /// # use google_cloud_appengine_v1::model::FileInfo;
6202 /// let x = FileInfo::new().set_sha1_sum("example");
6203 /// ```
6204 pub fn set_sha1_sum<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6205 self.sha1_sum = v.into();
6206 self
6207 }
6208
6209 /// Sets the value of [mime_type][crate::model::FileInfo::mime_type].
6210 ///
6211 /// # Example
6212 /// ```ignore,no_run
6213 /// # use google_cloud_appengine_v1::model::FileInfo;
6214 /// let x = FileInfo::new().set_mime_type("example");
6215 /// ```
6216 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6217 self.mime_type = v.into();
6218 self
6219 }
6220}
6221
6222impl wkt::message::Message for FileInfo {
6223 fn typename() -> &'static str {
6224 "type.googleapis.com/google.appengine.v1.FileInfo"
6225 }
6226}
6227
6228/// Docker image that is used to create a container and start a VM instance for
6229/// the version that you deploy. Only applicable for instances running in the App
6230/// Engine flexible environment.
6231#[derive(Clone, Default, PartialEq)]
6232#[non_exhaustive]
6233pub struct ContainerInfo {
6234 /// URI to the hosted container image in Google Container Registry. The URI
6235 /// must be fully qualified and include a tag or digest.
6236 /// Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest"
6237 pub image: std::string::String,
6238
6239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6240}
6241
6242impl ContainerInfo {
6243 /// Creates a new default instance.
6244 pub fn new() -> Self {
6245 std::default::Default::default()
6246 }
6247
6248 /// Sets the value of [image][crate::model::ContainerInfo::image].
6249 ///
6250 /// # Example
6251 /// ```ignore,no_run
6252 /// # use google_cloud_appengine_v1::model::ContainerInfo;
6253 /// let x = ContainerInfo::new().set_image("example");
6254 /// ```
6255 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6256 self.image = v.into();
6257 self
6258 }
6259}
6260
6261impl wkt::message::Message for ContainerInfo {
6262 fn typename() -> &'static str {
6263 "type.googleapis.com/google.appengine.v1.ContainerInfo"
6264 }
6265}
6266
6267/// Options for the build operations performed as a part of the version
6268/// deployment. Only applicable for App Engine flexible environment when creating
6269/// a version using source code directly.
6270#[derive(Clone, Default, PartialEq)]
6271#[non_exhaustive]
6272pub struct CloudBuildOptions {
6273 /// Path to the yaml file used in deployment, used to determine runtime
6274 /// configuration details.
6275 ///
6276 /// Required for flexible environment builds.
6277 ///
6278 /// See <https://cloud.google.com/appengine/docs/standard/python/config/appref>
6279 /// for more details.
6280 pub app_yaml_path: std::string::String,
6281
6282 /// The Cloud Build timeout used as part of any dependent builds performed by
6283 /// version creation. Defaults to 10 minutes.
6284 pub cloud_build_timeout: std::option::Option<wkt::Duration>,
6285
6286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6287}
6288
6289impl CloudBuildOptions {
6290 /// Creates a new default instance.
6291 pub fn new() -> Self {
6292 std::default::Default::default()
6293 }
6294
6295 /// Sets the value of [app_yaml_path][crate::model::CloudBuildOptions::app_yaml_path].
6296 ///
6297 /// # Example
6298 /// ```ignore,no_run
6299 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6300 /// let x = CloudBuildOptions::new().set_app_yaml_path("example");
6301 /// ```
6302 pub fn set_app_yaml_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6303 self.app_yaml_path = v.into();
6304 self
6305 }
6306
6307 /// Sets the value of [cloud_build_timeout][crate::model::CloudBuildOptions::cloud_build_timeout].
6308 ///
6309 /// # Example
6310 /// ```ignore,no_run
6311 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6312 /// use wkt::Duration;
6313 /// let x = CloudBuildOptions::new().set_cloud_build_timeout(Duration::default()/* use setters */);
6314 /// ```
6315 pub fn set_cloud_build_timeout<T>(mut self, v: T) -> Self
6316 where
6317 T: std::convert::Into<wkt::Duration>,
6318 {
6319 self.cloud_build_timeout = std::option::Option::Some(v.into());
6320 self
6321 }
6322
6323 /// Sets or clears the value of [cloud_build_timeout][crate::model::CloudBuildOptions::cloud_build_timeout].
6324 ///
6325 /// # Example
6326 /// ```ignore,no_run
6327 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6328 /// use wkt::Duration;
6329 /// let x = CloudBuildOptions::new().set_or_clear_cloud_build_timeout(Some(Duration::default()/* use setters */));
6330 /// let x = CloudBuildOptions::new().set_or_clear_cloud_build_timeout(None::<Duration>);
6331 /// ```
6332 pub fn set_or_clear_cloud_build_timeout<T>(mut self, v: std::option::Option<T>) -> Self
6333 where
6334 T: std::convert::Into<wkt::Duration>,
6335 {
6336 self.cloud_build_timeout = v.map(|x| x.into());
6337 self
6338 }
6339}
6340
6341impl wkt::message::Message for CloudBuildOptions {
6342 fn typename() -> &'static str {
6343 "type.googleapis.com/google.appengine.v1.CloudBuildOptions"
6344 }
6345}
6346
6347/// The zip file information for a zip deployment.
6348#[derive(Clone, Default, PartialEq)]
6349#[non_exhaustive]
6350pub struct ZipInfo {
6351 /// URL of the zip file to deploy from. Must be a URL to a resource in
6352 /// Google Cloud Storage in the form
6353 /// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
6354 pub source_url: std::string::String,
6355
6356 /// An estimate of the number of files in a zip for a zip deployment.
6357 /// If set, must be greater than or equal to the actual number of files.
6358 /// Used for optimizing performance; if not provided, deployment may be slow.
6359 pub files_count: i32,
6360
6361 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6362}
6363
6364impl ZipInfo {
6365 /// Creates a new default instance.
6366 pub fn new() -> Self {
6367 std::default::Default::default()
6368 }
6369
6370 /// Sets the value of [source_url][crate::model::ZipInfo::source_url].
6371 ///
6372 /// # Example
6373 /// ```ignore,no_run
6374 /// # use google_cloud_appengine_v1::model::ZipInfo;
6375 /// let x = ZipInfo::new().set_source_url("example");
6376 /// ```
6377 pub fn set_source_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6378 self.source_url = v.into();
6379 self
6380 }
6381
6382 /// Sets the value of [files_count][crate::model::ZipInfo::files_count].
6383 ///
6384 /// # Example
6385 /// ```ignore,no_run
6386 /// # use google_cloud_appengine_v1::model::ZipInfo;
6387 /// let x = ZipInfo::new().set_files_count(42);
6388 /// ```
6389 pub fn set_files_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6390 self.files_count = v.into();
6391 self
6392 }
6393}
6394
6395impl wkt::message::Message for ZipInfo {
6396 fn typename() -> &'static str {
6397 "type.googleapis.com/google.appengine.v1.ZipInfo"
6398 }
6399}
6400
6401/// A domain that a user has been authorized to administer. To authorize use
6402/// of a domain, verify ownership via
6403/// [Search Console](https://search.google.com/search-console/welcome).
6404#[derive(Clone, Default, PartialEq)]
6405#[non_exhaustive]
6406pub struct AuthorizedDomain {
6407 /// Full path to the `AuthorizedDomain` resource in the API. Example:
6408 /// `apps/myapp/authorizedDomains/example.com`.
6409 ///
6410 /// @OutputOnly
6411 pub name: std::string::String,
6412
6413 /// Fully qualified domain name of the domain authorized for use. Example:
6414 /// `example.com`.
6415 pub id: std::string::String,
6416
6417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6418}
6419
6420impl AuthorizedDomain {
6421 /// Creates a new default instance.
6422 pub fn new() -> Self {
6423 std::default::Default::default()
6424 }
6425
6426 /// Sets the value of [name][crate::model::AuthorizedDomain::name].
6427 ///
6428 /// # Example
6429 /// ```ignore,no_run
6430 /// # use google_cloud_appengine_v1::model::AuthorizedDomain;
6431 /// let x = AuthorizedDomain::new().set_name("example");
6432 /// ```
6433 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6434 self.name = v.into();
6435 self
6436 }
6437
6438 /// Sets the value of [id][crate::model::AuthorizedDomain::id].
6439 ///
6440 /// # Example
6441 /// ```ignore,no_run
6442 /// # use google_cloud_appengine_v1::model::AuthorizedDomain;
6443 /// let x = AuthorizedDomain::new().set_id("example");
6444 /// ```
6445 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6446 self.id = v.into();
6447 self
6448 }
6449}
6450
6451impl wkt::message::Message for AuthorizedDomain {
6452 fn typename() -> &'static str {
6453 "type.googleapis.com/google.appengine.v1.AuthorizedDomain"
6454 }
6455}
6456
6457/// A domain serving an App Engine application.
6458#[derive(Clone, Default, PartialEq)]
6459#[non_exhaustive]
6460pub struct DomainMapping {
6461 /// Full path to the `DomainMapping` resource in the API. Example:
6462 /// `apps/myapp/domainMapping/example.com`.
6463 ///
6464 /// @OutputOnly
6465 pub name: std::string::String,
6466
6467 /// Relative name of the domain serving the application. Example:
6468 /// `example.com`.
6469 pub id: std::string::String,
6470
6471 /// SSL configuration for this domain. If unconfigured, this domain will not
6472 /// serve with SSL.
6473 pub ssl_settings: std::option::Option<crate::model::SslSettings>,
6474
6475 /// The resource records required to configure this domain mapping. These
6476 /// records must be added to the domain's DNS configuration in order to
6477 /// serve the application via this domain mapping.
6478 ///
6479 /// @OutputOnly
6480 pub resource_records: std::vec::Vec<crate::model::ResourceRecord>,
6481
6482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6483}
6484
6485impl DomainMapping {
6486 /// Creates a new default instance.
6487 pub fn new() -> Self {
6488 std::default::Default::default()
6489 }
6490
6491 /// Sets the value of [name][crate::model::DomainMapping::name].
6492 ///
6493 /// # Example
6494 /// ```ignore,no_run
6495 /// # use google_cloud_appengine_v1::model::DomainMapping;
6496 /// let x = DomainMapping::new().set_name("example");
6497 /// ```
6498 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6499 self.name = v.into();
6500 self
6501 }
6502
6503 /// Sets the value of [id][crate::model::DomainMapping::id].
6504 ///
6505 /// # Example
6506 /// ```ignore,no_run
6507 /// # use google_cloud_appengine_v1::model::DomainMapping;
6508 /// let x = DomainMapping::new().set_id("example");
6509 /// ```
6510 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6511 self.id = v.into();
6512 self
6513 }
6514
6515 /// Sets the value of [ssl_settings][crate::model::DomainMapping::ssl_settings].
6516 ///
6517 /// # Example
6518 /// ```ignore,no_run
6519 /// # use google_cloud_appengine_v1::model::DomainMapping;
6520 /// use google_cloud_appengine_v1::model::SslSettings;
6521 /// let x = DomainMapping::new().set_ssl_settings(SslSettings::default()/* use setters */);
6522 /// ```
6523 pub fn set_ssl_settings<T>(mut self, v: T) -> Self
6524 where
6525 T: std::convert::Into<crate::model::SslSettings>,
6526 {
6527 self.ssl_settings = std::option::Option::Some(v.into());
6528 self
6529 }
6530
6531 /// Sets or clears the value of [ssl_settings][crate::model::DomainMapping::ssl_settings].
6532 ///
6533 /// # Example
6534 /// ```ignore,no_run
6535 /// # use google_cloud_appengine_v1::model::DomainMapping;
6536 /// use google_cloud_appengine_v1::model::SslSettings;
6537 /// let x = DomainMapping::new().set_or_clear_ssl_settings(Some(SslSettings::default()/* use setters */));
6538 /// let x = DomainMapping::new().set_or_clear_ssl_settings(None::<SslSettings>);
6539 /// ```
6540 pub fn set_or_clear_ssl_settings<T>(mut self, v: std::option::Option<T>) -> Self
6541 where
6542 T: std::convert::Into<crate::model::SslSettings>,
6543 {
6544 self.ssl_settings = v.map(|x| x.into());
6545 self
6546 }
6547
6548 /// Sets the value of [resource_records][crate::model::DomainMapping::resource_records].
6549 ///
6550 /// # Example
6551 /// ```ignore,no_run
6552 /// # use google_cloud_appengine_v1::model::DomainMapping;
6553 /// use google_cloud_appengine_v1::model::ResourceRecord;
6554 /// let x = DomainMapping::new()
6555 /// .set_resource_records([
6556 /// ResourceRecord::default()/* use setters */,
6557 /// ResourceRecord::default()/* use (different) setters */,
6558 /// ]);
6559 /// ```
6560 pub fn set_resource_records<T, V>(mut self, v: T) -> Self
6561 where
6562 T: std::iter::IntoIterator<Item = V>,
6563 V: std::convert::Into<crate::model::ResourceRecord>,
6564 {
6565 use std::iter::Iterator;
6566 self.resource_records = v.into_iter().map(|i| i.into()).collect();
6567 self
6568 }
6569}
6570
6571impl wkt::message::Message for DomainMapping {
6572 fn typename() -> &'static str {
6573 "type.googleapis.com/google.appengine.v1.DomainMapping"
6574 }
6575}
6576
6577/// SSL configuration for a `DomainMapping` resource.
6578#[derive(Clone, Default, PartialEq)]
6579#[non_exhaustive]
6580pub struct SslSettings {
6581 /// ID of the `AuthorizedCertificate` resource configuring SSL for the
6582 /// application. Clearing this field will remove SSL support.
6583 ///
6584 /// By default, a managed certificate is automatically created for every
6585 /// domain mapping. To omit SSL support or to configure SSL manually, specify
6586 /// `SslManagementType.MANUAL` on a `CREATE` or `UPDATE` request. You must
6587 /// be authorized to administer the `AuthorizedCertificate` resource to
6588 /// manually map it to a `DomainMapping` resource.
6589 /// Example: `12345`.
6590 pub certificate_id: std::string::String,
6591
6592 /// SSL management type for this domain. If `AUTOMATIC`, a managed certificate
6593 /// is automatically provisioned. If `MANUAL`, `certificate_id` must be
6594 /// manually specified in order to configure SSL for this domain.
6595 pub ssl_management_type: crate::model::ssl_settings::SslManagementType,
6596
6597 /// ID of the managed `AuthorizedCertificate` resource currently being
6598 /// provisioned, if applicable. Until the new managed certificate has been
6599 /// successfully provisioned, the previous SSL state will be preserved. Once
6600 /// the provisioning process completes, the `certificate_id` field will reflect
6601 /// the new managed certificate and this field will be left empty. To remove
6602 /// SSL support while there is still a pending managed certificate, clear the
6603 /// `certificate_id` field with an `UpdateDomainMappingRequest`.
6604 ///
6605 /// @OutputOnly
6606 pub pending_managed_certificate_id: std::string::String,
6607
6608 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6609}
6610
6611impl SslSettings {
6612 /// Creates a new default instance.
6613 pub fn new() -> Self {
6614 std::default::Default::default()
6615 }
6616
6617 /// Sets the value of [certificate_id][crate::model::SslSettings::certificate_id].
6618 ///
6619 /// # Example
6620 /// ```ignore,no_run
6621 /// # use google_cloud_appengine_v1::model::SslSettings;
6622 /// let x = SslSettings::new().set_certificate_id("example");
6623 /// ```
6624 pub fn set_certificate_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6625 self.certificate_id = v.into();
6626 self
6627 }
6628
6629 /// Sets the value of [ssl_management_type][crate::model::SslSettings::ssl_management_type].
6630 ///
6631 /// # Example
6632 /// ```ignore,no_run
6633 /// # use google_cloud_appengine_v1::model::SslSettings;
6634 /// use google_cloud_appengine_v1::model::ssl_settings::SslManagementType;
6635 /// let x0 = SslSettings::new().set_ssl_management_type(SslManagementType::Automatic);
6636 /// let x1 = SslSettings::new().set_ssl_management_type(SslManagementType::Manual);
6637 /// ```
6638 pub fn set_ssl_management_type<
6639 T: std::convert::Into<crate::model::ssl_settings::SslManagementType>,
6640 >(
6641 mut self,
6642 v: T,
6643 ) -> Self {
6644 self.ssl_management_type = v.into();
6645 self
6646 }
6647
6648 /// Sets the value of [pending_managed_certificate_id][crate::model::SslSettings::pending_managed_certificate_id].
6649 ///
6650 /// # Example
6651 /// ```ignore,no_run
6652 /// # use google_cloud_appengine_v1::model::SslSettings;
6653 /// let x = SslSettings::new().set_pending_managed_certificate_id("example");
6654 /// ```
6655 pub fn set_pending_managed_certificate_id<T: std::convert::Into<std::string::String>>(
6656 mut self,
6657 v: T,
6658 ) -> Self {
6659 self.pending_managed_certificate_id = v.into();
6660 self
6661 }
6662}
6663
6664impl wkt::message::Message for SslSettings {
6665 fn typename() -> &'static str {
6666 "type.googleapis.com/google.appengine.v1.SslSettings"
6667 }
6668}
6669
6670/// Defines additional types related to [SslSettings].
6671pub mod ssl_settings {
6672 #[allow(unused_imports)]
6673 use super::*;
6674
6675 /// The SSL management type for this domain.
6676 ///
6677 /// # Working with unknown values
6678 ///
6679 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6680 /// additional enum variants at any time. Adding new variants is not considered
6681 /// a breaking change. Applications should write their code in anticipation of:
6682 ///
6683 /// - New values appearing in future releases of the client library, **and**
6684 /// - New values received dynamically, without application changes.
6685 ///
6686 /// Please consult the [Working with enums] section in the user guide for some
6687 /// guidelines.
6688 ///
6689 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6690 #[derive(Clone, Debug, PartialEq)]
6691 #[non_exhaustive]
6692 pub enum SslManagementType {
6693 /// Defaults to `AUTOMATIC`.
6694 Unspecified,
6695 /// SSL support for this domain is configured automatically. The mapped SSL
6696 /// certificate will be automatically renewed.
6697 Automatic,
6698 /// SSL support for this domain is configured manually by the user. Either
6699 /// the domain has no SSL support or a user-obtained SSL certificate has been
6700 /// explictly mapped to this domain.
6701 Manual,
6702 /// If set, the enum was initialized with an unknown value.
6703 ///
6704 /// Applications can examine the value using [SslManagementType::value] or
6705 /// [SslManagementType::name].
6706 UnknownValue(ssl_management_type::UnknownValue),
6707 }
6708
6709 #[doc(hidden)]
6710 pub mod ssl_management_type {
6711 #[allow(unused_imports)]
6712 use super::*;
6713 #[derive(Clone, Debug, PartialEq)]
6714 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6715 }
6716
6717 impl SslManagementType {
6718 /// Gets the enum value.
6719 ///
6720 /// Returns `None` if the enum contains an unknown value deserialized from
6721 /// the string representation of enums.
6722 pub fn value(&self) -> std::option::Option<i32> {
6723 match self {
6724 Self::Unspecified => std::option::Option::Some(0),
6725 Self::Automatic => std::option::Option::Some(1),
6726 Self::Manual => std::option::Option::Some(2),
6727 Self::UnknownValue(u) => u.0.value(),
6728 }
6729 }
6730
6731 /// Gets the enum value as a string.
6732 ///
6733 /// Returns `None` if the enum contains an unknown value deserialized from
6734 /// the integer representation of enums.
6735 pub fn name(&self) -> std::option::Option<&str> {
6736 match self {
6737 Self::Unspecified => std::option::Option::Some("SSL_MANAGEMENT_TYPE_UNSPECIFIED"),
6738 Self::Automatic => std::option::Option::Some("AUTOMATIC"),
6739 Self::Manual => std::option::Option::Some("MANUAL"),
6740 Self::UnknownValue(u) => u.0.name(),
6741 }
6742 }
6743 }
6744
6745 impl std::default::Default for SslManagementType {
6746 fn default() -> Self {
6747 use std::convert::From;
6748 Self::from(0)
6749 }
6750 }
6751
6752 impl std::fmt::Display for SslManagementType {
6753 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6754 wkt::internal::display_enum(f, self.name(), self.value())
6755 }
6756 }
6757
6758 impl std::convert::From<i32> for SslManagementType {
6759 fn from(value: i32) -> Self {
6760 match value {
6761 0 => Self::Unspecified,
6762 1 => Self::Automatic,
6763 2 => Self::Manual,
6764 _ => Self::UnknownValue(ssl_management_type::UnknownValue(
6765 wkt::internal::UnknownEnumValue::Integer(value),
6766 )),
6767 }
6768 }
6769 }
6770
6771 impl std::convert::From<&str> for SslManagementType {
6772 fn from(value: &str) -> Self {
6773 use std::string::ToString;
6774 match value {
6775 "SSL_MANAGEMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
6776 "AUTOMATIC" => Self::Automatic,
6777 "MANUAL" => Self::Manual,
6778 _ => Self::UnknownValue(ssl_management_type::UnknownValue(
6779 wkt::internal::UnknownEnumValue::String(value.to_string()),
6780 )),
6781 }
6782 }
6783 }
6784
6785 impl serde::ser::Serialize for SslManagementType {
6786 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6787 where
6788 S: serde::Serializer,
6789 {
6790 match self {
6791 Self::Unspecified => serializer.serialize_i32(0),
6792 Self::Automatic => serializer.serialize_i32(1),
6793 Self::Manual => serializer.serialize_i32(2),
6794 Self::UnknownValue(u) => u.0.serialize(serializer),
6795 }
6796 }
6797 }
6798
6799 impl<'de> serde::de::Deserialize<'de> for SslManagementType {
6800 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6801 where
6802 D: serde::Deserializer<'de>,
6803 {
6804 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslManagementType>::new(
6805 ".google.appengine.v1.SslSettings.SslManagementType",
6806 ))
6807 }
6808 }
6809}
6810
6811/// A DNS resource record.
6812#[derive(Clone, Default, PartialEq)]
6813#[non_exhaustive]
6814pub struct ResourceRecord {
6815 /// Relative name of the object affected by this record. Only applicable for
6816 /// `CNAME` records. Example: 'www'.
6817 pub name: std::string::String,
6818
6819 /// Data for this record. Values vary by record type, as defined in RFC 1035
6820 /// (section 5) and RFC 1034 (section 3.6.1).
6821 pub rrdata: std::string::String,
6822
6823 /// Resource record type. Example: `AAAA`.
6824 pub r#type: crate::model::resource_record::RecordType,
6825
6826 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6827}
6828
6829impl ResourceRecord {
6830 /// Creates a new default instance.
6831 pub fn new() -> Self {
6832 std::default::Default::default()
6833 }
6834
6835 /// Sets the value of [name][crate::model::ResourceRecord::name].
6836 ///
6837 /// # Example
6838 /// ```ignore,no_run
6839 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6840 /// let x = ResourceRecord::new().set_name("example");
6841 /// ```
6842 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6843 self.name = v.into();
6844 self
6845 }
6846
6847 /// Sets the value of [rrdata][crate::model::ResourceRecord::rrdata].
6848 ///
6849 /// # Example
6850 /// ```ignore,no_run
6851 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6852 /// let x = ResourceRecord::new().set_rrdata("example");
6853 /// ```
6854 pub fn set_rrdata<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6855 self.rrdata = v.into();
6856 self
6857 }
6858
6859 /// Sets the value of [r#type][crate::model::ResourceRecord::type].
6860 ///
6861 /// # Example
6862 /// ```ignore,no_run
6863 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6864 /// use google_cloud_appengine_v1::model::resource_record::RecordType;
6865 /// let x0 = ResourceRecord::new().set_type(RecordType::A);
6866 /// let x1 = ResourceRecord::new().set_type(RecordType::Aaaa);
6867 /// let x2 = ResourceRecord::new().set_type(RecordType::Cname);
6868 /// ```
6869 pub fn set_type<T: std::convert::Into<crate::model::resource_record::RecordType>>(
6870 mut self,
6871 v: T,
6872 ) -> Self {
6873 self.r#type = v.into();
6874 self
6875 }
6876}
6877
6878impl wkt::message::Message for ResourceRecord {
6879 fn typename() -> &'static str {
6880 "type.googleapis.com/google.appengine.v1.ResourceRecord"
6881 }
6882}
6883
6884/// Defines additional types related to [ResourceRecord].
6885pub mod resource_record {
6886 #[allow(unused_imports)]
6887 use super::*;
6888
6889 /// A resource record type.
6890 ///
6891 /// # Working with unknown values
6892 ///
6893 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6894 /// additional enum variants at any time. Adding new variants is not considered
6895 /// a breaking change. Applications should write their code in anticipation of:
6896 ///
6897 /// - New values appearing in future releases of the client library, **and**
6898 /// - New values received dynamically, without application changes.
6899 ///
6900 /// Please consult the [Working with enums] section in the user guide for some
6901 /// guidelines.
6902 ///
6903 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6904 #[derive(Clone, Debug, PartialEq)]
6905 #[non_exhaustive]
6906 pub enum RecordType {
6907 /// An unknown resource record.
6908 Unspecified,
6909 /// An A resource record. Data is an IPv4 address.
6910 A,
6911 /// An AAAA resource record. Data is an IPv6 address.
6912 Aaaa,
6913 /// A CNAME resource record. Data is a domain name to be aliased.
6914 Cname,
6915 /// If set, the enum was initialized with an unknown value.
6916 ///
6917 /// Applications can examine the value using [RecordType::value] or
6918 /// [RecordType::name].
6919 UnknownValue(record_type::UnknownValue),
6920 }
6921
6922 #[doc(hidden)]
6923 pub mod record_type {
6924 #[allow(unused_imports)]
6925 use super::*;
6926 #[derive(Clone, Debug, PartialEq)]
6927 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6928 }
6929
6930 impl RecordType {
6931 /// Gets the enum value.
6932 ///
6933 /// Returns `None` if the enum contains an unknown value deserialized from
6934 /// the string representation of enums.
6935 pub fn value(&self) -> std::option::Option<i32> {
6936 match self {
6937 Self::Unspecified => std::option::Option::Some(0),
6938 Self::A => std::option::Option::Some(1),
6939 Self::Aaaa => std::option::Option::Some(2),
6940 Self::Cname => std::option::Option::Some(3),
6941 Self::UnknownValue(u) => u.0.value(),
6942 }
6943 }
6944
6945 /// Gets the enum value as a string.
6946 ///
6947 /// Returns `None` if the enum contains an unknown value deserialized from
6948 /// the integer representation of enums.
6949 pub fn name(&self) -> std::option::Option<&str> {
6950 match self {
6951 Self::Unspecified => std::option::Option::Some("RECORD_TYPE_UNSPECIFIED"),
6952 Self::A => std::option::Option::Some("A"),
6953 Self::Aaaa => std::option::Option::Some("AAAA"),
6954 Self::Cname => std::option::Option::Some("CNAME"),
6955 Self::UnknownValue(u) => u.0.name(),
6956 }
6957 }
6958 }
6959
6960 impl std::default::Default for RecordType {
6961 fn default() -> Self {
6962 use std::convert::From;
6963 Self::from(0)
6964 }
6965 }
6966
6967 impl std::fmt::Display for RecordType {
6968 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6969 wkt::internal::display_enum(f, self.name(), self.value())
6970 }
6971 }
6972
6973 impl std::convert::From<i32> for RecordType {
6974 fn from(value: i32) -> Self {
6975 match value {
6976 0 => Self::Unspecified,
6977 1 => Self::A,
6978 2 => Self::Aaaa,
6979 3 => Self::Cname,
6980 _ => Self::UnknownValue(record_type::UnknownValue(
6981 wkt::internal::UnknownEnumValue::Integer(value),
6982 )),
6983 }
6984 }
6985 }
6986
6987 impl std::convert::From<&str> for RecordType {
6988 fn from(value: &str) -> Self {
6989 use std::string::ToString;
6990 match value {
6991 "RECORD_TYPE_UNSPECIFIED" => Self::Unspecified,
6992 "A" => Self::A,
6993 "AAAA" => Self::Aaaa,
6994 "CNAME" => Self::Cname,
6995 _ => Self::UnknownValue(record_type::UnknownValue(
6996 wkt::internal::UnknownEnumValue::String(value.to_string()),
6997 )),
6998 }
6999 }
7000 }
7001
7002 impl serde::ser::Serialize for RecordType {
7003 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7004 where
7005 S: serde::Serializer,
7006 {
7007 match self {
7008 Self::Unspecified => serializer.serialize_i32(0),
7009 Self::A => serializer.serialize_i32(1),
7010 Self::Aaaa => serializer.serialize_i32(2),
7011 Self::Cname => serializer.serialize_i32(3),
7012 Self::UnknownValue(u) => u.0.serialize(serializer),
7013 }
7014 }
7015 }
7016
7017 impl<'de> serde::de::Deserialize<'de> for RecordType {
7018 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7019 where
7020 D: serde::Deserializer<'de>,
7021 {
7022 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordType>::new(
7023 ".google.appengine.v1.ResourceRecord.RecordType",
7024 ))
7025 }
7026 }
7027}
7028
7029/// A single firewall rule that is evaluated against incoming traffic
7030/// and provides an action to take on matched requests.
7031#[derive(Clone, Default, PartialEq)]
7032#[non_exhaustive]
7033pub struct FirewallRule {
7034 /// A positive integer between [1, Int32.MaxValue-1] that defines the order of
7035 /// rule evaluation. Rules with the lowest priority are evaluated first.
7036 ///
7037 /// A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic
7038 /// when no previous rule matches. Only the action of this rule can be modified
7039 /// by the user.
7040 pub priority: i32,
7041
7042 /// The action to take on matched requests.
7043 pub action: crate::model::firewall_rule::Action,
7044
7045 /// IP address or range, defined using CIDR notation, of requests that this
7046 /// rule applies to. You can use the wildcard character "*" to match all IPs
7047 /// equivalent to "0/0" and "::/0" together.
7048 /// Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32`
7049 /// or `2001:0db8:0000:0042:0000:8a2e:0370:7334`.
7050 pub source_range: std::string::String,
7051
7052 /// An optional string description of this rule.
7053 /// This field has a maximum length of 100 characters.
7054 pub description: std::string::String,
7055
7056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7057}
7058
7059impl FirewallRule {
7060 /// Creates a new default instance.
7061 pub fn new() -> Self {
7062 std::default::Default::default()
7063 }
7064
7065 /// Sets the value of [priority][crate::model::FirewallRule::priority].
7066 ///
7067 /// # Example
7068 /// ```ignore,no_run
7069 /// # use google_cloud_appengine_v1::model::FirewallRule;
7070 /// let x = FirewallRule::new().set_priority(42);
7071 /// ```
7072 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7073 self.priority = v.into();
7074 self
7075 }
7076
7077 /// Sets the value of [action][crate::model::FirewallRule::action].
7078 ///
7079 /// # Example
7080 /// ```ignore,no_run
7081 /// # use google_cloud_appengine_v1::model::FirewallRule;
7082 /// use google_cloud_appengine_v1::model::firewall_rule::Action;
7083 /// let x0 = FirewallRule::new().set_action(Action::Allow);
7084 /// let x1 = FirewallRule::new().set_action(Action::Deny);
7085 /// ```
7086 pub fn set_action<T: std::convert::Into<crate::model::firewall_rule::Action>>(
7087 mut self,
7088 v: T,
7089 ) -> Self {
7090 self.action = v.into();
7091 self
7092 }
7093
7094 /// Sets the value of [source_range][crate::model::FirewallRule::source_range].
7095 ///
7096 /// # Example
7097 /// ```ignore,no_run
7098 /// # use google_cloud_appengine_v1::model::FirewallRule;
7099 /// let x = FirewallRule::new().set_source_range("example");
7100 /// ```
7101 pub fn set_source_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7102 self.source_range = v.into();
7103 self
7104 }
7105
7106 /// Sets the value of [description][crate::model::FirewallRule::description].
7107 ///
7108 /// # Example
7109 /// ```ignore,no_run
7110 /// # use google_cloud_appengine_v1::model::FirewallRule;
7111 /// let x = FirewallRule::new().set_description("example");
7112 /// ```
7113 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7114 self.description = v.into();
7115 self
7116 }
7117}
7118
7119impl wkt::message::Message for FirewallRule {
7120 fn typename() -> &'static str {
7121 "type.googleapis.com/google.appengine.v1.FirewallRule"
7122 }
7123}
7124
7125/// Defines additional types related to [FirewallRule].
7126pub mod firewall_rule {
7127 #[allow(unused_imports)]
7128 use super::*;
7129
7130 /// Available actions to take on matching requests.
7131 ///
7132 /// # Working with unknown values
7133 ///
7134 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7135 /// additional enum variants at any time. Adding new variants is not considered
7136 /// a breaking change. Applications should write their code in anticipation of:
7137 ///
7138 /// - New values appearing in future releases of the client library, **and**
7139 /// - New values received dynamically, without application changes.
7140 ///
7141 /// Please consult the [Working with enums] section in the user guide for some
7142 /// guidelines.
7143 ///
7144 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7145 #[derive(Clone, Debug, PartialEq)]
7146 #[non_exhaustive]
7147 pub enum Action {
7148 #[allow(missing_docs)]
7149 UnspecifiedAction,
7150 /// Matching requests are allowed.
7151 Allow,
7152 /// Matching requests are denied.
7153 Deny,
7154 /// If set, the enum was initialized with an unknown value.
7155 ///
7156 /// Applications can examine the value using [Action::value] or
7157 /// [Action::name].
7158 UnknownValue(action::UnknownValue),
7159 }
7160
7161 #[doc(hidden)]
7162 pub mod action {
7163 #[allow(unused_imports)]
7164 use super::*;
7165 #[derive(Clone, Debug, PartialEq)]
7166 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7167 }
7168
7169 impl Action {
7170 /// Gets the enum value.
7171 ///
7172 /// Returns `None` if the enum contains an unknown value deserialized from
7173 /// the string representation of enums.
7174 pub fn value(&self) -> std::option::Option<i32> {
7175 match self {
7176 Self::UnspecifiedAction => std::option::Option::Some(0),
7177 Self::Allow => std::option::Option::Some(1),
7178 Self::Deny => std::option::Option::Some(2),
7179 Self::UnknownValue(u) => u.0.value(),
7180 }
7181 }
7182
7183 /// Gets the enum value as a string.
7184 ///
7185 /// Returns `None` if the enum contains an unknown value deserialized from
7186 /// the integer representation of enums.
7187 pub fn name(&self) -> std::option::Option<&str> {
7188 match self {
7189 Self::UnspecifiedAction => std::option::Option::Some("UNSPECIFIED_ACTION"),
7190 Self::Allow => std::option::Option::Some("ALLOW"),
7191 Self::Deny => std::option::Option::Some("DENY"),
7192 Self::UnknownValue(u) => u.0.name(),
7193 }
7194 }
7195 }
7196
7197 impl std::default::Default for Action {
7198 fn default() -> Self {
7199 use std::convert::From;
7200 Self::from(0)
7201 }
7202 }
7203
7204 impl std::fmt::Display for Action {
7205 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7206 wkt::internal::display_enum(f, self.name(), self.value())
7207 }
7208 }
7209
7210 impl std::convert::From<i32> for Action {
7211 fn from(value: i32) -> Self {
7212 match value {
7213 0 => Self::UnspecifiedAction,
7214 1 => Self::Allow,
7215 2 => Self::Deny,
7216 _ => Self::UnknownValue(action::UnknownValue(
7217 wkt::internal::UnknownEnumValue::Integer(value),
7218 )),
7219 }
7220 }
7221 }
7222
7223 impl std::convert::From<&str> for Action {
7224 fn from(value: &str) -> Self {
7225 use std::string::ToString;
7226 match value {
7227 "UNSPECIFIED_ACTION" => Self::UnspecifiedAction,
7228 "ALLOW" => Self::Allow,
7229 "DENY" => Self::Deny,
7230 _ => Self::UnknownValue(action::UnknownValue(
7231 wkt::internal::UnknownEnumValue::String(value.to_string()),
7232 )),
7233 }
7234 }
7235 }
7236
7237 impl serde::ser::Serialize for Action {
7238 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7239 where
7240 S: serde::Serializer,
7241 {
7242 match self {
7243 Self::UnspecifiedAction => serializer.serialize_i32(0),
7244 Self::Allow => serializer.serialize_i32(1),
7245 Self::Deny => serializer.serialize_i32(2),
7246 Self::UnknownValue(u) => u.0.serialize(serializer),
7247 }
7248 }
7249 }
7250
7251 impl<'de> serde::de::Deserialize<'de> for Action {
7252 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7253 where
7254 D: serde::Deserializer<'de>,
7255 {
7256 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
7257 ".google.appengine.v1.FirewallRule.Action",
7258 ))
7259 }
7260 }
7261}
7262
7263/// An Instance resource is the computing unit that App Engine uses to
7264/// automatically scale an application.
7265#[derive(Clone, Default, PartialEq)]
7266#[non_exhaustive]
7267pub struct Instance {
7268 /// Output only. Full path to the Instance resource in the API.
7269 /// Example: `apps/myapp/services/default/versions/v1/instances/instance-1`.
7270 pub name: std::string::String,
7271
7272 /// Output only. Relative name of the instance within the version.
7273 /// Example: `instance-1`.
7274 pub id: std::string::String,
7275
7276 /// Output only. App Engine release this instance is running on.
7277 pub app_engine_release: std::string::String,
7278
7279 /// Output only. Availability of the instance.
7280 pub availability: crate::model::instance::Availability,
7281
7282 /// Output only. Name of the virtual machine where this instance lives. Only applicable
7283 /// for instances in App Engine flexible environment.
7284 pub vm_name: std::string::String,
7285
7286 /// Output only. Zone where the virtual machine is located. Only applicable for instances
7287 /// in App Engine flexible environment.
7288 pub vm_zone_name: std::string::String,
7289
7290 /// Output only. Virtual machine ID of this instance. Only applicable for instances in
7291 /// App Engine flexible environment.
7292 pub vm_id: std::string::String,
7293
7294 /// Output only. Time that this instance was started.
7295 ///
7296 /// @OutputOnly
7297 pub start_time: std::option::Option<wkt::Timestamp>,
7298
7299 /// Output only. Number of requests since this instance was started.
7300 pub requests: i32,
7301
7302 /// Output only. Number of errors since this instance was started.
7303 pub errors: i32,
7304
7305 /// Output only. Average queries per second (QPS) over the last minute.
7306 pub qps: f32,
7307
7308 /// Output only. Average latency (ms) over the last minute.
7309 pub average_latency: i32,
7310
7311 /// Output only. Total memory in use (bytes).
7312 pub memory_usage: i64,
7313
7314 /// Output only. Status of the virtual machine where this instance lives. Only applicable
7315 /// for instances in App Engine flexible environment.
7316 pub vm_status: std::string::String,
7317
7318 /// Output only. Whether this instance is in debug mode. Only applicable for instances in
7319 /// App Engine flexible environment.
7320 pub vm_debug_enabled: bool,
7321
7322 /// Output only. The IP address of this instance. Only applicable for instances in App
7323 /// Engine flexible environment.
7324 pub vm_ip: std::string::String,
7325
7326 /// Output only. The liveness health check of this instance. Only applicable for instances
7327 /// in App Engine flexible environment.
7328 pub vm_liveness: crate::model::instance::liveness::LivenessState,
7329
7330 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7331}
7332
7333impl Instance {
7334 /// Creates a new default instance.
7335 pub fn new() -> Self {
7336 std::default::Default::default()
7337 }
7338
7339 /// Sets the value of [name][crate::model::Instance::name].
7340 ///
7341 /// # Example
7342 /// ```ignore,no_run
7343 /// # use google_cloud_appengine_v1::model::Instance;
7344 /// # let app_id = "app_id";
7345 /// # let service_id = "service_id";
7346 /// # let version_id = "version_id";
7347 /// # let instance_id = "instance_id";
7348 /// let x = Instance::new().set_name(format!("apps/{app_id}/services/{service_id}/versions/{version_id}/instances/{instance_id}"));
7349 /// ```
7350 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7351 self.name = v.into();
7352 self
7353 }
7354
7355 /// Sets the value of [id][crate::model::Instance::id].
7356 ///
7357 /// # Example
7358 /// ```ignore,no_run
7359 /// # use google_cloud_appengine_v1::model::Instance;
7360 /// let x = Instance::new().set_id("example");
7361 /// ```
7362 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7363 self.id = v.into();
7364 self
7365 }
7366
7367 /// Sets the value of [app_engine_release][crate::model::Instance::app_engine_release].
7368 ///
7369 /// # Example
7370 /// ```ignore,no_run
7371 /// # use google_cloud_appengine_v1::model::Instance;
7372 /// let x = Instance::new().set_app_engine_release("example");
7373 /// ```
7374 pub fn set_app_engine_release<T: std::convert::Into<std::string::String>>(
7375 mut self,
7376 v: T,
7377 ) -> Self {
7378 self.app_engine_release = v.into();
7379 self
7380 }
7381
7382 /// Sets the value of [availability][crate::model::Instance::availability].
7383 ///
7384 /// # Example
7385 /// ```ignore,no_run
7386 /// # use google_cloud_appengine_v1::model::Instance;
7387 /// use google_cloud_appengine_v1::model::instance::Availability;
7388 /// let x0 = Instance::new().set_availability(Availability::Resident);
7389 /// let x1 = Instance::new().set_availability(Availability::Dynamic);
7390 /// ```
7391 pub fn set_availability<T: std::convert::Into<crate::model::instance::Availability>>(
7392 mut self,
7393 v: T,
7394 ) -> Self {
7395 self.availability = v.into();
7396 self
7397 }
7398
7399 /// Sets the value of [vm_name][crate::model::Instance::vm_name].
7400 ///
7401 /// # Example
7402 /// ```ignore,no_run
7403 /// # use google_cloud_appengine_v1::model::Instance;
7404 /// let x = Instance::new().set_vm_name("example");
7405 /// ```
7406 pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7407 self.vm_name = v.into();
7408 self
7409 }
7410
7411 /// Sets the value of [vm_zone_name][crate::model::Instance::vm_zone_name].
7412 ///
7413 /// # Example
7414 /// ```ignore,no_run
7415 /// # use google_cloud_appengine_v1::model::Instance;
7416 /// let x = Instance::new().set_vm_zone_name("example");
7417 /// ```
7418 pub fn set_vm_zone_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7419 self.vm_zone_name = v.into();
7420 self
7421 }
7422
7423 /// Sets the value of [vm_id][crate::model::Instance::vm_id].
7424 ///
7425 /// # Example
7426 /// ```ignore,no_run
7427 /// # use google_cloud_appengine_v1::model::Instance;
7428 /// let x = Instance::new().set_vm_id("example");
7429 /// ```
7430 pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7431 self.vm_id = v.into();
7432 self
7433 }
7434
7435 /// Sets the value of [start_time][crate::model::Instance::start_time].
7436 ///
7437 /// # Example
7438 /// ```ignore,no_run
7439 /// # use google_cloud_appengine_v1::model::Instance;
7440 /// use wkt::Timestamp;
7441 /// let x = Instance::new().set_start_time(Timestamp::default()/* use setters */);
7442 /// ```
7443 pub fn set_start_time<T>(mut self, v: T) -> Self
7444 where
7445 T: std::convert::Into<wkt::Timestamp>,
7446 {
7447 self.start_time = std::option::Option::Some(v.into());
7448 self
7449 }
7450
7451 /// Sets or clears the value of [start_time][crate::model::Instance::start_time].
7452 ///
7453 /// # Example
7454 /// ```ignore,no_run
7455 /// # use google_cloud_appengine_v1::model::Instance;
7456 /// use wkt::Timestamp;
7457 /// let x = Instance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7458 /// let x = Instance::new().set_or_clear_start_time(None::<Timestamp>);
7459 /// ```
7460 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7461 where
7462 T: std::convert::Into<wkt::Timestamp>,
7463 {
7464 self.start_time = v.map(|x| x.into());
7465 self
7466 }
7467
7468 /// Sets the value of [requests][crate::model::Instance::requests].
7469 ///
7470 /// # Example
7471 /// ```ignore,no_run
7472 /// # use google_cloud_appengine_v1::model::Instance;
7473 /// let x = Instance::new().set_requests(42);
7474 /// ```
7475 pub fn set_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7476 self.requests = v.into();
7477 self
7478 }
7479
7480 /// Sets the value of [errors][crate::model::Instance::errors].
7481 ///
7482 /// # Example
7483 /// ```ignore,no_run
7484 /// # use google_cloud_appengine_v1::model::Instance;
7485 /// let x = Instance::new().set_errors(42);
7486 /// ```
7487 pub fn set_errors<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7488 self.errors = v.into();
7489 self
7490 }
7491
7492 /// Sets the value of [qps][crate::model::Instance::qps].
7493 ///
7494 /// # Example
7495 /// ```ignore,no_run
7496 /// # use google_cloud_appengine_v1::model::Instance;
7497 /// let x = Instance::new().set_qps(42.0);
7498 /// ```
7499 pub fn set_qps<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7500 self.qps = v.into();
7501 self
7502 }
7503
7504 /// Sets the value of [average_latency][crate::model::Instance::average_latency].
7505 ///
7506 /// # Example
7507 /// ```ignore,no_run
7508 /// # use google_cloud_appengine_v1::model::Instance;
7509 /// let x = Instance::new().set_average_latency(42);
7510 /// ```
7511 pub fn set_average_latency<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7512 self.average_latency = v.into();
7513 self
7514 }
7515
7516 /// Sets the value of [memory_usage][crate::model::Instance::memory_usage].
7517 ///
7518 /// # Example
7519 /// ```ignore,no_run
7520 /// # use google_cloud_appengine_v1::model::Instance;
7521 /// let x = Instance::new().set_memory_usage(42);
7522 /// ```
7523 pub fn set_memory_usage<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7524 self.memory_usage = v.into();
7525 self
7526 }
7527
7528 /// Sets the value of [vm_status][crate::model::Instance::vm_status].
7529 ///
7530 /// # Example
7531 /// ```ignore,no_run
7532 /// # use google_cloud_appengine_v1::model::Instance;
7533 /// let x = Instance::new().set_vm_status("example");
7534 /// ```
7535 pub fn set_vm_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7536 self.vm_status = v.into();
7537 self
7538 }
7539
7540 /// Sets the value of [vm_debug_enabled][crate::model::Instance::vm_debug_enabled].
7541 ///
7542 /// # Example
7543 /// ```ignore,no_run
7544 /// # use google_cloud_appengine_v1::model::Instance;
7545 /// let x = Instance::new().set_vm_debug_enabled(true);
7546 /// ```
7547 pub fn set_vm_debug_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7548 self.vm_debug_enabled = v.into();
7549 self
7550 }
7551
7552 /// Sets the value of [vm_ip][crate::model::Instance::vm_ip].
7553 ///
7554 /// # Example
7555 /// ```ignore,no_run
7556 /// # use google_cloud_appengine_v1::model::Instance;
7557 /// let x = Instance::new().set_vm_ip("example");
7558 /// ```
7559 pub fn set_vm_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7560 self.vm_ip = v.into();
7561 self
7562 }
7563
7564 /// Sets the value of [vm_liveness][crate::model::Instance::vm_liveness].
7565 ///
7566 /// # Example
7567 /// ```ignore,no_run
7568 /// # use google_cloud_appengine_v1::model::Instance;
7569 /// use google_cloud_appengine_v1::model::instance::liveness::LivenessState;
7570 /// let x0 = Instance::new().set_vm_liveness(LivenessState::Unknown);
7571 /// let x1 = Instance::new().set_vm_liveness(LivenessState::Healthy);
7572 /// let x2 = Instance::new().set_vm_liveness(LivenessState::Unhealthy);
7573 /// ```
7574 pub fn set_vm_liveness<
7575 T: std::convert::Into<crate::model::instance::liveness::LivenessState>,
7576 >(
7577 mut self,
7578 v: T,
7579 ) -> Self {
7580 self.vm_liveness = v.into();
7581 self
7582 }
7583}
7584
7585impl wkt::message::Message for Instance {
7586 fn typename() -> &'static str {
7587 "type.googleapis.com/google.appengine.v1.Instance"
7588 }
7589}
7590
7591/// Defines additional types related to [Instance].
7592pub mod instance {
7593 #[allow(unused_imports)]
7594 use super::*;
7595
7596 /// Wrapper for LivenessState enum.
7597 #[derive(Clone, Default, PartialEq)]
7598 #[non_exhaustive]
7599 pub struct Liveness {
7600 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7601 }
7602
7603 impl Liveness {
7604 /// Creates a new default instance.
7605 pub fn new() -> Self {
7606 std::default::Default::default()
7607 }
7608 }
7609
7610 impl wkt::message::Message for Liveness {
7611 fn typename() -> &'static str {
7612 "type.googleapis.com/google.appengine.v1.Instance.Liveness"
7613 }
7614 }
7615
7616 /// Defines additional types related to [Liveness].
7617 pub mod liveness {
7618 #[allow(unused_imports)]
7619 use super::*;
7620
7621 /// Liveness health check status for Flex instances.
7622 ///
7623 /// # Working with unknown values
7624 ///
7625 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7626 /// additional enum variants at any time. Adding new variants is not considered
7627 /// a breaking change. Applications should write their code in anticipation of:
7628 ///
7629 /// - New values appearing in future releases of the client library, **and**
7630 /// - New values received dynamically, without application changes.
7631 ///
7632 /// Please consult the [Working with enums] section in the user guide for some
7633 /// guidelines.
7634 ///
7635 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7636 #[derive(Clone, Debug, PartialEq)]
7637 #[non_exhaustive]
7638 pub enum LivenessState {
7639 /// There is no liveness health check for the instance. Only applicable for
7640 /// instances in App Engine standard environment.
7641 Unspecified,
7642 /// The health checking system is aware of the instance but its health is
7643 /// not known at the moment.
7644 Unknown,
7645 /// The instance is reachable i.e. a connection to the application health
7646 /// checking endpoint can be established, and conforms to the requirements
7647 /// defined by the health check.
7648 Healthy,
7649 /// The instance is reachable, but does not conform to the requirements
7650 /// defined by the health check.
7651 Unhealthy,
7652 /// The instance is being drained. The existing connections to the instance
7653 /// have time to complete, but the new ones are being refused.
7654 Draining,
7655 /// The instance is unreachable i.e. a connection to the application health
7656 /// checking endpoint cannot be established, or the server does not respond
7657 /// within the specified timeout.
7658 Timeout,
7659 /// If set, the enum was initialized with an unknown value.
7660 ///
7661 /// Applications can examine the value using [LivenessState::value] or
7662 /// [LivenessState::name].
7663 UnknownValue(liveness_state::UnknownValue),
7664 }
7665
7666 #[doc(hidden)]
7667 pub mod liveness_state {
7668 #[allow(unused_imports)]
7669 use super::*;
7670 #[derive(Clone, Debug, PartialEq)]
7671 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7672 }
7673
7674 impl LivenessState {
7675 /// Gets the enum value.
7676 ///
7677 /// Returns `None` if the enum contains an unknown value deserialized from
7678 /// the string representation of enums.
7679 pub fn value(&self) -> std::option::Option<i32> {
7680 match self {
7681 Self::Unspecified => std::option::Option::Some(0),
7682 Self::Unknown => std::option::Option::Some(1),
7683 Self::Healthy => std::option::Option::Some(2),
7684 Self::Unhealthy => std::option::Option::Some(3),
7685 Self::Draining => std::option::Option::Some(4),
7686 Self::Timeout => std::option::Option::Some(5),
7687 Self::UnknownValue(u) => u.0.value(),
7688 }
7689 }
7690
7691 /// Gets the enum value as a string.
7692 ///
7693 /// Returns `None` if the enum contains an unknown value deserialized from
7694 /// the integer representation of enums.
7695 pub fn name(&self) -> std::option::Option<&str> {
7696 match self {
7697 Self::Unspecified => std::option::Option::Some("LIVENESS_STATE_UNSPECIFIED"),
7698 Self::Unknown => std::option::Option::Some("UNKNOWN"),
7699 Self::Healthy => std::option::Option::Some("HEALTHY"),
7700 Self::Unhealthy => std::option::Option::Some("UNHEALTHY"),
7701 Self::Draining => std::option::Option::Some("DRAINING"),
7702 Self::Timeout => std::option::Option::Some("TIMEOUT"),
7703 Self::UnknownValue(u) => u.0.name(),
7704 }
7705 }
7706 }
7707
7708 impl std::default::Default for LivenessState {
7709 fn default() -> Self {
7710 use std::convert::From;
7711 Self::from(0)
7712 }
7713 }
7714
7715 impl std::fmt::Display for LivenessState {
7716 fn fmt(
7717 &self,
7718 f: &mut std::fmt::Formatter<'_>,
7719 ) -> std::result::Result<(), std::fmt::Error> {
7720 wkt::internal::display_enum(f, self.name(), self.value())
7721 }
7722 }
7723
7724 impl std::convert::From<i32> for LivenessState {
7725 fn from(value: i32) -> Self {
7726 match value {
7727 0 => Self::Unspecified,
7728 1 => Self::Unknown,
7729 2 => Self::Healthy,
7730 3 => Self::Unhealthy,
7731 4 => Self::Draining,
7732 5 => Self::Timeout,
7733 _ => Self::UnknownValue(liveness_state::UnknownValue(
7734 wkt::internal::UnknownEnumValue::Integer(value),
7735 )),
7736 }
7737 }
7738 }
7739
7740 impl std::convert::From<&str> for LivenessState {
7741 fn from(value: &str) -> Self {
7742 use std::string::ToString;
7743 match value {
7744 "LIVENESS_STATE_UNSPECIFIED" => Self::Unspecified,
7745 "UNKNOWN" => Self::Unknown,
7746 "HEALTHY" => Self::Healthy,
7747 "UNHEALTHY" => Self::Unhealthy,
7748 "DRAINING" => Self::Draining,
7749 "TIMEOUT" => Self::Timeout,
7750 _ => Self::UnknownValue(liveness_state::UnknownValue(
7751 wkt::internal::UnknownEnumValue::String(value.to_string()),
7752 )),
7753 }
7754 }
7755 }
7756
7757 impl serde::ser::Serialize for LivenessState {
7758 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7759 where
7760 S: serde::Serializer,
7761 {
7762 match self {
7763 Self::Unspecified => serializer.serialize_i32(0),
7764 Self::Unknown => serializer.serialize_i32(1),
7765 Self::Healthy => serializer.serialize_i32(2),
7766 Self::Unhealthy => serializer.serialize_i32(3),
7767 Self::Draining => serializer.serialize_i32(4),
7768 Self::Timeout => serializer.serialize_i32(5),
7769 Self::UnknownValue(u) => u.0.serialize(serializer),
7770 }
7771 }
7772 }
7773
7774 impl<'de> serde::de::Deserialize<'de> for LivenessState {
7775 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7776 where
7777 D: serde::Deserializer<'de>,
7778 {
7779 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LivenessState>::new(
7780 ".google.appengine.v1.Instance.Liveness.LivenessState",
7781 ))
7782 }
7783 }
7784 }
7785
7786 /// Availability of the instance.
7787 ///
7788 /// # Working with unknown values
7789 ///
7790 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7791 /// additional enum variants at any time. Adding new variants is not considered
7792 /// a breaking change. Applications should write their code in anticipation of:
7793 ///
7794 /// - New values appearing in future releases of the client library, **and**
7795 /// - New values received dynamically, without application changes.
7796 ///
7797 /// Please consult the [Working with enums] section in the user guide for some
7798 /// guidelines.
7799 ///
7800 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7801 #[derive(Clone, Debug, PartialEq)]
7802 #[non_exhaustive]
7803 pub enum Availability {
7804 #[allow(missing_docs)]
7805 Unspecified,
7806 #[allow(missing_docs)]
7807 Resident,
7808 #[allow(missing_docs)]
7809 Dynamic,
7810 /// If set, the enum was initialized with an unknown value.
7811 ///
7812 /// Applications can examine the value using [Availability::value] or
7813 /// [Availability::name].
7814 UnknownValue(availability::UnknownValue),
7815 }
7816
7817 #[doc(hidden)]
7818 pub mod availability {
7819 #[allow(unused_imports)]
7820 use super::*;
7821 #[derive(Clone, Debug, PartialEq)]
7822 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7823 }
7824
7825 impl Availability {
7826 /// Gets the enum value.
7827 ///
7828 /// Returns `None` if the enum contains an unknown value deserialized from
7829 /// the string representation of enums.
7830 pub fn value(&self) -> std::option::Option<i32> {
7831 match self {
7832 Self::Unspecified => std::option::Option::Some(0),
7833 Self::Resident => std::option::Option::Some(1),
7834 Self::Dynamic => std::option::Option::Some(2),
7835 Self::UnknownValue(u) => u.0.value(),
7836 }
7837 }
7838
7839 /// Gets the enum value as a string.
7840 ///
7841 /// Returns `None` if the enum contains an unknown value deserialized from
7842 /// the integer representation of enums.
7843 pub fn name(&self) -> std::option::Option<&str> {
7844 match self {
7845 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
7846 Self::Resident => std::option::Option::Some("RESIDENT"),
7847 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
7848 Self::UnknownValue(u) => u.0.name(),
7849 }
7850 }
7851 }
7852
7853 impl std::default::Default for Availability {
7854 fn default() -> Self {
7855 use std::convert::From;
7856 Self::from(0)
7857 }
7858 }
7859
7860 impl std::fmt::Display for Availability {
7861 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7862 wkt::internal::display_enum(f, self.name(), self.value())
7863 }
7864 }
7865
7866 impl std::convert::From<i32> for Availability {
7867 fn from(value: i32) -> Self {
7868 match value {
7869 0 => Self::Unspecified,
7870 1 => Self::Resident,
7871 2 => Self::Dynamic,
7872 _ => Self::UnknownValue(availability::UnknownValue(
7873 wkt::internal::UnknownEnumValue::Integer(value),
7874 )),
7875 }
7876 }
7877 }
7878
7879 impl std::convert::From<&str> for Availability {
7880 fn from(value: &str) -> Self {
7881 use std::string::ToString;
7882 match value {
7883 "UNSPECIFIED" => Self::Unspecified,
7884 "RESIDENT" => Self::Resident,
7885 "DYNAMIC" => Self::Dynamic,
7886 _ => Self::UnknownValue(availability::UnknownValue(
7887 wkt::internal::UnknownEnumValue::String(value.to_string()),
7888 )),
7889 }
7890 }
7891 }
7892
7893 impl serde::ser::Serialize for Availability {
7894 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7895 where
7896 S: serde::Serializer,
7897 {
7898 match self {
7899 Self::Unspecified => serializer.serialize_i32(0),
7900 Self::Resident => serializer.serialize_i32(1),
7901 Self::Dynamic => serializer.serialize_i32(2),
7902 Self::UnknownValue(u) => u.0.serialize(serializer),
7903 }
7904 }
7905 }
7906
7907 impl<'de> serde::de::Deserialize<'de> for Availability {
7908 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7909 where
7910 D: serde::Deserializer<'de>,
7911 {
7912 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Availability>::new(
7913 ".google.appengine.v1.Instance.Availability",
7914 ))
7915 }
7916 }
7917}
7918
7919/// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location].
7920#[derive(Clone, Default, PartialEq)]
7921#[non_exhaustive]
7922pub struct LocationMetadata {
7923 /// App Engine standard environment is available in the given location.
7924 ///
7925 /// @OutputOnly
7926 pub standard_environment_available: bool,
7927
7928 /// App Engine flexible environment is available in the given location.
7929 ///
7930 /// @OutputOnly
7931 pub flexible_environment_available: bool,
7932
7933 /// Output only. [Search API](https://cloud.google.com/appengine/docs/standard/python/search)
7934 /// is available in the given location.
7935 pub search_api_available: bool,
7936
7937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7938}
7939
7940impl LocationMetadata {
7941 /// Creates a new default instance.
7942 pub fn new() -> Self {
7943 std::default::Default::default()
7944 }
7945
7946 /// Sets the value of [standard_environment_available][crate::model::LocationMetadata::standard_environment_available].
7947 ///
7948 /// # Example
7949 /// ```ignore,no_run
7950 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7951 /// let x = LocationMetadata::new().set_standard_environment_available(true);
7952 /// ```
7953 pub fn set_standard_environment_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7954 self.standard_environment_available = v.into();
7955 self
7956 }
7957
7958 /// Sets the value of [flexible_environment_available][crate::model::LocationMetadata::flexible_environment_available].
7959 ///
7960 /// # Example
7961 /// ```ignore,no_run
7962 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7963 /// let x = LocationMetadata::new().set_flexible_environment_available(true);
7964 /// ```
7965 pub fn set_flexible_environment_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7966 self.flexible_environment_available = v.into();
7967 self
7968 }
7969
7970 /// Sets the value of [search_api_available][crate::model::LocationMetadata::search_api_available].
7971 ///
7972 /// # Example
7973 /// ```ignore,no_run
7974 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7975 /// let x = LocationMetadata::new().set_search_api_available(true);
7976 /// ```
7977 pub fn set_search_api_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7978 self.search_api_available = v.into();
7979 self
7980 }
7981}
7982
7983impl wkt::message::Message for LocationMetadata {
7984 fn typename() -> &'static str {
7985 "type.googleapis.com/google.appengine.v1.LocationMetadata"
7986 }
7987}
7988
7989/// A NetworkSettings resource is a container for ingress settings for a version
7990/// or service.
7991#[derive(Clone, Default, PartialEq)]
7992#[non_exhaustive]
7993pub struct NetworkSettings {
7994 /// The ingress settings for version or service.
7995 pub ingress_traffic_allowed: crate::model::network_settings::IngressTrafficAllowed,
7996
7997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7998}
7999
8000impl NetworkSettings {
8001 /// Creates a new default instance.
8002 pub fn new() -> Self {
8003 std::default::Default::default()
8004 }
8005
8006 /// Sets the value of [ingress_traffic_allowed][crate::model::NetworkSettings::ingress_traffic_allowed].
8007 ///
8008 /// # Example
8009 /// ```ignore,no_run
8010 /// # use google_cloud_appengine_v1::model::NetworkSettings;
8011 /// use google_cloud_appengine_v1::model::network_settings::IngressTrafficAllowed;
8012 /// let x0 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::All);
8013 /// let x1 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::InternalOnly);
8014 /// let x2 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::InternalAndLb);
8015 /// ```
8016 pub fn set_ingress_traffic_allowed<
8017 T: std::convert::Into<crate::model::network_settings::IngressTrafficAllowed>,
8018 >(
8019 mut self,
8020 v: T,
8021 ) -> Self {
8022 self.ingress_traffic_allowed = v.into();
8023 self
8024 }
8025}
8026
8027impl wkt::message::Message for NetworkSettings {
8028 fn typename() -> &'static str {
8029 "type.googleapis.com/google.appengine.v1.NetworkSettings"
8030 }
8031}
8032
8033/// Defines additional types related to [NetworkSettings].
8034pub mod network_settings {
8035 #[allow(unused_imports)]
8036 use super::*;
8037
8038 /// If unspecified, INGRESS_TRAFFIC_ALLOWED_ALL will be used.
8039 ///
8040 /// # Working with unknown values
8041 ///
8042 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8043 /// additional enum variants at any time. Adding new variants is not considered
8044 /// a breaking change. Applications should write their code in anticipation of:
8045 ///
8046 /// - New values appearing in future releases of the client library, **and**
8047 /// - New values received dynamically, without application changes.
8048 ///
8049 /// Please consult the [Working with enums] section in the user guide for some
8050 /// guidelines.
8051 ///
8052 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8053 #[derive(Clone, Debug, PartialEq)]
8054 #[non_exhaustive]
8055 pub enum IngressTrafficAllowed {
8056 /// Unspecified
8057 Unspecified,
8058 /// Allow HTTP traffic from public and private sources.
8059 All,
8060 /// Allow HTTP traffic from only private VPC sources.
8061 InternalOnly,
8062 /// Allow HTTP traffic from private VPC sources and through load balancers.
8063 InternalAndLb,
8064 /// If set, the enum was initialized with an unknown value.
8065 ///
8066 /// Applications can examine the value using [IngressTrafficAllowed::value] or
8067 /// [IngressTrafficAllowed::name].
8068 UnknownValue(ingress_traffic_allowed::UnknownValue),
8069 }
8070
8071 #[doc(hidden)]
8072 pub mod ingress_traffic_allowed {
8073 #[allow(unused_imports)]
8074 use super::*;
8075 #[derive(Clone, Debug, PartialEq)]
8076 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8077 }
8078
8079 impl IngressTrafficAllowed {
8080 /// Gets the enum value.
8081 ///
8082 /// Returns `None` if the enum contains an unknown value deserialized from
8083 /// the string representation of enums.
8084 pub fn value(&self) -> std::option::Option<i32> {
8085 match self {
8086 Self::Unspecified => std::option::Option::Some(0),
8087 Self::All => std::option::Option::Some(1),
8088 Self::InternalOnly => std::option::Option::Some(2),
8089 Self::InternalAndLb => std::option::Option::Some(3),
8090 Self::UnknownValue(u) => u.0.value(),
8091 }
8092 }
8093
8094 /// Gets the enum value as a string.
8095 ///
8096 /// Returns `None` if the enum contains an unknown value deserialized from
8097 /// the integer representation of enums.
8098 pub fn name(&self) -> std::option::Option<&str> {
8099 match self {
8100 Self::Unspecified => {
8101 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED")
8102 }
8103 Self::All => std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_ALL"),
8104 Self::InternalOnly => {
8105 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY")
8106 }
8107 Self::InternalAndLb => {
8108 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB")
8109 }
8110 Self::UnknownValue(u) => u.0.name(),
8111 }
8112 }
8113 }
8114
8115 impl std::default::Default for IngressTrafficAllowed {
8116 fn default() -> Self {
8117 use std::convert::From;
8118 Self::from(0)
8119 }
8120 }
8121
8122 impl std::fmt::Display for IngressTrafficAllowed {
8123 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8124 wkt::internal::display_enum(f, self.name(), self.value())
8125 }
8126 }
8127
8128 impl std::convert::From<i32> for IngressTrafficAllowed {
8129 fn from(value: i32) -> Self {
8130 match value {
8131 0 => Self::Unspecified,
8132 1 => Self::All,
8133 2 => Self::InternalOnly,
8134 3 => Self::InternalAndLb,
8135 _ => Self::UnknownValue(ingress_traffic_allowed::UnknownValue(
8136 wkt::internal::UnknownEnumValue::Integer(value),
8137 )),
8138 }
8139 }
8140 }
8141
8142 impl std::convert::From<&str> for IngressTrafficAllowed {
8143 fn from(value: &str) -> Self {
8144 use std::string::ToString;
8145 match value {
8146 "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED" => Self::Unspecified,
8147 "INGRESS_TRAFFIC_ALLOWED_ALL" => Self::All,
8148 "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY" => Self::InternalOnly,
8149 "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB" => Self::InternalAndLb,
8150 _ => Self::UnknownValue(ingress_traffic_allowed::UnknownValue(
8151 wkt::internal::UnknownEnumValue::String(value.to_string()),
8152 )),
8153 }
8154 }
8155 }
8156
8157 impl serde::ser::Serialize for IngressTrafficAllowed {
8158 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8159 where
8160 S: serde::Serializer,
8161 {
8162 match self {
8163 Self::Unspecified => serializer.serialize_i32(0),
8164 Self::All => serializer.serialize_i32(1),
8165 Self::InternalOnly => serializer.serialize_i32(2),
8166 Self::InternalAndLb => serializer.serialize_i32(3),
8167 Self::UnknownValue(u) => u.0.serialize(serializer),
8168 }
8169 }
8170 }
8171
8172 impl<'de> serde::de::Deserialize<'de> for IngressTrafficAllowed {
8173 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8174 where
8175 D: serde::Deserializer<'de>,
8176 {
8177 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngressTrafficAllowed>::new(
8178 ".google.appengine.v1.NetworkSettings.IngressTrafficAllowed",
8179 ))
8180 }
8181 }
8182}
8183
8184/// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation].
8185///
8186/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8187#[derive(Clone, Default, PartialEq)]
8188#[non_exhaustive]
8189pub struct OperationMetadataV1 {
8190 /// API method that initiated this operation. Example:
8191 /// `google.appengine.v1.Versions.CreateVersion`.
8192 ///
8193 /// @OutputOnly
8194 pub method: std::string::String,
8195
8196 /// Time that this operation was created.
8197 ///
8198 /// @OutputOnly
8199 pub insert_time: std::option::Option<wkt::Timestamp>,
8200
8201 /// Time that this operation completed.
8202 ///
8203 /// @OutputOnly
8204 pub end_time: std::option::Option<wkt::Timestamp>,
8205
8206 /// User who requested this operation.
8207 ///
8208 /// @OutputOnly
8209 pub user: std::string::String,
8210
8211 /// Name of the resource that this operation is acting on. Example:
8212 /// `apps/myapp/services/default`.
8213 ///
8214 /// @OutputOnly
8215 pub target: std::string::String,
8216
8217 /// Ephemeral message that may change every time the operation is polled.
8218 /// @OutputOnly
8219 pub ephemeral_message: std::string::String,
8220
8221 /// Durable messages that persist on every operation poll.
8222 /// @OutputOnly
8223 pub warning: std::vec::Vec<std::string::String>,
8224
8225 /// Metadata specific to the type of operation in progress.
8226 /// @OutputOnly
8227 pub method_metadata: std::option::Option<crate::model::operation_metadata_v_1::MethodMetadata>,
8228
8229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8230}
8231
8232impl OperationMetadataV1 {
8233 /// Creates a new default instance.
8234 pub fn new() -> Self {
8235 std::default::Default::default()
8236 }
8237
8238 /// Sets the value of [method][crate::model::OperationMetadataV1::method].
8239 ///
8240 /// # Example
8241 /// ```ignore,no_run
8242 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8243 /// let x = OperationMetadataV1::new().set_method("example");
8244 /// ```
8245 pub fn set_method<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8246 self.method = v.into();
8247 self
8248 }
8249
8250 /// Sets the value of [insert_time][crate::model::OperationMetadataV1::insert_time].
8251 ///
8252 /// # Example
8253 /// ```ignore,no_run
8254 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8255 /// use wkt::Timestamp;
8256 /// let x = OperationMetadataV1::new().set_insert_time(Timestamp::default()/* use setters */);
8257 /// ```
8258 pub fn set_insert_time<T>(mut self, v: T) -> Self
8259 where
8260 T: std::convert::Into<wkt::Timestamp>,
8261 {
8262 self.insert_time = std::option::Option::Some(v.into());
8263 self
8264 }
8265
8266 /// Sets or clears the value of [insert_time][crate::model::OperationMetadataV1::insert_time].
8267 ///
8268 /// # Example
8269 /// ```ignore,no_run
8270 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8271 /// use wkt::Timestamp;
8272 /// let x = OperationMetadataV1::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
8273 /// let x = OperationMetadataV1::new().set_or_clear_insert_time(None::<Timestamp>);
8274 /// ```
8275 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
8276 where
8277 T: std::convert::Into<wkt::Timestamp>,
8278 {
8279 self.insert_time = v.map(|x| x.into());
8280 self
8281 }
8282
8283 /// Sets the value of [end_time][crate::model::OperationMetadataV1::end_time].
8284 ///
8285 /// # Example
8286 /// ```ignore,no_run
8287 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8288 /// use wkt::Timestamp;
8289 /// let x = OperationMetadataV1::new().set_end_time(Timestamp::default()/* use setters */);
8290 /// ```
8291 pub fn set_end_time<T>(mut self, v: T) -> Self
8292 where
8293 T: std::convert::Into<wkt::Timestamp>,
8294 {
8295 self.end_time = std::option::Option::Some(v.into());
8296 self
8297 }
8298
8299 /// Sets or clears the value of [end_time][crate::model::OperationMetadataV1::end_time].
8300 ///
8301 /// # Example
8302 /// ```ignore,no_run
8303 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8304 /// use wkt::Timestamp;
8305 /// let x = OperationMetadataV1::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8306 /// let x = OperationMetadataV1::new().set_or_clear_end_time(None::<Timestamp>);
8307 /// ```
8308 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8309 where
8310 T: std::convert::Into<wkt::Timestamp>,
8311 {
8312 self.end_time = v.map(|x| x.into());
8313 self
8314 }
8315
8316 /// Sets the value of [user][crate::model::OperationMetadataV1::user].
8317 ///
8318 /// # Example
8319 /// ```ignore,no_run
8320 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8321 /// let x = OperationMetadataV1::new().set_user("example");
8322 /// ```
8323 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8324 self.user = v.into();
8325 self
8326 }
8327
8328 /// Sets the value of [target][crate::model::OperationMetadataV1::target].
8329 ///
8330 /// # Example
8331 /// ```ignore,no_run
8332 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8333 /// let x = OperationMetadataV1::new().set_target("example");
8334 /// ```
8335 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8336 self.target = v.into();
8337 self
8338 }
8339
8340 /// Sets the value of [ephemeral_message][crate::model::OperationMetadataV1::ephemeral_message].
8341 ///
8342 /// # Example
8343 /// ```ignore,no_run
8344 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8345 /// let x = OperationMetadataV1::new().set_ephemeral_message("example");
8346 /// ```
8347 pub fn set_ephemeral_message<T: std::convert::Into<std::string::String>>(
8348 mut self,
8349 v: T,
8350 ) -> Self {
8351 self.ephemeral_message = v.into();
8352 self
8353 }
8354
8355 /// Sets the value of [warning][crate::model::OperationMetadataV1::warning].
8356 ///
8357 /// # Example
8358 /// ```ignore,no_run
8359 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8360 /// let x = OperationMetadataV1::new().set_warning(["a", "b", "c"]);
8361 /// ```
8362 pub fn set_warning<T, V>(mut self, v: T) -> Self
8363 where
8364 T: std::iter::IntoIterator<Item = V>,
8365 V: std::convert::Into<std::string::String>,
8366 {
8367 use std::iter::Iterator;
8368 self.warning = v.into_iter().map(|i| i.into()).collect();
8369 self
8370 }
8371
8372 /// Sets the value of [method_metadata][crate::model::OperationMetadataV1::method_metadata].
8373 ///
8374 /// Note that all the setters affecting `method_metadata` are mutually
8375 /// exclusive.
8376 ///
8377 /// # Example
8378 /// ```ignore,no_run
8379 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8380 /// use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8381 /// let x = OperationMetadataV1::new().set_method_metadata(Some(
8382 /// google_cloud_appengine_v1::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(CreateVersionMetadataV1::default().into())));
8383 /// ```
8384 pub fn set_method_metadata<
8385 T: std::convert::Into<
8386 std::option::Option<crate::model::operation_metadata_v_1::MethodMetadata>,
8387 >,
8388 >(
8389 mut self,
8390 v: T,
8391 ) -> Self {
8392 self.method_metadata = v.into();
8393 self
8394 }
8395
8396 /// The value of [method_metadata][crate::model::OperationMetadataV1::method_metadata]
8397 /// if it holds a `CreateVersionMetadata`, `None` if the field is not set or
8398 /// holds a different branch.
8399 pub fn create_version_metadata(
8400 &self,
8401 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateVersionMetadataV1>> {
8402 #[allow(unreachable_patterns)]
8403 self.method_metadata.as_ref().and_then(|v| match v {
8404 crate::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(v) => {
8405 std::option::Option::Some(v)
8406 }
8407 _ => std::option::Option::None,
8408 })
8409 }
8410
8411 /// Sets the value of [method_metadata][crate::model::OperationMetadataV1::method_metadata]
8412 /// to hold a `CreateVersionMetadata`.
8413 ///
8414 /// Note that all the setters affecting `method_metadata` are
8415 /// mutually exclusive.
8416 ///
8417 /// # Example
8418 /// ```ignore,no_run
8419 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8420 /// use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8421 /// let x = OperationMetadataV1::new().set_create_version_metadata(CreateVersionMetadataV1::default()/* use setters */);
8422 /// assert!(x.create_version_metadata().is_some());
8423 /// ```
8424 pub fn set_create_version_metadata<
8425 T: std::convert::Into<std::boxed::Box<crate::model::CreateVersionMetadataV1>>,
8426 >(
8427 mut self,
8428 v: T,
8429 ) -> Self {
8430 self.method_metadata = std::option::Option::Some(
8431 crate::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(v.into()),
8432 );
8433 self
8434 }
8435}
8436
8437impl wkt::message::Message for OperationMetadataV1 {
8438 fn typename() -> &'static str {
8439 "type.googleapis.com/google.appengine.v1.OperationMetadataV1"
8440 }
8441}
8442
8443/// Defines additional types related to [OperationMetadataV1].
8444pub mod operation_metadata_v_1 {
8445 #[allow(unused_imports)]
8446 use super::*;
8447
8448 /// Metadata specific to the type of operation in progress.
8449 /// @OutputOnly
8450 #[derive(Clone, Debug, PartialEq)]
8451 #[non_exhaustive]
8452 pub enum MethodMetadata {
8453 #[allow(missing_docs)]
8454 CreateVersionMetadata(std::boxed::Box<crate::model::CreateVersionMetadataV1>),
8455 }
8456}
8457
8458/// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation] during a
8459/// [google.appengine.v1.CreateVersionRequest][google.appengine.v1.CreateVersionRequest].
8460///
8461/// [google.appengine.v1.CreateVersionRequest]: crate::model::CreateVersionRequest
8462/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8463#[derive(Clone, Default, PartialEq)]
8464#[non_exhaustive]
8465pub struct CreateVersionMetadataV1 {
8466 /// The Cloud Build ID if one was created as part of the version create.
8467 /// @OutputOnly
8468 pub cloud_build_id: std::string::String,
8469
8470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8471}
8472
8473impl CreateVersionMetadataV1 {
8474 /// Creates a new default instance.
8475 pub fn new() -> Self {
8476 std::default::Default::default()
8477 }
8478
8479 /// Sets the value of [cloud_build_id][crate::model::CreateVersionMetadataV1::cloud_build_id].
8480 ///
8481 /// # Example
8482 /// ```ignore,no_run
8483 /// # use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8484 /// let x = CreateVersionMetadataV1::new().set_cloud_build_id("example");
8485 /// ```
8486 pub fn set_cloud_build_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8487 self.cloud_build_id = v.into();
8488 self
8489 }
8490}
8491
8492impl wkt::message::Message for CreateVersionMetadataV1 {
8493 fn typename() -> &'static str {
8494 "type.googleapis.com/google.appengine.v1.CreateVersionMetadataV1"
8495 }
8496}
8497
8498/// A Service resource is a logical component of an application that can share
8499/// state and communicate in a secure fashion with other services.
8500/// For example, an application that handles customer requests might
8501/// include separate services to handle tasks such as backend data
8502/// analysis or API requests from mobile devices. Each service has a
8503/// collection of versions that define a specific set of code used to
8504/// implement the functionality of that service.
8505#[derive(Clone, Default, PartialEq)]
8506#[non_exhaustive]
8507pub struct Service {
8508 /// Full path to the Service resource in the API.
8509 /// Example: `apps/myapp/services/default`.
8510 ///
8511 /// @OutputOnly
8512 pub name: std::string::String,
8513
8514 /// Relative name of the service within the application.
8515 /// Example: `default`.
8516 ///
8517 /// @OutputOnly
8518 pub id: std::string::String,
8519
8520 /// Mapping that defines fractional HTTP traffic diversion to
8521 /// different versions within the service.
8522 pub split: std::option::Option<crate::model::TrafficSplit>,
8523
8524 /// A set of labels to apply to this service. Labels are key/value pairs that
8525 /// describe the service and all resources that belong to it (e.g.,
8526 /// versions). The labels can be used to search and group resources, and are
8527 /// propagated to the usage and billing reports, enabling fine-grain analysis
8528 /// of costs. An example of using labels is to tag resources belonging to
8529 /// different environments (e.g., "env=prod", "env=qa").
8530 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8531
8532 /// Ingress settings for this service. Will apply to all versions.
8533 pub network_settings: std::option::Option<crate::model::NetworkSettings>,
8534
8535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8536}
8537
8538impl Service {
8539 /// Creates a new default instance.
8540 pub fn new() -> Self {
8541 std::default::Default::default()
8542 }
8543
8544 /// Sets the value of [name][crate::model::Service::name].
8545 ///
8546 /// # Example
8547 /// ```ignore,no_run
8548 /// # use google_cloud_appengine_v1::model::Service;
8549 /// let x = Service::new().set_name("example");
8550 /// ```
8551 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8552 self.name = v.into();
8553 self
8554 }
8555
8556 /// Sets the value of [id][crate::model::Service::id].
8557 ///
8558 /// # Example
8559 /// ```ignore,no_run
8560 /// # use google_cloud_appengine_v1::model::Service;
8561 /// let x = Service::new().set_id("example");
8562 /// ```
8563 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8564 self.id = v.into();
8565 self
8566 }
8567
8568 /// Sets the value of [split][crate::model::Service::split].
8569 ///
8570 /// # Example
8571 /// ```ignore,no_run
8572 /// # use google_cloud_appengine_v1::model::Service;
8573 /// use google_cloud_appengine_v1::model::TrafficSplit;
8574 /// let x = Service::new().set_split(TrafficSplit::default()/* use setters */);
8575 /// ```
8576 pub fn set_split<T>(mut self, v: T) -> Self
8577 where
8578 T: std::convert::Into<crate::model::TrafficSplit>,
8579 {
8580 self.split = std::option::Option::Some(v.into());
8581 self
8582 }
8583
8584 /// Sets or clears the value of [split][crate::model::Service::split].
8585 ///
8586 /// # Example
8587 /// ```ignore,no_run
8588 /// # use google_cloud_appengine_v1::model::Service;
8589 /// use google_cloud_appengine_v1::model::TrafficSplit;
8590 /// let x = Service::new().set_or_clear_split(Some(TrafficSplit::default()/* use setters */));
8591 /// let x = Service::new().set_or_clear_split(None::<TrafficSplit>);
8592 /// ```
8593 pub fn set_or_clear_split<T>(mut self, v: std::option::Option<T>) -> Self
8594 where
8595 T: std::convert::Into<crate::model::TrafficSplit>,
8596 {
8597 self.split = v.map(|x| x.into());
8598 self
8599 }
8600
8601 /// Sets the value of [labels][crate::model::Service::labels].
8602 ///
8603 /// # Example
8604 /// ```ignore,no_run
8605 /// # use google_cloud_appengine_v1::model::Service;
8606 /// let x = Service::new().set_labels([
8607 /// ("key0", "abc"),
8608 /// ("key1", "xyz"),
8609 /// ]);
8610 /// ```
8611 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8612 where
8613 T: std::iter::IntoIterator<Item = (K, V)>,
8614 K: std::convert::Into<std::string::String>,
8615 V: std::convert::Into<std::string::String>,
8616 {
8617 use std::iter::Iterator;
8618 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8619 self
8620 }
8621
8622 /// Sets the value of [network_settings][crate::model::Service::network_settings].
8623 ///
8624 /// # Example
8625 /// ```ignore,no_run
8626 /// # use google_cloud_appengine_v1::model::Service;
8627 /// use google_cloud_appengine_v1::model::NetworkSettings;
8628 /// let x = Service::new().set_network_settings(NetworkSettings::default()/* use setters */);
8629 /// ```
8630 pub fn set_network_settings<T>(mut self, v: T) -> Self
8631 where
8632 T: std::convert::Into<crate::model::NetworkSettings>,
8633 {
8634 self.network_settings = std::option::Option::Some(v.into());
8635 self
8636 }
8637
8638 /// Sets or clears the value of [network_settings][crate::model::Service::network_settings].
8639 ///
8640 /// # Example
8641 /// ```ignore,no_run
8642 /// # use google_cloud_appengine_v1::model::Service;
8643 /// use google_cloud_appengine_v1::model::NetworkSettings;
8644 /// let x = Service::new().set_or_clear_network_settings(Some(NetworkSettings::default()/* use setters */));
8645 /// let x = Service::new().set_or_clear_network_settings(None::<NetworkSettings>);
8646 /// ```
8647 pub fn set_or_clear_network_settings<T>(mut self, v: std::option::Option<T>) -> Self
8648 where
8649 T: std::convert::Into<crate::model::NetworkSettings>,
8650 {
8651 self.network_settings = v.map(|x| x.into());
8652 self
8653 }
8654}
8655
8656impl wkt::message::Message for Service {
8657 fn typename() -> &'static str {
8658 "type.googleapis.com/google.appengine.v1.Service"
8659 }
8660}
8661
8662/// Traffic routing configuration for versions within a single service. Traffic
8663/// splits define how traffic directed to the service is assigned to versions.
8664#[derive(Clone, Default, PartialEq)]
8665#[non_exhaustive]
8666pub struct TrafficSplit {
8667 /// Mechanism used to determine which version a request is sent to.
8668 /// The traffic selection algorithm will
8669 /// be stable for either type until allocations are changed.
8670 pub shard_by: crate::model::traffic_split::ShardBy,
8671
8672 /// Mapping from version IDs within the service to fractional
8673 /// (0.000, 1] allocations of traffic for that version. Each version can
8674 /// be specified only once, but some versions in the service may not
8675 /// have any traffic allocation. Services that have traffic allocated
8676 /// cannot be deleted until either the service is deleted or
8677 /// their traffic allocation is removed. Allocations must sum to 1.
8678 /// Up to two decimal place precision is supported for IP-based splits and
8679 /// up to three decimal places is supported for cookie-based splits.
8680 pub allocations: std::collections::HashMap<std::string::String, f64>,
8681
8682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8683}
8684
8685impl TrafficSplit {
8686 /// Creates a new default instance.
8687 pub fn new() -> Self {
8688 std::default::Default::default()
8689 }
8690
8691 /// Sets the value of [shard_by][crate::model::TrafficSplit::shard_by].
8692 ///
8693 /// # Example
8694 /// ```ignore,no_run
8695 /// # use google_cloud_appengine_v1::model::TrafficSplit;
8696 /// use google_cloud_appengine_v1::model::traffic_split::ShardBy;
8697 /// let x0 = TrafficSplit::new().set_shard_by(ShardBy::Cookie);
8698 /// let x1 = TrafficSplit::new().set_shard_by(ShardBy::Ip);
8699 /// let x2 = TrafficSplit::new().set_shard_by(ShardBy::Random);
8700 /// ```
8701 pub fn set_shard_by<T: std::convert::Into<crate::model::traffic_split::ShardBy>>(
8702 mut self,
8703 v: T,
8704 ) -> Self {
8705 self.shard_by = v.into();
8706 self
8707 }
8708
8709 /// Sets the value of [allocations][crate::model::TrafficSplit::allocations].
8710 ///
8711 /// # Example
8712 /// ```ignore,no_run
8713 /// # use google_cloud_appengine_v1::model::TrafficSplit;
8714 /// let x = TrafficSplit::new().set_allocations([
8715 /// ("key0", 123.5),
8716 /// ("key1", 456.5),
8717 /// ]);
8718 /// ```
8719 pub fn set_allocations<T, K, V>(mut self, v: T) -> Self
8720 where
8721 T: std::iter::IntoIterator<Item = (K, V)>,
8722 K: std::convert::Into<std::string::String>,
8723 V: std::convert::Into<f64>,
8724 {
8725 use std::iter::Iterator;
8726 self.allocations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8727 self
8728 }
8729}
8730
8731impl wkt::message::Message for TrafficSplit {
8732 fn typename() -> &'static str {
8733 "type.googleapis.com/google.appengine.v1.TrafficSplit"
8734 }
8735}
8736
8737/// Defines additional types related to [TrafficSplit].
8738pub mod traffic_split {
8739 #[allow(unused_imports)]
8740 use super::*;
8741
8742 /// Available sharding mechanisms.
8743 ///
8744 /// # Working with unknown values
8745 ///
8746 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8747 /// additional enum variants at any time. Adding new variants is not considered
8748 /// a breaking change. Applications should write their code in anticipation of:
8749 ///
8750 /// - New values appearing in future releases of the client library, **and**
8751 /// - New values received dynamically, without application changes.
8752 ///
8753 /// Please consult the [Working with enums] section in the user guide for some
8754 /// guidelines.
8755 ///
8756 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8757 #[derive(Clone, Debug, PartialEq)]
8758 #[non_exhaustive]
8759 pub enum ShardBy {
8760 /// Diversion method unspecified.
8761 Unspecified,
8762 /// Diversion based on a specially named cookie, "GOOGAPPUID." The cookie
8763 /// must be set by the application itself or no diversion will occur.
8764 Cookie,
8765 /// Diversion based on applying the modulus operation to a fingerprint
8766 /// of the IP address.
8767 Ip,
8768 /// Diversion based on weighted random assignment. An incoming request is
8769 /// randomly routed to a version in the traffic split, with probability
8770 /// proportional to the version's traffic share.
8771 Random,
8772 /// If set, the enum was initialized with an unknown value.
8773 ///
8774 /// Applications can examine the value using [ShardBy::value] or
8775 /// [ShardBy::name].
8776 UnknownValue(shard_by::UnknownValue),
8777 }
8778
8779 #[doc(hidden)]
8780 pub mod shard_by {
8781 #[allow(unused_imports)]
8782 use super::*;
8783 #[derive(Clone, Debug, PartialEq)]
8784 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8785 }
8786
8787 impl ShardBy {
8788 /// Gets the enum value.
8789 ///
8790 /// Returns `None` if the enum contains an unknown value deserialized from
8791 /// the string representation of enums.
8792 pub fn value(&self) -> std::option::Option<i32> {
8793 match self {
8794 Self::Unspecified => std::option::Option::Some(0),
8795 Self::Cookie => std::option::Option::Some(1),
8796 Self::Ip => std::option::Option::Some(2),
8797 Self::Random => std::option::Option::Some(3),
8798 Self::UnknownValue(u) => u.0.value(),
8799 }
8800 }
8801
8802 /// Gets the enum value as a string.
8803 ///
8804 /// Returns `None` if the enum contains an unknown value deserialized from
8805 /// the integer representation of enums.
8806 pub fn name(&self) -> std::option::Option<&str> {
8807 match self {
8808 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
8809 Self::Cookie => std::option::Option::Some("COOKIE"),
8810 Self::Ip => std::option::Option::Some("IP"),
8811 Self::Random => std::option::Option::Some("RANDOM"),
8812 Self::UnknownValue(u) => u.0.name(),
8813 }
8814 }
8815 }
8816
8817 impl std::default::Default for ShardBy {
8818 fn default() -> Self {
8819 use std::convert::From;
8820 Self::from(0)
8821 }
8822 }
8823
8824 impl std::fmt::Display for ShardBy {
8825 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8826 wkt::internal::display_enum(f, self.name(), self.value())
8827 }
8828 }
8829
8830 impl std::convert::From<i32> for ShardBy {
8831 fn from(value: i32) -> Self {
8832 match value {
8833 0 => Self::Unspecified,
8834 1 => Self::Cookie,
8835 2 => Self::Ip,
8836 3 => Self::Random,
8837 _ => Self::UnknownValue(shard_by::UnknownValue(
8838 wkt::internal::UnknownEnumValue::Integer(value),
8839 )),
8840 }
8841 }
8842 }
8843
8844 impl std::convert::From<&str> for ShardBy {
8845 fn from(value: &str) -> Self {
8846 use std::string::ToString;
8847 match value {
8848 "UNSPECIFIED" => Self::Unspecified,
8849 "COOKIE" => Self::Cookie,
8850 "IP" => Self::Ip,
8851 "RANDOM" => Self::Random,
8852 _ => Self::UnknownValue(shard_by::UnknownValue(
8853 wkt::internal::UnknownEnumValue::String(value.to_string()),
8854 )),
8855 }
8856 }
8857 }
8858
8859 impl serde::ser::Serialize for ShardBy {
8860 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8861 where
8862 S: serde::Serializer,
8863 {
8864 match self {
8865 Self::Unspecified => serializer.serialize_i32(0),
8866 Self::Cookie => serializer.serialize_i32(1),
8867 Self::Ip => serializer.serialize_i32(2),
8868 Self::Random => serializer.serialize_i32(3),
8869 Self::UnknownValue(u) => u.0.serialize(serializer),
8870 }
8871 }
8872 }
8873
8874 impl<'de> serde::de::Deserialize<'de> for ShardBy {
8875 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8876 where
8877 D: serde::Deserializer<'de>,
8878 {
8879 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ShardBy>::new(
8880 ".google.appengine.v1.TrafficSplit.ShardBy",
8881 ))
8882 }
8883 }
8884}
8885
8886/// A Version resource is a specific set of source code and configuration files
8887/// that are deployed into a service.
8888#[derive(Clone, Default, PartialEq)]
8889#[non_exhaustive]
8890pub struct Version {
8891 /// Full path to the Version resource in the API. Example:
8892 /// `apps/myapp/services/default/versions/v1`.
8893 ///
8894 /// @OutputOnly
8895 pub name: std::string::String,
8896
8897 /// Relative name of the version within the service. Example: `v1`.
8898 /// Version names can contain only lowercase letters, numbers, or hyphens.
8899 /// Reserved names: "default", "latest", and any name with the prefix "ah-".
8900 pub id: std::string::String,
8901
8902 /// Before an application can receive email or XMPP messages, the application
8903 /// must be configured to enable the service.
8904 pub inbound_services: std::vec::Vec<crate::model::InboundServiceType>,
8905
8906 /// Instance class that is used to run this version. Valid values are:
8907 ///
8908 /// * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G`
8909 /// * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
8910 ///
8911 /// Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
8912 /// BasicScaling.
8913 pub instance_class: std::string::String,
8914
8915 /// Extra network settings.
8916 /// Only applicable in the App Engine flexible environment.
8917 pub network: std::option::Option<crate::model::Network>,
8918
8919 /// The Google Compute Engine zones that are supported by this version in the
8920 /// App Engine flexible environment. Deprecated.
8921 pub zones: std::vec::Vec<std::string::String>,
8922
8923 /// Machine resources for this version.
8924 /// Only applicable in the App Engine flexible environment.
8925 pub resources: std::option::Option<crate::model::Resources>,
8926
8927 /// Desired runtime. Example: `python27`.
8928 pub runtime: std::string::String,
8929
8930 /// The channel of the runtime to use. Only available for some
8931 /// runtimes. Defaults to the `default` channel.
8932 pub runtime_channel: std::string::String,
8933
8934 /// Whether multiple requests can be dispatched to this version at once.
8935 pub threadsafe: bool,
8936
8937 /// Whether to deploy this version in a container on a virtual machine.
8938 pub vm: bool,
8939
8940 /// Allows App Engine second generation runtimes to access the legacy bundled
8941 /// services.
8942 pub app_engine_apis: bool,
8943
8944 /// Metadata settings that are supplied to this version to enable
8945 /// beta runtime features.
8946 pub beta_settings: std::collections::HashMap<std::string::String, std::string::String>,
8947
8948 /// App Engine execution environment for this version.
8949 ///
8950 /// Defaults to `standard`.
8951 pub env: std::string::String,
8952
8953 /// Current serving status of this version. Only the versions with a
8954 /// `SERVING` status create instances and can be billed.
8955 ///
8956 /// `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`.
8957 pub serving_status: crate::model::ServingStatus,
8958
8959 /// Email address of the user who created this version.
8960 ///
8961 /// @OutputOnly
8962 pub created_by: std::string::String,
8963
8964 /// Time that this version was created.
8965 ///
8966 /// @OutputOnly
8967 pub create_time: std::option::Option<wkt::Timestamp>,
8968
8969 /// Total size in bytes of all the files that are included in this version
8970 /// and currently hosted on the App Engine disk.
8971 ///
8972 /// @OutputOnly
8973 pub disk_usage_bytes: i64,
8974
8975 /// The version of the API in the given runtime environment. Please see the
8976 /// app.yaml reference for valid values at
8977 /// <https://cloud.google.com/appengine/docs/standard/>\<language\>/config/appref
8978 pub runtime_api_version: std::string::String,
8979
8980 /// The path or name of the app's main executable.
8981 pub runtime_main_executable_path: std::string::String,
8982
8983 /// The identity that the deployed version will run as.
8984 /// Admin API will use the App Engine Appspot service account as default if
8985 /// this field is neither provided in app.yaml file nor through CLI flag.
8986 pub service_account: std::string::String,
8987
8988 /// An ordered list of URL-matching patterns that should be applied to incoming
8989 /// requests. The first matching URL handles the request and other request
8990 /// handlers are not attempted.
8991 ///
8992 /// Only returned in `GET` requests if `view=FULL` is set.
8993 pub handlers: std::vec::Vec<crate::model::UrlMap>,
8994
8995 /// Custom static error pages. Limited to 10KB per page.
8996 ///
8997 /// Only returned in `GET` requests if `view=FULL` is set.
8998 pub error_handlers: std::vec::Vec<crate::model::ErrorHandler>,
8999
9000 /// Configuration for third-party Python runtime libraries that are required
9001 /// by the application.
9002 ///
9003 /// Only returned in `GET` requests if `view=FULL` is set.
9004 pub libraries: std::vec::Vec<crate::model::Library>,
9005
9006 /// Serving configuration for
9007 /// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
9008 ///
9009 /// Only returned in `GET` requests if `view=FULL` is set.
9010 pub api_config: std::option::Option<crate::model::ApiConfigHandler>,
9011
9012 /// Environment variables available to the application.
9013 ///
9014 /// Only returned in `GET` requests if `view=FULL` is set.
9015 pub env_variables: std::collections::HashMap<std::string::String, std::string::String>,
9016
9017 /// Environment variables available to the build environment.
9018 ///
9019 /// Only returned in `GET` requests if `view=FULL` is set.
9020 pub build_env_variables: std::collections::HashMap<std::string::String, std::string::String>,
9021
9022 /// Duration that static files should be cached by web proxies and browsers.
9023 /// Only applicable if the corresponding
9024 /// [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StaticFilesHandler)
9025 /// does not specify its own expiration time.
9026 ///
9027 /// Only returned in `GET` requests if `view=FULL` is set.
9028 pub default_expiration: std::option::Option<wkt::Duration>,
9029
9030 /// Configures health checking for instances. Unhealthy instances are
9031 /// stopped and replaced with new instances.
9032 /// Only applicable in the App Engine flexible environment.
9033 ///
9034 /// Only returned in `GET` requests if `view=FULL` is set.
9035 pub health_check: std::option::Option<crate::model::HealthCheck>,
9036
9037 /// Configures readiness health checking for instances.
9038 /// Unhealthy instances are not put into the backend traffic rotation.
9039 ///
9040 /// Only returned in `GET` requests if `view=FULL` is set.
9041 pub readiness_check: std::option::Option<crate::model::ReadinessCheck>,
9042
9043 /// Configures liveness health checking for instances.
9044 /// Unhealthy instances are stopped and replaced with new instances
9045 ///
9046 /// Only returned in `GET` requests if `view=FULL` is set.
9047 pub liveness_check: std::option::Option<crate::model::LivenessCheck>,
9048
9049 /// Files that match this pattern will not be built into this version.
9050 /// Only applicable for Go runtimes.
9051 ///
9052 /// Only returned in `GET` requests if `view=FULL` is set.
9053 pub nobuild_files_regex: std::string::String,
9054
9055 /// Code and application artifacts that make up this version.
9056 ///
9057 /// Only returned in `GET` requests if `view=FULL` is set.
9058 pub deployment: std::option::Option<crate::model::Deployment>,
9059
9060 /// Serving URL for this version. Example:
9061 /// `https://myversion-dot-myservice-dot-myapp.appspot.com`
9062 ///
9063 /// @OutputOnly
9064 pub version_url: std::string::String,
9065
9066 /// Cloud Endpoints configuration.
9067 ///
9068 /// If endpoints_api_service is set, the Cloud Endpoints Extensible Service
9069 /// Proxy will be provided to serve the API implemented by the app.
9070 pub endpoints_api_service: std::option::Option<crate::model::EndpointsApiService>,
9071
9072 /// The entrypoint for the application.
9073 pub entrypoint: std::option::Option<crate::model::Entrypoint>,
9074
9075 /// Enables VPC connectivity for standard apps.
9076 pub vpc_access_connector: std::option::Option<crate::model::VpcAccessConnector>,
9077
9078 /// Controls how instances are created, scaled, and reaped.
9079 ///
9080 /// Defaults to `AutomaticScaling`.
9081 pub scaling: std::option::Option<crate::model::version::Scaling>,
9082
9083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9084}
9085
9086impl Version {
9087 /// Creates a new default instance.
9088 pub fn new() -> Self {
9089 std::default::Default::default()
9090 }
9091
9092 /// Sets the value of [name][crate::model::Version::name].
9093 ///
9094 /// # Example
9095 /// ```ignore,no_run
9096 /// # use google_cloud_appengine_v1::model::Version;
9097 /// let x = Version::new().set_name("example");
9098 /// ```
9099 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9100 self.name = v.into();
9101 self
9102 }
9103
9104 /// Sets the value of [id][crate::model::Version::id].
9105 ///
9106 /// # Example
9107 /// ```ignore,no_run
9108 /// # use google_cloud_appengine_v1::model::Version;
9109 /// let x = Version::new().set_id("example");
9110 /// ```
9111 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9112 self.id = v.into();
9113 self
9114 }
9115
9116 /// Sets the value of [inbound_services][crate::model::Version::inbound_services].
9117 ///
9118 /// # Example
9119 /// ```ignore,no_run
9120 /// # use google_cloud_appengine_v1::model::Version;
9121 /// use google_cloud_appengine_v1::model::InboundServiceType;
9122 /// let x = Version::new().set_inbound_services([
9123 /// InboundServiceType::InboundServiceMail,
9124 /// InboundServiceType::InboundServiceMailBounce,
9125 /// InboundServiceType::InboundServiceXmppError,
9126 /// ]);
9127 /// ```
9128 pub fn set_inbound_services<T, V>(mut self, v: T) -> Self
9129 where
9130 T: std::iter::IntoIterator<Item = V>,
9131 V: std::convert::Into<crate::model::InboundServiceType>,
9132 {
9133 use std::iter::Iterator;
9134 self.inbound_services = v.into_iter().map(|i| i.into()).collect();
9135 self
9136 }
9137
9138 /// Sets the value of [instance_class][crate::model::Version::instance_class].
9139 ///
9140 /// # Example
9141 /// ```ignore,no_run
9142 /// # use google_cloud_appengine_v1::model::Version;
9143 /// let x = Version::new().set_instance_class("example");
9144 /// ```
9145 pub fn set_instance_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9146 self.instance_class = v.into();
9147 self
9148 }
9149
9150 /// Sets the value of [network][crate::model::Version::network].
9151 ///
9152 /// # Example
9153 /// ```ignore,no_run
9154 /// # use google_cloud_appengine_v1::model::Version;
9155 /// use google_cloud_appengine_v1::model::Network;
9156 /// let x = Version::new().set_network(Network::default()/* use setters */);
9157 /// ```
9158 pub fn set_network<T>(mut self, v: T) -> Self
9159 where
9160 T: std::convert::Into<crate::model::Network>,
9161 {
9162 self.network = std::option::Option::Some(v.into());
9163 self
9164 }
9165
9166 /// Sets or clears the value of [network][crate::model::Version::network].
9167 ///
9168 /// # Example
9169 /// ```ignore,no_run
9170 /// # use google_cloud_appengine_v1::model::Version;
9171 /// use google_cloud_appengine_v1::model::Network;
9172 /// let x = Version::new().set_or_clear_network(Some(Network::default()/* use setters */));
9173 /// let x = Version::new().set_or_clear_network(None::<Network>);
9174 /// ```
9175 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
9176 where
9177 T: std::convert::Into<crate::model::Network>,
9178 {
9179 self.network = v.map(|x| x.into());
9180 self
9181 }
9182
9183 /// Sets the value of [zones][crate::model::Version::zones].
9184 ///
9185 /// # Example
9186 /// ```ignore,no_run
9187 /// # use google_cloud_appengine_v1::model::Version;
9188 /// let x = Version::new().set_zones(["a", "b", "c"]);
9189 /// ```
9190 pub fn set_zones<T, V>(mut self, v: T) -> Self
9191 where
9192 T: std::iter::IntoIterator<Item = V>,
9193 V: std::convert::Into<std::string::String>,
9194 {
9195 use std::iter::Iterator;
9196 self.zones = v.into_iter().map(|i| i.into()).collect();
9197 self
9198 }
9199
9200 /// Sets the value of [resources][crate::model::Version::resources].
9201 ///
9202 /// # Example
9203 /// ```ignore,no_run
9204 /// # use google_cloud_appengine_v1::model::Version;
9205 /// use google_cloud_appengine_v1::model::Resources;
9206 /// let x = Version::new().set_resources(Resources::default()/* use setters */);
9207 /// ```
9208 pub fn set_resources<T>(mut self, v: T) -> Self
9209 where
9210 T: std::convert::Into<crate::model::Resources>,
9211 {
9212 self.resources = std::option::Option::Some(v.into());
9213 self
9214 }
9215
9216 /// Sets or clears the value of [resources][crate::model::Version::resources].
9217 ///
9218 /// # Example
9219 /// ```ignore,no_run
9220 /// # use google_cloud_appengine_v1::model::Version;
9221 /// use google_cloud_appengine_v1::model::Resources;
9222 /// let x = Version::new().set_or_clear_resources(Some(Resources::default()/* use setters */));
9223 /// let x = Version::new().set_or_clear_resources(None::<Resources>);
9224 /// ```
9225 pub fn set_or_clear_resources<T>(mut self, v: std::option::Option<T>) -> Self
9226 where
9227 T: std::convert::Into<crate::model::Resources>,
9228 {
9229 self.resources = v.map(|x| x.into());
9230 self
9231 }
9232
9233 /// Sets the value of [runtime][crate::model::Version::runtime].
9234 ///
9235 /// # Example
9236 /// ```ignore,no_run
9237 /// # use google_cloud_appengine_v1::model::Version;
9238 /// let x = Version::new().set_runtime("example");
9239 /// ```
9240 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9241 self.runtime = v.into();
9242 self
9243 }
9244
9245 /// Sets the value of [runtime_channel][crate::model::Version::runtime_channel].
9246 ///
9247 /// # Example
9248 /// ```ignore,no_run
9249 /// # use google_cloud_appengine_v1::model::Version;
9250 /// let x = Version::new().set_runtime_channel("example");
9251 /// ```
9252 pub fn set_runtime_channel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9253 self.runtime_channel = v.into();
9254 self
9255 }
9256
9257 /// Sets the value of [threadsafe][crate::model::Version::threadsafe].
9258 ///
9259 /// # Example
9260 /// ```ignore,no_run
9261 /// # use google_cloud_appengine_v1::model::Version;
9262 /// let x = Version::new().set_threadsafe(true);
9263 /// ```
9264 pub fn set_threadsafe<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9265 self.threadsafe = v.into();
9266 self
9267 }
9268
9269 /// Sets the value of [vm][crate::model::Version::vm].
9270 ///
9271 /// # Example
9272 /// ```ignore,no_run
9273 /// # use google_cloud_appengine_v1::model::Version;
9274 /// let x = Version::new().set_vm(true);
9275 /// ```
9276 pub fn set_vm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9277 self.vm = v.into();
9278 self
9279 }
9280
9281 /// Sets the value of [app_engine_apis][crate::model::Version::app_engine_apis].
9282 ///
9283 /// # Example
9284 /// ```ignore,no_run
9285 /// # use google_cloud_appengine_v1::model::Version;
9286 /// let x = Version::new().set_app_engine_apis(true);
9287 /// ```
9288 pub fn set_app_engine_apis<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9289 self.app_engine_apis = v.into();
9290 self
9291 }
9292
9293 /// Sets the value of [beta_settings][crate::model::Version::beta_settings].
9294 ///
9295 /// # Example
9296 /// ```ignore,no_run
9297 /// # use google_cloud_appengine_v1::model::Version;
9298 /// let x = Version::new().set_beta_settings([
9299 /// ("key0", "abc"),
9300 /// ("key1", "xyz"),
9301 /// ]);
9302 /// ```
9303 pub fn set_beta_settings<T, K, V>(mut self, v: T) -> Self
9304 where
9305 T: std::iter::IntoIterator<Item = (K, V)>,
9306 K: std::convert::Into<std::string::String>,
9307 V: std::convert::Into<std::string::String>,
9308 {
9309 use std::iter::Iterator;
9310 self.beta_settings = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9311 self
9312 }
9313
9314 /// Sets the value of [env][crate::model::Version::env].
9315 ///
9316 /// # Example
9317 /// ```ignore,no_run
9318 /// # use google_cloud_appengine_v1::model::Version;
9319 /// let x = Version::new().set_env("example");
9320 /// ```
9321 pub fn set_env<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9322 self.env = v.into();
9323 self
9324 }
9325
9326 /// Sets the value of [serving_status][crate::model::Version::serving_status].
9327 ///
9328 /// # Example
9329 /// ```ignore,no_run
9330 /// # use google_cloud_appengine_v1::model::Version;
9331 /// use google_cloud_appengine_v1::model::ServingStatus;
9332 /// let x0 = Version::new().set_serving_status(ServingStatus::Serving);
9333 /// let x1 = Version::new().set_serving_status(ServingStatus::Stopped);
9334 /// ```
9335 pub fn set_serving_status<T: std::convert::Into<crate::model::ServingStatus>>(
9336 mut self,
9337 v: T,
9338 ) -> Self {
9339 self.serving_status = v.into();
9340 self
9341 }
9342
9343 /// Sets the value of [created_by][crate::model::Version::created_by].
9344 ///
9345 /// # Example
9346 /// ```ignore,no_run
9347 /// # use google_cloud_appengine_v1::model::Version;
9348 /// let x = Version::new().set_created_by("example");
9349 /// ```
9350 pub fn set_created_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9351 self.created_by = v.into();
9352 self
9353 }
9354
9355 /// Sets the value of [create_time][crate::model::Version::create_time].
9356 ///
9357 /// # Example
9358 /// ```ignore,no_run
9359 /// # use google_cloud_appengine_v1::model::Version;
9360 /// use wkt::Timestamp;
9361 /// let x = Version::new().set_create_time(Timestamp::default()/* use setters */);
9362 /// ```
9363 pub fn set_create_time<T>(mut self, v: T) -> Self
9364 where
9365 T: std::convert::Into<wkt::Timestamp>,
9366 {
9367 self.create_time = std::option::Option::Some(v.into());
9368 self
9369 }
9370
9371 /// Sets or clears the value of [create_time][crate::model::Version::create_time].
9372 ///
9373 /// # Example
9374 /// ```ignore,no_run
9375 /// # use google_cloud_appengine_v1::model::Version;
9376 /// use wkt::Timestamp;
9377 /// let x = Version::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9378 /// let x = Version::new().set_or_clear_create_time(None::<Timestamp>);
9379 /// ```
9380 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9381 where
9382 T: std::convert::Into<wkt::Timestamp>,
9383 {
9384 self.create_time = v.map(|x| x.into());
9385 self
9386 }
9387
9388 /// Sets the value of [disk_usage_bytes][crate::model::Version::disk_usage_bytes].
9389 ///
9390 /// # Example
9391 /// ```ignore,no_run
9392 /// # use google_cloud_appengine_v1::model::Version;
9393 /// let x = Version::new().set_disk_usage_bytes(42);
9394 /// ```
9395 pub fn set_disk_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9396 self.disk_usage_bytes = v.into();
9397 self
9398 }
9399
9400 /// Sets the value of [runtime_api_version][crate::model::Version::runtime_api_version].
9401 ///
9402 /// # Example
9403 /// ```ignore,no_run
9404 /// # use google_cloud_appengine_v1::model::Version;
9405 /// let x = Version::new().set_runtime_api_version("example");
9406 /// ```
9407 pub fn set_runtime_api_version<T: std::convert::Into<std::string::String>>(
9408 mut self,
9409 v: T,
9410 ) -> Self {
9411 self.runtime_api_version = v.into();
9412 self
9413 }
9414
9415 /// Sets the value of [runtime_main_executable_path][crate::model::Version::runtime_main_executable_path].
9416 ///
9417 /// # Example
9418 /// ```ignore,no_run
9419 /// # use google_cloud_appengine_v1::model::Version;
9420 /// let x = Version::new().set_runtime_main_executable_path("example");
9421 /// ```
9422 pub fn set_runtime_main_executable_path<T: std::convert::Into<std::string::String>>(
9423 mut self,
9424 v: T,
9425 ) -> Self {
9426 self.runtime_main_executable_path = v.into();
9427 self
9428 }
9429
9430 /// Sets the value of [service_account][crate::model::Version::service_account].
9431 ///
9432 /// # Example
9433 /// ```ignore,no_run
9434 /// # use google_cloud_appengine_v1::model::Version;
9435 /// let x = Version::new().set_service_account("example");
9436 /// ```
9437 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9438 self.service_account = v.into();
9439 self
9440 }
9441
9442 /// Sets the value of [handlers][crate::model::Version::handlers].
9443 ///
9444 /// # Example
9445 /// ```ignore,no_run
9446 /// # use google_cloud_appengine_v1::model::Version;
9447 /// use google_cloud_appengine_v1::model::UrlMap;
9448 /// let x = Version::new()
9449 /// .set_handlers([
9450 /// UrlMap::default()/* use setters */,
9451 /// UrlMap::default()/* use (different) setters */,
9452 /// ]);
9453 /// ```
9454 pub fn set_handlers<T, V>(mut self, v: T) -> Self
9455 where
9456 T: std::iter::IntoIterator<Item = V>,
9457 V: std::convert::Into<crate::model::UrlMap>,
9458 {
9459 use std::iter::Iterator;
9460 self.handlers = v.into_iter().map(|i| i.into()).collect();
9461 self
9462 }
9463
9464 /// Sets the value of [error_handlers][crate::model::Version::error_handlers].
9465 ///
9466 /// # Example
9467 /// ```ignore,no_run
9468 /// # use google_cloud_appengine_v1::model::Version;
9469 /// use google_cloud_appengine_v1::model::ErrorHandler;
9470 /// let x = Version::new()
9471 /// .set_error_handlers([
9472 /// ErrorHandler::default()/* use setters */,
9473 /// ErrorHandler::default()/* use (different) setters */,
9474 /// ]);
9475 /// ```
9476 pub fn set_error_handlers<T, V>(mut self, v: T) -> Self
9477 where
9478 T: std::iter::IntoIterator<Item = V>,
9479 V: std::convert::Into<crate::model::ErrorHandler>,
9480 {
9481 use std::iter::Iterator;
9482 self.error_handlers = v.into_iter().map(|i| i.into()).collect();
9483 self
9484 }
9485
9486 /// Sets the value of [libraries][crate::model::Version::libraries].
9487 ///
9488 /// # Example
9489 /// ```ignore,no_run
9490 /// # use google_cloud_appengine_v1::model::Version;
9491 /// use google_cloud_appengine_v1::model::Library;
9492 /// let x = Version::new()
9493 /// .set_libraries([
9494 /// Library::default()/* use setters */,
9495 /// Library::default()/* use (different) setters */,
9496 /// ]);
9497 /// ```
9498 pub fn set_libraries<T, V>(mut self, v: T) -> Self
9499 where
9500 T: std::iter::IntoIterator<Item = V>,
9501 V: std::convert::Into<crate::model::Library>,
9502 {
9503 use std::iter::Iterator;
9504 self.libraries = v.into_iter().map(|i| i.into()).collect();
9505 self
9506 }
9507
9508 /// Sets the value of [api_config][crate::model::Version::api_config].
9509 ///
9510 /// # Example
9511 /// ```ignore,no_run
9512 /// # use google_cloud_appengine_v1::model::Version;
9513 /// use google_cloud_appengine_v1::model::ApiConfigHandler;
9514 /// let x = Version::new().set_api_config(ApiConfigHandler::default()/* use setters */);
9515 /// ```
9516 pub fn set_api_config<T>(mut self, v: T) -> Self
9517 where
9518 T: std::convert::Into<crate::model::ApiConfigHandler>,
9519 {
9520 self.api_config = std::option::Option::Some(v.into());
9521 self
9522 }
9523
9524 /// Sets or clears the value of [api_config][crate::model::Version::api_config].
9525 ///
9526 /// # Example
9527 /// ```ignore,no_run
9528 /// # use google_cloud_appengine_v1::model::Version;
9529 /// use google_cloud_appengine_v1::model::ApiConfigHandler;
9530 /// let x = Version::new().set_or_clear_api_config(Some(ApiConfigHandler::default()/* use setters */));
9531 /// let x = Version::new().set_or_clear_api_config(None::<ApiConfigHandler>);
9532 /// ```
9533 pub fn set_or_clear_api_config<T>(mut self, v: std::option::Option<T>) -> Self
9534 where
9535 T: std::convert::Into<crate::model::ApiConfigHandler>,
9536 {
9537 self.api_config = v.map(|x| x.into());
9538 self
9539 }
9540
9541 /// Sets the value of [env_variables][crate::model::Version::env_variables].
9542 ///
9543 /// # Example
9544 /// ```ignore,no_run
9545 /// # use google_cloud_appengine_v1::model::Version;
9546 /// let x = Version::new().set_env_variables([
9547 /// ("key0", "abc"),
9548 /// ("key1", "xyz"),
9549 /// ]);
9550 /// ```
9551 pub fn set_env_variables<T, K, V>(mut self, v: T) -> Self
9552 where
9553 T: std::iter::IntoIterator<Item = (K, V)>,
9554 K: std::convert::Into<std::string::String>,
9555 V: std::convert::Into<std::string::String>,
9556 {
9557 use std::iter::Iterator;
9558 self.env_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9559 self
9560 }
9561
9562 /// Sets the value of [build_env_variables][crate::model::Version::build_env_variables].
9563 ///
9564 /// # Example
9565 /// ```ignore,no_run
9566 /// # use google_cloud_appengine_v1::model::Version;
9567 /// let x = Version::new().set_build_env_variables([
9568 /// ("key0", "abc"),
9569 /// ("key1", "xyz"),
9570 /// ]);
9571 /// ```
9572 pub fn set_build_env_variables<T, K, V>(mut self, v: T) -> Self
9573 where
9574 T: std::iter::IntoIterator<Item = (K, V)>,
9575 K: std::convert::Into<std::string::String>,
9576 V: std::convert::Into<std::string::String>,
9577 {
9578 use std::iter::Iterator;
9579 self.build_env_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9580 self
9581 }
9582
9583 /// Sets the value of [default_expiration][crate::model::Version::default_expiration].
9584 ///
9585 /// # Example
9586 /// ```ignore,no_run
9587 /// # use google_cloud_appengine_v1::model::Version;
9588 /// use wkt::Duration;
9589 /// let x = Version::new().set_default_expiration(Duration::default()/* use setters */);
9590 /// ```
9591 pub fn set_default_expiration<T>(mut self, v: T) -> Self
9592 where
9593 T: std::convert::Into<wkt::Duration>,
9594 {
9595 self.default_expiration = std::option::Option::Some(v.into());
9596 self
9597 }
9598
9599 /// Sets or clears the value of [default_expiration][crate::model::Version::default_expiration].
9600 ///
9601 /// # Example
9602 /// ```ignore,no_run
9603 /// # use google_cloud_appengine_v1::model::Version;
9604 /// use wkt::Duration;
9605 /// let x = Version::new().set_or_clear_default_expiration(Some(Duration::default()/* use setters */));
9606 /// let x = Version::new().set_or_clear_default_expiration(None::<Duration>);
9607 /// ```
9608 pub fn set_or_clear_default_expiration<T>(mut self, v: std::option::Option<T>) -> Self
9609 where
9610 T: std::convert::Into<wkt::Duration>,
9611 {
9612 self.default_expiration = v.map(|x| x.into());
9613 self
9614 }
9615
9616 /// Sets the value of [health_check][crate::model::Version::health_check].
9617 ///
9618 /// # Example
9619 /// ```ignore,no_run
9620 /// # use google_cloud_appengine_v1::model::Version;
9621 /// use google_cloud_appengine_v1::model::HealthCheck;
9622 /// let x = Version::new().set_health_check(HealthCheck::default()/* use setters */);
9623 /// ```
9624 pub fn set_health_check<T>(mut self, v: T) -> Self
9625 where
9626 T: std::convert::Into<crate::model::HealthCheck>,
9627 {
9628 self.health_check = std::option::Option::Some(v.into());
9629 self
9630 }
9631
9632 /// Sets or clears the value of [health_check][crate::model::Version::health_check].
9633 ///
9634 /// # Example
9635 /// ```ignore,no_run
9636 /// # use google_cloud_appengine_v1::model::Version;
9637 /// use google_cloud_appengine_v1::model::HealthCheck;
9638 /// let x = Version::new().set_or_clear_health_check(Some(HealthCheck::default()/* use setters */));
9639 /// let x = Version::new().set_or_clear_health_check(None::<HealthCheck>);
9640 /// ```
9641 pub fn set_or_clear_health_check<T>(mut self, v: std::option::Option<T>) -> Self
9642 where
9643 T: std::convert::Into<crate::model::HealthCheck>,
9644 {
9645 self.health_check = v.map(|x| x.into());
9646 self
9647 }
9648
9649 /// Sets the value of [readiness_check][crate::model::Version::readiness_check].
9650 ///
9651 /// # Example
9652 /// ```ignore,no_run
9653 /// # use google_cloud_appengine_v1::model::Version;
9654 /// use google_cloud_appengine_v1::model::ReadinessCheck;
9655 /// let x = Version::new().set_readiness_check(ReadinessCheck::default()/* use setters */);
9656 /// ```
9657 pub fn set_readiness_check<T>(mut self, v: T) -> Self
9658 where
9659 T: std::convert::Into<crate::model::ReadinessCheck>,
9660 {
9661 self.readiness_check = std::option::Option::Some(v.into());
9662 self
9663 }
9664
9665 /// Sets or clears the value of [readiness_check][crate::model::Version::readiness_check].
9666 ///
9667 /// # Example
9668 /// ```ignore,no_run
9669 /// # use google_cloud_appengine_v1::model::Version;
9670 /// use google_cloud_appengine_v1::model::ReadinessCheck;
9671 /// let x = Version::new().set_or_clear_readiness_check(Some(ReadinessCheck::default()/* use setters */));
9672 /// let x = Version::new().set_or_clear_readiness_check(None::<ReadinessCheck>);
9673 /// ```
9674 pub fn set_or_clear_readiness_check<T>(mut self, v: std::option::Option<T>) -> Self
9675 where
9676 T: std::convert::Into<crate::model::ReadinessCheck>,
9677 {
9678 self.readiness_check = v.map(|x| x.into());
9679 self
9680 }
9681
9682 /// Sets the value of [liveness_check][crate::model::Version::liveness_check].
9683 ///
9684 /// # Example
9685 /// ```ignore,no_run
9686 /// # use google_cloud_appengine_v1::model::Version;
9687 /// use google_cloud_appengine_v1::model::LivenessCheck;
9688 /// let x = Version::new().set_liveness_check(LivenessCheck::default()/* use setters */);
9689 /// ```
9690 pub fn set_liveness_check<T>(mut self, v: T) -> Self
9691 where
9692 T: std::convert::Into<crate::model::LivenessCheck>,
9693 {
9694 self.liveness_check = std::option::Option::Some(v.into());
9695 self
9696 }
9697
9698 /// Sets or clears the value of [liveness_check][crate::model::Version::liveness_check].
9699 ///
9700 /// # Example
9701 /// ```ignore,no_run
9702 /// # use google_cloud_appengine_v1::model::Version;
9703 /// use google_cloud_appengine_v1::model::LivenessCheck;
9704 /// let x = Version::new().set_or_clear_liveness_check(Some(LivenessCheck::default()/* use setters */));
9705 /// let x = Version::new().set_or_clear_liveness_check(None::<LivenessCheck>);
9706 /// ```
9707 pub fn set_or_clear_liveness_check<T>(mut self, v: std::option::Option<T>) -> Self
9708 where
9709 T: std::convert::Into<crate::model::LivenessCheck>,
9710 {
9711 self.liveness_check = v.map(|x| x.into());
9712 self
9713 }
9714
9715 /// Sets the value of [nobuild_files_regex][crate::model::Version::nobuild_files_regex].
9716 ///
9717 /// # Example
9718 /// ```ignore,no_run
9719 /// # use google_cloud_appengine_v1::model::Version;
9720 /// let x = Version::new().set_nobuild_files_regex("example");
9721 /// ```
9722 pub fn set_nobuild_files_regex<T: std::convert::Into<std::string::String>>(
9723 mut self,
9724 v: T,
9725 ) -> Self {
9726 self.nobuild_files_regex = v.into();
9727 self
9728 }
9729
9730 /// Sets the value of [deployment][crate::model::Version::deployment].
9731 ///
9732 /// # Example
9733 /// ```ignore,no_run
9734 /// # use google_cloud_appengine_v1::model::Version;
9735 /// use google_cloud_appengine_v1::model::Deployment;
9736 /// let x = Version::new().set_deployment(Deployment::default()/* use setters */);
9737 /// ```
9738 pub fn set_deployment<T>(mut self, v: T) -> Self
9739 where
9740 T: std::convert::Into<crate::model::Deployment>,
9741 {
9742 self.deployment = std::option::Option::Some(v.into());
9743 self
9744 }
9745
9746 /// Sets or clears the value of [deployment][crate::model::Version::deployment].
9747 ///
9748 /// # Example
9749 /// ```ignore,no_run
9750 /// # use google_cloud_appengine_v1::model::Version;
9751 /// use google_cloud_appengine_v1::model::Deployment;
9752 /// let x = Version::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
9753 /// let x = Version::new().set_or_clear_deployment(None::<Deployment>);
9754 /// ```
9755 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9756 where
9757 T: std::convert::Into<crate::model::Deployment>,
9758 {
9759 self.deployment = v.map(|x| x.into());
9760 self
9761 }
9762
9763 /// Sets the value of [version_url][crate::model::Version::version_url].
9764 ///
9765 /// # Example
9766 /// ```ignore,no_run
9767 /// # use google_cloud_appengine_v1::model::Version;
9768 /// let x = Version::new().set_version_url("example");
9769 /// ```
9770 pub fn set_version_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9771 self.version_url = v.into();
9772 self
9773 }
9774
9775 /// Sets the value of [endpoints_api_service][crate::model::Version::endpoints_api_service].
9776 ///
9777 /// # Example
9778 /// ```ignore,no_run
9779 /// # use google_cloud_appengine_v1::model::Version;
9780 /// use google_cloud_appengine_v1::model::EndpointsApiService;
9781 /// let x = Version::new().set_endpoints_api_service(EndpointsApiService::default()/* use setters */);
9782 /// ```
9783 pub fn set_endpoints_api_service<T>(mut self, v: T) -> Self
9784 where
9785 T: std::convert::Into<crate::model::EndpointsApiService>,
9786 {
9787 self.endpoints_api_service = std::option::Option::Some(v.into());
9788 self
9789 }
9790
9791 /// Sets or clears the value of [endpoints_api_service][crate::model::Version::endpoints_api_service].
9792 ///
9793 /// # Example
9794 /// ```ignore,no_run
9795 /// # use google_cloud_appengine_v1::model::Version;
9796 /// use google_cloud_appengine_v1::model::EndpointsApiService;
9797 /// let x = Version::new().set_or_clear_endpoints_api_service(Some(EndpointsApiService::default()/* use setters */));
9798 /// let x = Version::new().set_or_clear_endpoints_api_service(None::<EndpointsApiService>);
9799 /// ```
9800 pub fn set_or_clear_endpoints_api_service<T>(mut self, v: std::option::Option<T>) -> Self
9801 where
9802 T: std::convert::Into<crate::model::EndpointsApiService>,
9803 {
9804 self.endpoints_api_service = v.map(|x| x.into());
9805 self
9806 }
9807
9808 /// Sets the value of [entrypoint][crate::model::Version::entrypoint].
9809 ///
9810 /// # Example
9811 /// ```ignore,no_run
9812 /// # use google_cloud_appengine_v1::model::Version;
9813 /// use google_cloud_appengine_v1::model::Entrypoint;
9814 /// let x = Version::new().set_entrypoint(Entrypoint::default()/* use setters */);
9815 /// ```
9816 pub fn set_entrypoint<T>(mut self, v: T) -> Self
9817 where
9818 T: std::convert::Into<crate::model::Entrypoint>,
9819 {
9820 self.entrypoint = std::option::Option::Some(v.into());
9821 self
9822 }
9823
9824 /// Sets or clears the value of [entrypoint][crate::model::Version::entrypoint].
9825 ///
9826 /// # Example
9827 /// ```ignore,no_run
9828 /// # use google_cloud_appengine_v1::model::Version;
9829 /// use google_cloud_appengine_v1::model::Entrypoint;
9830 /// let x = Version::new().set_or_clear_entrypoint(Some(Entrypoint::default()/* use setters */));
9831 /// let x = Version::new().set_or_clear_entrypoint(None::<Entrypoint>);
9832 /// ```
9833 pub fn set_or_clear_entrypoint<T>(mut self, v: std::option::Option<T>) -> Self
9834 where
9835 T: std::convert::Into<crate::model::Entrypoint>,
9836 {
9837 self.entrypoint = v.map(|x| x.into());
9838 self
9839 }
9840
9841 /// Sets the value of [vpc_access_connector][crate::model::Version::vpc_access_connector].
9842 ///
9843 /// # Example
9844 /// ```ignore,no_run
9845 /// # use google_cloud_appengine_v1::model::Version;
9846 /// use google_cloud_appengine_v1::model::VpcAccessConnector;
9847 /// let x = Version::new().set_vpc_access_connector(VpcAccessConnector::default()/* use setters */);
9848 /// ```
9849 pub fn set_vpc_access_connector<T>(mut self, v: T) -> Self
9850 where
9851 T: std::convert::Into<crate::model::VpcAccessConnector>,
9852 {
9853 self.vpc_access_connector = std::option::Option::Some(v.into());
9854 self
9855 }
9856
9857 /// Sets or clears the value of [vpc_access_connector][crate::model::Version::vpc_access_connector].
9858 ///
9859 /// # Example
9860 /// ```ignore,no_run
9861 /// # use google_cloud_appengine_v1::model::Version;
9862 /// use google_cloud_appengine_v1::model::VpcAccessConnector;
9863 /// let x = Version::new().set_or_clear_vpc_access_connector(Some(VpcAccessConnector::default()/* use setters */));
9864 /// let x = Version::new().set_or_clear_vpc_access_connector(None::<VpcAccessConnector>);
9865 /// ```
9866 pub fn set_or_clear_vpc_access_connector<T>(mut self, v: std::option::Option<T>) -> Self
9867 where
9868 T: std::convert::Into<crate::model::VpcAccessConnector>,
9869 {
9870 self.vpc_access_connector = v.map(|x| x.into());
9871 self
9872 }
9873
9874 /// Sets the value of [scaling][crate::model::Version::scaling].
9875 ///
9876 /// Note that all the setters affecting `scaling` are mutually
9877 /// exclusive.
9878 ///
9879 /// # Example
9880 /// ```ignore,no_run
9881 /// # use google_cloud_appengine_v1::model::Version;
9882 /// use google_cloud_appengine_v1::model::AutomaticScaling;
9883 /// let x = Version::new().set_scaling(Some(
9884 /// google_cloud_appengine_v1::model::version::Scaling::AutomaticScaling(AutomaticScaling::default().into())));
9885 /// ```
9886 pub fn set_scaling<
9887 T: std::convert::Into<std::option::Option<crate::model::version::Scaling>>,
9888 >(
9889 mut self,
9890 v: T,
9891 ) -> Self {
9892 self.scaling = v.into();
9893 self
9894 }
9895
9896 /// The value of [scaling][crate::model::Version::scaling]
9897 /// if it holds a `AutomaticScaling`, `None` if the field is not set or
9898 /// holds a different branch.
9899 pub fn automatic_scaling(
9900 &self,
9901 ) -> std::option::Option<&std::boxed::Box<crate::model::AutomaticScaling>> {
9902 #[allow(unreachable_patterns)]
9903 self.scaling.as_ref().and_then(|v| match v {
9904 crate::model::version::Scaling::AutomaticScaling(v) => std::option::Option::Some(v),
9905 _ => std::option::Option::None,
9906 })
9907 }
9908
9909 /// Sets the value of [scaling][crate::model::Version::scaling]
9910 /// to hold a `AutomaticScaling`.
9911 ///
9912 /// Note that all the setters affecting `scaling` are
9913 /// mutually exclusive.
9914 ///
9915 /// # Example
9916 /// ```ignore,no_run
9917 /// # use google_cloud_appengine_v1::model::Version;
9918 /// use google_cloud_appengine_v1::model::AutomaticScaling;
9919 /// let x = Version::new().set_automatic_scaling(AutomaticScaling::default()/* use setters */);
9920 /// assert!(x.automatic_scaling().is_some());
9921 /// assert!(x.basic_scaling().is_none());
9922 /// assert!(x.manual_scaling().is_none());
9923 /// ```
9924 pub fn set_automatic_scaling<
9925 T: std::convert::Into<std::boxed::Box<crate::model::AutomaticScaling>>,
9926 >(
9927 mut self,
9928 v: T,
9929 ) -> Self {
9930 self.scaling =
9931 std::option::Option::Some(crate::model::version::Scaling::AutomaticScaling(v.into()));
9932 self
9933 }
9934
9935 /// The value of [scaling][crate::model::Version::scaling]
9936 /// if it holds a `BasicScaling`, `None` if the field is not set or
9937 /// holds a different branch.
9938 pub fn basic_scaling(
9939 &self,
9940 ) -> std::option::Option<&std::boxed::Box<crate::model::BasicScaling>> {
9941 #[allow(unreachable_patterns)]
9942 self.scaling.as_ref().and_then(|v| match v {
9943 crate::model::version::Scaling::BasicScaling(v) => std::option::Option::Some(v),
9944 _ => std::option::Option::None,
9945 })
9946 }
9947
9948 /// Sets the value of [scaling][crate::model::Version::scaling]
9949 /// to hold a `BasicScaling`.
9950 ///
9951 /// Note that all the setters affecting `scaling` are
9952 /// mutually exclusive.
9953 ///
9954 /// # Example
9955 /// ```ignore,no_run
9956 /// # use google_cloud_appengine_v1::model::Version;
9957 /// use google_cloud_appengine_v1::model::BasicScaling;
9958 /// let x = Version::new().set_basic_scaling(BasicScaling::default()/* use setters */);
9959 /// assert!(x.basic_scaling().is_some());
9960 /// assert!(x.automatic_scaling().is_none());
9961 /// assert!(x.manual_scaling().is_none());
9962 /// ```
9963 pub fn set_basic_scaling<T: std::convert::Into<std::boxed::Box<crate::model::BasicScaling>>>(
9964 mut self,
9965 v: T,
9966 ) -> Self {
9967 self.scaling =
9968 std::option::Option::Some(crate::model::version::Scaling::BasicScaling(v.into()));
9969 self
9970 }
9971
9972 /// The value of [scaling][crate::model::Version::scaling]
9973 /// if it holds a `ManualScaling`, `None` if the field is not set or
9974 /// holds a different branch.
9975 pub fn manual_scaling(
9976 &self,
9977 ) -> std::option::Option<&std::boxed::Box<crate::model::ManualScaling>> {
9978 #[allow(unreachable_patterns)]
9979 self.scaling.as_ref().and_then(|v| match v {
9980 crate::model::version::Scaling::ManualScaling(v) => std::option::Option::Some(v),
9981 _ => std::option::Option::None,
9982 })
9983 }
9984
9985 /// Sets the value of [scaling][crate::model::Version::scaling]
9986 /// to hold a `ManualScaling`.
9987 ///
9988 /// Note that all the setters affecting `scaling` are
9989 /// mutually exclusive.
9990 ///
9991 /// # Example
9992 /// ```ignore,no_run
9993 /// # use google_cloud_appengine_v1::model::Version;
9994 /// use google_cloud_appengine_v1::model::ManualScaling;
9995 /// let x = Version::new().set_manual_scaling(ManualScaling::default()/* use setters */);
9996 /// assert!(x.manual_scaling().is_some());
9997 /// assert!(x.automatic_scaling().is_none());
9998 /// assert!(x.basic_scaling().is_none());
9999 /// ```
10000 pub fn set_manual_scaling<
10001 T: std::convert::Into<std::boxed::Box<crate::model::ManualScaling>>,
10002 >(
10003 mut self,
10004 v: T,
10005 ) -> Self {
10006 self.scaling =
10007 std::option::Option::Some(crate::model::version::Scaling::ManualScaling(v.into()));
10008 self
10009 }
10010}
10011
10012impl wkt::message::Message for Version {
10013 fn typename() -> &'static str {
10014 "type.googleapis.com/google.appengine.v1.Version"
10015 }
10016}
10017
10018/// Defines additional types related to [Version].
10019pub mod version {
10020 #[allow(unused_imports)]
10021 use super::*;
10022
10023 /// Controls how instances are created, scaled, and reaped.
10024 ///
10025 /// Defaults to `AutomaticScaling`.
10026 #[derive(Clone, Debug, PartialEq)]
10027 #[non_exhaustive]
10028 pub enum Scaling {
10029 /// Automatic scaling is based on request rate, response latencies, and other
10030 /// application metrics. Instances are dynamically created and destroyed as
10031 /// needed in order to handle traffic.
10032 AutomaticScaling(std::boxed::Box<crate::model::AutomaticScaling>),
10033 /// A service with basic scaling will create an instance when the application
10034 /// receives a request. The instance will be turned down when the app becomes
10035 /// idle. Basic scaling is ideal for work that is intermittent or driven by
10036 /// user activity.
10037 BasicScaling(std::boxed::Box<crate::model::BasicScaling>),
10038 /// A service with manual scaling runs continuously, allowing you to perform
10039 /// complex initialization and rely on the state of its memory over time.
10040 /// Manually scaled versions are sometimes referred to as "backends".
10041 ManualScaling(std::boxed::Box<crate::model::ManualScaling>),
10042 }
10043}
10044
10045/// [Cloud Endpoints](https://cloud.google.com/endpoints) configuration.
10046/// The Endpoints API Service provides tooling for serving Open API and gRPC
10047/// endpoints via an NGINX proxy. Only valid for App Engine Flexible environment
10048/// deployments.
10049///
10050/// The fields here refer to the name and configuration ID of a "service"
10051/// resource in the [Service Management API](https://cloud.google.com/service-management/overview).
10052#[derive(Clone, Default, PartialEq)]
10053#[non_exhaustive]
10054pub struct EndpointsApiService {
10055 /// Endpoints service name which is the name of the "service" resource in the
10056 /// Service Management API. For example "myapi.endpoints.myproject.cloud.goog"
10057 pub name: std::string::String,
10058
10059 /// Endpoints service configuration ID as specified by the Service Management
10060 /// API. For example "2016-09-19r1".
10061 ///
10062 /// By default, the rollout strategy for Endpoints is `RolloutStrategy.FIXED`.
10063 /// This means that Endpoints starts up with a particular configuration ID.
10064 /// When a new configuration is rolled out, Endpoints must be given the new
10065 /// configuration ID. The `config_id` field is used to give the configuration
10066 /// ID and is required in this case.
10067 ///
10068 /// Endpoints also has a rollout strategy called `RolloutStrategy.MANAGED`.
10069 /// When using this, Endpoints fetches the latest configuration and does not
10070 /// need the configuration ID. In this case, `config_id` must be omitted.
10071 pub config_id: std::string::String,
10072
10073 /// Endpoints rollout strategy. If `FIXED`, `config_id` must be specified. If
10074 /// `MANAGED`, `config_id` must be omitted.
10075 pub rollout_strategy: crate::model::endpoints_api_service::RolloutStrategy,
10076
10077 /// Enable or disable trace sampling. By default, this is set to false for
10078 /// enabled.
10079 pub disable_trace_sampling: bool,
10080
10081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10082}
10083
10084impl EndpointsApiService {
10085 /// Creates a new default instance.
10086 pub fn new() -> Self {
10087 std::default::Default::default()
10088 }
10089
10090 /// Sets the value of [name][crate::model::EndpointsApiService::name].
10091 ///
10092 /// # Example
10093 /// ```ignore,no_run
10094 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10095 /// let x = EndpointsApiService::new().set_name("example");
10096 /// ```
10097 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10098 self.name = v.into();
10099 self
10100 }
10101
10102 /// Sets the value of [config_id][crate::model::EndpointsApiService::config_id].
10103 ///
10104 /// # Example
10105 /// ```ignore,no_run
10106 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10107 /// let x = EndpointsApiService::new().set_config_id("example");
10108 /// ```
10109 pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10110 self.config_id = v.into();
10111 self
10112 }
10113
10114 /// Sets the value of [rollout_strategy][crate::model::EndpointsApiService::rollout_strategy].
10115 ///
10116 /// # Example
10117 /// ```ignore,no_run
10118 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10119 /// use google_cloud_appengine_v1::model::endpoints_api_service::RolloutStrategy;
10120 /// let x0 = EndpointsApiService::new().set_rollout_strategy(RolloutStrategy::Fixed);
10121 /// let x1 = EndpointsApiService::new().set_rollout_strategy(RolloutStrategy::Managed);
10122 /// ```
10123 pub fn set_rollout_strategy<
10124 T: std::convert::Into<crate::model::endpoints_api_service::RolloutStrategy>,
10125 >(
10126 mut self,
10127 v: T,
10128 ) -> Self {
10129 self.rollout_strategy = v.into();
10130 self
10131 }
10132
10133 /// Sets the value of [disable_trace_sampling][crate::model::EndpointsApiService::disable_trace_sampling].
10134 ///
10135 /// # Example
10136 /// ```ignore,no_run
10137 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10138 /// let x = EndpointsApiService::new().set_disable_trace_sampling(true);
10139 /// ```
10140 pub fn set_disable_trace_sampling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10141 self.disable_trace_sampling = v.into();
10142 self
10143 }
10144}
10145
10146impl wkt::message::Message for EndpointsApiService {
10147 fn typename() -> &'static str {
10148 "type.googleapis.com/google.appengine.v1.EndpointsApiService"
10149 }
10150}
10151
10152/// Defines additional types related to [EndpointsApiService].
10153pub mod endpoints_api_service {
10154 #[allow(unused_imports)]
10155 use super::*;
10156
10157 /// Available rollout strategies.
10158 ///
10159 /// # Working with unknown values
10160 ///
10161 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10162 /// additional enum variants at any time. Adding new variants is not considered
10163 /// a breaking change. Applications should write their code in anticipation of:
10164 ///
10165 /// - New values appearing in future releases of the client library, **and**
10166 /// - New values received dynamically, without application changes.
10167 ///
10168 /// Please consult the [Working with enums] section in the user guide for some
10169 /// guidelines.
10170 ///
10171 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10172 #[derive(Clone, Debug, PartialEq)]
10173 #[non_exhaustive]
10174 pub enum RolloutStrategy {
10175 /// Not specified. Defaults to `FIXED`.
10176 UnspecifiedRolloutStrategy,
10177 /// Endpoints service configuration ID will be fixed to the configuration ID
10178 /// specified by `config_id`.
10179 Fixed,
10180 /// Endpoints service configuration ID will be updated with each rollout.
10181 Managed,
10182 /// If set, the enum was initialized with an unknown value.
10183 ///
10184 /// Applications can examine the value using [RolloutStrategy::value] or
10185 /// [RolloutStrategy::name].
10186 UnknownValue(rollout_strategy::UnknownValue),
10187 }
10188
10189 #[doc(hidden)]
10190 pub mod rollout_strategy {
10191 #[allow(unused_imports)]
10192 use super::*;
10193 #[derive(Clone, Debug, PartialEq)]
10194 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10195 }
10196
10197 impl RolloutStrategy {
10198 /// Gets the enum value.
10199 ///
10200 /// Returns `None` if the enum contains an unknown value deserialized from
10201 /// the string representation of enums.
10202 pub fn value(&self) -> std::option::Option<i32> {
10203 match self {
10204 Self::UnspecifiedRolloutStrategy => std::option::Option::Some(0),
10205 Self::Fixed => std::option::Option::Some(1),
10206 Self::Managed => std::option::Option::Some(2),
10207 Self::UnknownValue(u) => u.0.value(),
10208 }
10209 }
10210
10211 /// Gets the enum value as a string.
10212 ///
10213 /// Returns `None` if the enum contains an unknown value deserialized from
10214 /// the integer representation of enums.
10215 pub fn name(&self) -> std::option::Option<&str> {
10216 match self {
10217 Self::UnspecifiedRolloutStrategy => {
10218 std::option::Option::Some("UNSPECIFIED_ROLLOUT_STRATEGY")
10219 }
10220 Self::Fixed => std::option::Option::Some("FIXED"),
10221 Self::Managed => std::option::Option::Some("MANAGED"),
10222 Self::UnknownValue(u) => u.0.name(),
10223 }
10224 }
10225 }
10226
10227 impl std::default::Default for RolloutStrategy {
10228 fn default() -> Self {
10229 use std::convert::From;
10230 Self::from(0)
10231 }
10232 }
10233
10234 impl std::fmt::Display for RolloutStrategy {
10235 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10236 wkt::internal::display_enum(f, self.name(), self.value())
10237 }
10238 }
10239
10240 impl std::convert::From<i32> for RolloutStrategy {
10241 fn from(value: i32) -> Self {
10242 match value {
10243 0 => Self::UnspecifiedRolloutStrategy,
10244 1 => Self::Fixed,
10245 2 => Self::Managed,
10246 _ => Self::UnknownValue(rollout_strategy::UnknownValue(
10247 wkt::internal::UnknownEnumValue::Integer(value),
10248 )),
10249 }
10250 }
10251 }
10252
10253 impl std::convert::From<&str> for RolloutStrategy {
10254 fn from(value: &str) -> Self {
10255 use std::string::ToString;
10256 match value {
10257 "UNSPECIFIED_ROLLOUT_STRATEGY" => Self::UnspecifiedRolloutStrategy,
10258 "FIXED" => Self::Fixed,
10259 "MANAGED" => Self::Managed,
10260 _ => Self::UnknownValue(rollout_strategy::UnknownValue(
10261 wkt::internal::UnknownEnumValue::String(value.to_string()),
10262 )),
10263 }
10264 }
10265 }
10266
10267 impl serde::ser::Serialize for RolloutStrategy {
10268 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10269 where
10270 S: serde::Serializer,
10271 {
10272 match self {
10273 Self::UnspecifiedRolloutStrategy => serializer.serialize_i32(0),
10274 Self::Fixed => serializer.serialize_i32(1),
10275 Self::Managed => serializer.serialize_i32(2),
10276 Self::UnknownValue(u) => u.0.serialize(serializer),
10277 }
10278 }
10279 }
10280
10281 impl<'de> serde::de::Deserialize<'de> for RolloutStrategy {
10282 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10283 where
10284 D: serde::Deserializer<'de>,
10285 {
10286 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutStrategy>::new(
10287 ".google.appengine.v1.EndpointsApiService.RolloutStrategy",
10288 ))
10289 }
10290 }
10291}
10292
10293/// Automatic scaling is based on request rate, response latencies, and other
10294/// application metrics.
10295#[derive(Clone, Default, PartialEq)]
10296#[non_exhaustive]
10297pub struct AutomaticScaling {
10298 /// The time period that the
10299 /// [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
10300 /// should wait before it starts collecting information from a new instance.
10301 /// This prevents the autoscaler from collecting information when the instance
10302 /// is initializing, during which the collected usage would not be reliable.
10303 /// Only applicable in the App Engine flexible environment.
10304 pub cool_down_period: std::option::Option<wkt::Duration>,
10305
10306 /// Target scaling by CPU usage.
10307 pub cpu_utilization: std::option::Option<crate::model::CpuUtilization>,
10308
10309 /// Number of concurrent requests an automatic scaling instance can accept
10310 /// before the scheduler spawns a new instance.
10311 ///
10312 /// Defaults to a runtime-specific value.
10313 pub max_concurrent_requests: i32,
10314
10315 /// Maximum number of idle instances that should be maintained for this
10316 /// version.
10317 pub max_idle_instances: i32,
10318
10319 /// Maximum number of instances that should be started to handle requests for
10320 /// this version.
10321 pub max_total_instances: i32,
10322
10323 /// Maximum amount of time that a request should wait in the pending queue
10324 /// before starting a new instance to handle it.
10325 pub max_pending_latency: std::option::Option<wkt::Duration>,
10326
10327 /// Minimum number of idle instances that should be maintained for
10328 /// this version. Only applicable for the default version of a service.
10329 pub min_idle_instances: i32,
10330
10331 /// Minimum number of running instances that should be maintained for this
10332 /// version.
10333 pub min_total_instances: i32,
10334
10335 /// Minimum amount of time a request should wait in the pending queue before
10336 /// starting a new instance to handle it.
10337 pub min_pending_latency: std::option::Option<wkt::Duration>,
10338
10339 /// Target scaling by request utilization.
10340 pub request_utilization: std::option::Option<crate::model::RequestUtilization>,
10341
10342 /// Target scaling by disk usage.
10343 pub disk_utilization: std::option::Option<crate::model::DiskUtilization>,
10344
10345 /// Target scaling by network usage.
10346 pub network_utilization: std::option::Option<crate::model::NetworkUtilization>,
10347
10348 /// Scheduler settings for standard environment.
10349 pub standard_scheduler_settings: std::option::Option<crate::model::StandardSchedulerSettings>,
10350
10351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10352}
10353
10354impl AutomaticScaling {
10355 /// Creates a new default instance.
10356 pub fn new() -> Self {
10357 std::default::Default::default()
10358 }
10359
10360 /// Sets the value of [cool_down_period][crate::model::AutomaticScaling::cool_down_period].
10361 ///
10362 /// # Example
10363 /// ```ignore,no_run
10364 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10365 /// use wkt::Duration;
10366 /// let x = AutomaticScaling::new().set_cool_down_period(Duration::default()/* use setters */);
10367 /// ```
10368 pub fn set_cool_down_period<T>(mut self, v: T) -> Self
10369 where
10370 T: std::convert::Into<wkt::Duration>,
10371 {
10372 self.cool_down_period = std::option::Option::Some(v.into());
10373 self
10374 }
10375
10376 /// Sets or clears the value of [cool_down_period][crate::model::AutomaticScaling::cool_down_period].
10377 ///
10378 /// # Example
10379 /// ```ignore,no_run
10380 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10381 /// use wkt::Duration;
10382 /// let x = AutomaticScaling::new().set_or_clear_cool_down_period(Some(Duration::default()/* use setters */));
10383 /// let x = AutomaticScaling::new().set_or_clear_cool_down_period(None::<Duration>);
10384 /// ```
10385 pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
10386 where
10387 T: std::convert::Into<wkt::Duration>,
10388 {
10389 self.cool_down_period = v.map(|x| x.into());
10390 self
10391 }
10392
10393 /// Sets the value of [cpu_utilization][crate::model::AutomaticScaling::cpu_utilization].
10394 ///
10395 /// # Example
10396 /// ```ignore,no_run
10397 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10398 /// use google_cloud_appengine_v1::model::CpuUtilization;
10399 /// let x = AutomaticScaling::new().set_cpu_utilization(CpuUtilization::default()/* use setters */);
10400 /// ```
10401 pub fn set_cpu_utilization<T>(mut self, v: T) -> Self
10402 where
10403 T: std::convert::Into<crate::model::CpuUtilization>,
10404 {
10405 self.cpu_utilization = std::option::Option::Some(v.into());
10406 self
10407 }
10408
10409 /// Sets or clears the value of [cpu_utilization][crate::model::AutomaticScaling::cpu_utilization].
10410 ///
10411 /// # Example
10412 /// ```ignore,no_run
10413 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10414 /// use google_cloud_appengine_v1::model::CpuUtilization;
10415 /// let x = AutomaticScaling::new().set_or_clear_cpu_utilization(Some(CpuUtilization::default()/* use setters */));
10416 /// let x = AutomaticScaling::new().set_or_clear_cpu_utilization(None::<CpuUtilization>);
10417 /// ```
10418 pub fn set_or_clear_cpu_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10419 where
10420 T: std::convert::Into<crate::model::CpuUtilization>,
10421 {
10422 self.cpu_utilization = v.map(|x| x.into());
10423 self
10424 }
10425
10426 /// Sets the value of [max_concurrent_requests][crate::model::AutomaticScaling::max_concurrent_requests].
10427 ///
10428 /// # Example
10429 /// ```ignore,no_run
10430 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10431 /// let x = AutomaticScaling::new().set_max_concurrent_requests(42);
10432 /// ```
10433 pub fn set_max_concurrent_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10434 self.max_concurrent_requests = v.into();
10435 self
10436 }
10437
10438 /// Sets the value of [max_idle_instances][crate::model::AutomaticScaling::max_idle_instances].
10439 ///
10440 /// # Example
10441 /// ```ignore,no_run
10442 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10443 /// let x = AutomaticScaling::new().set_max_idle_instances(42);
10444 /// ```
10445 pub fn set_max_idle_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10446 self.max_idle_instances = v.into();
10447 self
10448 }
10449
10450 /// Sets the value of [max_total_instances][crate::model::AutomaticScaling::max_total_instances].
10451 ///
10452 /// # Example
10453 /// ```ignore,no_run
10454 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10455 /// let x = AutomaticScaling::new().set_max_total_instances(42);
10456 /// ```
10457 pub fn set_max_total_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10458 self.max_total_instances = v.into();
10459 self
10460 }
10461
10462 /// Sets the value of [max_pending_latency][crate::model::AutomaticScaling::max_pending_latency].
10463 ///
10464 /// # Example
10465 /// ```ignore,no_run
10466 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10467 /// use wkt::Duration;
10468 /// let x = AutomaticScaling::new().set_max_pending_latency(Duration::default()/* use setters */);
10469 /// ```
10470 pub fn set_max_pending_latency<T>(mut self, v: T) -> Self
10471 where
10472 T: std::convert::Into<wkt::Duration>,
10473 {
10474 self.max_pending_latency = std::option::Option::Some(v.into());
10475 self
10476 }
10477
10478 /// Sets or clears the value of [max_pending_latency][crate::model::AutomaticScaling::max_pending_latency].
10479 ///
10480 /// # Example
10481 /// ```ignore,no_run
10482 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10483 /// use wkt::Duration;
10484 /// let x = AutomaticScaling::new().set_or_clear_max_pending_latency(Some(Duration::default()/* use setters */));
10485 /// let x = AutomaticScaling::new().set_or_clear_max_pending_latency(None::<Duration>);
10486 /// ```
10487 pub fn set_or_clear_max_pending_latency<T>(mut self, v: std::option::Option<T>) -> Self
10488 where
10489 T: std::convert::Into<wkt::Duration>,
10490 {
10491 self.max_pending_latency = v.map(|x| x.into());
10492 self
10493 }
10494
10495 /// Sets the value of [min_idle_instances][crate::model::AutomaticScaling::min_idle_instances].
10496 ///
10497 /// # Example
10498 /// ```ignore,no_run
10499 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10500 /// let x = AutomaticScaling::new().set_min_idle_instances(42);
10501 /// ```
10502 pub fn set_min_idle_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10503 self.min_idle_instances = v.into();
10504 self
10505 }
10506
10507 /// Sets the value of [min_total_instances][crate::model::AutomaticScaling::min_total_instances].
10508 ///
10509 /// # Example
10510 /// ```ignore,no_run
10511 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10512 /// let x = AutomaticScaling::new().set_min_total_instances(42);
10513 /// ```
10514 pub fn set_min_total_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10515 self.min_total_instances = v.into();
10516 self
10517 }
10518
10519 /// Sets the value of [min_pending_latency][crate::model::AutomaticScaling::min_pending_latency].
10520 ///
10521 /// # Example
10522 /// ```ignore,no_run
10523 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10524 /// use wkt::Duration;
10525 /// let x = AutomaticScaling::new().set_min_pending_latency(Duration::default()/* use setters */);
10526 /// ```
10527 pub fn set_min_pending_latency<T>(mut self, v: T) -> Self
10528 where
10529 T: std::convert::Into<wkt::Duration>,
10530 {
10531 self.min_pending_latency = std::option::Option::Some(v.into());
10532 self
10533 }
10534
10535 /// Sets or clears the value of [min_pending_latency][crate::model::AutomaticScaling::min_pending_latency].
10536 ///
10537 /// # Example
10538 /// ```ignore,no_run
10539 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10540 /// use wkt::Duration;
10541 /// let x = AutomaticScaling::new().set_or_clear_min_pending_latency(Some(Duration::default()/* use setters */));
10542 /// let x = AutomaticScaling::new().set_or_clear_min_pending_latency(None::<Duration>);
10543 /// ```
10544 pub fn set_or_clear_min_pending_latency<T>(mut self, v: std::option::Option<T>) -> Self
10545 where
10546 T: std::convert::Into<wkt::Duration>,
10547 {
10548 self.min_pending_latency = v.map(|x| x.into());
10549 self
10550 }
10551
10552 /// Sets the value of [request_utilization][crate::model::AutomaticScaling::request_utilization].
10553 ///
10554 /// # Example
10555 /// ```ignore,no_run
10556 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10557 /// use google_cloud_appengine_v1::model::RequestUtilization;
10558 /// let x = AutomaticScaling::new().set_request_utilization(RequestUtilization::default()/* use setters */);
10559 /// ```
10560 pub fn set_request_utilization<T>(mut self, v: T) -> Self
10561 where
10562 T: std::convert::Into<crate::model::RequestUtilization>,
10563 {
10564 self.request_utilization = std::option::Option::Some(v.into());
10565 self
10566 }
10567
10568 /// Sets or clears the value of [request_utilization][crate::model::AutomaticScaling::request_utilization].
10569 ///
10570 /// # Example
10571 /// ```ignore,no_run
10572 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10573 /// use google_cloud_appengine_v1::model::RequestUtilization;
10574 /// let x = AutomaticScaling::new().set_or_clear_request_utilization(Some(RequestUtilization::default()/* use setters */));
10575 /// let x = AutomaticScaling::new().set_or_clear_request_utilization(None::<RequestUtilization>);
10576 /// ```
10577 pub fn set_or_clear_request_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10578 where
10579 T: std::convert::Into<crate::model::RequestUtilization>,
10580 {
10581 self.request_utilization = v.map(|x| x.into());
10582 self
10583 }
10584
10585 /// Sets the value of [disk_utilization][crate::model::AutomaticScaling::disk_utilization].
10586 ///
10587 /// # Example
10588 /// ```ignore,no_run
10589 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10590 /// use google_cloud_appengine_v1::model::DiskUtilization;
10591 /// let x = AutomaticScaling::new().set_disk_utilization(DiskUtilization::default()/* use setters */);
10592 /// ```
10593 pub fn set_disk_utilization<T>(mut self, v: T) -> Self
10594 where
10595 T: std::convert::Into<crate::model::DiskUtilization>,
10596 {
10597 self.disk_utilization = std::option::Option::Some(v.into());
10598 self
10599 }
10600
10601 /// Sets or clears the value of [disk_utilization][crate::model::AutomaticScaling::disk_utilization].
10602 ///
10603 /// # Example
10604 /// ```ignore,no_run
10605 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10606 /// use google_cloud_appengine_v1::model::DiskUtilization;
10607 /// let x = AutomaticScaling::new().set_or_clear_disk_utilization(Some(DiskUtilization::default()/* use setters */));
10608 /// let x = AutomaticScaling::new().set_or_clear_disk_utilization(None::<DiskUtilization>);
10609 /// ```
10610 pub fn set_or_clear_disk_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10611 where
10612 T: std::convert::Into<crate::model::DiskUtilization>,
10613 {
10614 self.disk_utilization = v.map(|x| x.into());
10615 self
10616 }
10617
10618 /// Sets the value of [network_utilization][crate::model::AutomaticScaling::network_utilization].
10619 ///
10620 /// # Example
10621 /// ```ignore,no_run
10622 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10623 /// use google_cloud_appengine_v1::model::NetworkUtilization;
10624 /// let x = AutomaticScaling::new().set_network_utilization(NetworkUtilization::default()/* use setters */);
10625 /// ```
10626 pub fn set_network_utilization<T>(mut self, v: T) -> Self
10627 where
10628 T: std::convert::Into<crate::model::NetworkUtilization>,
10629 {
10630 self.network_utilization = std::option::Option::Some(v.into());
10631 self
10632 }
10633
10634 /// Sets or clears the value of [network_utilization][crate::model::AutomaticScaling::network_utilization].
10635 ///
10636 /// # Example
10637 /// ```ignore,no_run
10638 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10639 /// use google_cloud_appengine_v1::model::NetworkUtilization;
10640 /// let x = AutomaticScaling::new().set_or_clear_network_utilization(Some(NetworkUtilization::default()/* use setters */));
10641 /// let x = AutomaticScaling::new().set_or_clear_network_utilization(None::<NetworkUtilization>);
10642 /// ```
10643 pub fn set_or_clear_network_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10644 where
10645 T: std::convert::Into<crate::model::NetworkUtilization>,
10646 {
10647 self.network_utilization = v.map(|x| x.into());
10648 self
10649 }
10650
10651 /// Sets the value of [standard_scheduler_settings][crate::model::AutomaticScaling::standard_scheduler_settings].
10652 ///
10653 /// # Example
10654 /// ```ignore,no_run
10655 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10656 /// use google_cloud_appengine_v1::model::StandardSchedulerSettings;
10657 /// let x = AutomaticScaling::new().set_standard_scheduler_settings(StandardSchedulerSettings::default()/* use setters */);
10658 /// ```
10659 pub fn set_standard_scheduler_settings<T>(mut self, v: T) -> Self
10660 where
10661 T: std::convert::Into<crate::model::StandardSchedulerSettings>,
10662 {
10663 self.standard_scheduler_settings = std::option::Option::Some(v.into());
10664 self
10665 }
10666
10667 /// Sets or clears the value of [standard_scheduler_settings][crate::model::AutomaticScaling::standard_scheduler_settings].
10668 ///
10669 /// # Example
10670 /// ```ignore,no_run
10671 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10672 /// use google_cloud_appengine_v1::model::StandardSchedulerSettings;
10673 /// let x = AutomaticScaling::new().set_or_clear_standard_scheduler_settings(Some(StandardSchedulerSettings::default()/* use setters */));
10674 /// let x = AutomaticScaling::new().set_or_clear_standard_scheduler_settings(None::<StandardSchedulerSettings>);
10675 /// ```
10676 pub fn set_or_clear_standard_scheduler_settings<T>(mut self, v: std::option::Option<T>) -> Self
10677 where
10678 T: std::convert::Into<crate::model::StandardSchedulerSettings>,
10679 {
10680 self.standard_scheduler_settings = v.map(|x| x.into());
10681 self
10682 }
10683}
10684
10685impl wkt::message::Message for AutomaticScaling {
10686 fn typename() -> &'static str {
10687 "type.googleapis.com/google.appengine.v1.AutomaticScaling"
10688 }
10689}
10690
10691/// A service with basic scaling will create an instance when the application
10692/// receives a request. The instance will be turned down when the app becomes
10693/// idle. Basic scaling is ideal for work that is intermittent or driven by
10694/// user activity.
10695#[derive(Clone, Default, PartialEq)]
10696#[non_exhaustive]
10697pub struct BasicScaling {
10698 /// Duration of time after the last request that an instance must wait before
10699 /// the instance is shut down.
10700 pub idle_timeout: std::option::Option<wkt::Duration>,
10701
10702 /// Maximum number of instances to create for this version.
10703 pub max_instances: i32,
10704
10705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10706}
10707
10708impl BasicScaling {
10709 /// Creates a new default instance.
10710 pub fn new() -> Self {
10711 std::default::Default::default()
10712 }
10713
10714 /// Sets the value of [idle_timeout][crate::model::BasicScaling::idle_timeout].
10715 ///
10716 /// # Example
10717 /// ```ignore,no_run
10718 /// # use google_cloud_appengine_v1::model::BasicScaling;
10719 /// use wkt::Duration;
10720 /// let x = BasicScaling::new().set_idle_timeout(Duration::default()/* use setters */);
10721 /// ```
10722 pub fn set_idle_timeout<T>(mut self, v: T) -> Self
10723 where
10724 T: std::convert::Into<wkt::Duration>,
10725 {
10726 self.idle_timeout = std::option::Option::Some(v.into());
10727 self
10728 }
10729
10730 /// Sets or clears the value of [idle_timeout][crate::model::BasicScaling::idle_timeout].
10731 ///
10732 /// # Example
10733 /// ```ignore,no_run
10734 /// # use google_cloud_appengine_v1::model::BasicScaling;
10735 /// use wkt::Duration;
10736 /// let x = BasicScaling::new().set_or_clear_idle_timeout(Some(Duration::default()/* use setters */));
10737 /// let x = BasicScaling::new().set_or_clear_idle_timeout(None::<Duration>);
10738 /// ```
10739 pub fn set_or_clear_idle_timeout<T>(mut self, v: std::option::Option<T>) -> Self
10740 where
10741 T: std::convert::Into<wkt::Duration>,
10742 {
10743 self.idle_timeout = v.map(|x| x.into());
10744 self
10745 }
10746
10747 /// Sets the value of [max_instances][crate::model::BasicScaling::max_instances].
10748 ///
10749 /// # Example
10750 /// ```ignore,no_run
10751 /// # use google_cloud_appengine_v1::model::BasicScaling;
10752 /// let x = BasicScaling::new().set_max_instances(42);
10753 /// ```
10754 pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10755 self.max_instances = v.into();
10756 self
10757 }
10758}
10759
10760impl wkt::message::Message for BasicScaling {
10761 fn typename() -> &'static str {
10762 "type.googleapis.com/google.appengine.v1.BasicScaling"
10763 }
10764}
10765
10766/// A service with manual scaling runs continuously, allowing you to perform
10767/// complex initialization and rely on the state of its memory over time.
10768#[derive(Clone, Default, PartialEq)]
10769#[non_exhaustive]
10770pub struct ManualScaling {
10771 /// Number of instances to assign to the service at the start. This number
10772 /// can later be altered by using the
10773 /// [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions)
10774 /// `set_num_instances()` function.
10775 pub instances: i32,
10776
10777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10778}
10779
10780impl ManualScaling {
10781 /// Creates a new default instance.
10782 pub fn new() -> Self {
10783 std::default::Default::default()
10784 }
10785
10786 /// Sets the value of [instances][crate::model::ManualScaling::instances].
10787 ///
10788 /// # Example
10789 /// ```ignore,no_run
10790 /// # use google_cloud_appengine_v1::model::ManualScaling;
10791 /// let x = ManualScaling::new().set_instances(42);
10792 /// ```
10793 pub fn set_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10794 self.instances = v.into();
10795 self
10796 }
10797}
10798
10799impl wkt::message::Message for ManualScaling {
10800 fn typename() -> &'static str {
10801 "type.googleapis.com/google.appengine.v1.ManualScaling"
10802 }
10803}
10804
10805/// Target scaling by CPU usage.
10806#[derive(Clone, Default, PartialEq)]
10807#[non_exhaustive]
10808pub struct CpuUtilization {
10809 /// Period of time over which CPU utilization is calculated.
10810 pub aggregation_window_length: std::option::Option<wkt::Duration>,
10811
10812 /// Target CPU utilization ratio to maintain when scaling. Must be between 0
10813 /// and 1.
10814 pub target_utilization: f64,
10815
10816 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10817}
10818
10819impl CpuUtilization {
10820 /// Creates a new default instance.
10821 pub fn new() -> Self {
10822 std::default::Default::default()
10823 }
10824
10825 /// Sets the value of [aggregation_window_length][crate::model::CpuUtilization::aggregation_window_length].
10826 ///
10827 /// # Example
10828 /// ```ignore,no_run
10829 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10830 /// use wkt::Duration;
10831 /// let x = CpuUtilization::new().set_aggregation_window_length(Duration::default()/* use setters */);
10832 /// ```
10833 pub fn set_aggregation_window_length<T>(mut self, v: T) -> Self
10834 where
10835 T: std::convert::Into<wkt::Duration>,
10836 {
10837 self.aggregation_window_length = std::option::Option::Some(v.into());
10838 self
10839 }
10840
10841 /// Sets or clears the value of [aggregation_window_length][crate::model::CpuUtilization::aggregation_window_length].
10842 ///
10843 /// # Example
10844 /// ```ignore,no_run
10845 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10846 /// use wkt::Duration;
10847 /// let x = CpuUtilization::new().set_or_clear_aggregation_window_length(Some(Duration::default()/* use setters */));
10848 /// let x = CpuUtilization::new().set_or_clear_aggregation_window_length(None::<Duration>);
10849 /// ```
10850 pub fn set_or_clear_aggregation_window_length<T>(mut self, v: std::option::Option<T>) -> Self
10851 where
10852 T: std::convert::Into<wkt::Duration>,
10853 {
10854 self.aggregation_window_length = v.map(|x| x.into());
10855 self
10856 }
10857
10858 /// Sets the value of [target_utilization][crate::model::CpuUtilization::target_utilization].
10859 ///
10860 /// # Example
10861 /// ```ignore,no_run
10862 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10863 /// let x = CpuUtilization::new().set_target_utilization(42.0);
10864 /// ```
10865 pub fn set_target_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10866 self.target_utilization = v.into();
10867 self
10868 }
10869}
10870
10871impl wkt::message::Message for CpuUtilization {
10872 fn typename() -> &'static str {
10873 "type.googleapis.com/google.appengine.v1.CpuUtilization"
10874 }
10875}
10876
10877/// Target scaling by request utilization.
10878/// Only applicable in the App Engine flexible environment.
10879#[derive(Clone, Default, PartialEq)]
10880#[non_exhaustive]
10881pub struct RequestUtilization {
10882 /// Target requests per second.
10883 pub target_request_count_per_second: i32,
10884
10885 /// Target number of concurrent requests.
10886 pub target_concurrent_requests: i32,
10887
10888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10889}
10890
10891impl RequestUtilization {
10892 /// Creates a new default instance.
10893 pub fn new() -> Self {
10894 std::default::Default::default()
10895 }
10896
10897 /// Sets the value of [target_request_count_per_second][crate::model::RequestUtilization::target_request_count_per_second].
10898 ///
10899 /// # Example
10900 /// ```ignore,no_run
10901 /// # use google_cloud_appengine_v1::model::RequestUtilization;
10902 /// let x = RequestUtilization::new().set_target_request_count_per_second(42);
10903 /// ```
10904 pub fn set_target_request_count_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10905 self.target_request_count_per_second = v.into();
10906 self
10907 }
10908
10909 /// Sets the value of [target_concurrent_requests][crate::model::RequestUtilization::target_concurrent_requests].
10910 ///
10911 /// # Example
10912 /// ```ignore,no_run
10913 /// # use google_cloud_appengine_v1::model::RequestUtilization;
10914 /// let x = RequestUtilization::new().set_target_concurrent_requests(42);
10915 /// ```
10916 pub fn set_target_concurrent_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10917 self.target_concurrent_requests = v.into();
10918 self
10919 }
10920}
10921
10922impl wkt::message::Message for RequestUtilization {
10923 fn typename() -> &'static str {
10924 "type.googleapis.com/google.appengine.v1.RequestUtilization"
10925 }
10926}
10927
10928/// Target scaling by disk usage.
10929/// Only applicable in the App Engine flexible environment.
10930#[derive(Clone, Default, PartialEq)]
10931#[non_exhaustive]
10932pub struct DiskUtilization {
10933 /// Target bytes written per second.
10934 pub target_write_bytes_per_second: i32,
10935
10936 /// Target ops written per second.
10937 pub target_write_ops_per_second: i32,
10938
10939 /// Target bytes read per second.
10940 pub target_read_bytes_per_second: i32,
10941
10942 /// Target ops read per seconds.
10943 pub target_read_ops_per_second: i32,
10944
10945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10946}
10947
10948impl DiskUtilization {
10949 /// Creates a new default instance.
10950 pub fn new() -> Self {
10951 std::default::Default::default()
10952 }
10953
10954 /// Sets the value of [target_write_bytes_per_second][crate::model::DiskUtilization::target_write_bytes_per_second].
10955 ///
10956 /// # Example
10957 /// ```ignore,no_run
10958 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10959 /// let x = DiskUtilization::new().set_target_write_bytes_per_second(42);
10960 /// ```
10961 pub fn set_target_write_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10962 self.target_write_bytes_per_second = v.into();
10963 self
10964 }
10965
10966 /// Sets the value of [target_write_ops_per_second][crate::model::DiskUtilization::target_write_ops_per_second].
10967 ///
10968 /// # Example
10969 /// ```ignore,no_run
10970 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10971 /// let x = DiskUtilization::new().set_target_write_ops_per_second(42);
10972 /// ```
10973 pub fn set_target_write_ops_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10974 self.target_write_ops_per_second = v.into();
10975 self
10976 }
10977
10978 /// Sets the value of [target_read_bytes_per_second][crate::model::DiskUtilization::target_read_bytes_per_second].
10979 ///
10980 /// # Example
10981 /// ```ignore,no_run
10982 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10983 /// let x = DiskUtilization::new().set_target_read_bytes_per_second(42);
10984 /// ```
10985 pub fn set_target_read_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10986 self.target_read_bytes_per_second = v.into();
10987 self
10988 }
10989
10990 /// Sets the value of [target_read_ops_per_second][crate::model::DiskUtilization::target_read_ops_per_second].
10991 ///
10992 /// # Example
10993 /// ```ignore,no_run
10994 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10995 /// let x = DiskUtilization::new().set_target_read_ops_per_second(42);
10996 /// ```
10997 pub fn set_target_read_ops_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10998 self.target_read_ops_per_second = v.into();
10999 self
11000 }
11001}
11002
11003impl wkt::message::Message for DiskUtilization {
11004 fn typename() -> &'static str {
11005 "type.googleapis.com/google.appengine.v1.DiskUtilization"
11006 }
11007}
11008
11009/// Target scaling by network usage.
11010/// Only applicable in the App Engine flexible environment.
11011#[derive(Clone, Default, PartialEq)]
11012#[non_exhaustive]
11013pub struct NetworkUtilization {
11014 /// Target bytes sent per second.
11015 pub target_sent_bytes_per_second: i32,
11016
11017 /// Target packets sent per second.
11018 pub target_sent_packets_per_second: i32,
11019
11020 /// Target bytes received per second.
11021 pub target_received_bytes_per_second: i32,
11022
11023 /// Target packets received per second.
11024 pub target_received_packets_per_second: i32,
11025
11026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11027}
11028
11029impl NetworkUtilization {
11030 /// Creates a new default instance.
11031 pub fn new() -> Self {
11032 std::default::Default::default()
11033 }
11034
11035 /// Sets the value of [target_sent_bytes_per_second][crate::model::NetworkUtilization::target_sent_bytes_per_second].
11036 ///
11037 /// # Example
11038 /// ```ignore,no_run
11039 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
11040 /// let x = NetworkUtilization::new().set_target_sent_bytes_per_second(42);
11041 /// ```
11042 pub fn set_target_sent_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11043 self.target_sent_bytes_per_second = v.into();
11044 self
11045 }
11046
11047 /// Sets the value of [target_sent_packets_per_second][crate::model::NetworkUtilization::target_sent_packets_per_second].
11048 ///
11049 /// # Example
11050 /// ```ignore,no_run
11051 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
11052 /// let x = NetworkUtilization::new().set_target_sent_packets_per_second(42);
11053 /// ```
11054 pub fn set_target_sent_packets_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11055 self.target_sent_packets_per_second = v.into();
11056 self
11057 }
11058
11059 /// Sets the value of [target_received_bytes_per_second][crate::model::NetworkUtilization::target_received_bytes_per_second].
11060 ///
11061 /// # Example
11062 /// ```ignore,no_run
11063 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
11064 /// let x = NetworkUtilization::new().set_target_received_bytes_per_second(42);
11065 /// ```
11066 pub fn set_target_received_bytes_per_second<T: std::convert::Into<i32>>(
11067 mut self,
11068 v: T,
11069 ) -> Self {
11070 self.target_received_bytes_per_second = v.into();
11071 self
11072 }
11073
11074 /// Sets the value of [target_received_packets_per_second][crate::model::NetworkUtilization::target_received_packets_per_second].
11075 ///
11076 /// # Example
11077 /// ```ignore,no_run
11078 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
11079 /// let x = NetworkUtilization::new().set_target_received_packets_per_second(42);
11080 /// ```
11081 pub fn set_target_received_packets_per_second<T: std::convert::Into<i32>>(
11082 mut self,
11083 v: T,
11084 ) -> Self {
11085 self.target_received_packets_per_second = v.into();
11086 self
11087 }
11088}
11089
11090impl wkt::message::Message for NetworkUtilization {
11091 fn typename() -> &'static str {
11092 "type.googleapis.com/google.appengine.v1.NetworkUtilization"
11093 }
11094}
11095
11096/// Scheduler settings for standard environment.
11097#[derive(Clone, Default, PartialEq)]
11098#[non_exhaustive]
11099pub struct StandardSchedulerSettings {
11100 /// Target CPU utilization ratio to maintain when scaling.
11101 pub target_cpu_utilization: f64,
11102
11103 /// Target throughput utilization ratio to maintain when scaling
11104 pub target_throughput_utilization: f64,
11105
11106 /// Minimum number of instances to run for this version. Set to zero to disable
11107 /// `min_instances` configuration.
11108 pub min_instances: i32,
11109
11110 /// Maximum number of instances to run for this version. Set to zero to disable
11111 /// `max_instances` configuration.
11112 pub max_instances: i32,
11113
11114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11115}
11116
11117impl StandardSchedulerSettings {
11118 /// Creates a new default instance.
11119 pub fn new() -> Self {
11120 std::default::Default::default()
11121 }
11122
11123 /// Sets the value of [target_cpu_utilization][crate::model::StandardSchedulerSettings::target_cpu_utilization].
11124 ///
11125 /// # Example
11126 /// ```ignore,no_run
11127 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11128 /// let x = StandardSchedulerSettings::new().set_target_cpu_utilization(42.0);
11129 /// ```
11130 pub fn set_target_cpu_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11131 self.target_cpu_utilization = v.into();
11132 self
11133 }
11134
11135 /// Sets the value of [target_throughput_utilization][crate::model::StandardSchedulerSettings::target_throughput_utilization].
11136 ///
11137 /// # Example
11138 /// ```ignore,no_run
11139 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11140 /// let x = StandardSchedulerSettings::new().set_target_throughput_utilization(42.0);
11141 /// ```
11142 pub fn set_target_throughput_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11143 self.target_throughput_utilization = v.into();
11144 self
11145 }
11146
11147 /// Sets the value of [min_instances][crate::model::StandardSchedulerSettings::min_instances].
11148 ///
11149 /// # Example
11150 /// ```ignore,no_run
11151 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11152 /// let x = StandardSchedulerSettings::new().set_min_instances(42);
11153 /// ```
11154 pub fn set_min_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11155 self.min_instances = v.into();
11156 self
11157 }
11158
11159 /// Sets the value of [max_instances][crate::model::StandardSchedulerSettings::max_instances].
11160 ///
11161 /// # Example
11162 /// ```ignore,no_run
11163 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11164 /// let x = StandardSchedulerSettings::new().set_max_instances(42);
11165 /// ```
11166 pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11167 self.max_instances = v.into();
11168 self
11169 }
11170}
11171
11172impl wkt::message::Message for StandardSchedulerSettings {
11173 fn typename() -> &'static str {
11174 "type.googleapis.com/google.appengine.v1.StandardSchedulerSettings"
11175 }
11176}
11177
11178/// Extra network settings.
11179/// Only applicable in the App Engine flexible environment.
11180#[derive(Clone, Default, PartialEq)]
11181#[non_exhaustive]
11182pub struct Network {
11183 /// List of ports, or port pairs, to forward from the virtual machine to the
11184 /// application container.
11185 /// Only applicable in the App Engine flexible environment.
11186 pub forwarded_ports: std::vec::Vec<std::string::String>,
11187
11188 /// Tag to apply to the instance during creation.
11189 /// Only applicable in the App Engine flexible environment.
11190 pub instance_tag: std::string::String,
11191
11192 /// Google Compute Engine network where the virtual machines are created.
11193 /// Specify the short name, not the resource path.
11194 ///
11195 /// Defaults to `default`.
11196 pub name: std::string::String,
11197
11198 /// Google Cloud Platform sub-network where the virtual machines are created.
11199 /// Specify the short name, not the resource path.
11200 ///
11201 /// If a subnetwork name is specified, a network name will also be required
11202 /// unless it is for the default network.
11203 ///
11204 /// * If the network that the instance is being created in is a Legacy network,
11205 /// then the IP address is allocated from the IPv4Range.
11206 /// * If the network that the instance is being created in is an auto Subnet
11207 /// Mode Network, then only network name should be specified (not the
11208 /// subnetwork_name) and the IP address is created from the IPCidrRange of the
11209 /// subnetwork that exists in that zone for that network.
11210 /// * If the network that the instance is being created in is a custom Subnet
11211 /// Mode Network, then the subnetwork_name must be specified and the
11212 /// IP address is created from the IPCidrRange of the subnetwork.
11213 ///
11214 /// If specified, the subnetwork must exist in the same region as the
11215 /// App Engine flexible environment application.
11216 pub subnetwork_name: std::string::String,
11217
11218 /// Enable session affinity.
11219 /// Only applicable in the App Engine flexible environment.
11220 pub session_affinity: bool,
11221
11222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11223}
11224
11225impl Network {
11226 /// Creates a new default instance.
11227 pub fn new() -> Self {
11228 std::default::Default::default()
11229 }
11230
11231 /// Sets the value of [forwarded_ports][crate::model::Network::forwarded_ports].
11232 ///
11233 /// # Example
11234 /// ```ignore,no_run
11235 /// # use google_cloud_appengine_v1::model::Network;
11236 /// let x = Network::new().set_forwarded_ports(["a", "b", "c"]);
11237 /// ```
11238 pub fn set_forwarded_ports<T, V>(mut self, v: T) -> Self
11239 where
11240 T: std::iter::IntoIterator<Item = V>,
11241 V: std::convert::Into<std::string::String>,
11242 {
11243 use std::iter::Iterator;
11244 self.forwarded_ports = v.into_iter().map(|i| i.into()).collect();
11245 self
11246 }
11247
11248 /// Sets the value of [instance_tag][crate::model::Network::instance_tag].
11249 ///
11250 /// # Example
11251 /// ```ignore,no_run
11252 /// # use google_cloud_appengine_v1::model::Network;
11253 /// let x = Network::new().set_instance_tag("example");
11254 /// ```
11255 pub fn set_instance_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11256 self.instance_tag = v.into();
11257 self
11258 }
11259
11260 /// Sets the value of [name][crate::model::Network::name].
11261 ///
11262 /// # Example
11263 /// ```ignore,no_run
11264 /// # use google_cloud_appengine_v1::model::Network;
11265 /// let x = Network::new().set_name("example");
11266 /// ```
11267 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11268 self.name = v.into();
11269 self
11270 }
11271
11272 /// Sets the value of [subnetwork_name][crate::model::Network::subnetwork_name].
11273 ///
11274 /// # Example
11275 /// ```ignore,no_run
11276 /// # use google_cloud_appengine_v1::model::Network;
11277 /// let x = Network::new().set_subnetwork_name("example");
11278 /// ```
11279 pub fn set_subnetwork_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11280 self.subnetwork_name = v.into();
11281 self
11282 }
11283
11284 /// Sets the value of [session_affinity][crate::model::Network::session_affinity].
11285 ///
11286 /// # Example
11287 /// ```ignore,no_run
11288 /// # use google_cloud_appengine_v1::model::Network;
11289 /// let x = Network::new().set_session_affinity(true);
11290 /// ```
11291 pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11292 self.session_affinity = v.into();
11293 self
11294 }
11295}
11296
11297impl wkt::message::Message for Network {
11298 fn typename() -> &'static str {
11299 "type.googleapis.com/google.appengine.v1.Network"
11300 }
11301}
11302
11303/// Volumes mounted within the app container.
11304/// Only applicable in the App Engine flexible environment.
11305#[derive(Clone, Default, PartialEq)]
11306#[non_exhaustive]
11307pub struct Volume {
11308 /// Unique name for the volume.
11309 pub name: std::string::String,
11310
11311 /// Underlying volume type, e.g. 'tmpfs'.
11312 pub volume_type: std::string::String,
11313
11314 /// Volume size in gigabytes.
11315 pub size_gb: f64,
11316
11317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11318}
11319
11320impl Volume {
11321 /// Creates a new default instance.
11322 pub fn new() -> Self {
11323 std::default::Default::default()
11324 }
11325
11326 /// Sets the value of [name][crate::model::Volume::name].
11327 ///
11328 /// # Example
11329 /// ```ignore,no_run
11330 /// # use google_cloud_appengine_v1::model::Volume;
11331 /// let x = Volume::new().set_name("example");
11332 /// ```
11333 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11334 self.name = v.into();
11335 self
11336 }
11337
11338 /// Sets the value of [volume_type][crate::model::Volume::volume_type].
11339 ///
11340 /// # Example
11341 /// ```ignore,no_run
11342 /// # use google_cloud_appengine_v1::model::Volume;
11343 /// let x = Volume::new().set_volume_type("example");
11344 /// ```
11345 pub fn set_volume_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11346 self.volume_type = v.into();
11347 self
11348 }
11349
11350 /// Sets the value of [size_gb][crate::model::Volume::size_gb].
11351 ///
11352 /// # Example
11353 /// ```ignore,no_run
11354 /// # use google_cloud_appengine_v1::model::Volume;
11355 /// let x = Volume::new().set_size_gb(42.0);
11356 /// ```
11357 pub fn set_size_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11358 self.size_gb = v.into();
11359 self
11360 }
11361}
11362
11363impl wkt::message::Message for Volume {
11364 fn typename() -> &'static str {
11365 "type.googleapis.com/google.appengine.v1.Volume"
11366 }
11367}
11368
11369/// Machine resources for a version.
11370#[derive(Clone, Default, PartialEq)]
11371#[non_exhaustive]
11372pub struct Resources {
11373 /// Number of CPU cores needed.
11374 pub cpu: f64,
11375
11376 /// Disk size (GB) needed.
11377 pub disk_gb: f64,
11378
11379 /// Memory (GB) needed.
11380 pub memory_gb: f64,
11381
11382 /// User specified volumes.
11383 pub volumes: std::vec::Vec<crate::model::Volume>,
11384
11385 /// The name of the encryption key that is stored in Google Cloud KMS.
11386 /// Only should be used by Cloud Composer to encrypt the vm disk
11387 pub kms_key_reference: std::string::String,
11388
11389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11390}
11391
11392impl Resources {
11393 /// Creates a new default instance.
11394 pub fn new() -> Self {
11395 std::default::Default::default()
11396 }
11397
11398 /// Sets the value of [cpu][crate::model::Resources::cpu].
11399 ///
11400 /// # Example
11401 /// ```ignore,no_run
11402 /// # use google_cloud_appengine_v1::model::Resources;
11403 /// let x = Resources::new().set_cpu(42.0);
11404 /// ```
11405 pub fn set_cpu<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11406 self.cpu = v.into();
11407 self
11408 }
11409
11410 /// Sets the value of [disk_gb][crate::model::Resources::disk_gb].
11411 ///
11412 /// # Example
11413 /// ```ignore,no_run
11414 /// # use google_cloud_appengine_v1::model::Resources;
11415 /// let x = Resources::new().set_disk_gb(42.0);
11416 /// ```
11417 pub fn set_disk_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11418 self.disk_gb = v.into();
11419 self
11420 }
11421
11422 /// Sets the value of [memory_gb][crate::model::Resources::memory_gb].
11423 ///
11424 /// # Example
11425 /// ```ignore,no_run
11426 /// # use google_cloud_appengine_v1::model::Resources;
11427 /// let x = Resources::new().set_memory_gb(42.0);
11428 /// ```
11429 pub fn set_memory_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11430 self.memory_gb = v.into();
11431 self
11432 }
11433
11434 /// Sets the value of [volumes][crate::model::Resources::volumes].
11435 ///
11436 /// # Example
11437 /// ```ignore,no_run
11438 /// # use google_cloud_appengine_v1::model::Resources;
11439 /// use google_cloud_appengine_v1::model::Volume;
11440 /// let x = Resources::new()
11441 /// .set_volumes([
11442 /// Volume::default()/* use setters */,
11443 /// Volume::default()/* use (different) setters */,
11444 /// ]);
11445 /// ```
11446 pub fn set_volumes<T, V>(mut self, v: T) -> Self
11447 where
11448 T: std::iter::IntoIterator<Item = V>,
11449 V: std::convert::Into<crate::model::Volume>,
11450 {
11451 use std::iter::Iterator;
11452 self.volumes = v.into_iter().map(|i| i.into()).collect();
11453 self
11454 }
11455
11456 /// Sets the value of [kms_key_reference][crate::model::Resources::kms_key_reference].
11457 ///
11458 /// # Example
11459 /// ```ignore,no_run
11460 /// # use google_cloud_appengine_v1::model::Resources;
11461 /// let x = Resources::new().set_kms_key_reference("example");
11462 /// ```
11463 pub fn set_kms_key_reference<T: std::convert::Into<std::string::String>>(
11464 mut self,
11465 v: T,
11466 ) -> Self {
11467 self.kms_key_reference = v.into();
11468 self
11469 }
11470}
11471
11472impl wkt::message::Message for Resources {
11473 fn typename() -> &'static str {
11474 "type.googleapis.com/google.appengine.v1.Resources"
11475 }
11476}
11477
11478/// VPC access connector specification.
11479#[derive(Clone, Default, PartialEq)]
11480#[non_exhaustive]
11481pub struct VpcAccessConnector {
11482 /// Full Serverless VPC Access Connector name e.g.
11483 /// /projects/my-project/locations/us-central1/connectors/c1.
11484 pub name: std::string::String,
11485
11486 /// The egress setting for the connector, controlling what traffic is diverted
11487 /// through it.
11488 pub egress_setting: crate::model::vpc_access_connector::EgressSetting,
11489
11490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11491}
11492
11493impl VpcAccessConnector {
11494 /// Creates a new default instance.
11495 pub fn new() -> Self {
11496 std::default::Default::default()
11497 }
11498
11499 /// Sets the value of [name][crate::model::VpcAccessConnector::name].
11500 ///
11501 /// # Example
11502 /// ```ignore,no_run
11503 /// # use google_cloud_appengine_v1::model::VpcAccessConnector;
11504 /// let x = VpcAccessConnector::new().set_name("example");
11505 /// ```
11506 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11507 self.name = v.into();
11508 self
11509 }
11510
11511 /// Sets the value of [egress_setting][crate::model::VpcAccessConnector::egress_setting].
11512 ///
11513 /// # Example
11514 /// ```ignore,no_run
11515 /// # use google_cloud_appengine_v1::model::VpcAccessConnector;
11516 /// use google_cloud_appengine_v1::model::vpc_access_connector::EgressSetting;
11517 /// let x0 = VpcAccessConnector::new().set_egress_setting(EgressSetting::AllTraffic);
11518 /// let x1 = VpcAccessConnector::new().set_egress_setting(EgressSetting::PrivateIpRanges);
11519 /// ```
11520 pub fn set_egress_setting<
11521 T: std::convert::Into<crate::model::vpc_access_connector::EgressSetting>,
11522 >(
11523 mut self,
11524 v: T,
11525 ) -> Self {
11526 self.egress_setting = v.into();
11527 self
11528 }
11529}
11530
11531impl wkt::message::Message for VpcAccessConnector {
11532 fn typename() -> &'static str {
11533 "type.googleapis.com/google.appengine.v1.VpcAccessConnector"
11534 }
11535}
11536
11537/// Defines additional types related to [VpcAccessConnector].
11538pub mod vpc_access_connector {
11539 #[allow(unused_imports)]
11540 use super::*;
11541
11542 /// Available egress settings.
11543 ///
11544 /// This controls what traffic is diverted through the VPC Access Connector
11545 /// resource. By default PRIVATE_IP_RANGES will be used.
11546 ///
11547 /// # Working with unknown values
11548 ///
11549 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11550 /// additional enum variants at any time. Adding new variants is not considered
11551 /// a breaking change. Applications should write their code in anticipation of:
11552 ///
11553 /// - New values appearing in future releases of the client library, **and**
11554 /// - New values received dynamically, without application changes.
11555 ///
11556 /// Please consult the [Working with enums] section in the user guide for some
11557 /// guidelines.
11558 ///
11559 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11560 #[derive(Clone, Debug, PartialEq)]
11561 #[non_exhaustive]
11562 pub enum EgressSetting {
11563 #[allow(missing_docs)]
11564 Unspecified,
11565 /// Force the use of VPC Access for all egress traffic from the function.
11566 AllTraffic,
11567 /// Use the VPC Access Connector for private IP space from RFC1918.
11568 PrivateIpRanges,
11569 /// If set, the enum was initialized with an unknown value.
11570 ///
11571 /// Applications can examine the value using [EgressSetting::value] or
11572 /// [EgressSetting::name].
11573 UnknownValue(egress_setting::UnknownValue),
11574 }
11575
11576 #[doc(hidden)]
11577 pub mod egress_setting {
11578 #[allow(unused_imports)]
11579 use super::*;
11580 #[derive(Clone, Debug, PartialEq)]
11581 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11582 }
11583
11584 impl EgressSetting {
11585 /// Gets the enum value.
11586 ///
11587 /// Returns `None` if the enum contains an unknown value deserialized from
11588 /// the string representation of enums.
11589 pub fn value(&self) -> std::option::Option<i32> {
11590 match self {
11591 Self::Unspecified => std::option::Option::Some(0),
11592 Self::AllTraffic => std::option::Option::Some(1),
11593 Self::PrivateIpRanges => std::option::Option::Some(2),
11594 Self::UnknownValue(u) => u.0.value(),
11595 }
11596 }
11597
11598 /// Gets the enum value as a string.
11599 ///
11600 /// Returns `None` if the enum contains an unknown value deserialized from
11601 /// the integer representation of enums.
11602 pub fn name(&self) -> std::option::Option<&str> {
11603 match self {
11604 Self::Unspecified => std::option::Option::Some("EGRESS_SETTING_UNSPECIFIED"),
11605 Self::AllTraffic => std::option::Option::Some("ALL_TRAFFIC"),
11606 Self::PrivateIpRanges => std::option::Option::Some("PRIVATE_IP_RANGES"),
11607 Self::UnknownValue(u) => u.0.name(),
11608 }
11609 }
11610 }
11611
11612 impl std::default::Default for EgressSetting {
11613 fn default() -> Self {
11614 use std::convert::From;
11615 Self::from(0)
11616 }
11617 }
11618
11619 impl std::fmt::Display for EgressSetting {
11620 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11621 wkt::internal::display_enum(f, self.name(), self.value())
11622 }
11623 }
11624
11625 impl std::convert::From<i32> for EgressSetting {
11626 fn from(value: i32) -> Self {
11627 match value {
11628 0 => Self::Unspecified,
11629 1 => Self::AllTraffic,
11630 2 => Self::PrivateIpRanges,
11631 _ => Self::UnknownValue(egress_setting::UnknownValue(
11632 wkt::internal::UnknownEnumValue::Integer(value),
11633 )),
11634 }
11635 }
11636 }
11637
11638 impl std::convert::From<&str> for EgressSetting {
11639 fn from(value: &str) -> Self {
11640 use std::string::ToString;
11641 match value {
11642 "EGRESS_SETTING_UNSPECIFIED" => Self::Unspecified,
11643 "ALL_TRAFFIC" => Self::AllTraffic,
11644 "PRIVATE_IP_RANGES" => Self::PrivateIpRanges,
11645 _ => Self::UnknownValue(egress_setting::UnknownValue(
11646 wkt::internal::UnknownEnumValue::String(value.to_string()),
11647 )),
11648 }
11649 }
11650 }
11651
11652 impl serde::ser::Serialize for EgressSetting {
11653 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11654 where
11655 S: serde::Serializer,
11656 {
11657 match self {
11658 Self::Unspecified => serializer.serialize_i32(0),
11659 Self::AllTraffic => serializer.serialize_i32(1),
11660 Self::PrivateIpRanges => serializer.serialize_i32(2),
11661 Self::UnknownValue(u) => u.0.serialize(serializer),
11662 }
11663 }
11664 }
11665
11666 impl<'de> serde::de::Deserialize<'de> for EgressSetting {
11667 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11668 where
11669 D: serde::Deserializer<'de>,
11670 {
11671 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EgressSetting>::new(
11672 ".google.appengine.v1.VpcAccessConnector.EgressSetting",
11673 ))
11674 }
11675 }
11676}
11677
11678/// The entrypoint for the application.
11679#[derive(Clone, Default, PartialEq)]
11680#[non_exhaustive]
11681pub struct Entrypoint {
11682 /// The command to run.
11683 pub command: std::option::Option<crate::model::entrypoint::Command>,
11684
11685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11686}
11687
11688impl Entrypoint {
11689 /// Creates a new default instance.
11690 pub fn new() -> Self {
11691 std::default::Default::default()
11692 }
11693
11694 /// Sets the value of [command][crate::model::Entrypoint::command].
11695 ///
11696 /// Note that all the setters affecting `command` are mutually
11697 /// exclusive.
11698 ///
11699 /// # Example
11700 /// ```ignore,no_run
11701 /// # use google_cloud_appengine_v1::model::Entrypoint;
11702 /// use google_cloud_appengine_v1::model::entrypoint::Command;
11703 /// let x = Entrypoint::new().set_command(Some(Command::Shell("example".to_string())));
11704 /// ```
11705 pub fn set_command<
11706 T: std::convert::Into<std::option::Option<crate::model::entrypoint::Command>>,
11707 >(
11708 mut self,
11709 v: T,
11710 ) -> Self {
11711 self.command = v.into();
11712 self
11713 }
11714
11715 /// The value of [command][crate::model::Entrypoint::command]
11716 /// if it holds a `Shell`, `None` if the field is not set or
11717 /// holds a different branch.
11718 pub fn shell(&self) -> std::option::Option<&std::string::String> {
11719 #[allow(unreachable_patterns)]
11720 self.command.as_ref().and_then(|v| match v {
11721 crate::model::entrypoint::Command::Shell(v) => std::option::Option::Some(v),
11722 _ => std::option::Option::None,
11723 })
11724 }
11725
11726 /// Sets the value of [command][crate::model::Entrypoint::command]
11727 /// to hold a `Shell`.
11728 ///
11729 /// Note that all the setters affecting `command` are
11730 /// mutually exclusive.
11731 ///
11732 /// # Example
11733 /// ```ignore,no_run
11734 /// # use google_cloud_appengine_v1::model::Entrypoint;
11735 /// let x = Entrypoint::new().set_shell("example");
11736 /// assert!(x.shell().is_some());
11737 /// ```
11738 pub fn set_shell<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11739 self.command =
11740 std::option::Option::Some(crate::model::entrypoint::Command::Shell(v.into()));
11741 self
11742 }
11743}
11744
11745impl wkt::message::Message for Entrypoint {
11746 fn typename() -> &'static str {
11747 "type.googleapis.com/google.appengine.v1.Entrypoint"
11748 }
11749}
11750
11751/// Defines additional types related to [Entrypoint].
11752pub mod entrypoint {
11753 #[allow(unused_imports)]
11754 use super::*;
11755
11756 /// The command to run.
11757 #[derive(Clone, Debug, PartialEq)]
11758 #[non_exhaustive]
11759 pub enum Command {
11760 /// The format should be a shell command that can be fed to `bash -c`.
11761 Shell(std::string::String),
11762 }
11763}
11764
11765/// Actions to take when the user is not logged in.
11766///
11767/// # Working with unknown values
11768///
11769/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11770/// additional enum variants at any time. Adding new variants is not considered
11771/// a breaking change. Applications should write their code in anticipation of:
11772///
11773/// - New values appearing in future releases of the client library, **and**
11774/// - New values received dynamically, without application changes.
11775///
11776/// Please consult the [Working with enums] section in the user guide for some
11777/// guidelines.
11778///
11779/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11780#[derive(Clone, Debug, PartialEq)]
11781#[non_exhaustive]
11782pub enum AuthFailAction {
11783 /// Not specified. `AUTH_FAIL_ACTION_REDIRECT` is assumed.
11784 Unspecified,
11785 /// Redirects user to "accounts.google.com". The user is redirected back to the
11786 /// application URL after signing in or creating an account.
11787 Redirect,
11788 /// Rejects request with a `401` HTTP status code and an error
11789 /// message.
11790 Unauthorized,
11791 /// If set, the enum was initialized with an unknown value.
11792 ///
11793 /// Applications can examine the value using [AuthFailAction::value] or
11794 /// [AuthFailAction::name].
11795 UnknownValue(auth_fail_action::UnknownValue),
11796}
11797
11798#[doc(hidden)]
11799pub mod auth_fail_action {
11800 #[allow(unused_imports)]
11801 use super::*;
11802 #[derive(Clone, Debug, PartialEq)]
11803 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11804}
11805
11806impl AuthFailAction {
11807 /// Gets the enum value.
11808 ///
11809 /// Returns `None` if the enum contains an unknown value deserialized from
11810 /// the string representation of enums.
11811 pub fn value(&self) -> std::option::Option<i32> {
11812 match self {
11813 Self::Unspecified => std::option::Option::Some(0),
11814 Self::Redirect => std::option::Option::Some(1),
11815 Self::Unauthorized => std::option::Option::Some(2),
11816 Self::UnknownValue(u) => u.0.value(),
11817 }
11818 }
11819
11820 /// Gets the enum value as a string.
11821 ///
11822 /// Returns `None` if the enum contains an unknown value deserialized from
11823 /// the integer representation of enums.
11824 pub fn name(&self) -> std::option::Option<&str> {
11825 match self {
11826 Self::Unspecified => std::option::Option::Some("AUTH_FAIL_ACTION_UNSPECIFIED"),
11827 Self::Redirect => std::option::Option::Some("AUTH_FAIL_ACTION_REDIRECT"),
11828 Self::Unauthorized => std::option::Option::Some("AUTH_FAIL_ACTION_UNAUTHORIZED"),
11829 Self::UnknownValue(u) => u.0.name(),
11830 }
11831 }
11832}
11833
11834impl std::default::Default for AuthFailAction {
11835 fn default() -> Self {
11836 use std::convert::From;
11837 Self::from(0)
11838 }
11839}
11840
11841impl std::fmt::Display for AuthFailAction {
11842 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11843 wkt::internal::display_enum(f, self.name(), self.value())
11844 }
11845}
11846
11847impl std::convert::From<i32> for AuthFailAction {
11848 fn from(value: i32) -> Self {
11849 match value {
11850 0 => Self::Unspecified,
11851 1 => Self::Redirect,
11852 2 => Self::Unauthorized,
11853 _ => Self::UnknownValue(auth_fail_action::UnknownValue(
11854 wkt::internal::UnknownEnumValue::Integer(value),
11855 )),
11856 }
11857 }
11858}
11859
11860impl std::convert::From<&str> for AuthFailAction {
11861 fn from(value: &str) -> Self {
11862 use std::string::ToString;
11863 match value {
11864 "AUTH_FAIL_ACTION_UNSPECIFIED" => Self::Unspecified,
11865 "AUTH_FAIL_ACTION_REDIRECT" => Self::Redirect,
11866 "AUTH_FAIL_ACTION_UNAUTHORIZED" => Self::Unauthorized,
11867 _ => Self::UnknownValue(auth_fail_action::UnknownValue(
11868 wkt::internal::UnknownEnumValue::String(value.to_string()),
11869 )),
11870 }
11871 }
11872}
11873
11874impl serde::ser::Serialize for AuthFailAction {
11875 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11876 where
11877 S: serde::Serializer,
11878 {
11879 match self {
11880 Self::Unspecified => serializer.serialize_i32(0),
11881 Self::Redirect => serializer.serialize_i32(1),
11882 Self::Unauthorized => serializer.serialize_i32(2),
11883 Self::UnknownValue(u) => u.0.serialize(serializer),
11884 }
11885 }
11886}
11887
11888impl<'de> serde::de::Deserialize<'de> for AuthFailAction {
11889 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11890 where
11891 D: serde::Deserializer<'de>,
11892 {
11893 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthFailAction>::new(
11894 ".google.appengine.v1.AuthFailAction",
11895 ))
11896 }
11897}
11898
11899/// Methods to restrict access to a URL based on login status.
11900///
11901/// # Working with unknown values
11902///
11903/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11904/// additional enum variants at any time. Adding new variants is not considered
11905/// a breaking change. Applications should write their code in anticipation of:
11906///
11907/// - New values appearing in future releases of the client library, **and**
11908/// - New values received dynamically, without application changes.
11909///
11910/// Please consult the [Working with enums] section in the user guide for some
11911/// guidelines.
11912///
11913/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11914#[derive(Clone, Debug, PartialEq)]
11915#[non_exhaustive]
11916pub enum LoginRequirement {
11917 /// Not specified. `LOGIN_OPTIONAL` is assumed.
11918 LoginUnspecified,
11919 /// Does not require that the user is signed in.
11920 LoginOptional,
11921 /// If the user is not signed in, the `auth_fail_action` is taken.
11922 /// In addition, if the user is not an administrator for the
11923 /// application, they are given an error message regardless of
11924 /// `auth_fail_action`. If the user is an administrator, the handler
11925 /// proceeds.
11926 LoginAdmin,
11927 /// If the user has signed in, the handler proceeds normally. Otherwise, the
11928 /// auth_fail_action is taken.
11929 LoginRequired,
11930 /// If set, the enum was initialized with an unknown value.
11931 ///
11932 /// Applications can examine the value using [LoginRequirement::value] or
11933 /// [LoginRequirement::name].
11934 UnknownValue(login_requirement::UnknownValue),
11935}
11936
11937#[doc(hidden)]
11938pub mod login_requirement {
11939 #[allow(unused_imports)]
11940 use super::*;
11941 #[derive(Clone, Debug, PartialEq)]
11942 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11943}
11944
11945impl LoginRequirement {
11946 /// Gets the enum value.
11947 ///
11948 /// Returns `None` if the enum contains an unknown value deserialized from
11949 /// the string representation of enums.
11950 pub fn value(&self) -> std::option::Option<i32> {
11951 match self {
11952 Self::LoginUnspecified => std::option::Option::Some(0),
11953 Self::LoginOptional => std::option::Option::Some(1),
11954 Self::LoginAdmin => std::option::Option::Some(2),
11955 Self::LoginRequired => std::option::Option::Some(3),
11956 Self::UnknownValue(u) => u.0.value(),
11957 }
11958 }
11959
11960 /// Gets the enum value as a string.
11961 ///
11962 /// Returns `None` if the enum contains an unknown value deserialized from
11963 /// the integer representation of enums.
11964 pub fn name(&self) -> std::option::Option<&str> {
11965 match self {
11966 Self::LoginUnspecified => std::option::Option::Some("LOGIN_UNSPECIFIED"),
11967 Self::LoginOptional => std::option::Option::Some("LOGIN_OPTIONAL"),
11968 Self::LoginAdmin => std::option::Option::Some("LOGIN_ADMIN"),
11969 Self::LoginRequired => std::option::Option::Some("LOGIN_REQUIRED"),
11970 Self::UnknownValue(u) => u.0.name(),
11971 }
11972 }
11973}
11974
11975impl std::default::Default for LoginRequirement {
11976 fn default() -> Self {
11977 use std::convert::From;
11978 Self::from(0)
11979 }
11980}
11981
11982impl std::fmt::Display for LoginRequirement {
11983 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11984 wkt::internal::display_enum(f, self.name(), self.value())
11985 }
11986}
11987
11988impl std::convert::From<i32> for LoginRequirement {
11989 fn from(value: i32) -> Self {
11990 match value {
11991 0 => Self::LoginUnspecified,
11992 1 => Self::LoginOptional,
11993 2 => Self::LoginAdmin,
11994 3 => Self::LoginRequired,
11995 _ => Self::UnknownValue(login_requirement::UnknownValue(
11996 wkt::internal::UnknownEnumValue::Integer(value),
11997 )),
11998 }
11999 }
12000}
12001
12002impl std::convert::From<&str> for LoginRequirement {
12003 fn from(value: &str) -> Self {
12004 use std::string::ToString;
12005 match value {
12006 "LOGIN_UNSPECIFIED" => Self::LoginUnspecified,
12007 "LOGIN_OPTIONAL" => Self::LoginOptional,
12008 "LOGIN_ADMIN" => Self::LoginAdmin,
12009 "LOGIN_REQUIRED" => Self::LoginRequired,
12010 _ => Self::UnknownValue(login_requirement::UnknownValue(
12011 wkt::internal::UnknownEnumValue::String(value.to_string()),
12012 )),
12013 }
12014 }
12015}
12016
12017impl serde::ser::Serialize for LoginRequirement {
12018 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12019 where
12020 S: serde::Serializer,
12021 {
12022 match self {
12023 Self::LoginUnspecified => serializer.serialize_i32(0),
12024 Self::LoginOptional => serializer.serialize_i32(1),
12025 Self::LoginAdmin => serializer.serialize_i32(2),
12026 Self::LoginRequired => serializer.serialize_i32(3),
12027 Self::UnknownValue(u) => u.0.serialize(serializer),
12028 }
12029 }
12030}
12031
12032impl<'de> serde::de::Deserialize<'de> for LoginRequirement {
12033 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12034 where
12035 D: serde::Deserializer<'de>,
12036 {
12037 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoginRequirement>::new(
12038 ".google.appengine.v1.LoginRequirement",
12039 ))
12040 }
12041}
12042
12043/// Methods to enforce security (HTTPS) on a URL.
12044///
12045/// # Working with unknown values
12046///
12047/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12048/// additional enum variants at any time. Adding new variants is not considered
12049/// a breaking change. Applications should write their code in anticipation of:
12050///
12051/// - New values appearing in future releases of the client library, **and**
12052/// - New values received dynamically, without application changes.
12053///
12054/// Please consult the [Working with enums] section in the user guide for some
12055/// guidelines.
12056///
12057/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12058#[derive(Clone, Debug, PartialEq)]
12059#[non_exhaustive]
12060pub enum SecurityLevel {
12061 /// Not specified.
12062 SecureUnspecified,
12063 /// Both HTTP and HTTPS requests with URLs that match the handler succeed
12064 /// without redirects. The application can examine the request to determine
12065 /// which protocol was used, and respond accordingly.
12066 SecureDefault,
12067 /// Requests for a URL that match this handler that use HTTPS are automatically
12068 /// redirected to the HTTP equivalent URL.
12069 SecureNever,
12070 /// Both HTTP and HTTPS requests with URLs that match the handler succeed
12071 /// without redirects. The application can examine the request to determine
12072 /// which protocol was used and respond accordingly.
12073 SecureOptional,
12074 /// Requests for a URL that match this handler that do not use HTTPS are
12075 /// automatically redirected to the HTTPS URL with the same path. Query
12076 /// parameters are reserved for the redirect.
12077 SecureAlways,
12078 /// If set, the enum was initialized with an unknown value.
12079 ///
12080 /// Applications can examine the value using [SecurityLevel::value] or
12081 /// [SecurityLevel::name].
12082 UnknownValue(security_level::UnknownValue),
12083}
12084
12085#[doc(hidden)]
12086pub mod security_level {
12087 #[allow(unused_imports)]
12088 use super::*;
12089 #[derive(Clone, Debug, PartialEq)]
12090 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12091}
12092
12093impl SecurityLevel {
12094 /// Gets the enum value.
12095 ///
12096 /// Returns `None` if the enum contains an unknown value deserialized from
12097 /// the string representation of enums.
12098 pub fn value(&self) -> std::option::Option<i32> {
12099 match self {
12100 Self::SecureUnspecified => std::option::Option::Some(0),
12101 Self::SecureDefault => std::option::Option::Some(0),
12102 Self::SecureNever => std::option::Option::Some(1),
12103 Self::SecureOptional => std::option::Option::Some(2),
12104 Self::SecureAlways => std::option::Option::Some(3),
12105 Self::UnknownValue(u) => u.0.value(),
12106 }
12107 }
12108
12109 /// Gets the enum value as a string.
12110 ///
12111 /// Returns `None` if the enum contains an unknown value deserialized from
12112 /// the integer representation of enums.
12113 pub fn name(&self) -> std::option::Option<&str> {
12114 match self {
12115 Self::SecureUnspecified => std::option::Option::Some("SECURE_UNSPECIFIED"),
12116 Self::SecureDefault => std::option::Option::Some("SECURE_DEFAULT"),
12117 Self::SecureNever => std::option::Option::Some("SECURE_NEVER"),
12118 Self::SecureOptional => std::option::Option::Some("SECURE_OPTIONAL"),
12119 Self::SecureAlways => std::option::Option::Some("SECURE_ALWAYS"),
12120 Self::UnknownValue(u) => u.0.name(),
12121 }
12122 }
12123}
12124
12125impl std::default::Default for SecurityLevel {
12126 fn default() -> Self {
12127 use std::convert::From;
12128 Self::from(0)
12129 }
12130}
12131
12132impl std::fmt::Display for SecurityLevel {
12133 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12134 wkt::internal::display_enum(f, self.name(), self.value())
12135 }
12136}
12137
12138impl std::convert::From<i32> for SecurityLevel {
12139 fn from(value: i32) -> Self {
12140 match value {
12141 0 => Self::SecureDefault,
12142 1 => Self::SecureNever,
12143 2 => Self::SecureOptional,
12144 3 => Self::SecureAlways,
12145 _ => Self::UnknownValue(security_level::UnknownValue(
12146 wkt::internal::UnknownEnumValue::Integer(value),
12147 )),
12148 }
12149 }
12150}
12151
12152impl std::convert::From<&str> for SecurityLevel {
12153 fn from(value: &str) -> Self {
12154 use std::string::ToString;
12155 match value {
12156 "SECURE_UNSPECIFIED" => Self::SecureUnspecified,
12157 "SECURE_DEFAULT" => Self::SecureDefault,
12158 "SECURE_NEVER" => Self::SecureNever,
12159 "SECURE_OPTIONAL" => Self::SecureOptional,
12160 "SECURE_ALWAYS" => Self::SecureAlways,
12161 _ => Self::UnknownValue(security_level::UnknownValue(
12162 wkt::internal::UnknownEnumValue::String(value.to_string()),
12163 )),
12164 }
12165 }
12166}
12167
12168impl serde::ser::Serialize for SecurityLevel {
12169 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12170 where
12171 S: serde::Serializer,
12172 {
12173 match self {
12174 Self::SecureUnspecified => serializer.serialize_i32(0),
12175 Self::SecureDefault => serializer.serialize_i32(0),
12176 Self::SecureNever => serializer.serialize_i32(1),
12177 Self::SecureOptional => serializer.serialize_i32(2),
12178 Self::SecureAlways => serializer.serialize_i32(3),
12179 Self::UnknownValue(u) => u.0.serialize(serializer),
12180 }
12181 }
12182}
12183
12184impl<'de> serde::de::Deserialize<'de> for SecurityLevel {
12185 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12186 where
12187 D: serde::Deserializer<'de>,
12188 {
12189 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityLevel>::new(
12190 ".google.appengine.v1.SecurityLevel",
12191 ))
12192 }
12193}
12194
12195/// Fields that should be returned when [Version][google.appengine.v1.Version] resources
12196/// are retrieved.
12197///
12198/// [google.appengine.v1.Version]: crate::model::Version
12199///
12200/// # Working with unknown values
12201///
12202/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12203/// additional enum variants at any time. Adding new variants is not considered
12204/// a breaking change. Applications should write their code in anticipation of:
12205///
12206/// - New values appearing in future releases of the client library, **and**
12207/// - New values received dynamically, without application changes.
12208///
12209/// Please consult the [Working with enums] section in the user guide for some
12210/// guidelines.
12211///
12212/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12213#[derive(Clone, Debug, PartialEq)]
12214#[non_exhaustive]
12215pub enum VersionView {
12216 /// Basic version information including scaling and inbound services,
12217 /// but not detailed deployment information.
12218 Basic,
12219 /// The information from `BASIC`, plus detailed information about the
12220 /// deployment. This format is required when creating resources, but
12221 /// is not returned in `Get` or `List` by default.
12222 Full,
12223 /// If set, the enum was initialized with an unknown value.
12224 ///
12225 /// Applications can examine the value using [VersionView::value] or
12226 /// [VersionView::name].
12227 UnknownValue(version_view::UnknownValue),
12228}
12229
12230#[doc(hidden)]
12231pub mod version_view {
12232 #[allow(unused_imports)]
12233 use super::*;
12234 #[derive(Clone, Debug, PartialEq)]
12235 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12236}
12237
12238impl VersionView {
12239 /// Gets the enum value.
12240 ///
12241 /// Returns `None` if the enum contains an unknown value deserialized from
12242 /// the string representation of enums.
12243 pub fn value(&self) -> std::option::Option<i32> {
12244 match self {
12245 Self::Basic => std::option::Option::Some(0),
12246 Self::Full => std::option::Option::Some(1),
12247 Self::UnknownValue(u) => u.0.value(),
12248 }
12249 }
12250
12251 /// Gets the enum value as a string.
12252 ///
12253 /// Returns `None` if the enum contains an unknown value deserialized from
12254 /// the integer representation of enums.
12255 pub fn name(&self) -> std::option::Option<&str> {
12256 match self {
12257 Self::Basic => std::option::Option::Some("BASIC"),
12258 Self::Full => std::option::Option::Some("FULL"),
12259 Self::UnknownValue(u) => u.0.name(),
12260 }
12261 }
12262}
12263
12264impl std::default::Default for VersionView {
12265 fn default() -> Self {
12266 use std::convert::From;
12267 Self::from(0)
12268 }
12269}
12270
12271impl std::fmt::Display for VersionView {
12272 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12273 wkt::internal::display_enum(f, self.name(), self.value())
12274 }
12275}
12276
12277impl std::convert::From<i32> for VersionView {
12278 fn from(value: i32) -> Self {
12279 match value {
12280 0 => Self::Basic,
12281 1 => Self::Full,
12282 _ => Self::UnknownValue(version_view::UnknownValue(
12283 wkt::internal::UnknownEnumValue::Integer(value),
12284 )),
12285 }
12286 }
12287}
12288
12289impl std::convert::From<&str> for VersionView {
12290 fn from(value: &str) -> Self {
12291 use std::string::ToString;
12292 match value {
12293 "BASIC" => Self::Basic,
12294 "FULL" => Self::Full,
12295 _ => Self::UnknownValue(version_view::UnknownValue(
12296 wkt::internal::UnknownEnumValue::String(value.to_string()),
12297 )),
12298 }
12299 }
12300}
12301
12302impl serde::ser::Serialize for VersionView {
12303 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12304 where
12305 S: serde::Serializer,
12306 {
12307 match self {
12308 Self::Basic => serializer.serialize_i32(0),
12309 Self::Full => serializer.serialize_i32(1),
12310 Self::UnknownValue(u) => u.0.serialize(serializer),
12311 }
12312 }
12313}
12314
12315impl<'de> serde::de::Deserialize<'de> for VersionView {
12316 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12317 where
12318 D: serde::Deserializer<'de>,
12319 {
12320 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VersionView>::new(
12321 ".google.appengine.v1.VersionView",
12322 ))
12323 }
12324}
12325
12326/// Fields that should be returned when an AuthorizedCertificate resource is
12327/// retrieved.
12328///
12329/// # Working with unknown values
12330///
12331/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12332/// additional enum variants at any time. Adding new variants is not considered
12333/// a breaking change. Applications should write their code in anticipation of:
12334///
12335/// - New values appearing in future releases of the client library, **and**
12336/// - New values received dynamically, without application changes.
12337///
12338/// Please consult the [Working with enums] section in the user guide for some
12339/// guidelines.
12340///
12341/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12342#[derive(Clone, Debug, PartialEq)]
12343#[non_exhaustive]
12344pub enum AuthorizedCertificateView {
12345 /// Basic certificate information, including applicable domains and expiration
12346 /// date.
12347 BasicCertificate,
12348 /// The information from `BASIC_CERTIFICATE`, plus detailed information on the
12349 /// domain mappings that have this certificate mapped.
12350 FullCertificate,
12351 /// If set, the enum was initialized with an unknown value.
12352 ///
12353 /// Applications can examine the value using [AuthorizedCertificateView::value] or
12354 /// [AuthorizedCertificateView::name].
12355 UnknownValue(authorized_certificate_view::UnknownValue),
12356}
12357
12358#[doc(hidden)]
12359pub mod authorized_certificate_view {
12360 #[allow(unused_imports)]
12361 use super::*;
12362 #[derive(Clone, Debug, PartialEq)]
12363 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12364}
12365
12366impl AuthorizedCertificateView {
12367 /// Gets the enum value.
12368 ///
12369 /// Returns `None` if the enum contains an unknown value deserialized from
12370 /// the string representation of enums.
12371 pub fn value(&self) -> std::option::Option<i32> {
12372 match self {
12373 Self::BasicCertificate => std::option::Option::Some(0),
12374 Self::FullCertificate => std::option::Option::Some(1),
12375 Self::UnknownValue(u) => u.0.value(),
12376 }
12377 }
12378
12379 /// Gets the enum value as a string.
12380 ///
12381 /// Returns `None` if the enum contains an unknown value deserialized from
12382 /// the integer representation of enums.
12383 pub fn name(&self) -> std::option::Option<&str> {
12384 match self {
12385 Self::BasicCertificate => std::option::Option::Some("BASIC_CERTIFICATE"),
12386 Self::FullCertificate => std::option::Option::Some("FULL_CERTIFICATE"),
12387 Self::UnknownValue(u) => u.0.name(),
12388 }
12389 }
12390}
12391
12392impl std::default::Default for AuthorizedCertificateView {
12393 fn default() -> Self {
12394 use std::convert::From;
12395 Self::from(0)
12396 }
12397}
12398
12399impl std::fmt::Display for AuthorizedCertificateView {
12400 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12401 wkt::internal::display_enum(f, self.name(), self.value())
12402 }
12403}
12404
12405impl std::convert::From<i32> for AuthorizedCertificateView {
12406 fn from(value: i32) -> Self {
12407 match value {
12408 0 => Self::BasicCertificate,
12409 1 => Self::FullCertificate,
12410 _ => Self::UnknownValue(authorized_certificate_view::UnknownValue(
12411 wkt::internal::UnknownEnumValue::Integer(value),
12412 )),
12413 }
12414 }
12415}
12416
12417impl std::convert::From<&str> for AuthorizedCertificateView {
12418 fn from(value: &str) -> Self {
12419 use std::string::ToString;
12420 match value {
12421 "BASIC_CERTIFICATE" => Self::BasicCertificate,
12422 "FULL_CERTIFICATE" => Self::FullCertificate,
12423 _ => Self::UnknownValue(authorized_certificate_view::UnknownValue(
12424 wkt::internal::UnknownEnumValue::String(value.to_string()),
12425 )),
12426 }
12427 }
12428}
12429
12430impl serde::ser::Serialize for AuthorizedCertificateView {
12431 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12432 where
12433 S: serde::Serializer,
12434 {
12435 match self {
12436 Self::BasicCertificate => serializer.serialize_i32(0),
12437 Self::FullCertificate => serializer.serialize_i32(1),
12438 Self::UnknownValue(u) => u.0.serialize(serializer),
12439 }
12440 }
12441}
12442
12443impl<'de> serde::de::Deserialize<'de> for AuthorizedCertificateView {
12444 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12445 where
12446 D: serde::Deserializer<'de>,
12447 {
12448 deserializer.deserialize_any(
12449 wkt::internal::EnumVisitor::<AuthorizedCertificateView>::new(
12450 ".google.appengine.v1.AuthorizedCertificateView",
12451 ),
12452 )
12453 }
12454}
12455
12456/// Override strategy for mutating an existing mapping.
12457///
12458/// # Working with unknown values
12459///
12460/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12461/// additional enum variants at any time. Adding new variants is not considered
12462/// a breaking change. Applications should write their code in anticipation of:
12463///
12464/// - New values appearing in future releases of the client library, **and**
12465/// - New values received dynamically, without application changes.
12466///
12467/// Please consult the [Working with enums] section in the user guide for some
12468/// guidelines.
12469///
12470/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12471#[derive(Clone, Debug, PartialEq)]
12472#[non_exhaustive]
12473pub enum DomainOverrideStrategy {
12474 /// Strategy unspecified. Defaults to `STRICT`.
12475 UnspecifiedDomainOverrideStrategy,
12476 /// Overrides not allowed. If a mapping already exists for the
12477 /// specified domain, the request will return an ALREADY_EXISTS (409).
12478 Strict,
12479 /// Overrides allowed. If a mapping already exists for the specified domain,
12480 /// the request will overwrite it. Note that this might stop another
12481 /// Google product from serving. For example, if the domain is
12482 /// mapped to another App Engine application, that app will no
12483 /// longer serve from that domain.
12484 Override,
12485 /// If set, the enum was initialized with an unknown value.
12486 ///
12487 /// Applications can examine the value using [DomainOverrideStrategy::value] or
12488 /// [DomainOverrideStrategy::name].
12489 UnknownValue(domain_override_strategy::UnknownValue),
12490}
12491
12492#[doc(hidden)]
12493pub mod domain_override_strategy {
12494 #[allow(unused_imports)]
12495 use super::*;
12496 #[derive(Clone, Debug, PartialEq)]
12497 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12498}
12499
12500impl DomainOverrideStrategy {
12501 /// Gets the enum value.
12502 ///
12503 /// Returns `None` if the enum contains an unknown value deserialized from
12504 /// the string representation of enums.
12505 pub fn value(&self) -> std::option::Option<i32> {
12506 match self {
12507 Self::UnspecifiedDomainOverrideStrategy => std::option::Option::Some(0),
12508 Self::Strict => std::option::Option::Some(1),
12509 Self::Override => std::option::Option::Some(2),
12510 Self::UnknownValue(u) => u.0.value(),
12511 }
12512 }
12513
12514 /// Gets the enum value as a string.
12515 ///
12516 /// Returns `None` if the enum contains an unknown value deserialized from
12517 /// the integer representation of enums.
12518 pub fn name(&self) -> std::option::Option<&str> {
12519 match self {
12520 Self::UnspecifiedDomainOverrideStrategy => {
12521 std::option::Option::Some("UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY")
12522 }
12523 Self::Strict => std::option::Option::Some("STRICT"),
12524 Self::Override => std::option::Option::Some("OVERRIDE"),
12525 Self::UnknownValue(u) => u.0.name(),
12526 }
12527 }
12528}
12529
12530impl std::default::Default for DomainOverrideStrategy {
12531 fn default() -> Self {
12532 use std::convert::From;
12533 Self::from(0)
12534 }
12535}
12536
12537impl std::fmt::Display for DomainOverrideStrategy {
12538 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12539 wkt::internal::display_enum(f, self.name(), self.value())
12540 }
12541}
12542
12543impl std::convert::From<i32> for DomainOverrideStrategy {
12544 fn from(value: i32) -> Self {
12545 match value {
12546 0 => Self::UnspecifiedDomainOverrideStrategy,
12547 1 => Self::Strict,
12548 2 => Self::Override,
12549 _ => Self::UnknownValue(domain_override_strategy::UnknownValue(
12550 wkt::internal::UnknownEnumValue::Integer(value),
12551 )),
12552 }
12553 }
12554}
12555
12556impl std::convert::From<&str> for DomainOverrideStrategy {
12557 fn from(value: &str) -> Self {
12558 use std::string::ToString;
12559 match value {
12560 "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY" => Self::UnspecifiedDomainOverrideStrategy,
12561 "STRICT" => Self::Strict,
12562 "OVERRIDE" => Self::Override,
12563 _ => Self::UnknownValue(domain_override_strategy::UnknownValue(
12564 wkt::internal::UnknownEnumValue::String(value.to_string()),
12565 )),
12566 }
12567 }
12568}
12569
12570impl serde::ser::Serialize for DomainOverrideStrategy {
12571 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12572 where
12573 S: serde::Serializer,
12574 {
12575 match self {
12576 Self::UnspecifiedDomainOverrideStrategy => serializer.serialize_i32(0),
12577 Self::Strict => serializer.serialize_i32(1),
12578 Self::Override => serializer.serialize_i32(2),
12579 Self::UnknownValue(u) => u.0.serialize(serializer),
12580 }
12581 }
12582}
12583
12584impl<'de> serde::de::Deserialize<'de> for DomainOverrideStrategy {
12585 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12586 where
12587 D: serde::Deserializer<'de>,
12588 {
12589 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DomainOverrideStrategy>::new(
12590 ".google.appengine.v1.DomainOverrideStrategy",
12591 ))
12592 }
12593}
12594
12595/// State of certificate management. Refers to the most recent certificate
12596/// acquisition or renewal attempt.
12597///
12598/// # Working with unknown values
12599///
12600/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12601/// additional enum variants at any time. Adding new variants is not considered
12602/// a breaking change. Applications should write their code in anticipation of:
12603///
12604/// - New values appearing in future releases of the client library, **and**
12605/// - New values received dynamically, without application changes.
12606///
12607/// Please consult the [Working with enums] section in the user guide for some
12608/// guidelines.
12609///
12610/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12611#[derive(Clone, Debug, PartialEq)]
12612#[non_exhaustive]
12613pub enum ManagementStatus {
12614 #[allow(missing_docs)]
12615 Unspecified,
12616 /// Certificate was successfully obtained and inserted into the serving
12617 /// system.
12618 Ok,
12619 /// Certificate is under active attempts to acquire or renew.
12620 Pending,
12621 /// Most recent renewal failed due to an invalid DNS setup and will be
12622 /// retried. Renewal attempts will continue to fail until the certificate
12623 /// domain's DNS configuration is fixed. The last successfully provisioned
12624 /// certificate may still be serving.
12625 FailedRetryingNotVisible,
12626 /// All renewal attempts have been exhausted, likely due to an invalid DNS
12627 /// setup.
12628 FailedPermanent,
12629 /// Most recent renewal failed due to an explicit CAA record that does not
12630 /// include one of the in-use CAs (Google CA and Let's Encrypt). Renewals will
12631 /// continue to fail until the CAA is reconfigured. The last successfully
12632 /// provisioned certificate may still be serving.
12633 FailedRetryingCaaForbidden,
12634 /// Most recent renewal failed due to a CAA retrieval failure. This means that
12635 /// the domain's DNS provider does not properly handle CAA records, failing
12636 /// requests for CAA records when no CAA records are defined. Renewals will
12637 /// continue to fail until the DNS provider is changed or a CAA record is
12638 /// added for the given domain. The last successfully provisioned certificate
12639 /// may still be serving.
12640 FailedRetryingCaaChecking,
12641 /// If set, the enum was initialized with an unknown value.
12642 ///
12643 /// Applications can examine the value using [ManagementStatus::value] or
12644 /// [ManagementStatus::name].
12645 UnknownValue(management_status::UnknownValue),
12646}
12647
12648#[doc(hidden)]
12649pub mod management_status {
12650 #[allow(unused_imports)]
12651 use super::*;
12652 #[derive(Clone, Debug, PartialEq)]
12653 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12654}
12655
12656impl ManagementStatus {
12657 /// Gets the enum value.
12658 ///
12659 /// Returns `None` if the enum contains an unknown value deserialized from
12660 /// the string representation of enums.
12661 pub fn value(&self) -> std::option::Option<i32> {
12662 match self {
12663 Self::Unspecified => std::option::Option::Some(0),
12664 Self::Ok => std::option::Option::Some(1),
12665 Self::Pending => std::option::Option::Some(2),
12666 Self::FailedRetryingNotVisible => std::option::Option::Some(4),
12667 Self::FailedPermanent => std::option::Option::Some(6),
12668 Self::FailedRetryingCaaForbidden => std::option::Option::Some(7),
12669 Self::FailedRetryingCaaChecking => std::option::Option::Some(8),
12670 Self::UnknownValue(u) => u.0.value(),
12671 }
12672 }
12673
12674 /// Gets the enum value as a string.
12675 ///
12676 /// Returns `None` if the enum contains an unknown value deserialized from
12677 /// the integer representation of enums.
12678 pub fn name(&self) -> std::option::Option<&str> {
12679 match self {
12680 Self::Unspecified => std::option::Option::Some("MANAGEMENT_STATUS_UNSPECIFIED"),
12681 Self::Ok => std::option::Option::Some("OK"),
12682 Self::Pending => std::option::Option::Some("PENDING"),
12683 Self::FailedRetryingNotVisible => {
12684 std::option::Option::Some("FAILED_RETRYING_NOT_VISIBLE")
12685 }
12686 Self::FailedPermanent => std::option::Option::Some("FAILED_PERMANENT"),
12687 Self::FailedRetryingCaaForbidden => {
12688 std::option::Option::Some("FAILED_RETRYING_CAA_FORBIDDEN")
12689 }
12690 Self::FailedRetryingCaaChecking => {
12691 std::option::Option::Some("FAILED_RETRYING_CAA_CHECKING")
12692 }
12693 Self::UnknownValue(u) => u.0.name(),
12694 }
12695 }
12696}
12697
12698impl std::default::Default for ManagementStatus {
12699 fn default() -> Self {
12700 use std::convert::From;
12701 Self::from(0)
12702 }
12703}
12704
12705impl std::fmt::Display for ManagementStatus {
12706 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12707 wkt::internal::display_enum(f, self.name(), self.value())
12708 }
12709}
12710
12711impl std::convert::From<i32> for ManagementStatus {
12712 fn from(value: i32) -> Self {
12713 match value {
12714 0 => Self::Unspecified,
12715 1 => Self::Ok,
12716 2 => Self::Pending,
12717 4 => Self::FailedRetryingNotVisible,
12718 6 => Self::FailedPermanent,
12719 7 => Self::FailedRetryingCaaForbidden,
12720 8 => Self::FailedRetryingCaaChecking,
12721 _ => Self::UnknownValue(management_status::UnknownValue(
12722 wkt::internal::UnknownEnumValue::Integer(value),
12723 )),
12724 }
12725 }
12726}
12727
12728impl std::convert::From<&str> for ManagementStatus {
12729 fn from(value: &str) -> Self {
12730 use std::string::ToString;
12731 match value {
12732 "MANAGEMENT_STATUS_UNSPECIFIED" => Self::Unspecified,
12733 "OK" => Self::Ok,
12734 "PENDING" => Self::Pending,
12735 "FAILED_RETRYING_NOT_VISIBLE" => Self::FailedRetryingNotVisible,
12736 "FAILED_PERMANENT" => Self::FailedPermanent,
12737 "FAILED_RETRYING_CAA_FORBIDDEN" => Self::FailedRetryingCaaForbidden,
12738 "FAILED_RETRYING_CAA_CHECKING" => Self::FailedRetryingCaaChecking,
12739 _ => Self::UnknownValue(management_status::UnknownValue(
12740 wkt::internal::UnknownEnumValue::String(value.to_string()),
12741 )),
12742 }
12743 }
12744}
12745
12746impl serde::ser::Serialize for ManagementStatus {
12747 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12748 where
12749 S: serde::Serializer,
12750 {
12751 match self {
12752 Self::Unspecified => serializer.serialize_i32(0),
12753 Self::Ok => serializer.serialize_i32(1),
12754 Self::Pending => serializer.serialize_i32(2),
12755 Self::FailedRetryingNotVisible => serializer.serialize_i32(4),
12756 Self::FailedPermanent => serializer.serialize_i32(6),
12757 Self::FailedRetryingCaaForbidden => serializer.serialize_i32(7),
12758 Self::FailedRetryingCaaChecking => serializer.serialize_i32(8),
12759 Self::UnknownValue(u) => u.0.serialize(serializer),
12760 }
12761 }
12762}
12763
12764impl<'de> serde::de::Deserialize<'de> for ManagementStatus {
12765 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12766 where
12767 D: serde::Deserializer<'de>,
12768 {
12769 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManagementStatus>::new(
12770 ".google.appengine.v1.ManagementStatus",
12771 ))
12772 }
12773}
12774
12775/// Available inbound services.
12776///
12777/// # Working with unknown values
12778///
12779/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12780/// additional enum variants at any time. Adding new variants is not considered
12781/// a breaking change. Applications should write their code in anticipation of:
12782///
12783/// - New values appearing in future releases of the client library, **and**
12784/// - New values received dynamically, without application changes.
12785///
12786/// Please consult the [Working with enums] section in the user guide for some
12787/// guidelines.
12788///
12789/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12790#[derive(Clone, Debug, PartialEq)]
12791#[non_exhaustive]
12792pub enum InboundServiceType {
12793 /// Not specified.
12794 InboundServiceUnspecified,
12795 /// Allows an application to receive mail.
12796 InboundServiceMail,
12797 /// Allows an application to receive email-bound notifications.
12798 InboundServiceMailBounce,
12799 /// Allows an application to receive error stanzas.
12800 InboundServiceXmppError,
12801 /// Allows an application to receive instant messages.
12802 InboundServiceXmppMessage,
12803 /// Allows an application to receive user subscription POSTs.
12804 InboundServiceXmppSubscribe,
12805 /// Allows an application to receive a user's chat presence.
12806 InboundServiceXmppPresence,
12807 /// Registers an application for notifications when a client connects or
12808 /// disconnects from a channel.
12809 InboundServiceChannelPresence,
12810 /// Enables warmup requests.
12811 InboundServiceWarmup,
12812 /// If set, the enum was initialized with an unknown value.
12813 ///
12814 /// Applications can examine the value using [InboundServiceType::value] or
12815 /// [InboundServiceType::name].
12816 UnknownValue(inbound_service_type::UnknownValue),
12817}
12818
12819#[doc(hidden)]
12820pub mod inbound_service_type {
12821 #[allow(unused_imports)]
12822 use super::*;
12823 #[derive(Clone, Debug, PartialEq)]
12824 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12825}
12826
12827impl InboundServiceType {
12828 /// Gets the enum value.
12829 ///
12830 /// Returns `None` if the enum contains an unknown value deserialized from
12831 /// the string representation of enums.
12832 pub fn value(&self) -> std::option::Option<i32> {
12833 match self {
12834 Self::InboundServiceUnspecified => std::option::Option::Some(0),
12835 Self::InboundServiceMail => std::option::Option::Some(1),
12836 Self::InboundServiceMailBounce => std::option::Option::Some(2),
12837 Self::InboundServiceXmppError => std::option::Option::Some(3),
12838 Self::InboundServiceXmppMessage => std::option::Option::Some(4),
12839 Self::InboundServiceXmppSubscribe => std::option::Option::Some(5),
12840 Self::InboundServiceXmppPresence => std::option::Option::Some(6),
12841 Self::InboundServiceChannelPresence => std::option::Option::Some(7),
12842 Self::InboundServiceWarmup => std::option::Option::Some(9),
12843 Self::UnknownValue(u) => u.0.value(),
12844 }
12845 }
12846
12847 /// Gets the enum value as a string.
12848 ///
12849 /// Returns `None` if the enum contains an unknown value deserialized from
12850 /// the integer representation of enums.
12851 pub fn name(&self) -> std::option::Option<&str> {
12852 match self {
12853 Self::InboundServiceUnspecified => {
12854 std::option::Option::Some("INBOUND_SERVICE_UNSPECIFIED")
12855 }
12856 Self::InboundServiceMail => std::option::Option::Some("INBOUND_SERVICE_MAIL"),
12857 Self::InboundServiceMailBounce => {
12858 std::option::Option::Some("INBOUND_SERVICE_MAIL_BOUNCE")
12859 }
12860 Self::InboundServiceXmppError => {
12861 std::option::Option::Some("INBOUND_SERVICE_XMPP_ERROR")
12862 }
12863 Self::InboundServiceXmppMessage => {
12864 std::option::Option::Some("INBOUND_SERVICE_XMPP_MESSAGE")
12865 }
12866 Self::InboundServiceXmppSubscribe => {
12867 std::option::Option::Some("INBOUND_SERVICE_XMPP_SUBSCRIBE")
12868 }
12869 Self::InboundServiceXmppPresence => {
12870 std::option::Option::Some("INBOUND_SERVICE_XMPP_PRESENCE")
12871 }
12872 Self::InboundServiceChannelPresence => {
12873 std::option::Option::Some("INBOUND_SERVICE_CHANNEL_PRESENCE")
12874 }
12875 Self::InboundServiceWarmup => std::option::Option::Some("INBOUND_SERVICE_WARMUP"),
12876 Self::UnknownValue(u) => u.0.name(),
12877 }
12878 }
12879}
12880
12881impl std::default::Default for InboundServiceType {
12882 fn default() -> Self {
12883 use std::convert::From;
12884 Self::from(0)
12885 }
12886}
12887
12888impl std::fmt::Display for InboundServiceType {
12889 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12890 wkt::internal::display_enum(f, self.name(), self.value())
12891 }
12892}
12893
12894impl std::convert::From<i32> for InboundServiceType {
12895 fn from(value: i32) -> Self {
12896 match value {
12897 0 => Self::InboundServiceUnspecified,
12898 1 => Self::InboundServiceMail,
12899 2 => Self::InboundServiceMailBounce,
12900 3 => Self::InboundServiceXmppError,
12901 4 => Self::InboundServiceXmppMessage,
12902 5 => Self::InboundServiceXmppSubscribe,
12903 6 => Self::InboundServiceXmppPresence,
12904 7 => Self::InboundServiceChannelPresence,
12905 9 => Self::InboundServiceWarmup,
12906 _ => Self::UnknownValue(inbound_service_type::UnknownValue(
12907 wkt::internal::UnknownEnumValue::Integer(value),
12908 )),
12909 }
12910 }
12911}
12912
12913impl std::convert::From<&str> for InboundServiceType {
12914 fn from(value: &str) -> Self {
12915 use std::string::ToString;
12916 match value {
12917 "INBOUND_SERVICE_UNSPECIFIED" => Self::InboundServiceUnspecified,
12918 "INBOUND_SERVICE_MAIL" => Self::InboundServiceMail,
12919 "INBOUND_SERVICE_MAIL_BOUNCE" => Self::InboundServiceMailBounce,
12920 "INBOUND_SERVICE_XMPP_ERROR" => Self::InboundServiceXmppError,
12921 "INBOUND_SERVICE_XMPP_MESSAGE" => Self::InboundServiceXmppMessage,
12922 "INBOUND_SERVICE_XMPP_SUBSCRIBE" => Self::InboundServiceXmppSubscribe,
12923 "INBOUND_SERVICE_XMPP_PRESENCE" => Self::InboundServiceXmppPresence,
12924 "INBOUND_SERVICE_CHANNEL_PRESENCE" => Self::InboundServiceChannelPresence,
12925 "INBOUND_SERVICE_WARMUP" => Self::InboundServiceWarmup,
12926 _ => Self::UnknownValue(inbound_service_type::UnknownValue(
12927 wkt::internal::UnknownEnumValue::String(value.to_string()),
12928 )),
12929 }
12930 }
12931}
12932
12933impl serde::ser::Serialize for InboundServiceType {
12934 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12935 where
12936 S: serde::Serializer,
12937 {
12938 match self {
12939 Self::InboundServiceUnspecified => serializer.serialize_i32(0),
12940 Self::InboundServiceMail => serializer.serialize_i32(1),
12941 Self::InboundServiceMailBounce => serializer.serialize_i32(2),
12942 Self::InboundServiceXmppError => serializer.serialize_i32(3),
12943 Self::InboundServiceXmppMessage => serializer.serialize_i32(4),
12944 Self::InboundServiceXmppSubscribe => serializer.serialize_i32(5),
12945 Self::InboundServiceXmppPresence => serializer.serialize_i32(6),
12946 Self::InboundServiceChannelPresence => serializer.serialize_i32(7),
12947 Self::InboundServiceWarmup => serializer.serialize_i32(9),
12948 Self::UnknownValue(u) => u.0.serialize(serializer),
12949 }
12950 }
12951}
12952
12953impl<'de> serde::de::Deserialize<'de> for InboundServiceType {
12954 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12955 where
12956 D: serde::Deserializer<'de>,
12957 {
12958 deserializer.deserialize_any(wkt::internal::EnumVisitor::<InboundServiceType>::new(
12959 ".google.appengine.v1.InboundServiceType",
12960 ))
12961 }
12962}
12963
12964/// Run states of a version.
12965///
12966/// # Working with unknown values
12967///
12968/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12969/// additional enum variants at any time. Adding new variants is not considered
12970/// a breaking change. Applications should write their code in anticipation of:
12971///
12972/// - New values appearing in future releases of the client library, **and**
12973/// - New values received dynamically, without application changes.
12974///
12975/// Please consult the [Working with enums] section in the user guide for some
12976/// guidelines.
12977///
12978/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12979#[derive(Clone, Debug, PartialEq)]
12980#[non_exhaustive]
12981pub enum ServingStatus {
12982 /// Not specified.
12983 Unspecified,
12984 /// Currently serving. Instances are created according to the
12985 /// scaling settings of the version.
12986 Serving,
12987 /// Disabled. No instances will be created and the scaling
12988 /// settings are ignored until the state of the version changes
12989 /// to `SERVING`.
12990 Stopped,
12991 /// If set, the enum was initialized with an unknown value.
12992 ///
12993 /// Applications can examine the value using [ServingStatus::value] or
12994 /// [ServingStatus::name].
12995 UnknownValue(serving_status::UnknownValue),
12996}
12997
12998#[doc(hidden)]
12999pub mod serving_status {
13000 #[allow(unused_imports)]
13001 use super::*;
13002 #[derive(Clone, Debug, PartialEq)]
13003 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13004}
13005
13006impl ServingStatus {
13007 /// Gets the enum value.
13008 ///
13009 /// Returns `None` if the enum contains an unknown value deserialized from
13010 /// the string representation of enums.
13011 pub fn value(&self) -> std::option::Option<i32> {
13012 match self {
13013 Self::Unspecified => std::option::Option::Some(0),
13014 Self::Serving => std::option::Option::Some(1),
13015 Self::Stopped => std::option::Option::Some(2),
13016 Self::UnknownValue(u) => u.0.value(),
13017 }
13018 }
13019
13020 /// Gets the enum value as a string.
13021 ///
13022 /// Returns `None` if the enum contains an unknown value deserialized from
13023 /// the integer representation of enums.
13024 pub fn name(&self) -> std::option::Option<&str> {
13025 match self {
13026 Self::Unspecified => std::option::Option::Some("SERVING_STATUS_UNSPECIFIED"),
13027 Self::Serving => std::option::Option::Some("SERVING"),
13028 Self::Stopped => std::option::Option::Some("STOPPED"),
13029 Self::UnknownValue(u) => u.0.name(),
13030 }
13031 }
13032}
13033
13034impl std::default::Default for ServingStatus {
13035 fn default() -> Self {
13036 use std::convert::From;
13037 Self::from(0)
13038 }
13039}
13040
13041impl std::fmt::Display for ServingStatus {
13042 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13043 wkt::internal::display_enum(f, self.name(), self.value())
13044 }
13045}
13046
13047impl std::convert::From<i32> for ServingStatus {
13048 fn from(value: i32) -> Self {
13049 match value {
13050 0 => Self::Unspecified,
13051 1 => Self::Serving,
13052 2 => Self::Stopped,
13053 _ => Self::UnknownValue(serving_status::UnknownValue(
13054 wkt::internal::UnknownEnumValue::Integer(value),
13055 )),
13056 }
13057 }
13058}
13059
13060impl std::convert::From<&str> for ServingStatus {
13061 fn from(value: &str) -> Self {
13062 use std::string::ToString;
13063 match value {
13064 "SERVING_STATUS_UNSPECIFIED" => Self::Unspecified,
13065 "SERVING" => Self::Serving,
13066 "STOPPED" => Self::Stopped,
13067 _ => Self::UnknownValue(serving_status::UnknownValue(
13068 wkt::internal::UnknownEnumValue::String(value.to_string()),
13069 )),
13070 }
13071 }
13072}
13073
13074impl serde::ser::Serialize for ServingStatus {
13075 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13076 where
13077 S: serde::Serializer,
13078 {
13079 match self {
13080 Self::Unspecified => serializer.serialize_i32(0),
13081 Self::Serving => serializer.serialize_i32(1),
13082 Self::Stopped => serializer.serialize_i32(2),
13083 Self::UnknownValue(u) => u.0.serialize(serializer),
13084 }
13085 }
13086}
13087
13088impl<'de> serde::de::Deserialize<'de> for ServingStatus {
13089 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13090 where
13091 D: serde::Deserializer<'de>,
13092 {
13093 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServingStatus>::new(
13094 ".google.appengine.v1.ServingStatus",
13095 ))
13096 }
13097}