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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/)
40/// configuration for API handlers.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ApiConfigHandler {
44 /// Action to take when users access resources that require
45 /// authentication. Defaults to `redirect`.
46 pub auth_fail_action: crate::model::AuthFailAction,
47
48 /// Level of login required to access this resource. Defaults to
49 /// `optional`.
50 pub login: crate::model::LoginRequirement,
51
52 /// Path to the script from the application root directory.
53 pub script: std::string::String,
54
55 /// Security (HTTPS) enforcement for this URL.
56 pub security_level: crate::model::SecurityLevel,
57
58 /// URL to serve the endpoint at.
59 pub url: std::string::String,
60
61 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
62}
63
64impl ApiConfigHandler {
65 /// Creates a new default instance.
66 pub fn new() -> Self {
67 std::default::Default::default()
68 }
69
70 /// Sets the value of [auth_fail_action][crate::model::ApiConfigHandler::auth_fail_action].
71 ///
72 /// # Example
73 /// ```ignore,no_run
74 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
75 /// use google_cloud_appengine_v1::model::AuthFailAction;
76 /// let x0 = ApiConfigHandler::new().set_auth_fail_action(AuthFailAction::Redirect);
77 /// let x1 = ApiConfigHandler::new().set_auth_fail_action(AuthFailAction::Unauthorized);
78 /// ```
79 pub fn set_auth_fail_action<T: std::convert::Into<crate::model::AuthFailAction>>(
80 mut self,
81 v: T,
82 ) -> Self {
83 self.auth_fail_action = v.into();
84 self
85 }
86
87 /// Sets the value of [login][crate::model::ApiConfigHandler::login].
88 ///
89 /// # Example
90 /// ```ignore,no_run
91 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
92 /// use google_cloud_appengine_v1::model::LoginRequirement;
93 /// let x0 = ApiConfigHandler::new().set_login(LoginRequirement::LoginOptional);
94 /// let x1 = ApiConfigHandler::new().set_login(LoginRequirement::LoginAdmin);
95 /// let x2 = ApiConfigHandler::new().set_login(LoginRequirement::LoginRequired);
96 /// ```
97 pub fn set_login<T: std::convert::Into<crate::model::LoginRequirement>>(
98 mut self,
99 v: T,
100 ) -> Self {
101 self.login = v.into();
102 self
103 }
104
105 /// Sets the value of [script][crate::model::ApiConfigHandler::script].
106 ///
107 /// # Example
108 /// ```ignore,no_run
109 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
110 /// let x = ApiConfigHandler::new().set_script("example");
111 /// ```
112 pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
113 self.script = v.into();
114 self
115 }
116
117 /// Sets the value of [security_level][crate::model::ApiConfigHandler::security_level].
118 ///
119 /// # Example
120 /// ```ignore,no_run
121 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
122 /// use google_cloud_appengine_v1::model::SecurityLevel;
123 /// let x0 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureNever);
124 /// let x1 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureOptional);
125 /// let x2 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureAlways);
126 /// ```
127 pub fn set_security_level<T: std::convert::Into<crate::model::SecurityLevel>>(
128 mut self,
129 v: T,
130 ) -> Self {
131 self.security_level = v.into();
132 self
133 }
134
135 /// Sets the value of [url][crate::model::ApiConfigHandler::url].
136 ///
137 /// # Example
138 /// ```ignore,no_run
139 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
140 /// let x = ApiConfigHandler::new().set_url("example");
141 /// ```
142 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
143 self.url = v.into();
144 self
145 }
146}
147
148impl wkt::message::Message for ApiConfigHandler {
149 fn typename() -> &'static str {
150 "type.googleapis.com/google.appengine.v1.ApiConfigHandler"
151 }
152}
153
154/// Custom static error page to be served when an error occurs.
155#[derive(Clone, Default, PartialEq)]
156#[non_exhaustive]
157pub struct ErrorHandler {
158 /// Error condition this handler applies to.
159 pub error_code: crate::model::error_handler::ErrorCode,
160
161 /// Static file content to be served for this error.
162 pub static_file: std::string::String,
163
164 /// MIME type of file. Defaults to `text/html`.
165 pub mime_type: std::string::String,
166
167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
168}
169
170impl ErrorHandler {
171 /// Creates a new default instance.
172 pub fn new() -> Self {
173 std::default::Default::default()
174 }
175
176 /// Sets the value of [error_code][crate::model::ErrorHandler::error_code].
177 ///
178 /// # Example
179 /// ```ignore,no_run
180 /// # use google_cloud_appengine_v1::model::ErrorHandler;
181 /// use google_cloud_appengine_v1::model::error_handler::ErrorCode;
182 /// let x0 = ErrorHandler::new().set_error_code(ErrorCode::OverQuota);
183 /// let x1 = ErrorHandler::new().set_error_code(ErrorCode::DosApiDenial);
184 /// let x2 = ErrorHandler::new().set_error_code(ErrorCode::Timeout);
185 /// ```
186 pub fn set_error_code<T: std::convert::Into<crate::model::error_handler::ErrorCode>>(
187 mut self,
188 v: T,
189 ) -> Self {
190 self.error_code = v.into();
191 self
192 }
193
194 /// Sets the value of [static_file][crate::model::ErrorHandler::static_file].
195 ///
196 /// # Example
197 /// ```ignore,no_run
198 /// # use google_cloud_appengine_v1::model::ErrorHandler;
199 /// let x = ErrorHandler::new().set_static_file("example");
200 /// ```
201 pub fn set_static_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
202 self.static_file = v.into();
203 self
204 }
205
206 /// Sets the value of [mime_type][crate::model::ErrorHandler::mime_type].
207 ///
208 /// # Example
209 /// ```ignore,no_run
210 /// # use google_cloud_appengine_v1::model::ErrorHandler;
211 /// let x = ErrorHandler::new().set_mime_type("example");
212 /// ```
213 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
214 self.mime_type = v.into();
215 self
216 }
217}
218
219impl wkt::message::Message for ErrorHandler {
220 fn typename() -> &'static str {
221 "type.googleapis.com/google.appengine.v1.ErrorHandler"
222 }
223}
224
225/// Defines additional types related to [ErrorHandler].
226pub mod error_handler {
227 #[allow(unused_imports)]
228 use super::*;
229
230 /// Error codes.
231 ///
232 /// # Working with unknown values
233 ///
234 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
235 /// additional enum variants at any time. Adding new variants is not considered
236 /// a breaking change. Applications should write their code in anticipation of:
237 ///
238 /// - New values appearing in future releases of the client library, **and**
239 /// - New values received dynamically, without application changes.
240 ///
241 /// Please consult the [Working with enums] section in the user guide for some
242 /// guidelines.
243 ///
244 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
245 #[derive(Clone, Debug, PartialEq)]
246 #[non_exhaustive]
247 pub enum ErrorCode {
248 /// Not specified. ERROR_CODE_DEFAULT is assumed.
249 Unspecified,
250 /// All other error types.
251 Default,
252 /// Application has exceeded a resource quota.
253 OverQuota,
254 /// Client blocked by the application's Denial of Service protection
255 /// configuration.
256 DosApiDenial,
257 /// Deadline reached before the application responds.
258 Timeout,
259 /// If set, the enum was initialized with an unknown value.
260 ///
261 /// Applications can examine the value using [ErrorCode::value] or
262 /// [ErrorCode::name].
263 UnknownValue(error_code::UnknownValue),
264 }
265
266 #[doc(hidden)]
267 pub mod error_code {
268 #[allow(unused_imports)]
269 use super::*;
270 #[derive(Clone, Debug, PartialEq)]
271 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
272 }
273
274 impl ErrorCode {
275 /// Gets the enum value.
276 ///
277 /// Returns `None` if the enum contains an unknown value deserialized from
278 /// the string representation of enums.
279 pub fn value(&self) -> std::option::Option<i32> {
280 match self {
281 Self::Unspecified => std::option::Option::Some(0),
282 Self::Default => std::option::Option::Some(0),
283 Self::OverQuota => std::option::Option::Some(1),
284 Self::DosApiDenial => std::option::Option::Some(2),
285 Self::Timeout => std::option::Option::Some(3),
286 Self::UnknownValue(u) => u.0.value(),
287 }
288 }
289
290 /// Gets the enum value as a string.
291 ///
292 /// Returns `None` if the enum contains an unknown value deserialized from
293 /// the integer representation of enums.
294 pub fn name(&self) -> std::option::Option<&str> {
295 match self {
296 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
297 Self::Default => std::option::Option::Some("ERROR_CODE_DEFAULT"),
298 Self::OverQuota => std::option::Option::Some("ERROR_CODE_OVER_QUOTA"),
299 Self::DosApiDenial => std::option::Option::Some("ERROR_CODE_DOS_API_DENIAL"),
300 Self::Timeout => std::option::Option::Some("ERROR_CODE_TIMEOUT"),
301 Self::UnknownValue(u) => u.0.name(),
302 }
303 }
304 }
305
306 impl std::default::Default for ErrorCode {
307 fn default() -> Self {
308 use std::convert::From;
309 Self::from(0)
310 }
311 }
312
313 impl std::fmt::Display for ErrorCode {
314 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
315 wkt::internal::display_enum(f, self.name(), self.value())
316 }
317 }
318
319 impl std::convert::From<i32> for ErrorCode {
320 fn from(value: i32) -> Self {
321 match value {
322 0 => Self::Default,
323 1 => Self::OverQuota,
324 2 => Self::DosApiDenial,
325 3 => Self::Timeout,
326 _ => Self::UnknownValue(error_code::UnknownValue(
327 wkt::internal::UnknownEnumValue::Integer(value),
328 )),
329 }
330 }
331 }
332
333 impl std::convert::From<&str> for ErrorCode {
334 fn from(value: &str) -> Self {
335 use std::string::ToString;
336 match value {
337 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
338 "ERROR_CODE_DEFAULT" => Self::Default,
339 "ERROR_CODE_OVER_QUOTA" => Self::OverQuota,
340 "ERROR_CODE_DOS_API_DENIAL" => Self::DosApiDenial,
341 "ERROR_CODE_TIMEOUT" => Self::Timeout,
342 _ => Self::UnknownValue(error_code::UnknownValue(
343 wkt::internal::UnknownEnumValue::String(value.to_string()),
344 )),
345 }
346 }
347 }
348
349 impl serde::ser::Serialize for ErrorCode {
350 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
351 where
352 S: serde::Serializer,
353 {
354 match self {
355 Self::Unspecified => serializer.serialize_i32(0),
356 Self::Default => serializer.serialize_i32(0),
357 Self::OverQuota => serializer.serialize_i32(1),
358 Self::DosApiDenial => serializer.serialize_i32(2),
359 Self::Timeout => serializer.serialize_i32(3),
360 Self::UnknownValue(u) => u.0.serialize(serializer),
361 }
362 }
363 }
364
365 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
366 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
367 where
368 D: serde::Deserializer<'de>,
369 {
370 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
371 ".google.appengine.v1.ErrorHandler.ErrorCode",
372 ))
373 }
374 }
375}
376
377/// URL pattern and description of how the URL should be handled. App Engine can
378/// handle URLs by executing application code or by serving static files
379/// uploaded with the version, such as images, CSS, or JavaScript.
380#[derive(Clone, Default, PartialEq)]
381#[non_exhaustive]
382pub struct UrlMap {
383 /// URL prefix. Uses regular expression syntax, which means regexp
384 /// special characters must be escaped, but should not contain groupings.
385 /// All URLs that begin with this prefix are handled by this handler, using the
386 /// portion of the URL after the prefix as part of the file path.
387 pub url_regex: std::string::String,
388
389 /// Security (HTTPS) enforcement for this URL.
390 pub security_level: crate::model::SecurityLevel,
391
392 /// Level of login required to access this resource. Not supported for Node.js
393 /// in the App Engine standard environment.
394 pub login: crate::model::LoginRequirement,
395
396 /// Action to take when users access resources that require
397 /// authentication. Defaults to `redirect`.
398 pub auth_fail_action: crate::model::AuthFailAction,
399
400 /// `30x` code to use when performing redirects for the `secure` field.
401 /// Defaults to `302`.
402 pub redirect_http_response_code: crate::model::url_map::RedirectHttpResponseCode,
403
404 /// Type of handler for this URL pattern.
405 pub handler_type: std::option::Option<crate::model::url_map::HandlerType>,
406
407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
408}
409
410impl UrlMap {
411 /// Creates a new default instance.
412 pub fn new() -> Self {
413 std::default::Default::default()
414 }
415
416 /// Sets the value of [url_regex][crate::model::UrlMap::url_regex].
417 ///
418 /// # Example
419 /// ```ignore,no_run
420 /// # use google_cloud_appengine_v1::model::UrlMap;
421 /// let x = UrlMap::new().set_url_regex("example");
422 /// ```
423 pub fn set_url_regex<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
424 self.url_regex = v.into();
425 self
426 }
427
428 /// Sets the value of [security_level][crate::model::UrlMap::security_level].
429 ///
430 /// # Example
431 /// ```ignore,no_run
432 /// # use google_cloud_appengine_v1::model::UrlMap;
433 /// use google_cloud_appengine_v1::model::SecurityLevel;
434 /// let x0 = UrlMap::new().set_security_level(SecurityLevel::SecureNever);
435 /// let x1 = UrlMap::new().set_security_level(SecurityLevel::SecureOptional);
436 /// let x2 = UrlMap::new().set_security_level(SecurityLevel::SecureAlways);
437 /// ```
438 pub fn set_security_level<T: std::convert::Into<crate::model::SecurityLevel>>(
439 mut self,
440 v: T,
441 ) -> Self {
442 self.security_level = v.into();
443 self
444 }
445
446 /// Sets the value of [login][crate::model::UrlMap::login].
447 ///
448 /// # Example
449 /// ```ignore,no_run
450 /// # use google_cloud_appengine_v1::model::UrlMap;
451 /// use google_cloud_appengine_v1::model::LoginRequirement;
452 /// let x0 = UrlMap::new().set_login(LoginRequirement::LoginOptional);
453 /// let x1 = UrlMap::new().set_login(LoginRequirement::LoginAdmin);
454 /// let x2 = UrlMap::new().set_login(LoginRequirement::LoginRequired);
455 /// ```
456 pub fn set_login<T: std::convert::Into<crate::model::LoginRequirement>>(
457 mut self,
458 v: T,
459 ) -> Self {
460 self.login = v.into();
461 self
462 }
463
464 /// Sets the value of [auth_fail_action][crate::model::UrlMap::auth_fail_action].
465 ///
466 /// # Example
467 /// ```ignore,no_run
468 /// # use google_cloud_appengine_v1::model::UrlMap;
469 /// use google_cloud_appengine_v1::model::AuthFailAction;
470 /// let x0 = UrlMap::new().set_auth_fail_action(AuthFailAction::Redirect);
471 /// let x1 = UrlMap::new().set_auth_fail_action(AuthFailAction::Unauthorized);
472 /// ```
473 pub fn set_auth_fail_action<T: std::convert::Into<crate::model::AuthFailAction>>(
474 mut self,
475 v: T,
476 ) -> Self {
477 self.auth_fail_action = v.into();
478 self
479 }
480
481 /// Sets the value of [redirect_http_response_code][crate::model::UrlMap::redirect_http_response_code].
482 ///
483 /// # Example
484 /// ```ignore,no_run
485 /// # use google_cloud_appengine_v1::model::UrlMap;
486 /// use google_cloud_appengine_v1::model::url_map::RedirectHttpResponseCode;
487 /// let x0 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode301);
488 /// let x1 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode302);
489 /// let x2 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode303);
490 /// ```
491 pub fn set_redirect_http_response_code<
492 T: std::convert::Into<crate::model::url_map::RedirectHttpResponseCode>,
493 >(
494 mut self,
495 v: T,
496 ) -> Self {
497 self.redirect_http_response_code = v.into();
498 self
499 }
500
501 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type].
502 ///
503 /// Note that all the setters affecting `handler_type` are mutually
504 /// exclusive.
505 ///
506 /// # Example
507 /// ```ignore,no_run
508 /// # use google_cloud_appengine_v1::model::UrlMap;
509 /// use google_cloud_appengine_v1::model::StaticFilesHandler;
510 /// let x = UrlMap::new().set_handler_type(Some(
511 /// google_cloud_appengine_v1::model::url_map::HandlerType::StaticFiles(StaticFilesHandler::default().into())));
512 /// ```
513 pub fn set_handler_type<
514 T: std::convert::Into<std::option::Option<crate::model::url_map::HandlerType>>,
515 >(
516 mut self,
517 v: T,
518 ) -> Self {
519 self.handler_type = v.into();
520 self
521 }
522
523 /// The value of [handler_type][crate::model::UrlMap::handler_type]
524 /// if it holds a `StaticFiles`, `None` if the field is not set or
525 /// holds a different branch.
526 pub fn static_files(
527 &self,
528 ) -> std::option::Option<&std::boxed::Box<crate::model::StaticFilesHandler>> {
529 #[allow(unreachable_patterns)]
530 self.handler_type.as_ref().and_then(|v| match v {
531 crate::model::url_map::HandlerType::StaticFiles(v) => std::option::Option::Some(v),
532 _ => std::option::Option::None,
533 })
534 }
535
536 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
537 /// to hold a `StaticFiles`.
538 ///
539 /// Note that all the setters affecting `handler_type` are
540 /// mutually exclusive.
541 ///
542 /// # Example
543 /// ```ignore,no_run
544 /// # use google_cloud_appengine_v1::model::UrlMap;
545 /// use google_cloud_appengine_v1::model::StaticFilesHandler;
546 /// let x = UrlMap::new().set_static_files(StaticFilesHandler::default()/* use setters */);
547 /// assert!(x.static_files().is_some());
548 /// assert!(x.script().is_none());
549 /// assert!(x.api_endpoint().is_none());
550 /// ```
551 pub fn set_static_files<
552 T: std::convert::Into<std::boxed::Box<crate::model::StaticFilesHandler>>,
553 >(
554 mut self,
555 v: T,
556 ) -> Self {
557 self.handler_type =
558 std::option::Option::Some(crate::model::url_map::HandlerType::StaticFiles(v.into()));
559 self
560 }
561
562 /// The value of [handler_type][crate::model::UrlMap::handler_type]
563 /// if it holds a `Script`, `None` if the field is not set or
564 /// holds a different branch.
565 pub fn script(&self) -> std::option::Option<&std::boxed::Box<crate::model::ScriptHandler>> {
566 #[allow(unreachable_patterns)]
567 self.handler_type.as_ref().and_then(|v| match v {
568 crate::model::url_map::HandlerType::Script(v) => std::option::Option::Some(v),
569 _ => std::option::Option::None,
570 })
571 }
572
573 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
574 /// to hold a `Script`.
575 ///
576 /// Note that all the setters affecting `handler_type` are
577 /// mutually exclusive.
578 ///
579 /// # Example
580 /// ```ignore,no_run
581 /// # use google_cloud_appengine_v1::model::UrlMap;
582 /// use google_cloud_appengine_v1::model::ScriptHandler;
583 /// let x = UrlMap::new().set_script(ScriptHandler::default()/* use setters */);
584 /// assert!(x.script().is_some());
585 /// assert!(x.static_files().is_none());
586 /// assert!(x.api_endpoint().is_none());
587 /// ```
588 pub fn set_script<T: std::convert::Into<std::boxed::Box<crate::model::ScriptHandler>>>(
589 mut self,
590 v: T,
591 ) -> Self {
592 self.handler_type =
593 std::option::Option::Some(crate::model::url_map::HandlerType::Script(v.into()));
594 self
595 }
596
597 /// The value of [handler_type][crate::model::UrlMap::handler_type]
598 /// if it holds a `ApiEndpoint`, `None` if the field is not set or
599 /// holds a different branch.
600 pub fn api_endpoint(
601 &self,
602 ) -> std::option::Option<&std::boxed::Box<crate::model::ApiEndpointHandler>> {
603 #[allow(unreachable_patterns)]
604 self.handler_type.as_ref().and_then(|v| match v {
605 crate::model::url_map::HandlerType::ApiEndpoint(v) => std::option::Option::Some(v),
606 _ => std::option::Option::None,
607 })
608 }
609
610 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
611 /// to hold a `ApiEndpoint`.
612 ///
613 /// Note that all the setters affecting `handler_type` are
614 /// mutually exclusive.
615 ///
616 /// # Example
617 /// ```ignore,no_run
618 /// # use google_cloud_appengine_v1::model::UrlMap;
619 /// use google_cloud_appengine_v1::model::ApiEndpointHandler;
620 /// let x = UrlMap::new().set_api_endpoint(ApiEndpointHandler::default()/* use setters */);
621 /// assert!(x.api_endpoint().is_some());
622 /// assert!(x.static_files().is_none());
623 /// assert!(x.script().is_none());
624 /// ```
625 pub fn set_api_endpoint<
626 T: std::convert::Into<std::boxed::Box<crate::model::ApiEndpointHandler>>,
627 >(
628 mut self,
629 v: T,
630 ) -> Self {
631 self.handler_type =
632 std::option::Option::Some(crate::model::url_map::HandlerType::ApiEndpoint(v.into()));
633 self
634 }
635}
636
637impl wkt::message::Message for UrlMap {
638 fn typename() -> &'static str {
639 "type.googleapis.com/google.appengine.v1.UrlMap"
640 }
641}
642
643/// Defines additional types related to [UrlMap].
644pub mod url_map {
645 #[allow(unused_imports)]
646 use super::*;
647
648 /// Redirect codes.
649 ///
650 /// # Working with unknown values
651 ///
652 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
653 /// additional enum variants at any time. Adding new variants is not considered
654 /// a breaking change. Applications should write their code in anticipation of:
655 ///
656 /// - New values appearing in future releases of the client library, **and**
657 /// - New values received dynamically, without application changes.
658 ///
659 /// Please consult the [Working with enums] section in the user guide for some
660 /// guidelines.
661 ///
662 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
663 #[derive(Clone, Debug, PartialEq)]
664 #[non_exhaustive]
665 pub enum RedirectHttpResponseCode {
666 /// Not specified. `302` is assumed.
667 Unspecified,
668 /// `301 Moved Permanently` code.
669 RedirectHttpResponseCode301,
670 /// `302 Moved Temporarily` code.
671 RedirectHttpResponseCode302,
672 /// `303 See Other` code.
673 RedirectHttpResponseCode303,
674 /// `307 Temporary Redirect` code.
675 RedirectHttpResponseCode307,
676 /// If set, the enum was initialized with an unknown value.
677 ///
678 /// Applications can examine the value using [RedirectHttpResponseCode::value] or
679 /// [RedirectHttpResponseCode::name].
680 UnknownValue(redirect_http_response_code::UnknownValue),
681 }
682
683 #[doc(hidden)]
684 pub mod redirect_http_response_code {
685 #[allow(unused_imports)]
686 use super::*;
687 #[derive(Clone, Debug, PartialEq)]
688 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
689 }
690
691 impl RedirectHttpResponseCode {
692 /// Gets the enum value.
693 ///
694 /// Returns `None` if the enum contains an unknown value deserialized from
695 /// the string representation of enums.
696 pub fn value(&self) -> std::option::Option<i32> {
697 match self {
698 Self::Unspecified => std::option::Option::Some(0),
699 Self::RedirectHttpResponseCode301 => std::option::Option::Some(1),
700 Self::RedirectHttpResponseCode302 => std::option::Option::Some(2),
701 Self::RedirectHttpResponseCode303 => std::option::Option::Some(3),
702 Self::RedirectHttpResponseCode307 => std::option::Option::Some(4),
703 Self::UnknownValue(u) => u.0.value(),
704 }
705 }
706
707 /// Gets the enum value as a string.
708 ///
709 /// Returns `None` if the enum contains an unknown value deserialized from
710 /// the integer representation of enums.
711 pub fn name(&self) -> std::option::Option<&str> {
712 match self {
713 Self::Unspecified => {
714 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED")
715 }
716 Self::RedirectHttpResponseCode301 => {
717 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_301")
718 }
719 Self::RedirectHttpResponseCode302 => {
720 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_302")
721 }
722 Self::RedirectHttpResponseCode303 => {
723 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_303")
724 }
725 Self::RedirectHttpResponseCode307 => {
726 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_307")
727 }
728 Self::UnknownValue(u) => u.0.name(),
729 }
730 }
731 }
732
733 impl std::default::Default for RedirectHttpResponseCode {
734 fn default() -> Self {
735 use std::convert::From;
736 Self::from(0)
737 }
738 }
739
740 impl std::fmt::Display for RedirectHttpResponseCode {
741 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
742 wkt::internal::display_enum(f, self.name(), self.value())
743 }
744 }
745
746 impl std::convert::From<i32> for RedirectHttpResponseCode {
747 fn from(value: i32) -> Self {
748 match value {
749 0 => Self::Unspecified,
750 1 => Self::RedirectHttpResponseCode301,
751 2 => Self::RedirectHttpResponseCode302,
752 3 => Self::RedirectHttpResponseCode303,
753 4 => Self::RedirectHttpResponseCode307,
754 _ => Self::UnknownValue(redirect_http_response_code::UnknownValue(
755 wkt::internal::UnknownEnumValue::Integer(value),
756 )),
757 }
758 }
759 }
760
761 impl std::convert::From<&str> for RedirectHttpResponseCode {
762 fn from(value: &str) -> Self {
763 use std::string::ToString;
764 match value {
765 "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED" => Self::Unspecified,
766 "REDIRECT_HTTP_RESPONSE_CODE_301" => Self::RedirectHttpResponseCode301,
767 "REDIRECT_HTTP_RESPONSE_CODE_302" => Self::RedirectHttpResponseCode302,
768 "REDIRECT_HTTP_RESPONSE_CODE_303" => Self::RedirectHttpResponseCode303,
769 "REDIRECT_HTTP_RESPONSE_CODE_307" => Self::RedirectHttpResponseCode307,
770 _ => Self::UnknownValue(redirect_http_response_code::UnknownValue(
771 wkt::internal::UnknownEnumValue::String(value.to_string()),
772 )),
773 }
774 }
775 }
776
777 impl serde::ser::Serialize for RedirectHttpResponseCode {
778 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
779 where
780 S: serde::Serializer,
781 {
782 match self {
783 Self::Unspecified => serializer.serialize_i32(0),
784 Self::RedirectHttpResponseCode301 => serializer.serialize_i32(1),
785 Self::RedirectHttpResponseCode302 => serializer.serialize_i32(2),
786 Self::RedirectHttpResponseCode303 => serializer.serialize_i32(3),
787 Self::RedirectHttpResponseCode307 => serializer.serialize_i32(4),
788 Self::UnknownValue(u) => u.0.serialize(serializer),
789 }
790 }
791 }
792
793 impl<'de> serde::de::Deserialize<'de> for RedirectHttpResponseCode {
794 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
795 where
796 D: serde::Deserializer<'de>,
797 {
798 deserializer.deserialize_any(
799 wkt::internal::EnumVisitor::<RedirectHttpResponseCode>::new(
800 ".google.appengine.v1.UrlMap.RedirectHttpResponseCode",
801 ),
802 )
803 }
804 }
805
806 /// Type of handler for this URL pattern.
807 #[derive(Clone, Debug, PartialEq)]
808 #[non_exhaustive]
809 pub enum HandlerType {
810 /// Returns the contents of a file, such as an image, as the response.
811 StaticFiles(std::boxed::Box<crate::model::StaticFilesHandler>),
812 /// Executes a script to handle the requests that match this URL
813 /// pattern. Only the `auto` value is supported for Node.js in the
814 /// App Engine standard environment, for example `"script": "auto"`.
815 Script(std::boxed::Box<crate::model::ScriptHandler>),
816 /// Uses API Endpoints to handle requests.
817 ApiEndpoint(std::boxed::Box<crate::model::ApiEndpointHandler>),
818 }
819}
820
821/// Files served directly to the user for a given URL, such as images, CSS
822/// stylesheets, or JavaScript source files. Static file handlers describe which
823/// files in the application directory are static files, and which URLs serve
824/// them.
825#[derive(Clone, Default, PartialEq)]
826#[non_exhaustive]
827pub struct StaticFilesHandler {
828 /// Path to the static files matched by the URL pattern, from the
829 /// application root directory. The path can refer to text matched in groupings
830 /// in the URL pattern.
831 pub path: std::string::String,
832
833 /// Regular expression that matches the file paths for all files that should be
834 /// referenced by this handler.
835 pub upload_path_regex: std::string::String,
836
837 /// HTTP headers to use for all responses from these URLs.
838 pub http_headers: std::collections::HashMap<std::string::String, std::string::String>,
839
840 /// MIME type used to serve all files served by this handler.
841 ///
842 /// Defaults to file-specific MIME types, which are derived from each file's
843 /// filename extension.
844 pub mime_type: std::string::String,
845
846 /// Time a static file served by this handler should be cached
847 /// by web proxies and browsers.
848 pub expiration: std::option::Option<wkt::Duration>,
849
850 /// Whether this handler should match the request if the file
851 /// referenced by the handler does not exist.
852 pub require_matching_file: bool,
853
854 /// Whether files should also be uploaded as code data. By default, files
855 /// declared in static file handlers are uploaded as static
856 /// data and are only served to end users; they cannot be read by the
857 /// application. If enabled, uploads are charged against both your code and
858 /// static data storage resource quotas.
859 pub application_readable: bool,
860
861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
862}
863
864impl StaticFilesHandler {
865 /// Creates a new default instance.
866 pub fn new() -> Self {
867 std::default::Default::default()
868 }
869
870 /// Sets the value of [path][crate::model::StaticFilesHandler::path].
871 ///
872 /// # Example
873 /// ```ignore,no_run
874 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
875 /// let x = StaticFilesHandler::new().set_path("example");
876 /// ```
877 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
878 self.path = v.into();
879 self
880 }
881
882 /// Sets the value of [upload_path_regex][crate::model::StaticFilesHandler::upload_path_regex].
883 ///
884 /// # Example
885 /// ```ignore,no_run
886 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
887 /// let x = StaticFilesHandler::new().set_upload_path_regex("example");
888 /// ```
889 pub fn set_upload_path_regex<T: std::convert::Into<std::string::String>>(
890 mut self,
891 v: T,
892 ) -> Self {
893 self.upload_path_regex = v.into();
894 self
895 }
896
897 /// Sets the value of [http_headers][crate::model::StaticFilesHandler::http_headers].
898 ///
899 /// # Example
900 /// ```ignore,no_run
901 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
902 /// let x = StaticFilesHandler::new().set_http_headers([
903 /// ("key0", "abc"),
904 /// ("key1", "xyz"),
905 /// ]);
906 /// ```
907 pub fn set_http_headers<T, K, V>(mut self, v: T) -> Self
908 where
909 T: std::iter::IntoIterator<Item = (K, V)>,
910 K: std::convert::Into<std::string::String>,
911 V: std::convert::Into<std::string::String>,
912 {
913 use std::iter::Iterator;
914 self.http_headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
915 self
916 }
917
918 /// Sets the value of [mime_type][crate::model::StaticFilesHandler::mime_type].
919 ///
920 /// # Example
921 /// ```ignore,no_run
922 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
923 /// let x = StaticFilesHandler::new().set_mime_type("example");
924 /// ```
925 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
926 self.mime_type = v.into();
927 self
928 }
929
930 /// Sets the value of [expiration][crate::model::StaticFilesHandler::expiration].
931 ///
932 /// # Example
933 /// ```ignore,no_run
934 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
935 /// use wkt::Duration;
936 /// let x = StaticFilesHandler::new().set_expiration(Duration::default()/* use setters */);
937 /// ```
938 pub fn set_expiration<T>(mut self, v: T) -> Self
939 where
940 T: std::convert::Into<wkt::Duration>,
941 {
942 self.expiration = std::option::Option::Some(v.into());
943 self
944 }
945
946 /// Sets or clears the value of [expiration][crate::model::StaticFilesHandler::expiration].
947 ///
948 /// # Example
949 /// ```ignore,no_run
950 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
951 /// use wkt::Duration;
952 /// let x = StaticFilesHandler::new().set_or_clear_expiration(Some(Duration::default()/* use setters */));
953 /// let x = StaticFilesHandler::new().set_or_clear_expiration(None::<Duration>);
954 /// ```
955 pub fn set_or_clear_expiration<T>(mut self, v: std::option::Option<T>) -> Self
956 where
957 T: std::convert::Into<wkt::Duration>,
958 {
959 self.expiration = v.map(|x| x.into());
960 self
961 }
962
963 /// Sets the value of [require_matching_file][crate::model::StaticFilesHandler::require_matching_file].
964 ///
965 /// # Example
966 /// ```ignore,no_run
967 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
968 /// let x = StaticFilesHandler::new().set_require_matching_file(true);
969 /// ```
970 pub fn set_require_matching_file<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
971 self.require_matching_file = v.into();
972 self
973 }
974
975 /// Sets the value of [application_readable][crate::model::StaticFilesHandler::application_readable].
976 ///
977 /// # Example
978 /// ```ignore,no_run
979 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
980 /// let x = StaticFilesHandler::new().set_application_readable(true);
981 /// ```
982 pub fn set_application_readable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
983 self.application_readable = v.into();
984 self
985 }
986}
987
988impl wkt::message::Message for StaticFilesHandler {
989 fn typename() -> &'static str {
990 "type.googleapis.com/google.appengine.v1.StaticFilesHandler"
991 }
992}
993
994/// Executes a script to handle the request that matches the URL pattern.
995#[derive(Clone, Default, PartialEq)]
996#[non_exhaustive]
997pub struct ScriptHandler {
998 /// Path to the script from the application root directory.
999 pub script_path: std::string::String,
1000
1001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1002}
1003
1004impl ScriptHandler {
1005 /// Creates a new default instance.
1006 pub fn new() -> Self {
1007 std::default::Default::default()
1008 }
1009
1010 /// Sets the value of [script_path][crate::model::ScriptHandler::script_path].
1011 ///
1012 /// # Example
1013 /// ```ignore,no_run
1014 /// # use google_cloud_appengine_v1::model::ScriptHandler;
1015 /// let x = ScriptHandler::new().set_script_path("example");
1016 /// ```
1017 pub fn set_script_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1018 self.script_path = v.into();
1019 self
1020 }
1021}
1022
1023impl wkt::message::Message for ScriptHandler {
1024 fn typename() -> &'static str {
1025 "type.googleapis.com/google.appengine.v1.ScriptHandler"
1026 }
1027}
1028
1029/// Uses Google Cloud Endpoints to handle requests.
1030#[derive(Clone, Default, PartialEq)]
1031#[non_exhaustive]
1032pub struct ApiEndpointHandler {
1033 /// Path to the script from the application root directory.
1034 pub script_path: std::string::String,
1035
1036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1037}
1038
1039impl ApiEndpointHandler {
1040 /// Creates a new default instance.
1041 pub fn new() -> Self {
1042 std::default::Default::default()
1043 }
1044
1045 /// Sets the value of [script_path][crate::model::ApiEndpointHandler::script_path].
1046 ///
1047 /// # Example
1048 /// ```ignore,no_run
1049 /// # use google_cloud_appengine_v1::model::ApiEndpointHandler;
1050 /// let x = ApiEndpointHandler::new().set_script_path("example");
1051 /// ```
1052 pub fn set_script_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1053 self.script_path = v.into();
1054 self
1055 }
1056}
1057
1058impl wkt::message::Message for ApiEndpointHandler {
1059 fn typename() -> &'static str {
1060 "type.googleapis.com/google.appengine.v1.ApiEndpointHandler"
1061 }
1062}
1063
1064/// Health checking configuration for VM instances. Unhealthy instances
1065/// are killed and replaced with new instances. Only applicable for
1066/// instances in App Engine flexible environment.
1067#[derive(Clone, Default, PartialEq)]
1068#[non_exhaustive]
1069pub struct HealthCheck {
1070 /// Whether to explicitly disable health checks for this instance.
1071 pub disable_health_check: bool,
1072
1073 /// Host header to send when performing an HTTP health check.
1074 /// Example: "myapp.appspot.com"
1075 pub host: std::string::String,
1076
1077 /// Number of consecutive successful health checks required before receiving
1078 /// traffic.
1079 pub healthy_threshold: u32,
1080
1081 /// Number of consecutive failed health checks required before removing
1082 /// traffic.
1083 pub unhealthy_threshold: u32,
1084
1085 /// Number of consecutive failed health checks required before an instance is
1086 /// restarted.
1087 pub restart_threshold: u32,
1088
1089 /// Interval between health checks.
1090 pub check_interval: std::option::Option<wkt::Duration>,
1091
1092 /// Time before the health check is considered failed.
1093 pub timeout: std::option::Option<wkt::Duration>,
1094
1095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1096}
1097
1098impl HealthCheck {
1099 /// Creates a new default instance.
1100 pub fn new() -> Self {
1101 std::default::Default::default()
1102 }
1103
1104 /// Sets the value of [disable_health_check][crate::model::HealthCheck::disable_health_check].
1105 ///
1106 /// # Example
1107 /// ```ignore,no_run
1108 /// # use google_cloud_appengine_v1::model::HealthCheck;
1109 /// let x = HealthCheck::new().set_disable_health_check(true);
1110 /// ```
1111 pub fn set_disable_health_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1112 self.disable_health_check = v.into();
1113 self
1114 }
1115
1116 /// Sets the value of [host][crate::model::HealthCheck::host].
1117 ///
1118 /// # Example
1119 /// ```ignore,no_run
1120 /// # use google_cloud_appengine_v1::model::HealthCheck;
1121 /// let x = HealthCheck::new().set_host("example");
1122 /// ```
1123 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1124 self.host = v.into();
1125 self
1126 }
1127
1128 /// Sets the value of [healthy_threshold][crate::model::HealthCheck::healthy_threshold].
1129 ///
1130 /// # Example
1131 /// ```ignore,no_run
1132 /// # use google_cloud_appengine_v1::model::HealthCheck;
1133 /// let x = HealthCheck::new().set_healthy_threshold(42_u32);
1134 /// ```
1135 pub fn set_healthy_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1136 self.healthy_threshold = v.into();
1137 self
1138 }
1139
1140 /// Sets the value of [unhealthy_threshold][crate::model::HealthCheck::unhealthy_threshold].
1141 ///
1142 /// # Example
1143 /// ```ignore,no_run
1144 /// # use google_cloud_appengine_v1::model::HealthCheck;
1145 /// let x = HealthCheck::new().set_unhealthy_threshold(42_u32);
1146 /// ```
1147 pub fn set_unhealthy_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1148 self.unhealthy_threshold = v.into();
1149 self
1150 }
1151
1152 /// Sets the value of [restart_threshold][crate::model::HealthCheck::restart_threshold].
1153 ///
1154 /// # Example
1155 /// ```ignore,no_run
1156 /// # use google_cloud_appengine_v1::model::HealthCheck;
1157 /// let x = HealthCheck::new().set_restart_threshold(42_u32);
1158 /// ```
1159 pub fn set_restart_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1160 self.restart_threshold = v.into();
1161 self
1162 }
1163
1164 /// Sets the value of [check_interval][crate::model::HealthCheck::check_interval].
1165 ///
1166 /// # Example
1167 /// ```ignore,no_run
1168 /// # use google_cloud_appengine_v1::model::HealthCheck;
1169 /// use wkt::Duration;
1170 /// let x = HealthCheck::new().set_check_interval(Duration::default()/* use setters */);
1171 /// ```
1172 pub fn set_check_interval<T>(mut self, v: T) -> Self
1173 where
1174 T: std::convert::Into<wkt::Duration>,
1175 {
1176 self.check_interval = std::option::Option::Some(v.into());
1177 self
1178 }
1179
1180 /// Sets or clears the value of [check_interval][crate::model::HealthCheck::check_interval].
1181 ///
1182 /// # Example
1183 /// ```ignore,no_run
1184 /// # use google_cloud_appengine_v1::model::HealthCheck;
1185 /// use wkt::Duration;
1186 /// let x = HealthCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1187 /// let x = HealthCheck::new().set_or_clear_check_interval(None::<Duration>);
1188 /// ```
1189 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1190 where
1191 T: std::convert::Into<wkt::Duration>,
1192 {
1193 self.check_interval = v.map(|x| x.into());
1194 self
1195 }
1196
1197 /// Sets the value of [timeout][crate::model::HealthCheck::timeout].
1198 ///
1199 /// # Example
1200 /// ```ignore,no_run
1201 /// # use google_cloud_appengine_v1::model::HealthCheck;
1202 /// use wkt::Duration;
1203 /// let x = HealthCheck::new().set_timeout(Duration::default()/* use setters */);
1204 /// ```
1205 pub fn set_timeout<T>(mut self, v: T) -> Self
1206 where
1207 T: std::convert::Into<wkt::Duration>,
1208 {
1209 self.timeout = std::option::Option::Some(v.into());
1210 self
1211 }
1212
1213 /// Sets or clears the value of [timeout][crate::model::HealthCheck::timeout].
1214 ///
1215 /// # Example
1216 /// ```ignore,no_run
1217 /// # use google_cloud_appengine_v1::model::HealthCheck;
1218 /// use wkt::Duration;
1219 /// let x = HealthCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1220 /// let x = HealthCheck::new().set_or_clear_timeout(None::<Duration>);
1221 /// ```
1222 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1223 where
1224 T: std::convert::Into<wkt::Duration>,
1225 {
1226 self.timeout = v.map(|x| x.into());
1227 self
1228 }
1229}
1230
1231impl wkt::message::Message for HealthCheck {
1232 fn typename() -> &'static str {
1233 "type.googleapis.com/google.appengine.v1.HealthCheck"
1234 }
1235}
1236
1237/// Readiness checking configuration for VM instances. Unhealthy instances
1238/// are removed from traffic rotation.
1239#[derive(Clone, Default, PartialEq)]
1240#[non_exhaustive]
1241pub struct ReadinessCheck {
1242 /// The request path.
1243 pub path: std::string::String,
1244
1245 /// Host header to send when performing a HTTP Readiness check.
1246 /// Example: "myapp.appspot.com"
1247 pub host: std::string::String,
1248
1249 /// Number of consecutive failed checks required before removing
1250 /// traffic.
1251 pub failure_threshold: u32,
1252
1253 /// Number of consecutive successful checks required before receiving
1254 /// traffic.
1255 pub success_threshold: u32,
1256
1257 /// Interval between health checks.
1258 pub check_interval: std::option::Option<wkt::Duration>,
1259
1260 /// Time before the check is considered failed.
1261 pub timeout: std::option::Option<wkt::Duration>,
1262
1263 /// A maximum time limit on application initialization, measured from moment
1264 /// the application successfully replies to a healthcheck until it is ready to
1265 /// serve traffic.
1266 pub app_start_timeout: std::option::Option<wkt::Duration>,
1267
1268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1269}
1270
1271impl ReadinessCheck {
1272 /// Creates a new default instance.
1273 pub fn new() -> Self {
1274 std::default::Default::default()
1275 }
1276
1277 /// Sets the value of [path][crate::model::ReadinessCheck::path].
1278 ///
1279 /// # Example
1280 /// ```ignore,no_run
1281 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1282 /// let x = ReadinessCheck::new().set_path("example");
1283 /// ```
1284 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1285 self.path = v.into();
1286 self
1287 }
1288
1289 /// Sets the value of [host][crate::model::ReadinessCheck::host].
1290 ///
1291 /// # Example
1292 /// ```ignore,no_run
1293 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1294 /// let x = ReadinessCheck::new().set_host("example");
1295 /// ```
1296 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1297 self.host = v.into();
1298 self
1299 }
1300
1301 /// Sets the value of [failure_threshold][crate::model::ReadinessCheck::failure_threshold].
1302 ///
1303 /// # Example
1304 /// ```ignore,no_run
1305 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1306 /// let x = ReadinessCheck::new().set_failure_threshold(42_u32);
1307 /// ```
1308 pub fn set_failure_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1309 self.failure_threshold = v.into();
1310 self
1311 }
1312
1313 /// Sets the value of [success_threshold][crate::model::ReadinessCheck::success_threshold].
1314 ///
1315 /// # Example
1316 /// ```ignore,no_run
1317 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1318 /// let x = ReadinessCheck::new().set_success_threshold(42_u32);
1319 /// ```
1320 pub fn set_success_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1321 self.success_threshold = v.into();
1322 self
1323 }
1324
1325 /// Sets the value of [check_interval][crate::model::ReadinessCheck::check_interval].
1326 ///
1327 /// # Example
1328 /// ```ignore,no_run
1329 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1330 /// use wkt::Duration;
1331 /// let x = ReadinessCheck::new().set_check_interval(Duration::default()/* use setters */);
1332 /// ```
1333 pub fn set_check_interval<T>(mut self, v: T) -> Self
1334 where
1335 T: std::convert::Into<wkt::Duration>,
1336 {
1337 self.check_interval = std::option::Option::Some(v.into());
1338 self
1339 }
1340
1341 /// Sets or clears the value of [check_interval][crate::model::ReadinessCheck::check_interval].
1342 ///
1343 /// # Example
1344 /// ```ignore,no_run
1345 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1346 /// use wkt::Duration;
1347 /// let x = ReadinessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1348 /// let x = ReadinessCheck::new().set_or_clear_check_interval(None::<Duration>);
1349 /// ```
1350 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1351 where
1352 T: std::convert::Into<wkt::Duration>,
1353 {
1354 self.check_interval = v.map(|x| x.into());
1355 self
1356 }
1357
1358 /// Sets the value of [timeout][crate::model::ReadinessCheck::timeout].
1359 ///
1360 /// # Example
1361 /// ```ignore,no_run
1362 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1363 /// use wkt::Duration;
1364 /// let x = ReadinessCheck::new().set_timeout(Duration::default()/* use setters */);
1365 /// ```
1366 pub fn set_timeout<T>(mut self, v: T) -> Self
1367 where
1368 T: std::convert::Into<wkt::Duration>,
1369 {
1370 self.timeout = std::option::Option::Some(v.into());
1371 self
1372 }
1373
1374 /// Sets or clears the value of [timeout][crate::model::ReadinessCheck::timeout].
1375 ///
1376 /// # Example
1377 /// ```ignore,no_run
1378 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1379 /// use wkt::Duration;
1380 /// let x = ReadinessCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1381 /// let x = ReadinessCheck::new().set_or_clear_timeout(None::<Duration>);
1382 /// ```
1383 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1384 where
1385 T: std::convert::Into<wkt::Duration>,
1386 {
1387 self.timeout = v.map(|x| x.into());
1388 self
1389 }
1390
1391 /// Sets the value of [app_start_timeout][crate::model::ReadinessCheck::app_start_timeout].
1392 ///
1393 /// # Example
1394 /// ```ignore,no_run
1395 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1396 /// use wkt::Duration;
1397 /// let x = ReadinessCheck::new().set_app_start_timeout(Duration::default()/* use setters */);
1398 /// ```
1399 pub fn set_app_start_timeout<T>(mut self, v: T) -> Self
1400 where
1401 T: std::convert::Into<wkt::Duration>,
1402 {
1403 self.app_start_timeout = std::option::Option::Some(v.into());
1404 self
1405 }
1406
1407 /// Sets or clears the value of [app_start_timeout][crate::model::ReadinessCheck::app_start_timeout].
1408 ///
1409 /// # Example
1410 /// ```ignore,no_run
1411 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1412 /// use wkt::Duration;
1413 /// let x = ReadinessCheck::new().set_or_clear_app_start_timeout(Some(Duration::default()/* use setters */));
1414 /// let x = ReadinessCheck::new().set_or_clear_app_start_timeout(None::<Duration>);
1415 /// ```
1416 pub fn set_or_clear_app_start_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1417 where
1418 T: std::convert::Into<wkt::Duration>,
1419 {
1420 self.app_start_timeout = v.map(|x| x.into());
1421 self
1422 }
1423}
1424
1425impl wkt::message::Message for ReadinessCheck {
1426 fn typename() -> &'static str {
1427 "type.googleapis.com/google.appengine.v1.ReadinessCheck"
1428 }
1429}
1430
1431/// Health checking configuration for VM instances. Unhealthy instances
1432/// are killed and replaced with new instances.
1433#[derive(Clone, Default, PartialEq)]
1434#[non_exhaustive]
1435pub struct LivenessCheck {
1436 /// The request path.
1437 pub path: std::string::String,
1438
1439 /// Host header to send when performing a HTTP Liveness check.
1440 /// Example: "myapp.appspot.com"
1441 pub host: std::string::String,
1442
1443 /// Number of consecutive failed checks required before considering the
1444 /// VM unhealthy.
1445 pub failure_threshold: u32,
1446
1447 /// Number of consecutive successful checks required before considering
1448 /// the VM healthy.
1449 pub success_threshold: u32,
1450
1451 /// Interval between health checks.
1452 pub check_interval: std::option::Option<wkt::Duration>,
1453
1454 /// Time before the check is considered failed.
1455 pub timeout: std::option::Option<wkt::Duration>,
1456
1457 /// The initial delay before starting to execute the checks.
1458 pub initial_delay: std::option::Option<wkt::Duration>,
1459
1460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1461}
1462
1463impl LivenessCheck {
1464 /// Creates a new default instance.
1465 pub fn new() -> Self {
1466 std::default::Default::default()
1467 }
1468
1469 /// Sets the value of [path][crate::model::LivenessCheck::path].
1470 ///
1471 /// # Example
1472 /// ```ignore,no_run
1473 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1474 /// let x = LivenessCheck::new().set_path("example");
1475 /// ```
1476 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1477 self.path = v.into();
1478 self
1479 }
1480
1481 /// Sets the value of [host][crate::model::LivenessCheck::host].
1482 ///
1483 /// # Example
1484 /// ```ignore,no_run
1485 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1486 /// let x = LivenessCheck::new().set_host("example");
1487 /// ```
1488 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1489 self.host = v.into();
1490 self
1491 }
1492
1493 /// Sets the value of [failure_threshold][crate::model::LivenessCheck::failure_threshold].
1494 ///
1495 /// # Example
1496 /// ```ignore,no_run
1497 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1498 /// let x = LivenessCheck::new().set_failure_threshold(42_u32);
1499 /// ```
1500 pub fn set_failure_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1501 self.failure_threshold = v.into();
1502 self
1503 }
1504
1505 /// Sets the value of [success_threshold][crate::model::LivenessCheck::success_threshold].
1506 ///
1507 /// # Example
1508 /// ```ignore,no_run
1509 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1510 /// let x = LivenessCheck::new().set_success_threshold(42_u32);
1511 /// ```
1512 pub fn set_success_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1513 self.success_threshold = v.into();
1514 self
1515 }
1516
1517 /// Sets the value of [check_interval][crate::model::LivenessCheck::check_interval].
1518 ///
1519 /// # Example
1520 /// ```ignore,no_run
1521 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1522 /// use wkt::Duration;
1523 /// let x = LivenessCheck::new().set_check_interval(Duration::default()/* use setters */);
1524 /// ```
1525 pub fn set_check_interval<T>(mut self, v: T) -> Self
1526 where
1527 T: std::convert::Into<wkt::Duration>,
1528 {
1529 self.check_interval = std::option::Option::Some(v.into());
1530 self
1531 }
1532
1533 /// Sets or clears the value of [check_interval][crate::model::LivenessCheck::check_interval].
1534 ///
1535 /// # Example
1536 /// ```ignore,no_run
1537 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1538 /// use wkt::Duration;
1539 /// let x = LivenessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1540 /// let x = LivenessCheck::new().set_or_clear_check_interval(None::<Duration>);
1541 /// ```
1542 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1543 where
1544 T: std::convert::Into<wkt::Duration>,
1545 {
1546 self.check_interval = v.map(|x| x.into());
1547 self
1548 }
1549
1550 /// Sets the value of [timeout][crate::model::LivenessCheck::timeout].
1551 ///
1552 /// # Example
1553 /// ```ignore,no_run
1554 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1555 /// use wkt::Duration;
1556 /// let x = LivenessCheck::new().set_timeout(Duration::default()/* use setters */);
1557 /// ```
1558 pub fn set_timeout<T>(mut self, v: T) -> Self
1559 where
1560 T: std::convert::Into<wkt::Duration>,
1561 {
1562 self.timeout = std::option::Option::Some(v.into());
1563 self
1564 }
1565
1566 /// Sets or clears the value of [timeout][crate::model::LivenessCheck::timeout].
1567 ///
1568 /// # Example
1569 /// ```ignore,no_run
1570 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1571 /// use wkt::Duration;
1572 /// let x = LivenessCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1573 /// let x = LivenessCheck::new().set_or_clear_timeout(None::<Duration>);
1574 /// ```
1575 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1576 where
1577 T: std::convert::Into<wkt::Duration>,
1578 {
1579 self.timeout = v.map(|x| x.into());
1580 self
1581 }
1582
1583 /// Sets the value of [initial_delay][crate::model::LivenessCheck::initial_delay].
1584 ///
1585 /// # Example
1586 /// ```ignore,no_run
1587 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1588 /// use wkt::Duration;
1589 /// let x = LivenessCheck::new().set_initial_delay(Duration::default()/* use setters */);
1590 /// ```
1591 pub fn set_initial_delay<T>(mut self, v: T) -> Self
1592 where
1593 T: std::convert::Into<wkt::Duration>,
1594 {
1595 self.initial_delay = std::option::Option::Some(v.into());
1596 self
1597 }
1598
1599 /// Sets or clears the value of [initial_delay][crate::model::LivenessCheck::initial_delay].
1600 ///
1601 /// # Example
1602 /// ```ignore,no_run
1603 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1604 /// use wkt::Duration;
1605 /// let x = LivenessCheck::new().set_or_clear_initial_delay(Some(Duration::default()/* use setters */));
1606 /// let x = LivenessCheck::new().set_or_clear_initial_delay(None::<Duration>);
1607 /// ```
1608 pub fn set_or_clear_initial_delay<T>(mut self, v: std::option::Option<T>) -> Self
1609 where
1610 T: std::convert::Into<wkt::Duration>,
1611 {
1612 self.initial_delay = v.map(|x| x.into());
1613 self
1614 }
1615}
1616
1617impl wkt::message::Message for LivenessCheck {
1618 fn typename() -> &'static str {
1619 "type.googleapis.com/google.appengine.v1.LivenessCheck"
1620 }
1621}
1622
1623/// Third-party Python runtime library that is required by the application.
1624#[derive(Clone, Default, PartialEq)]
1625#[non_exhaustive]
1626pub struct Library {
1627 /// Name of the library. Example: "django".
1628 pub name: std::string::String,
1629
1630 /// Version of the library to select, or "latest".
1631 pub version: std::string::String,
1632
1633 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1634}
1635
1636impl Library {
1637 /// Creates a new default instance.
1638 pub fn new() -> Self {
1639 std::default::Default::default()
1640 }
1641
1642 /// Sets the value of [name][crate::model::Library::name].
1643 ///
1644 /// # Example
1645 /// ```ignore,no_run
1646 /// # use google_cloud_appengine_v1::model::Library;
1647 /// let x = Library::new().set_name("example");
1648 /// ```
1649 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1650 self.name = v.into();
1651 self
1652 }
1653
1654 /// Sets the value of [version][crate::model::Library::version].
1655 ///
1656 /// # Example
1657 /// ```ignore,no_run
1658 /// # use google_cloud_appengine_v1::model::Library;
1659 /// let x = Library::new().set_version("example");
1660 /// ```
1661 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1662 self.version = v.into();
1663 self
1664 }
1665}
1666
1667impl wkt::message::Message for Library {
1668 fn typename() -> &'static str {
1669 "type.googleapis.com/google.appengine.v1.Library"
1670 }
1671}
1672
1673/// Request message for `Applications.GetApplication`.
1674#[derive(Clone, Default, PartialEq)]
1675#[non_exhaustive]
1676pub struct GetApplicationRequest {
1677 /// Name of the Application resource to get. Example: `apps/myapp`.
1678 pub name: std::string::String,
1679
1680 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1681}
1682
1683impl GetApplicationRequest {
1684 /// Creates a new default instance.
1685 pub fn new() -> Self {
1686 std::default::Default::default()
1687 }
1688
1689 /// Sets the value of [name][crate::model::GetApplicationRequest::name].
1690 ///
1691 /// # Example
1692 /// ```ignore,no_run
1693 /// # use google_cloud_appengine_v1::model::GetApplicationRequest;
1694 /// let x = GetApplicationRequest::new().set_name("example");
1695 /// ```
1696 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1697 self.name = v.into();
1698 self
1699 }
1700}
1701
1702impl wkt::message::Message for GetApplicationRequest {
1703 fn typename() -> &'static str {
1704 "type.googleapis.com/google.appengine.v1.GetApplicationRequest"
1705 }
1706}
1707
1708/// Request message for `Applications.CreateApplication`.
1709#[derive(Clone, Default, PartialEq)]
1710#[non_exhaustive]
1711pub struct CreateApplicationRequest {
1712 /// Application configuration.
1713 pub application: std::option::Option<crate::model::Application>,
1714
1715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1716}
1717
1718impl CreateApplicationRequest {
1719 /// Creates a new default instance.
1720 pub fn new() -> Self {
1721 std::default::Default::default()
1722 }
1723
1724 /// Sets the value of [application][crate::model::CreateApplicationRequest::application].
1725 ///
1726 /// # Example
1727 /// ```ignore,no_run
1728 /// # use google_cloud_appengine_v1::model::CreateApplicationRequest;
1729 /// use google_cloud_appengine_v1::model::Application;
1730 /// let x = CreateApplicationRequest::new().set_application(Application::default()/* use setters */);
1731 /// ```
1732 pub fn set_application<T>(mut self, v: T) -> Self
1733 where
1734 T: std::convert::Into<crate::model::Application>,
1735 {
1736 self.application = std::option::Option::Some(v.into());
1737 self
1738 }
1739
1740 /// Sets or clears the value of [application][crate::model::CreateApplicationRequest::application].
1741 ///
1742 /// # Example
1743 /// ```ignore,no_run
1744 /// # use google_cloud_appengine_v1::model::CreateApplicationRequest;
1745 /// use google_cloud_appengine_v1::model::Application;
1746 /// let x = CreateApplicationRequest::new().set_or_clear_application(Some(Application::default()/* use setters */));
1747 /// let x = CreateApplicationRequest::new().set_or_clear_application(None::<Application>);
1748 /// ```
1749 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
1750 where
1751 T: std::convert::Into<crate::model::Application>,
1752 {
1753 self.application = v.map(|x| x.into());
1754 self
1755 }
1756}
1757
1758impl wkt::message::Message for CreateApplicationRequest {
1759 fn typename() -> &'static str {
1760 "type.googleapis.com/google.appengine.v1.CreateApplicationRequest"
1761 }
1762}
1763
1764/// Request message for `Applications.UpdateApplication`.
1765#[derive(Clone, Default, PartialEq)]
1766#[non_exhaustive]
1767pub struct UpdateApplicationRequest {
1768 /// Name of the Application resource to update. Example: `apps/myapp`.
1769 pub name: std::string::String,
1770
1771 /// An Application containing the updated resource.
1772 pub application: std::option::Option<crate::model::Application>,
1773
1774 /// Required. Standard field mask for the set of fields to be updated.
1775 pub update_mask: std::option::Option<wkt::FieldMask>,
1776
1777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1778}
1779
1780impl UpdateApplicationRequest {
1781 /// Creates a new default instance.
1782 pub fn new() -> Self {
1783 std::default::Default::default()
1784 }
1785
1786 /// Sets the value of [name][crate::model::UpdateApplicationRequest::name].
1787 ///
1788 /// # Example
1789 /// ```ignore,no_run
1790 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1791 /// let x = UpdateApplicationRequest::new().set_name("example");
1792 /// ```
1793 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1794 self.name = v.into();
1795 self
1796 }
1797
1798 /// Sets the value of [application][crate::model::UpdateApplicationRequest::application].
1799 ///
1800 /// # Example
1801 /// ```ignore,no_run
1802 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1803 /// use google_cloud_appengine_v1::model::Application;
1804 /// let x = UpdateApplicationRequest::new().set_application(Application::default()/* use setters */);
1805 /// ```
1806 pub fn set_application<T>(mut self, v: T) -> Self
1807 where
1808 T: std::convert::Into<crate::model::Application>,
1809 {
1810 self.application = std::option::Option::Some(v.into());
1811 self
1812 }
1813
1814 /// Sets or clears the value of [application][crate::model::UpdateApplicationRequest::application].
1815 ///
1816 /// # Example
1817 /// ```ignore,no_run
1818 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1819 /// use google_cloud_appengine_v1::model::Application;
1820 /// let x = UpdateApplicationRequest::new().set_or_clear_application(Some(Application::default()/* use setters */));
1821 /// let x = UpdateApplicationRequest::new().set_or_clear_application(None::<Application>);
1822 /// ```
1823 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
1824 where
1825 T: std::convert::Into<crate::model::Application>,
1826 {
1827 self.application = v.map(|x| x.into());
1828 self
1829 }
1830
1831 /// Sets the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
1832 ///
1833 /// # Example
1834 /// ```ignore,no_run
1835 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1836 /// use wkt::FieldMask;
1837 /// let x = UpdateApplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1838 /// ```
1839 pub fn set_update_mask<T>(mut self, v: T) -> Self
1840 where
1841 T: std::convert::Into<wkt::FieldMask>,
1842 {
1843 self.update_mask = std::option::Option::Some(v.into());
1844 self
1845 }
1846
1847 /// Sets or clears the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
1848 ///
1849 /// # Example
1850 /// ```ignore,no_run
1851 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1852 /// use wkt::FieldMask;
1853 /// let x = UpdateApplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1854 /// let x = UpdateApplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1855 /// ```
1856 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1857 where
1858 T: std::convert::Into<wkt::FieldMask>,
1859 {
1860 self.update_mask = v.map(|x| x.into());
1861 self
1862 }
1863}
1864
1865impl wkt::message::Message for UpdateApplicationRequest {
1866 fn typename() -> &'static str {
1867 "type.googleapis.com/google.appengine.v1.UpdateApplicationRequest"
1868 }
1869}
1870
1871/// Request message for 'Applications.RepairApplication'.
1872#[derive(Clone, Default, PartialEq)]
1873#[non_exhaustive]
1874pub struct RepairApplicationRequest {
1875 /// Name of the application to repair. Example: `apps/myapp`
1876 pub name: std::string::String,
1877
1878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1879}
1880
1881impl RepairApplicationRequest {
1882 /// Creates a new default instance.
1883 pub fn new() -> Self {
1884 std::default::Default::default()
1885 }
1886
1887 /// Sets the value of [name][crate::model::RepairApplicationRequest::name].
1888 ///
1889 /// # Example
1890 /// ```ignore,no_run
1891 /// # use google_cloud_appengine_v1::model::RepairApplicationRequest;
1892 /// let x = RepairApplicationRequest::new().set_name("example");
1893 /// ```
1894 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1895 self.name = v.into();
1896 self
1897 }
1898}
1899
1900impl wkt::message::Message for RepairApplicationRequest {
1901 fn typename() -> &'static str {
1902 "type.googleapis.com/google.appengine.v1.RepairApplicationRequest"
1903 }
1904}
1905
1906/// Request message for `Services.ListServices`.
1907#[derive(Clone, Default, PartialEq)]
1908#[non_exhaustive]
1909pub struct ListServicesRequest {
1910 /// Name of the parent Application resource. Example: `apps/myapp`.
1911 pub parent: std::string::String,
1912
1913 /// Maximum results to return per page.
1914 pub page_size: i32,
1915
1916 /// Continuation token for fetching the next page of results.
1917 pub page_token: std::string::String,
1918
1919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1920}
1921
1922impl ListServicesRequest {
1923 /// Creates a new default instance.
1924 pub fn new() -> Self {
1925 std::default::Default::default()
1926 }
1927
1928 /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
1929 ///
1930 /// # Example
1931 /// ```ignore,no_run
1932 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1933 /// let x = ListServicesRequest::new().set_parent("example");
1934 /// ```
1935 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1936 self.parent = v.into();
1937 self
1938 }
1939
1940 /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
1941 ///
1942 /// # Example
1943 /// ```ignore,no_run
1944 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1945 /// let x = ListServicesRequest::new().set_page_size(42);
1946 /// ```
1947 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1948 self.page_size = v.into();
1949 self
1950 }
1951
1952 /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
1953 ///
1954 /// # Example
1955 /// ```ignore,no_run
1956 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1957 /// let x = ListServicesRequest::new().set_page_token("example");
1958 /// ```
1959 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1960 self.page_token = v.into();
1961 self
1962 }
1963}
1964
1965impl wkt::message::Message for ListServicesRequest {
1966 fn typename() -> &'static str {
1967 "type.googleapis.com/google.appengine.v1.ListServicesRequest"
1968 }
1969}
1970
1971/// Response message for `Services.ListServices`.
1972#[derive(Clone, Default, PartialEq)]
1973#[non_exhaustive]
1974pub struct ListServicesResponse {
1975 /// The services belonging to the requested application.
1976 pub services: std::vec::Vec<crate::model::Service>,
1977
1978 /// Continuation token for fetching the next page of results.
1979 pub next_page_token: std::string::String,
1980
1981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1982}
1983
1984impl ListServicesResponse {
1985 /// Creates a new default instance.
1986 pub fn new() -> Self {
1987 std::default::Default::default()
1988 }
1989
1990 /// Sets the value of [services][crate::model::ListServicesResponse::services].
1991 ///
1992 /// # Example
1993 /// ```ignore,no_run
1994 /// # use google_cloud_appengine_v1::model::ListServicesResponse;
1995 /// use google_cloud_appengine_v1::model::Service;
1996 /// let x = ListServicesResponse::new()
1997 /// .set_services([
1998 /// Service::default()/* use setters */,
1999 /// Service::default()/* use (different) setters */,
2000 /// ]);
2001 /// ```
2002 pub fn set_services<T, V>(mut self, v: T) -> Self
2003 where
2004 T: std::iter::IntoIterator<Item = V>,
2005 V: std::convert::Into<crate::model::Service>,
2006 {
2007 use std::iter::Iterator;
2008 self.services = v.into_iter().map(|i| i.into()).collect();
2009 self
2010 }
2011
2012 /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
2013 ///
2014 /// # Example
2015 /// ```ignore,no_run
2016 /// # use google_cloud_appengine_v1::model::ListServicesResponse;
2017 /// let x = ListServicesResponse::new().set_next_page_token("example");
2018 /// ```
2019 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2020 self.next_page_token = v.into();
2021 self
2022 }
2023}
2024
2025impl wkt::message::Message for ListServicesResponse {
2026 fn typename() -> &'static str {
2027 "type.googleapis.com/google.appengine.v1.ListServicesResponse"
2028 }
2029}
2030
2031#[doc(hidden)]
2032impl google_cloud_gax::paginator::internal::PageableResponse for ListServicesResponse {
2033 type PageItem = crate::model::Service;
2034
2035 fn items(self) -> std::vec::Vec<Self::PageItem> {
2036 self.services
2037 }
2038
2039 fn next_page_token(&self) -> std::string::String {
2040 use std::clone::Clone;
2041 self.next_page_token.clone()
2042 }
2043}
2044
2045/// Request message for `Services.GetService`.
2046#[derive(Clone, Default, PartialEq)]
2047#[non_exhaustive]
2048pub struct GetServiceRequest {
2049 /// Name of the resource requested. Example: `apps/myapp/services/default`.
2050 pub name: std::string::String,
2051
2052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2053}
2054
2055impl GetServiceRequest {
2056 /// Creates a new default instance.
2057 pub fn new() -> Self {
2058 std::default::Default::default()
2059 }
2060
2061 /// Sets the value of [name][crate::model::GetServiceRequest::name].
2062 ///
2063 /// # Example
2064 /// ```ignore,no_run
2065 /// # use google_cloud_appengine_v1::model::GetServiceRequest;
2066 /// let x = GetServiceRequest::new().set_name("example");
2067 /// ```
2068 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2069 self.name = v.into();
2070 self
2071 }
2072}
2073
2074impl wkt::message::Message for GetServiceRequest {
2075 fn typename() -> &'static str {
2076 "type.googleapis.com/google.appengine.v1.GetServiceRequest"
2077 }
2078}
2079
2080/// Request message for `Services.UpdateService`.
2081#[derive(Clone, Default, PartialEq)]
2082#[non_exhaustive]
2083pub struct UpdateServiceRequest {
2084 /// Name of the resource to update. Example: `apps/myapp/services/default`.
2085 pub name: std::string::String,
2086
2087 /// A Service resource containing the updated service. Only fields set in the
2088 /// field mask will be updated.
2089 pub service: std::option::Option<crate::model::Service>,
2090
2091 /// Required. Standard field mask for the set of fields to be updated.
2092 pub update_mask: std::option::Option<wkt::FieldMask>,
2093
2094 /// Set to `true` to gradually shift traffic to one or more versions that you
2095 /// specify. By default, traffic is shifted immediately.
2096 /// For gradual traffic migration, the target versions
2097 /// must be located within instances that are configured for both
2098 /// [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType)
2099 /// and
2100 /// [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling).
2101 /// You must specify the
2102 /// [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy)
2103 /// field in the Service resource. Gradual traffic migration is not
2104 /// supported in the App Engine flexible environment. For examples, see
2105 /// [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
2106 pub migrate_traffic: bool,
2107
2108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2109}
2110
2111impl UpdateServiceRequest {
2112 /// Creates a new default instance.
2113 pub fn new() -> Self {
2114 std::default::Default::default()
2115 }
2116
2117 /// Sets the value of [name][crate::model::UpdateServiceRequest::name].
2118 ///
2119 /// # Example
2120 /// ```ignore,no_run
2121 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2122 /// let x = UpdateServiceRequest::new().set_name("example");
2123 /// ```
2124 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2125 self.name = v.into();
2126 self
2127 }
2128
2129 /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
2130 ///
2131 /// # Example
2132 /// ```ignore,no_run
2133 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2134 /// use google_cloud_appengine_v1::model::Service;
2135 /// let x = UpdateServiceRequest::new().set_service(Service::default()/* use setters */);
2136 /// ```
2137 pub fn set_service<T>(mut self, v: T) -> Self
2138 where
2139 T: std::convert::Into<crate::model::Service>,
2140 {
2141 self.service = std::option::Option::Some(v.into());
2142 self
2143 }
2144
2145 /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
2146 ///
2147 /// # Example
2148 /// ```ignore,no_run
2149 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2150 /// use google_cloud_appengine_v1::model::Service;
2151 /// let x = UpdateServiceRequest::new().set_or_clear_service(Some(Service::default()/* use setters */));
2152 /// let x = UpdateServiceRequest::new().set_or_clear_service(None::<Service>);
2153 /// ```
2154 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
2155 where
2156 T: std::convert::Into<crate::model::Service>,
2157 {
2158 self.service = v.map(|x| x.into());
2159 self
2160 }
2161
2162 /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
2163 ///
2164 /// # Example
2165 /// ```ignore,no_run
2166 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2167 /// use wkt::FieldMask;
2168 /// let x = UpdateServiceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2169 /// ```
2170 pub fn set_update_mask<T>(mut self, v: T) -> Self
2171 where
2172 T: std::convert::Into<wkt::FieldMask>,
2173 {
2174 self.update_mask = std::option::Option::Some(v.into());
2175 self
2176 }
2177
2178 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
2179 ///
2180 /// # Example
2181 /// ```ignore,no_run
2182 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2183 /// use wkt::FieldMask;
2184 /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2185 /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2186 /// ```
2187 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2188 where
2189 T: std::convert::Into<wkt::FieldMask>,
2190 {
2191 self.update_mask = v.map(|x| x.into());
2192 self
2193 }
2194
2195 /// Sets the value of [migrate_traffic][crate::model::UpdateServiceRequest::migrate_traffic].
2196 ///
2197 /// # Example
2198 /// ```ignore,no_run
2199 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2200 /// let x = UpdateServiceRequest::new().set_migrate_traffic(true);
2201 /// ```
2202 pub fn set_migrate_traffic<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2203 self.migrate_traffic = v.into();
2204 self
2205 }
2206}
2207
2208impl wkt::message::Message for UpdateServiceRequest {
2209 fn typename() -> &'static str {
2210 "type.googleapis.com/google.appengine.v1.UpdateServiceRequest"
2211 }
2212}
2213
2214/// Request message for `Services.DeleteService`.
2215#[derive(Clone, Default, PartialEq)]
2216#[non_exhaustive]
2217pub struct DeleteServiceRequest {
2218 /// Name of the resource requested. Example: `apps/myapp/services/default`.
2219 pub name: std::string::String,
2220
2221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2222}
2223
2224impl DeleteServiceRequest {
2225 /// Creates a new default instance.
2226 pub fn new() -> Self {
2227 std::default::Default::default()
2228 }
2229
2230 /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
2231 ///
2232 /// # Example
2233 /// ```ignore,no_run
2234 /// # use google_cloud_appengine_v1::model::DeleteServiceRequest;
2235 /// let x = DeleteServiceRequest::new().set_name("example");
2236 /// ```
2237 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2238 self.name = v.into();
2239 self
2240 }
2241}
2242
2243impl wkt::message::Message for DeleteServiceRequest {
2244 fn typename() -> &'static str {
2245 "type.googleapis.com/google.appengine.v1.DeleteServiceRequest"
2246 }
2247}
2248
2249/// Request message for `Versions.ListVersions`.
2250#[derive(Clone, Default, PartialEq)]
2251#[non_exhaustive]
2252pub struct ListVersionsRequest {
2253 /// Name of the parent Service resource. Example:
2254 /// `apps/myapp/services/default`.
2255 pub parent: std::string::String,
2256
2257 /// Controls the set of fields returned in the `List` response.
2258 pub view: crate::model::VersionView,
2259
2260 /// Maximum results to return per page.
2261 pub page_size: i32,
2262
2263 /// Continuation token for fetching the next page of results.
2264 pub page_token: std::string::String,
2265
2266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2267}
2268
2269impl ListVersionsRequest {
2270 /// Creates a new default instance.
2271 pub fn new() -> Self {
2272 std::default::Default::default()
2273 }
2274
2275 /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
2276 ///
2277 /// # Example
2278 /// ```ignore,no_run
2279 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2280 /// let x = ListVersionsRequest::new().set_parent("example");
2281 /// ```
2282 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2283 self.parent = v.into();
2284 self
2285 }
2286
2287 /// Sets the value of [view][crate::model::ListVersionsRequest::view].
2288 ///
2289 /// # Example
2290 /// ```ignore,no_run
2291 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2292 /// use google_cloud_appengine_v1::model::VersionView;
2293 /// let x0 = ListVersionsRequest::new().set_view(VersionView::Full);
2294 /// ```
2295 pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
2296 self.view = v.into();
2297 self
2298 }
2299
2300 /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
2301 ///
2302 /// # Example
2303 /// ```ignore,no_run
2304 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2305 /// let x = ListVersionsRequest::new().set_page_size(42);
2306 /// ```
2307 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2308 self.page_size = v.into();
2309 self
2310 }
2311
2312 /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
2313 ///
2314 /// # Example
2315 /// ```ignore,no_run
2316 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2317 /// let x = ListVersionsRequest::new().set_page_token("example");
2318 /// ```
2319 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2320 self.page_token = v.into();
2321 self
2322 }
2323}
2324
2325impl wkt::message::Message for ListVersionsRequest {
2326 fn typename() -> &'static str {
2327 "type.googleapis.com/google.appengine.v1.ListVersionsRequest"
2328 }
2329}
2330
2331/// Response message for `Versions.ListVersions`.
2332#[derive(Clone, Default, PartialEq)]
2333#[non_exhaustive]
2334pub struct ListVersionsResponse {
2335 /// The versions belonging to the requested service.
2336 pub versions: std::vec::Vec<crate::model::Version>,
2337
2338 /// Continuation token for fetching the next page of results.
2339 pub next_page_token: std::string::String,
2340
2341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2342}
2343
2344impl ListVersionsResponse {
2345 /// Creates a new default instance.
2346 pub fn new() -> Self {
2347 std::default::Default::default()
2348 }
2349
2350 /// Sets the value of [versions][crate::model::ListVersionsResponse::versions].
2351 ///
2352 /// # Example
2353 /// ```ignore,no_run
2354 /// # use google_cloud_appengine_v1::model::ListVersionsResponse;
2355 /// use google_cloud_appengine_v1::model::Version;
2356 /// let x = ListVersionsResponse::new()
2357 /// .set_versions([
2358 /// Version::default()/* use setters */,
2359 /// Version::default()/* use (different) setters */,
2360 /// ]);
2361 /// ```
2362 pub fn set_versions<T, V>(mut self, v: T) -> Self
2363 where
2364 T: std::iter::IntoIterator<Item = V>,
2365 V: std::convert::Into<crate::model::Version>,
2366 {
2367 use std::iter::Iterator;
2368 self.versions = v.into_iter().map(|i| i.into()).collect();
2369 self
2370 }
2371
2372 /// Sets the value of [next_page_token][crate::model::ListVersionsResponse::next_page_token].
2373 ///
2374 /// # Example
2375 /// ```ignore,no_run
2376 /// # use google_cloud_appengine_v1::model::ListVersionsResponse;
2377 /// let x = ListVersionsResponse::new().set_next_page_token("example");
2378 /// ```
2379 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2380 self.next_page_token = v.into();
2381 self
2382 }
2383}
2384
2385impl wkt::message::Message for ListVersionsResponse {
2386 fn typename() -> &'static str {
2387 "type.googleapis.com/google.appengine.v1.ListVersionsResponse"
2388 }
2389}
2390
2391#[doc(hidden)]
2392impl google_cloud_gax::paginator::internal::PageableResponse for ListVersionsResponse {
2393 type PageItem = crate::model::Version;
2394
2395 fn items(self) -> std::vec::Vec<Self::PageItem> {
2396 self.versions
2397 }
2398
2399 fn next_page_token(&self) -> std::string::String {
2400 use std::clone::Clone;
2401 self.next_page_token.clone()
2402 }
2403}
2404
2405/// Request message for `Versions.GetVersion`.
2406#[derive(Clone, Default, PartialEq)]
2407#[non_exhaustive]
2408pub struct GetVersionRequest {
2409 /// Name of the resource requested. Example:
2410 /// `apps/myapp/services/default/versions/v1`.
2411 pub name: std::string::String,
2412
2413 /// Controls the set of fields returned in the `Get` response.
2414 pub view: crate::model::VersionView,
2415
2416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2417}
2418
2419impl GetVersionRequest {
2420 /// Creates a new default instance.
2421 pub fn new() -> Self {
2422 std::default::Default::default()
2423 }
2424
2425 /// Sets the value of [name][crate::model::GetVersionRequest::name].
2426 ///
2427 /// # Example
2428 /// ```ignore,no_run
2429 /// # use google_cloud_appengine_v1::model::GetVersionRequest;
2430 /// let x = GetVersionRequest::new().set_name("example");
2431 /// ```
2432 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2433 self.name = v.into();
2434 self
2435 }
2436
2437 /// Sets the value of [view][crate::model::GetVersionRequest::view].
2438 ///
2439 /// # Example
2440 /// ```ignore,no_run
2441 /// # use google_cloud_appengine_v1::model::GetVersionRequest;
2442 /// use google_cloud_appengine_v1::model::VersionView;
2443 /// let x0 = GetVersionRequest::new().set_view(VersionView::Full);
2444 /// ```
2445 pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
2446 self.view = v.into();
2447 self
2448 }
2449}
2450
2451impl wkt::message::Message for GetVersionRequest {
2452 fn typename() -> &'static str {
2453 "type.googleapis.com/google.appengine.v1.GetVersionRequest"
2454 }
2455}
2456
2457/// Request message for `Versions.CreateVersion`.
2458#[derive(Clone, Default, PartialEq)]
2459#[non_exhaustive]
2460pub struct CreateVersionRequest {
2461 /// Name of the parent resource to create this version under. Example:
2462 /// `apps/myapp/services/default`.
2463 pub parent: std::string::String,
2464
2465 /// Application deployment configuration.
2466 pub version: std::option::Option<crate::model::Version>,
2467
2468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2469}
2470
2471impl CreateVersionRequest {
2472 /// Creates a new default instance.
2473 pub fn new() -> Self {
2474 std::default::Default::default()
2475 }
2476
2477 /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
2478 ///
2479 /// # Example
2480 /// ```ignore,no_run
2481 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2482 /// let x = CreateVersionRequest::new().set_parent("example");
2483 /// ```
2484 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2485 self.parent = v.into();
2486 self
2487 }
2488
2489 /// Sets the value of [version][crate::model::CreateVersionRequest::version].
2490 ///
2491 /// # Example
2492 /// ```ignore,no_run
2493 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2494 /// use google_cloud_appengine_v1::model::Version;
2495 /// let x = CreateVersionRequest::new().set_version(Version::default()/* use setters */);
2496 /// ```
2497 pub fn set_version<T>(mut self, v: T) -> Self
2498 where
2499 T: std::convert::Into<crate::model::Version>,
2500 {
2501 self.version = std::option::Option::Some(v.into());
2502 self
2503 }
2504
2505 /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
2506 ///
2507 /// # Example
2508 /// ```ignore,no_run
2509 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2510 /// use google_cloud_appengine_v1::model::Version;
2511 /// let x = CreateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
2512 /// let x = CreateVersionRequest::new().set_or_clear_version(None::<Version>);
2513 /// ```
2514 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2515 where
2516 T: std::convert::Into<crate::model::Version>,
2517 {
2518 self.version = v.map(|x| x.into());
2519 self
2520 }
2521}
2522
2523impl wkt::message::Message for CreateVersionRequest {
2524 fn typename() -> &'static str {
2525 "type.googleapis.com/google.appengine.v1.CreateVersionRequest"
2526 }
2527}
2528
2529/// Request message for `Versions.UpdateVersion`.
2530#[derive(Clone, Default, PartialEq)]
2531#[non_exhaustive]
2532pub struct UpdateVersionRequest {
2533 /// Name of the resource to update. Example:
2534 /// `apps/myapp/services/default/versions/1`.
2535 pub name: std::string::String,
2536
2537 /// A Version containing the updated resource. Only fields set in the field
2538 /// mask will be updated.
2539 pub version: std::option::Option<crate::model::Version>,
2540
2541 /// Standard field mask for the set of fields to be updated.
2542 pub update_mask: std::option::Option<wkt::FieldMask>,
2543
2544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2545}
2546
2547impl UpdateVersionRequest {
2548 /// Creates a new default instance.
2549 pub fn new() -> Self {
2550 std::default::Default::default()
2551 }
2552
2553 /// Sets the value of [name][crate::model::UpdateVersionRequest::name].
2554 ///
2555 /// # Example
2556 /// ```ignore,no_run
2557 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2558 /// let x = UpdateVersionRequest::new().set_name("example");
2559 /// ```
2560 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2561 self.name = v.into();
2562 self
2563 }
2564
2565 /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
2566 ///
2567 /// # Example
2568 /// ```ignore,no_run
2569 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2570 /// use google_cloud_appengine_v1::model::Version;
2571 /// let x = UpdateVersionRequest::new().set_version(Version::default()/* use setters */);
2572 /// ```
2573 pub fn set_version<T>(mut self, v: T) -> Self
2574 where
2575 T: std::convert::Into<crate::model::Version>,
2576 {
2577 self.version = std::option::Option::Some(v.into());
2578 self
2579 }
2580
2581 /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
2582 ///
2583 /// # Example
2584 /// ```ignore,no_run
2585 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2586 /// use google_cloud_appengine_v1::model::Version;
2587 /// let x = UpdateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
2588 /// let x = UpdateVersionRequest::new().set_or_clear_version(None::<Version>);
2589 /// ```
2590 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2591 where
2592 T: std::convert::Into<crate::model::Version>,
2593 {
2594 self.version = v.map(|x| x.into());
2595 self
2596 }
2597
2598 /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
2599 ///
2600 /// # Example
2601 /// ```ignore,no_run
2602 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2603 /// use wkt::FieldMask;
2604 /// let x = UpdateVersionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2605 /// ```
2606 pub fn set_update_mask<T>(mut self, v: T) -> Self
2607 where
2608 T: std::convert::Into<wkt::FieldMask>,
2609 {
2610 self.update_mask = std::option::Option::Some(v.into());
2611 self
2612 }
2613
2614 /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
2615 ///
2616 /// # Example
2617 /// ```ignore,no_run
2618 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2619 /// use wkt::FieldMask;
2620 /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2621 /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2622 /// ```
2623 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2624 where
2625 T: std::convert::Into<wkt::FieldMask>,
2626 {
2627 self.update_mask = v.map(|x| x.into());
2628 self
2629 }
2630}
2631
2632impl wkt::message::Message for UpdateVersionRequest {
2633 fn typename() -> &'static str {
2634 "type.googleapis.com/google.appengine.v1.UpdateVersionRequest"
2635 }
2636}
2637
2638/// Request message for `Versions.DeleteVersion`.
2639#[derive(Clone, Default, PartialEq)]
2640#[non_exhaustive]
2641pub struct DeleteVersionRequest {
2642 /// Name of the resource requested. Example:
2643 /// `apps/myapp/services/default/versions/v1`.
2644 pub name: std::string::String,
2645
2646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2647}
2648
2649impl DeleteVersionRequest {
2650 /// Creates a new default instance.
2651 pub fn new() -> Self {
2652 std::default::Default::default()
2653 }
2654
2655 /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
2656 ///
2657 /// # Example
2658 /// ```ignore,no_run
2659 /// # use google_cloud_appengine_v1::model::DeleteVersionRequest;
2660 /// let x = DeleteVersionRequest::new().set_name("example");
2661 /// ```
2662 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2663 self.name = v.into();
2664 self
2665 }
2666}
2667
2668impl wkt::message::Message for DeleteVersionRequest {
2669 fn typename() -> &'static str {
2670 "type.googleapis.com/google.appengine.v1.DeleteVersionRequest"
2671 }
2672}
2673
2674/// Request message for `Instances.ListInstances`.
2675#[derive(Clone, Default, PartialEq)]
2676#[non_exhaustive]
2677pub struct ListInstancesRequest {
2678 /// Name of the parent Version resource. Example:
2679 /// `apps/myapp/services/default/versions/v1`.
2680 pub parent: std::string::String,
2681
2682 /// Maximum results to return per page.
2683 pub page_size: i32,
2684
2685 /// Continuation token for fetching the next page of results.
2686 pub page_token: std::string::String,
2687
2688 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2689}
2690
2691impl ListInstancesRequest {
2692 /// Creates a new default instance.
2693 pub fn new() -> Self {
2694 std::default::Default::default()
2695 }
2696
2697 /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
2698 ///
2699 /// # Example
2700 /// ```ignore,no_run
2701 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2702 /// let x = ListInstancesRequest::new().set_parent("example");
2703 /// ```
2704 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2705 self.parent = v.into();
2706 self
2707 }
2708
2709 /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
2710 ///
2711 /// # Example
2712 /// ```ignore,no_run
2713 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2714 /// let x = ListInstancesRequest::new().set_page_size(42);
2715 /// ```
2716 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2717 self.page_size = v.into();
2718 self
2719 }
2720
2721 /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
2722 ///
2723 /// # Example
2724 /// ```ignore,no_run
2725 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2726 /// let x = ListInstancesRequest::new().set_page_token("example");
2727 /// ```
2728 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2729 self.page_token = v.into();
2730 self
2731 }
2732}
2733
2734impl wkt::message::Message for ListInstancesRequest {
2735 fn typename() -> &'static str {
2736 "type.googleapis.com/google.appengine.v1.ListInstancesRequest"
2737 }
2738}
2739
2740/// Response message for `Instances.ListInstances`.
2741#[derive(Clone, Default, PartialEq)]
2742#[non_exhaustive]
2743pub struct ListInstancesResponse {
2744 /// The instances belonging to the requested version.
2745 pub instances: std::vec::Vec<crate::model::Instance>,
2746
2747 /// Continuation token for fetching the next page of results.
2748 pub next_page_token: std::string::String,
2749
2750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2751}
2752
2753impl ListInstancesResponse {
2754 /// Creates a new default instance.
2755 pub fn new() -> Self {
2756 std::default::Default::default()
2757 }
2758
2759 /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
2760 ///
2761 /// # Example
2762 /// ```ignore,no_run
2763 /// # use google_cloud_appengine_v1::model::ListInstancesResponse;
2764 /// use google_cloud_appengine_v1::model::Instance;
2765 /// let x = ListInstancesResponse::new()
2766 /// .set_instances([
2767 /// Instance::default()/* use setters */,
2768 /// Instance::default()/* use (different) setters */,
2769 /// ]);
2770 /// ```
2771 pub fn set_instances<T, V>(mut self, v: T) -> Self
2772 where
2773 T: std::iter::IntoIterator<Item = V>,
2774 V: std::convert::Into<crate::model::Instance>,
2775 {
2776 use std::iter::Iterator;
2777 self.instances = v.into_iter().map(|i| i.into()).collect();
2778 self
2779 }
2780
2781 /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
2782 ///
2783 /// # Example
2784 /// ```ignore,no_run
2785 /// # use google_cloud_appengine_v1::model::ListInstancesResponse;
2786 /// let x = ListInstancesResponse::new().set_next_page_token("example");
2787 /// ```
2788 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2789 self.next_page_token = v.into();
2790 self
2791 }
2792}
2793
2794impl wkt::message::Message for ListInstancesResponse {
2795 fn typename() -> &'static str {
2796 "type.googleapis.com/google.appengine.v1.ListInstancesResponse"
2797 }
2798}
2799
2800#[doc(hidden)]
2801impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
2802 type PageItem = crate::model::Instance;
2803
2804 fn items(self) -> std::vec::Vec<Self::PageItem> {
2805 self.instances
2806 }
2807
2808 fn next_page_token(&self) -> std::string::String {
2809 use std::clone::Clone;
2810 self.next_page_token.clone()
2811 }
2812}
2813
2814/// Request message for `Instances.GetInstance`.
2815#[derive(Clone, Default, PartialEq)]
2816#[non_exhaustive]
2817pub struct GetInstanceRequest {
2818 /// Name of the resource requested. Example:
2819 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2820 pub name: std::string::String,
2821
2822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2823}
2824
2825impl GetInstanceRequest {
2826 /// Creates a new default instance.
2827 pub fn new() -> Self {
2828 std::default::Default::default()
2829 }
2830
2831 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2832 ///
2833 /// # Example
2834 /// ```ignore,no_run
2835 /// # use google_cloud_appengine_v1::model::GetInstanceRequest;
2836 /// let x = GetInstanceRequest::new().set_name("example");
2837 /// ```
2838 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2839 self.name = v.into();
2840 self
2841 }
2842}
2843
2844impl wkt::message::Message for GetInstanceRequest {
2845 fn typename() -> &'static str {
2846 "type.googleapis.com/google.appengine.v1.GetInstanceRequest"
2847 }
2848}
2849
2850/// Request message for `Instances.DeleteInstance`.
2851#[derive(Clone, Default, PartialEq)]
2852#[non_exhaustive]
2853pub struct DeleteInstanceRequest {
2854 /// Name of the resource requested. Example:
2855 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2856 pub name: std::string::String,
2857
2858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2859}
2860
2861impl DeleteInstanceRequest {
2862 /// Creates a new default instance.
2863 pub fn new() -> Self {
2864 std::default::Default::default()
2865 }
2866
2867 /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
2868 ///
2869 /// # Example
2870 /// ```ignore,no_run
2871 /// # use google_cloud_appengine_v1::model::DeleteInstanceRequest;
2872 /// let x = DeleteInstanceRequest::new().set_name("example");
2873 /// ```
2874 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2875 self.name = v.into();
2876 self
2877 }
2878}
2879
2880impl wkt::message::Message for DeleteInstanceRequest {
2881 fn typename() -> &'static str {
2882 "type.googleapis.com/google.appengine.v1.DeleteInstanceRequest"
2883 }
2884}
2885
2886/// Request message for `Instances.DebugInstance`.
2887#[derive(Clone, Default, PartialEq)]
2888#[non_exhaustive]
2889pub struct DebugInstanceRequest {
2890 /// Name of the resource requested. Example:
2891 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2892 pub name: std::string::String,
2893
2894 /// Public SSH key to add to the instance. Examples:
2895 ///
2896 /// * `[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]`
2897 /// * `[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}`
2898 ///
2899 /// For more information, see
2900 /// [Adding and Removing SSH Keys](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).
2901 pub ssh_key: std::string::String,
2902
2903 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2904}
2905
2906impl DebugInstanceRequest {
2907 /// Creates a new default instance.
2908 pub fn new() -> Self {
2909 std::default::Default::default()
2910 }
2911
2912 /// Sets the value of [name][crate::model::DebugInstanceRequest::name].
2913 ///
2914 /// # Example
2915 /// ```ignore,no_run
2916 /// # use google_cloud_appengine_v1::model::DebugInstanceRequest;
2917 /// let x = DebugInstanceRequest::new().set_name("example");
2918 /// ```
2919 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2920 self.name = v.into();
2921 self
2922 }
2923
2924 /// Sets the value of [ssh_key][crate::model::DebugInstanceRequest::ssh_key].
2925 ///
2926 /// # Example
2927 /// ```ignore,no_run
2928 /// # use google_cloud_appengine_v1::model::DebugInstanceRequest;
2929 /// let x = DebugInstanceRequest::new().set_ssh_key("example");
2930 /// ```
2931 pub fn set_ssh_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2932 self.ssh_key = v.into();
2933 self
2934 }
2935}
2936
2937impl wkt::message::Message for DebugInstanceRequest {
2938 fn typename() -> &'static str {
2939 "type.googleapis.com/google.appengine.v1.DebugInstanceRequest"
2940 }
2941}
2942
2943/// Request message for `Firewall.ListIngressRules`.
2944#[derive(Clone, Default, PartialEq)]
2945#[non_exhaustive]
2946pub struct ListIngressRulesRequest {
2947 /// Name of the Firewall collection to retrieve.
2948 /// Example: `apps/myapp/firewall/ingressRules`.
2949 pub parent: std::string::String,
2950
2951 /// Maximum results to return per page.
2952 pub page_size: i32,
2953
2954 /// Continuation token for fetching the next page of results.
2955 pub page_token: std::string::String,
2956
2957 /// A valid IP Address. If set, only rules matching this address will be
2958 /// returned. The first returned rule will be the rule that fires on requests
2959 /// from this IP.
2960 pub matching_address: std::string::String,
2961
2962 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2963}
2964
2965impl ListIngressRulesRequest {
2966 /// Creates a new default instance.
2967 pub fn new() -> Self {
2968 std::default::Default::default()
2969 }
2970
2971 /// Sets the value of [parent][crate::model::ListIngressRulesRequest::parent].
2972 ///
2973 /// # Example
2974 /// ```ignore,no_run
2975 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2976 /// let x = ListIngressRulesRequest::new().set_parent("example");
2977 /// ```
2978 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2979 self.parent = v.into();
2980 self
2981 }
2982
2983 /// Sets the value of [page_size][crate::model::ListIngressRulesRequest::page_size].
2984 ///
2985 /// # Example
2986 /// ```ignore,no_run
2987 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2988 /// let x = ListIngressRulesRequest::new().set_page_size(42);
2989 /// ```
2990 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2991 self.page_size = v.into();
2992 self
2993 }
2994
2995 /// Sets the value of [page_token][crate::model::ListIngressRulesRequest::page_token].
2996 ///
2997 /// # Example
2998 /// ```ignore,no_run
2999 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
3000 /// let x = ListIngressRulesRequest::new().set_page_token("example");
3001 /// ```
3002 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3003 self.page_token = v.into();
3004 self
3005 }
3006
3007 /// Sets the value of [matching_address][crate::model::ListIngressRulesRequest::matching_address].
3008 ///
3009 /// # Example
3010 /// ```ignore,no_run
3011 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
3012 /// let x = ListIngressRulesRequest::new().set_matching_address("example");
3013 /// ```
3014 pub fn set_matching_address<T: std::convert::Into<std::string::String>>(
3015 mut self,
3016 v: T,
3017 ) -> Self {
3018 self.matching_address = v.into();
3019 self
3020 }
3021}
3022
3023impl wkt::message::Message for ListIngressRulesRequest {
3024 fn typename() -> &'static str {
3025 "type.googleapis.com/google.appengine.v1.ListIngressRulesRequest"
3026 }
3027}
3028
3029/// Response message for `Firewall.ListIngressRules`.
3030#[derive(Clone, Default, PartialEq)]
3031#[non_exhaustive]
3032pub struct ListIngressRulesResponse {
3033 /// The ingress FirewallRules for this application.
3034 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3035
3036 /// Continuation token for fetching the next page of results.
3037 pub next_page_token: std::string::String,
3038
3039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3040}
3041
3042impl ListIngressRulesResponse {
3043 /// Creates a new default instance.
3044 pub fn new() -> Self {
3045 std::default::Default::default()
3046 }
3047
3048 /// Sets the value of [ingress_rules][crate::model::ListIngressRulesResponse::ingress_rules].
3049 ///
3050 /// # Example
3051 /// ```ignore,no_run
3052 /// # use google_cloud_appengine_v1::model::ListIngressRulesResponse;
3053 /// use google_cloud_appengine_v1::model::FirewallRule;
3054 /// let x = ListIngressRulesResponse::new()
3055 /// .set_ingress_rules([
3056 /// FirewallRule::default()/* use setters */,
3057 /// FirewallRule::default()/* use (different) setters */,
3058 /// ]);
3059 /// ```
3060 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3061 where
3062 T: std::iter::IntoIterator<Item = V>,
3063 V: std::convert::Into<crate::model::FirewallRule>,
3064 {
3065 use std::iter::Iterator;
3066 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3067 self
3068 }
3069
3070 /// Sets the value of [next_page_token][crate::model::ListIngressRulesResponse::next_page_token].
3071 ///
3072 /// # Example
3073 /// ```ignore,no_run
3074 /// # use google_cloud_appengine_v1::model::ListIngressRulesResponse;
3075 /// let x = ListIngressRulesResponse::new().set_next_page_token("example");
3076 /// ```
3077 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3078 self.next_page_token = v.into();
3079 self
3080 }
3081}
3082
3083impl wkt::message::Message for ListIngressRulesResponse {
3084 fn typename() -> &'static str {
3085 "type.googleapis.com/google.appengine.v1.ListIngressRulesResponse"
3086 }
3087}
3088
3089#[doc(hidden)]
3090impl google_cloud_gax::paginator::internal::PageableResponse for ListIngressRulesResponse {
3091 type PageItem = crate::model::FirewallRule;
3092
3093 fn items(self) -> std::vec::Vec<Self::PageItem> {
3094 self.ingress_rules
3095 }
3096
3097 fn next_page_token(&self) -> std::string::String {
3098 use std::clone::Clone;
3099 self.next_page_token.clone()
3100 }
3101}
3102
3103/// Request message for `Firewall.BatchUpdateIngressRules`.
3104#[derive(Clone, Default, PartialEq)]
3105#[non_exhaustive]
3106pub struct BatchUpdateIngressRulesRequest {
3107 /// Name of the Firewall collection to set.
3108 /// Example: `apps/myapp/firewall/ingressRules`.
3109 pub name: std::string::String,
3110
3111 /// A list of FirewallRules to replace the existing set.
3112 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3113
3114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3115}
3116
3117impl BatchUpdateIngressRulesRequest {
3118 /// Creates a new default instance.
3119 pub fn new() -> Self {
3120 std::default::Default::default()
3121 }
3122
3123 /// Sets the value of [name][crate::model::BatchUpdateIngressRulesRequest::name].
3124 ///
3125 /// # Example
3126 /// ```ignore,no_run
3127 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesRequest;
3128 /// let x = BatchUpdateIngressRulesRequest::new().set_name("example");
3129 /// ```
3130 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3131 self.name = v.into();
3132 self
3133 }
3134
3135 /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesRequest::ingress_rules].
3136 ///
3137 /// # Example
3138 /// ```ignore,no_run
3139 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesRequest;
3140 /// use google_cloud_appengine_v1::model::FirewallRule;
3141 /// let x = BatchUpdateIngressRulesRequest::new()
3142 /// .set_ingress_rules([
3143 /// FirewallRule::default()/* use setters */,
3144 /// FirewallRule::default()/* use (different) setters */,
3145 /// ]);
3146 /// ```
3147 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3148 where
3149 T: std::iter::IntoIterator<Item = V>,
3150 V: std::convert::Into<crate::model::FirewallRule>,
3151 {
3152 use std::iter::Iterator;
3153 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3154 self
3155 }
3156}
3157
3158impl wkt::message::Message for BatchUpdateIngressRulesRequest {
3159 fn typename() -> &'static str {
3160 "type.googleapis.com/google.appengine.v1.BatchUpdateIngressRulesRequest"
3161 }
3162}
3163
3164/// Response message for `Firewall.UpdateAllIngressRules`.
3165#[derive(Clone, Default, PartialEq)]
3166#[non_exhaustive]
3167pub struct BatchUpdateIngressRulesResponse {
3168 /// The full list of ingress FirewallRules for this application.
3169 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3170
3171 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3172}
3173
3174impl BatchUpdateIngressRulesResponse {
3175 /// Creates a new default instance.
3176 pub fn new() -> Self {
3177 std::default::Default::default()
3178 }
3179
3180 /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesResponse::ingress_rules].
3181 ///
3182 /// # Example
3183 /// ```ignore,no_run
3184 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesResponse;
3185 /// use google_cloud_appengine_v1::model::FirewallRule;
3186 /// let x = BatchUpdateIngressRulesResponse::new()
3187 /// .set_ingress_rules([
3188 /// FirewallRule::default()/* use setters */,
3189 /// FirewallRule::default()/* use (different) setters */,
3190 /// ]);
3191 /// ```
3192 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3193 where
3194 T: std::iter::IntoIterator<Item = V>,
3195 V: std::convert::Into<crate::model::FirewallRule>,
3196 {
3197 use std::iter::Iterator;
3198 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3199 self
3200 }
3201}
3202
3203impl wkt::message::Message for BatchUpdateIngressRulesResponse {
3204 fn typename() -> &'static str {
3205 "type.googleapis.com/google.appengine.v1.BatchUpdateIngressRulesResponse"
3206 }
3207}
3208
3209/// Request message for `Firewall.CreateIngressRule`.
3210#[derive(Clone, Default, PartialEq)]
3211#[non_exhaustive]
3212pub struct CreateIngressRuleRequest {
3213 /// Name of the parent Firewall collection in which to create a new rule.
3214 /// Example: `apps/myapp/firewall/ingressRules`.
3215 pub parent: std::string::String,
3216
3217 /// A FirewallRule containing the new resource.
3218 ///
3219 /// The user may optionally provide a position at which the new rule will be
3220 /// placed. The positions define a sequential list starting at 1. If a rule
3221 /// already exists at the given position, rules greater than the provided
3222 /// position will be moved forward by one.
3223 ///
3224 /// If no position is provided, the server will place the rule as the second to
3225 /// last rule in the sequence before the required default allow-all or deny-all
3226 /// rule.
3227 pub rule: std::option::Option<crate::model::FirewallRule>,
3228
3229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3230}
3231
3232impl CreateIngressRuleRequest {
3233 /// Creates a new default instance.
3234 pub fn new() -> Self {
3235 std::default::Default::default()
3236 }
3237
3238 /// Sets the value of [parent][crate::model::CreateIngressRuleRequest::parent].
3239 ///
3240 /// # Example
3241 /// ```ignore,no_run
3242 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3243 /// let x = CreateIngressRuleRequest::new().set_parent("example");
3244 /// ```
3245 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3246 self.parent = v.into();
3247 self
3248 }
3249
3250 /// Sets the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3251 ///
3252 /// # Example
3253 /// ```ignore,no_run
3254 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3255 /// use google_cloud_appengine_v1::model::FirewallRule;
3256 /// let x = CreateIngressRuleRequest::new().set_rule(FirewallRule::default()/* use setters */);
3257 /// ```
3258 pub fn set_rule<T>(mut self, v: T) -> Self
3259 where
3260 T: std::convert::Into<crate::model::FirewallRule>,
3261 {
3262 self.rule = std::option::Option::Some(v.into());
3263 self
3264 }
3265
3266 /// Sets or clears the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3267 ///
3268 /// # Example
3269 /// ```ignore,no_run
3270 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3271 /// use google_cloud_appengine_v1::model::FirewallRule;
3272 /// let x = CreateIngressRuleRequest::new().set_or_clear_rule(Some(FirewallRule::default()/* use setters */));
3273 /// let x = CreateIngressRuleRequest::new().set_or_clear_rule(None::<FirewallRule>);
3274 /// ```
3275 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3276 where
3277 T: std::convert::Into<crate::model::FirewallRule>,
3278 {
3279 self.rule = v.map(|x| x.into());
3280 self
3281 }
3282}
3283
3284impl wkt::message::Message for CreateIngressRuleRequest {
3285 fn typename() -> &'static str {
3286 "type.googleapis.com/google.appengine.v1.CreateIngressRuleRequest"
3287 }
3288}
3289
3290/// Request message for `Firewall.GetIngressRule`.
3291#[derive(Clone, Default, PartialEq)]
3292#[non_exhaustive]
3293pub struct GetIngressRuleRequest {
3294 /// Name of the Firewall resource to retrieve.
3295 /// Example: `apps/myapp/firewall/ingressRules/100`.
3296 pub name: std::string::String,
3297
3298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3299}
3300
3301impl GetIngressRuleRequest {
3302 /// Creates a new default instance.
3303 pub fn new() -> Self {
3304 std::default::Default::default()
3305 }
3306
3307 /// Sets the value of [name][crate::model::GetIngressRuleRequest::name].
3308 ///
3309 /// # Example
3310 /// ```ignore,no_run
3311 /// # use google_cloud_appengine_v1::model::GetIngressRuleRequest;
3312 /// let x = GetIngressRuleRequest::new().set_name("example");
3313 /// ```
3314 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3315 self.name = v.into();
3316 self
3317 }
3318}
3319
3320impl wkt::message::Message for GetIngressRuleRequest {
3321 fn typename() -> &'static str {
3322 "type.googleapis.com/google.appengine.v1.GetIngressRuleRequest"
3323 }
3324}
3325
3326/// Request message for `Firewall.UpdateIngressRule`.
3327#[derive(Clone, Default, PartialEq)]
3328#[non_exhaustive]
3329pub struct UpdateIngressRuleRequest {
3330 /// Name of the Firewall resource to update.
3331 /// Example: `apps/myapp/firewall/ingressRules/100`.
3332 pub name: std::string::String,
3333
3334 /// A FirewallRule containing the updated resource
3335 pub rule: std::option::Option<crate::model::FirewallRule>,
3336
3337 /// Standard field mask for the set of fields to be updated.
3338 pub update_mask: std::option::Option<wkt::FieldMask>,
3339
3340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3341}
3342
3343impl UpdateIngressRuleRequest {
3344 /// Creates a new default instance.
3345 pub fn new() -> Self {
3346 std::default::Default::default()
3347 }
3348
3349 /// Sets the value of [name][crate::model::UpdateIngressRuleRequest::name].
3350 ///
3351 /// # Example
3352 /// ```ignore,no_run
3353 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3354 /// let x = UpdateIngressRuleRequest::new().set_name("example");
3355 /// ```
3356 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3357 self.name = v.into();
3358 self
3359 }
3360
3361 /// Sets the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3362 ///
3363 /// # Example
3364 /// ```ignore,no_run
3365 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3366 /// use google_cloud_appengine_v1::model::FirewallRule;
3367 /// let x = UpdateIngressRuleRequest::new().set_rule(FirewallRule::default()/* use setters */);
3368 /// ```
3369 pub fn set_rule<T>(mut self, v: T) -> Self
3370 where
3371 T: std::convert::Into<crate::model::FirewallRule>,
3372 {
3373 self.rule = std::option::Option::Some(v.into());
3374 self
3375 }
3376
3377 /// Sets or clears the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3378 ///
3379 /// # Example
3380 /// ```ignore,no_run
3381 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3382 /// use google_cloud_appengine_v1::model::FirewallRule;
3383 /// let x = UpdateIngressRuleRequest::new().set_or_clear_rule(Some(FirewallRule::default()/* use setters */));
3384 /// let x = UpdateIngressRuleRequest::new().set_or_clear_rule(None::<FirewallRule>);
3385 /// ```
3386 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3387 where
3388 T: std::convert::Into<crate::model::FirewallRule>,
3389 {
3390 self.rule = v.map(|x| x.into());
3391 self
3392 }
3393
3394 /// Sets the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3395 ///
3396 /// # Example
3397 /// ```ignore,no_run
3398 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3399 /// use wkt::FieldMask;
3400 /// let x = UpdateIngressRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3401 /// ```
3402 pub fn set_update_mask<T>(mut self, v: T) -> Self
3403 where
3404 T: std::convert::Into<wkt::FieldMask>,
3405 {
3406 self.update_mask = std::option::Option::Some(v.into());
3407 self
3408 }
3409
3410 /// Sets or clears the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3411 ///
3412 /// # Example
3413 /// ```ignore,no_run
3414 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3415 /// use wkt::FieldMask;
3416 /// let x = UpdateIngressRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3417 /// let x = UpdateIngressRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3418 /// ```
3419 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3420 where
3421 T: std::convert::Into<wkt::FieldMask>,
3422 {
3423 self.update_mask = v.map(|x| x.into());
3424 self
3425 }
3426}
3427
3428impl wkt::message::Message for UpdateIngressRuleRequest {
3429 fn typename() -> &'static str {
3430 "type.googleapis.com/google.appengine.v1.UpdateIngressRuleRequest"
3431 }
3432}
3433
3434/// Request message for `Firewall.DeleteIngressRule`.
3435#[derive(Clone, Default, PartialEq)]
3436#[non_exhaustive]
3437pub struct DeleteIngressRuleRequest {
3438 /// Name of the Firewall resource to delete.
3439 /// Example: `apps/myapp/firewall/ingressRules/100`.
3440 pub name: std::string::String,
3441
3442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3443}
3444
3445impl DeleteIngressRuleRequest {
3446 /// Creates a new default instance.
3447 pub fn new() -> Self {
3448 std::default::Default::default()
3449 }
3450
3451 /// Sets the value of [name][crate::model::DeleteIngressRuleRequest::name].
3452 ///
3453 /// # Example
3454 /// ```ignore,no_run
3455 /// # use google_cloud_appengine_v1::model::DeleteIngressRuleRequest;
3456 /// let x = DeleteIngressRuleRequest::new().set_name("example");
3457 /// ```
3458 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459 self.name = v.into();
3460 self
3461 }
3462}
3463
3464impl wkt::message::Message for DeleteIngressRuleRequest {
3465 fn typename() -> &'static str {
3466 "type.googleapis.com/google.appengine.v1.DeleteIngressRuleRequest"
3467 }
3468}
3469
3470/// Request message for `AuthorizedDomains.ListAuthorizedDomains`.
3471#[derive(Clone, Default, PartialEq)]
3472#[non_exhaustive]
3473pub struct ListAuthorizedDomainsRequest {
3474 /// Name of the parent Application resource. Example: `apps/myapp`.
3475 pub parent: std::string::String,
3476
3477 /// Maximum results to return per page.
3478 pub page_size: i32,
3479
3480 /// Continuation token for fetching the next page of results.
3481 pub page_token: std::string::String,
3482
3483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3484}
3485
3486impl ListAuthorizedDomainsRequest {
3487 /// Creates a new default instance.
3488 pub fn new() -> Self {
3489 std::default::Default::default()
3490 }
3491
3492 /// Sets the value of [parent][crate::model::ListAuthorizedDomainsRequest::parent].
3493 ///
3494 /// # Example
3495 /// ```ignore,no_run
3496 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3497 /// let x = ListAuthorizedDomainsRequest::new().set_parent("example");
3498 /// ```
3499 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3500 self.parent = v.into();
3501 self
3502 }
3503
3504 /// Sets the value of [page_size][crate::model::ListAuthorizedDomainsRequest::page_size].
3505 ///
3506 /// # Example
3507 /// ```ignore,no_run
3508 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3509 /// let x = ListAuthorizedDomainsRequest::new().set_page_size(42);
3510 /// ```
3511 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3512 self.page_size = v.into();
3513 self
3514 }
3515
3516 /// Sets the value of [page_token][crate::model::ListAuthorizedDomainsRequest::page_token].
3517 ///
3518 /// # Example
3519 /// ```ignore,no_run
3520 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3521 /// let x = ListAuthorizedDomainsRequest::new().set_page_token("example");
3522 /// ```
3523 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3524 self.page_token = v.into();
3525 self
3526 }
3527}
3528
3529impl wkt::message::Message for ListAuthorizedDomainsRequest {
3530 fn typename() -> &'static str {
3531 "type.googleapis.com/google.appengine.v1.ListAuthorizedDomainsRequest"
3532 }
3533}
3534
3535/// Response message for `AuthorizedDomains.ListAuthorizedDomains`.
3536#[derive(Clone, Default, PartialEq)]
3537#[non_exhaustive]
3538pub struct ListAuthorizedDomainsResponse {
3539 /// The authorized domains belonging to the user.
3540 pub domains: std::vec::Vec<crate::model::AuthorizedDomain>,
3541
3542 /// Continuation token for fetching the next page of results.
3543 pub next_page_token: std::string::String,
3544
3545 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3546}
3547
3548impl ListAuthorizedDomainsResponse {
3549 /// Creates a new default instance.
3550 pub fn new() -> Self {
3551 std::default::Default::default()
3552 }
3553
3554 /// Sets the value of [domains][crate::model::ListAuthorizedDomainsResponse::domains].
3555 ///
3556 /// # Example
3557 /// ```ignore,no_run
3558 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsResponse;
3559 /// use google_cloud_appengine_v1::model::AuthorizedDomain;
3560 /// let x = ListAuthorizedDomainsResponse::new()
3561 /// .set_domains([
3562 /// AuthorizedDomain::default()/* use setters */,
3563 /// AuthorizedDomain::default()/* use (different) setters */,
3564 /// ]);
3565 /// ```
3566 pub fn set_domains<T, V>(mut self, v: T) -> Self
3567 where
3568 T: std::iter::IntoIterator<Item = V>,
3569 V: std::convert::Into<crate::model::AuthorizedDomain>,
3570 {
3571 use std::iter::Iterator;
3572 self.domains = v.into_iter().map(|i| i.into()).collect();
3573 self
3574 }
3575
3576 /// Sets the value of [next_page_token][crate::model::ListAuthorizedDomainsResponse::next_page_token].
3577 ///
3578 /// # Example
3579 /// ```ignore,no_run
3580 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsResponse;
3581 /// let x = ListAuthorizedDomainsResponse::new().set_next_page_token("example");
3582 /// ```
3583 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3584 self.next_page_token = v.into();
3585 self
3586 }
3587}
3588
3589impl wkt::message::Message for ListAuthorizedDomainsResponse {
3590 fn typename() -> &'static str {
3591 "type.googleapis.com/google.appengine.v1.ListAuthorizedDomainsResponse"
3592 }
3593}
3594
3595#[doc(hidden)]
3596impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizedDomainsResponse {
3597 type PageItem = crate::model::AuthorizedDomain;
3598
3599 fn items(self) -> std::vec::Vec<Self::PageItem> {
3600 self.domains
3601 }
3602
3603 fn next_page_token(&self) -> std::string::String {
3604 use std::clone::Clone;
3605 self.next_page_token.clone()
3606 }
3607}
3608
3609/// Request message for `AuthorizedCertificates.ListAuthorizedCertificates`.
3610#[derive(Clone, Default, PartialEq)]
3611#[non_exhaustive]
3612pub struct ListAuthorizedCertificatesRequest {
3613 /// Name of the parent `Application` resource. Example: `apps/myapp`.
3614 pub parent: std::string::String,
3615
3616 /// Controls the set of fields returned in the `LIST` response.
3617 pub view: crate::model::AuthorizedCertificateView,
3618
3619 /// Maximum results to return per page.
3620 pub page_size: i32,
3621
3622 /// Continuation token for fetching the next page of results.
3623 pub page_token: std::string::String,
3624
3625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3626}
3627
3628impl ListAuthorizedCertificatesRequest {
3629 /// Creates a new default instance.
3630 pub fn new() -> Self {
3631 std::default::Default::default()
3632 }
3633
3634 /// Sets the value of [parent][crate::model::ListAuthorizedCertificatesRequest::parent].
3635 ///
3636 /// # Example
3637 /// ```ignore,no_run
3638 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3639 /// let x = ListAuthorizedCertificatesRequest::new().set_parent("example");
3640 /// ```
3641 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3642 self.parent = v.into();
3643 self
3644 }
3645
3646 /// Sets the value of [view][crate::model::ListAuthorizedCertificatesRequest::view].
3647 ///
3648 /// # Example
3649 /// ```ignore,no_run
3650 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3651 /// use google_cloud_appengine_v1::model::AuthorizedCertificateView;
3652 /// let x0 = ListAuthorizedCertificatesRequest::new().set_view(AuthorizedCertificateView::FullCertificate);
3653 /// ```
3654 pub fn set_view<T: std::convert::Into<crate::model::AuthorizedCertificateView>>(
3655 mut self,
3656 v: T,
3657 ) -> Self {
3658 self.view = v.into();
3659 self
3660 }
3661
3662 /// Sets the value of [page_size][crate::model::ListAuthorizedCertificatesRequest::page_size].
3663 ///
3664 /// # Example
3665 /// ```ignore,no_run
3666 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3667 /// let x = ListAuthorizedCertificatesRequest::new().set_page_size(42);
3668 /// ```
3669 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3670 self.page_size = v.into();
3671 self
3672 }
3673
3674 /// Sets the value of [page_token][crate::model::ListAuthorizedCertificatesRequest::page_token].
3675 ///
3676 /// # Example
3677 /// ```ignore,no_run
3678 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3679 /// let x = ListAuthorizedCertificatesRequest::new().set_page_token("example");
3680 /// ```
3681 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3682 self.page_token = v.into();
3683 self
3684 }
3685}
3686
3687impl wkt::message::Message for ListAuthorizedCertificatesRequest {
3688 fn typename() -> &'static str {
3689 "type.googleapis.com/google.appengine.v1.ListAuthorizedCertificatesRequest"
3690 }
3691}
3692
3693/// Response message for `AuthorizedCertificates.ListAuthorizedCertificates`.
3694#[derive(Clone, Default, PartialEq)]
3695#[non_exhaustive]
3696pub struct ListAuthorizedCertificatesResponse {
3697 /// The SSL certificates the user is authorized to administer.
3698 pub certificates: std::vec::Vec<crate::model::AuthorizedCertificate>,
3699
3700 /// Continuation token for fetching the next page of results.
3701 pub next_page_token: std::string::String,
3702
3703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3704}
3705
3706impl ListAuthorizedCertificatesResponse {
3707 /// Creates a new default instance.
3708 pub fn new() -> Self {
3709 std::default::Default::default()
3710 }
3711
3712 /// Sets the value of [certificates][crate::model::ListAuthorizedCertificatesResponse::certificates].
3713 ///
3714 /// # Example
3715 /// ```ignore,no_run
3716 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesResponse;
3717 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3718 /// let x = ListAuthorizedCertificatesResponse::new()
3719 /// .set_certificates([
3720 /// AuthorizedCertificate::default()/* use setters */,
3721 /// AuthorizedCertificate::default()/* use (different) setters */,
3722 /// ]);
3723 /// ```
3724 pub fn set_certificates<T, V>(mut self, v: T) -> Self
3725 where
3726 T: std::iter::IntoIterator<Item = V>,
3727 V: std::convert::Into<crate::model::AuthorizedCertificate>,
3728 {
3729 use std::iter::Iterator;
3730 self.certificates = v.into_iter().map(|i| i.into()).collect();
3731 self
3732 }
3733
3734 /// Sets the value of [next_page_token][crate::model::ListAuthorizedCertificatesResponse::next_page_token].
3735 ///
3736 /// # Example
3737 /// ```ignore,no_run
3738 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesResponse;
3739 /// let x = ListAuthorizedCertificatesResponse::new().set_next_page_token("example");
3740 /// ```
3741 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3742 self.next_page_token = v.into();
3743 self
3744 }
3745}
3746
3747impl wkt::message::Message for ListAuthorizedCertificatesResponse {
3748 fn typename() -> &'static str {
3749 "type.googleapis.com/google.appengine.v1.ListAuthorizedCertificatesResponse"
3750 }
3751}
3752
3753#[doc(hidden)]
3754impl google_cloud_gax::paginator::internal::PageableResponse
3755 for ListAuthorizedCertificatesResponse
3756{
3757 type PageItem = crate::model::AuthorizedCertificate;
3758
3759 fn items(self) -> std::vec::Vec<Self::PageItem> {
3760 self.certificates
3761 }
3762
3763 fn next_page_token(&self) -> std::string::String {
3764 use std::clone::Clone;
3765 self.next_page_token.clone()
3766 }
3767}
3768
3769/// Request message for `AuthorizedCertificates.GetAuthorizedCertificate`.
3770#[derive(Clone, Default, PartialEq)]
3771#[non_exhaustive]
3772pub struct GetAuthorizedCertificateRequest {
3773 /// Name of the resource requested. Example:
3774 /// `apps/myapp/authorizedCertificates/12345`.
3775 pub name: std::string::String,
3776
3777 /// Controls the set of fields returned in the `GET` response.
3778 pub view: crate::model::AuthorizedCertificateView,
3779
3780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3781}
3782
3783impl GetAuthorizedCertificateRequest {
3784 /// Creates a new default instance.
3785 pub fn new() -> Self {
3786 std::default::Default::default()
3787 }
3788
3789 /// Sets the value of [name][crate::model::GetAuthorizedCertificateRequest::name].
3790 ///
3791 /// # Example
3792 /// ```ignore,no_run
3793 /// # use google_cloud_appengine_v1::model::GetAuthorizedCertificateRequest;
3794 /// let x = GetAuthorizedCertificateRequest::new().set_name("example");
3795 /// ```
3796 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3797 self.name = v.into();
3798 self
3799 }
3800
3801 /// Sets the value of [view][crate::model::GetAuthorizedCertificateRequest::view].
3802 ///
3803 /// # Example
3804 /// ```ignore,no_run
3805 /// # use google_cloud_appengine_v1::model::GetAuthorizedCertificateRequest;
3806 /// use google_cloud_appengine_v1::model::AuthorizedCertificateView;
3807 /// let x0 = GetAuthorizedCertificateRequest::new().set_view(AuthorizedCertificateView::FullCertificate);
3808 /// ```
3809 pub fn set_view<T: std::convert::Into<crate::model::AuthorizedCertificateView>>(
3810 mut self,
3811 v: T,
3812 ) -> Self {
3813 self.view = v.into();
3814 self
3815 }
3816}
3817
3818impl wkt::message::Message for GetAuthorizedCertificateRequest {
3819 fn typename() -> &'static str {
3820 "type.googleapis.com/google.appengine.v1.GetAuthorizedCertificateRequest"
3821 }
3822}
3823
3824/// Request message for `AuthorizedCertificates.CreateAuthorizedCertificate`.
3825#[derive(Clone, Default, PartialEq)]
3826#[non_exhaustive]
3827pub struct CreateAuthorizedCertificateRequest {
3828 /// Name of the parent `Application` resource. Example: `apps/myapp`.
3829 pub parent: std::string::String,
3830
3831 /// SSL certificate data.
3832 pub certificate: std::option::Option<crate::model::AuthorizedCertificate>,
3833
3834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3835}
3836
3837impl CreateAuthorizedCertificateRequest {
3838 /// Creates a new default instance.
3839 pub fn new() -> Self {
3840 std::default::Default::default()
3841 }
3842
3843 /// Sets the value of [parent][crate::model::CreateAuthorizedCertificateRequest::parent].
3844 ///
3845 /// # Example
3846 /// ```ignore,no_run
3847 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3848 /// let x = CreateAuthorizedCertificateRequest::new().set_parent("example");
3849 /// ```
3850 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3851 self.parent = v.into();
3852 self
3853 }
3854
3855 /// Sets the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
3856 ///
3857 /// # Example
3858 /// ```ignore,no_run
3859 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3860 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3861 /// let x = CreateAuthorizedCertificateRequest::new().set_certificate(AuthorizedCertificate::default()/* use setters */);
3862 /// ```
3863 pub fn set_certificate<T>(mut self, v: T) -> Self
3864 where
3865 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3866 {
3867 self.certificate = std::option::Option::Some(v.into());
3868 self
3869 }
3870
3871 /// Sets or clears the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
3872 ///
3873 /// # Example
3874 /// ```ignore,no_run
3875 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3876 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3877 /// let x = CreateAuthorizedCertificateRequest::new().set_or_clear_certificate(Some(AuthorizedCertificate::default()/* use setters */));
3878 /// let x = CreateAuthorizedCertificateRequest::new().set_or_clear_certificate(None::<AuthorizedCertificate>);
3879 /// ```
3880 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
3881 where
3882 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3883 {
3884 self.certificate = v.map(|x| x.into());
3885 self
3886 }
3887}
3888
3889impl wkt::message::Message for CreateAuthorizedCertificateRequest {
3890 fn typename() -> &'static str {
3891 "type.googleapis.com/google.appengine.v1.CreateAuthorizedCertificateRequest"
3892 }
3893}
3894
3895/// Request message for `AuthorizedCertificates.UpdateAuthorizedCertificate`.
3896#[derive(Clone, Default, PartialEq)]
3897#[non_exhaustive]
3898pub struct UpdateAuthorizedCertificateRequest {
3899 /// Name of the resource to update. Example:
3900 /// `apps/myapp/authorizedCertificates/12345`.
3901 pub name: std::string::String,
3902
3903 /// An `AuthorizedCertificate` containing the updated resource. Only fields set
3904 /// in the field mask will be updated.
3905 pub certificate: std::option::Option<crate::model::AuthorizedCertificate>,
3906
3907 /// Standard field mask for the set of fields to be updated. Updates are only
3908 /// supported on the `certificate_raw_data` and `display_name` fields.
3909 pub update_mask: std::option::Option<wkt::FieldMask>,
3910
3911 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3912}
3913
3914impl UpdateAuthorizedCertificateRequest {
3915 /// Creates a new default instance.
3916 pub fn new() -> Self {
3917 std::default::Default::default()
3918 }
3919
3920 /// Sets the value of [name][crate::model::UpdateAuthorizedCertificateRequest::name].
3921 ///
3922 /// # Example
3923 /// ```ignore,no_run
3924 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3925 /// let x = UpdateAuthorizedCertificateRequest::new().set_name("example");
3926 /// ```
3927 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3928 self.name = v.into();
3929 self
3930 }
3931
3932 /// Sets the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
3933 ///
3934 /// # Example
3935 /// ```ignore,no_run
3936 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3937 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3938 /// let x = UpdateAuthorizedCertificateRequest::new().set_certificate(AuthorizedCertificate::default()/* use setters */);
3939 /// ```
3940 pub fn set_certificate<T>(mut self, v: T) -> Self
3941 where
3942 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3943 {
3944 self.certificate = std::option::Option::Some(v.into());
3945 self
3946 }
3947
3948 /// Sets or clears the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
3949 ///
3950 /// # Example
3951 /// ```ignore,no_run
3952 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3953 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3954 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_certificate(Some(AuthorizedCertificate::default()/* use setters */));
3955 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_certificate(None::<AuthorizedCertificate>);
3956 /// ```
3957 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
3958 where
3959 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3960 {
3961 self.certificate = v.map(|x| x.into());
3962 self
3963 }
3964
3965 /// Sets the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
3966 ///
3967 /// # Example
3968 /// ```ignore,no_run
3969 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3970 /// use wkt::FieldMask;
3971 /// let x = UpdateAuthorizedCertificateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3972 /// ```
3973 pub fn set_update_mask<T>(mut self, v: T) -> Self
3974 where
3975 T: std::convert::Into<wkt::FieldMask>,
3976 {
3977 self.update_mask = std::option::Option::Some(v.into());
3978 self
3979 }
3980
3981 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
3982 ///
3983 /// # Example
3984 /// ```ignore,no_run
3985 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3986 /// use wkt::FieldMask;
3987 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3988 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3989 /// ```
3990 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3991 where
3992 T: std::convert::Into<wkt::FieldMask>,
3993 {
3994 self.update_mask = v.map(|x| x.into());
3995 self
3996 }
3997}
3998
3999impl wkt::message::Message for UpdateAuthorizedCertificateRequest {
4000 fn typename() -> &'static str {
4001 "type.googleapis.com/google.appengine.v1.UpdateAuthorizedCertificateRequest"
4002 }
4003}
4004
4005/// Request message for `AuthorizedCertificates.DeleteAuthorizedCertificate`.
4006#[derive(Clone, Default, PartialEq)]
4007#[non_exhaustive]
4008pub struct DeleteAuthorizedCertificateRequest {
4009 /// Name of the resource to delete. Example:
4010 /// `apps/myapp/authorizedCertificates/12345`.
4011 pub name: std::string::String,
4012
4013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4014}
4015
4016impl DeleteAuthorizedCertificateRequest {
4017 /// Creates a new default instance.
4018 pub fn new() -> Self {
4019 std::default::Default::default()
4020 }
4021
4022 /// Sets the value of [name][crate::model::DeleteAuthorizedCertificateRequest::name].
4023 ///
4024 /// # Example
4025 /// ```ignore,no_run
4026 /// # use google_cloud_appengine_v1::model::DeleteAuthorizedCertificateRequest;
4027 /// let x = DeleteAuthorizedCertificateRequest::new().set_name("example");
4028 /// ```
4029 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4030 self.name = v.into();
4031 self
4032 }
4033}
4034
4035impl wkt::message::Message for DeleteAuthorizedCertificateRequest {
4036 fn typename() -> &'static str {
4037 "type.googleapis.com/google.appengine.v1.DeleteAuthorizedCertificateRequest"
4038 }
4039}
4040
4041/// Request message for `DomainMappings.ListDomainMappings`.
4042#[derive(Clone, Default, PartialEq)]
4043#[non_exhaustive]
4044pub struct ListDomainMappingsRequest {
4045 /// Name of the parent Application resource. Example: `apps/myapp`.
4046 pub parent: std::string::String,
4047
4048 /// Maximum results to return per page.
4049 pub page_size: i32,
4050
4051 /// Continuation token for fetching the next page of results.
4052 pub page_token: std::string::String,
4053
4054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4055}
4056
4057impl ListDomainMappingsRequest {
4058 /// Creates a new default instance.
4059 pub fn new() -> Self {
4060 std::default::Default::default()
4061 }
4062
4063 /// Sets the value of [parent][crate::model::ListDomainMappingsRequest::parent].
4064 ///
4065 /// # Example
4066 /// ```ignore,no_run
4067 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4068 /// let x = ListDomainMappingsRequest::new().set_parent("example");
4069 /// ```
4070 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4071 self.parent = v.into();
4072 self
4073 }
4074
4075 /// Sets the value of [page_size][crate::model::ListDomainMappingsRequest::page_size].
4076 ///
4077 /// # Example
4078 /// ```ignore,no_run
4079 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4080 /// let x = ListDomainMappingsRequest::new().set_page_size(42);
4081 /// ```
4082 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4083 self.page_size = v.into();
4084 self
4085 }
4086
4087 /// Sets the value of [page_token][crate::model::ListDomainMappingsRequest::page_token].
4088 ///
4089 /// # Example
4090 /// ```ignore,no_run
4091 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4092 /// let x = ListDomainMappingsRequest::new().set_page_token("example");
4093 /// ```
4094 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4095 self.page_token = v.into();
4096 self
4097 }
4098}
4099
4100impl wkt::message::Message for ListDomainMappingsRequest {
4101 fn typename() -> &'static str {
4102 "type.googleapis.com/google.appengine.v1.ListDomainMappingsRequest"
4103 }
4104}
4105
4106/// Response message for `DomainMappings.ListDomainMappings`.
4107#[derive(Clone, Default, PartialEq)]
4108#[non_exhaustive]
4109pub struct ListDomainMappingsResponse {
4110 /// The domain mappings for the application.
4111 pub domain_mappings: std::vec::Vec<crate::model::DomainMapping>,
4112
4113 /// Continuation token for fetching the next page of results.
4114 pub next_page_token: std::string::String,
4115
4116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4117}
4118
4119impl ListDomainMappingsResponse {
4120 /// Creates a new default instance.
4121 pub fn new() -> Self {
4122 std::default::Default::default()
4123 }
4124
4125 /// Sets the value of [domain_mappings][crate::model::ListDomainMappingsResponse::domain_mappings].
4126 ///
4127 /// # Example
4128 /// ```ignore,no_run
4129 /// # use google_cloud_appengine_v1::model::ListDomainMappingsResponse;
4130 /// use google_cloud_appengine_v1::model::DomainMapping;
4131 /// let x = ListDomainMappingsResponse::new()
4132 /// .set_domain_mappings([
4133 /// DomainMapping::default()/* use setters */,
4134 /// DomainMapping::default()/* use (different) setters */,
4135 /// ]);
4136 /// ```
4137 pub fn set_domain_mappings<T, V>(mut self, v: T) -> Self
4138 where
4139 T: std::iter::IntoIterator<Item = V>,
4140 V: std::convert::Into<crate::model::DomainMapping>,
4141 {
4142 use std::iter::Iterator;
4143 self.domain_mappings = v.into_iter().map(|i| i.into()).collect();
4144 self
4145 }
4146
4147 /// Sets the value of [next_page_token][crate::model::ListDomainMappingsResponse::next_page_token].
4148 ///
4149 /// # Example
4150 /// ```ignore,no_run
4151 /// # use google_cloud_appengine_v1::model::ListDomainMappingsResponse;
4152 /// let x = ListDomainMappingsResponse::new().set_next_page_token("example");
4153 /// ```
4154 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4155 self.next_page_token = v.into();
4156 self
4157 }
4158}
4159
4160impl wkt::message::Message for ListDomainMappingsResponse {
4161 fn typename() -> &'static str {
4162 "type.googleapis.com/google.appengine.v1.ListDomainMappingsResponse"
4163 }
4164}
4165
4166#[doc(hidden)]
4167impl google_cloud_gax::paginator::internal::PageableResponse for ListDomainMappingsResponse {
4168 type PageItem = crate::model::DomainMapping;
4169
4170 fn items(self) -> std::vec::Vec<Self::PageItem> {
4171 self.domain_mappings
4172 }
4173
4174 fn next_page_token(&self) -> std::string::String {
4175 use std::clone::Clone;
4176 self.next_page_token.clone()
4177 }
4178}
4179
4180/// Request message for `DomainMappings.GetDomainMapping`.
4181#[derive(Clone, Default, PartialEq)]
4182#[non_exhaustive]
4183pub struct GetDomainMappingRequest {
4184 /// Name of the resource requested. Example:
4185 /// `apps/myapp/domainMappings/example.com`.
4186 pub name: std::string::String,
4187
4188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4189}
4190
4191impl GetDomainMappingRequest {
4192 /// Creates a new default instance.
4193 pub fn new() -> Self {
4194 std::default::Default::default()
4195 }
4196
4197 /// Sets the value of [name][crate::model::GetDomainMappingRequest::name].
4198 ///
4199 /// # Example
4200 /// ```ignore,no_run
4201 /// # use google_cloud_appengine_v1::model::GetDomainMappingRequest;
4202 /// let x = GetDomainMappingRequest::new().set_name("example");
4203 /// ```
4204 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4205 self.name = v.into();
4206 self
4207 }
4208}
4209
4210impl wkt::message::Message for GetDomainMappingRequest {
4211 fn typename() -> &'static str {
4212 "type.googleapis.com/google.appengine.v1.GetDomainMappingRequest"
4213 }
4214}
4215
4216/// Request message for `DomainMappings.CreateDomainMapping`.
4217#[derive(Clone, Default, PartialEq)]
4218#[non_exhaustive]
4219pub struct CreateDomainMappingRequest {
4220 /// Name of the parent Application resource. Example: `apps/myapp`.
4221 pub parent: std::string::String,
4222
4223 /// Domain mapping configuration.
4224 pub domain_mapping: std::option::Option<crate::model::DomainMapping>,
4225
4226 /// Whether the domain creation should override any existing mappings for this
4227 /// domain. By default, overrides are rejected.
4228 pub override_strategy: crate::model::DomainOverrideStrategy,
4229
4230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4231}
4232
4233impl CreateDomainMappingRequest {
4234 /// Creates a new default instance.
4235 pub fn new() -> Self {
4236 std::default::Default::default()
4237 }
4238
4239 /// Sets the value of [parent][crate::model::CreateDomainMappingRequest::parent].
4240 ///
4241 /// # Example
4242 /// ```ignore,no_run
4243 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4244 /// let x = CreateDomainMappingRequest::new().set_parent("example");
4245 /// ```
4246 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4247 self.parent = v.into();
4248 self
4249 }
4250
4251 /// Sets the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4252 ///
4253 /// # Example
4254 /// ```ignore,no_run
4255 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4256 /// use google_cloud_appengine_v1::model::DomainMapping;
4257 /// let x = CreateDomainMappingRequest::new().set_domain_mapping(DomainMapping::default()/* use setters */);
4258 /// ```
4259 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4260 where
4261 T: std::convert::Into<crate::model::DomainMapping>,
4262 {
4263 self.domain_mapping = std::option::Option::Some(v.into());
4264 self
4265 }
4266
4267 /// Sets or clears the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4268 ///
4269 /// # Example
4270 /// ```ignore,no_run
4271 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4272 /// use google_cloud_appengine_v1::model::DomainMapping;
4273 /// let x = CreateDomainMappingRequest::new().set_or_clear_domain_mapping(Some(DomainMapping::default()/* use setters */));
4274 /// let x = CreateDomainMappingRequest::new().set_or_clear_domain_mapping(None::<DomainMapping>);
4275 /// ```
4276 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4277 where
4278 T: std::convert::Into<crate::model::DomainMapping>,
4279 {
4280 self.domain_mapping = v.map(|x| x.into());
4281 self
4282 }
4283
4284 /// Sets the value of [override_strategy][crate::model::CreateDomainMappingRequest::override_strategy].
4285 ///
4286 /// # Example
4287 /// ```ignore,no_run
4288 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4289 /// use google_cloud_appengine_v1::model::DomainOverrideStrategy;
4290 /// let x0 = CreateDomainMappingRequest::new().set_override_strategy(DomainOverrideStrategy::Strict);
4291 /// let x1 = CreateDomainMappingRequest::new().set_override_strategy(DomainOverrideStrategy::Override);
4292 /// ```
4293 pub fn set_override_strategy<T: std::convert::Into<crate::model::DomainOverrideStrategy>>(
4294 mut self,
4295 v: T,
4296 ) -> Self {
4297 self.override_strategy = v.into();
4298 self
4299 }
4300}
4301
4302impl wkt::message::Message for CreateDomainMappingRequest {
4303 fn typename() -> &'static str {
4304 "type.googleapis.com/google.appengine.v1.CreateDomainMappingRequest"
4305 }
4306}
4307
4308/// Request message for `DomainMappings.UpdateDomainMapping`.
4309#[derive(Clone, Default, PartialEq)]
4310#[non_exhaustive]
4311pub struct UpdateDomainMappingRequest {
4312 /// Name of the resource to update. Example:
4313 /// `apps/myapp/domainMappings/example.com`.
4314 pub name: std::string::String,
4315
4316 /// A domain mapping containing the updated resource. Only fields set
4317 /// in the field mask will be updated.
4318 pub domain_mapping: std::option::Option<crate::model::DomainMapping>,
4319
4320 /// Required. Standard field mask for the set of fields to be updated.
4321 pub update_mask: std::option::Option<wkt::FieldMask>,
4322
4323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4324}
4325
4326impl UpdateDomainMappingRequest {
4327 /// Creates a new default instance.
4328 pub fn new() -> Self {
4329 std::default::Default::default()
4330 }
4331
4332 /// Sets the value of [name][crate::model::UpdateDomainMappingRequest::name].
4333 ///
4334 /// # Example
4335 /// ```ignore,no_run
4336 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4337 /// let x = UpdateDomainMappingRequest::new().set_name("example");
4338 /// ```
4339 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4340 self.name = v.into();
4341 self
4342 }
4343
4344 /// Sets the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
4345 ///
4346 /// # Example
4347 /// ```ignore,no_run
4348 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4349 /// use google_cloud_appengine_v1::model::DomainMapping;
4350 /// let x = UpdateDomainMappingRequest::new().set_domain_mapping(DomainMapping::default()/* use setters */);
4351 /// ```
4352 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4353 where
4354 T: std::convert::Into<crate::model::DomainMapping>,
4355 {
4356 self.domain_mapping = std::option::Option::Some(v.into());
4357 self
4358 }
4359
4360 /// Sets or clears the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
4361 ///
4362 /// # Example
4363 /// ```ignore,no_run
4364 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4365 /// use google_cloud_appengine_v1::model::DomainMapping;
4366 /// let x = UpdateDomainMappingRequest::new().set_or_clear_domain_mapping(Some(DomainMapping::default()/* use setters */));
4367 /// let x = UpdateDomainMappingRequest::new().set_or_clear_domain_mapping(None::<DomainMapping>);
4368 /// ```
4369 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4370 where
4371 T: std::convert::Into<crate::model::DomainMapping>,
4372 {
4373 self.domain_mapping = v.map(|x| x.into());
4374 self
4375 }
4376
4377 /// Sets the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
4378 ///
4379 /// # Example
4380 /// ```ignore,no_run
4381 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4382 /// use wkt::FieldMask;
4383 /// let x = UpdateDomainMappingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4384 /// ```
4385 pub fn set_update_mask<T>(mut self, v: T) -> Self
4386 where
4387 T: std::convert::Into<wkt::FieldMask>,
4388 {
4389 self.update_mask = std::option::Option::Some(v.into());
4390 self
4391 }
4392
4393 /// Sets or clears the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
4394 ///
4395 /// # Example
4396 /// ```ignore,no_run
4397 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4398 /// use wkt::FieldMask;
4399 /// let x = UpdateDomainMappingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4400 /// let x = UpdateDomainMappingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4401 /// ```
4402 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4403 where
4404 T: std::convert::Into<wkt::FieldMask>,
4405 {
4406 self.update_mask = v.map(|x| x.into());
4407 self
4408 }
4409}
4410
4411impl wkt::message::Message for UpdateDomainMappingRequest {
4412 fn typename() -> &'static str {
4413 "type.googleapis.com/google.appengine.v1.UpdateDomainMappingRequest"
4414 }
4415}
4416
4417/// Request message for `DomainMappings.DeleteDomainMapping`.
4418#[derive(Clone, Default, PartialEq)]
4419#[non_exhaustive]
4420pub struct DeleteDomainMappingRequest {
4421 /// Name of the resource to delete. Example:
4422 /// `apps/myapp/domainMappings/example.com`.
4423 pub name: std::string::String,
4424
4425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4426}
4427
4428impl DeleteDomainMappingRequest {
4429 /// Creates a new default instance.
4430 pub fn new() -> Self {
4431 std::default::Default::default()
4432 }
4433
4434 /// Sets the value of [name][crate::model::DeleteDomainMappingRequest::name].
4435 ///
4436 /// # Example
4437 /// ```ignore,no_run
4438 /// # use google_cloud_appengine_v1::model::DeleteDomainMappingRequest;
4439 /// let x = DeleteDomainMappingRequest::new().set_name("example");
4440 /// ```
4441 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4442 self.name = v.into();
4443 self
4444 }
4445}
4446
4447impl wkt::message::Message for DeleteDomainMappingRequest {
4448 fn typename() -> &'static str {
4449 "type.googleapis.com/google.appengine.v1.DeleteDomainMappingRequest"
4450 }
4451}
4452
4453/// An Application resource contains the top-level configuration of an App
4454/// Engine application.
4455#[derive(Clone, Default, PartialEq)]
4456#[non_exhaustive]
4457pub struct Application {
4458 /// Full path to the Application resource in the API.
4459 /// Example: `apps/myapp`.
4460 ///
4461 /// @OutputOnly
4462 pub name: std::string::String,
4463
4464 /// Identifier of the Application resource. This identifier is equivalent
4465 /// to the project ID of the Google Cloud Platform project where you want to
4466 /// deploy your application.
4467 /// Example: `myapp`.
4468 pub id: std::string::String,
4469
4470 /// HTTP path dispatch rules for requests to the application that do not
4471 /// explicitly target a service or version. Rules are order-dependent.
4472 /// Up to 20 dispatch rules can be supported.
4473 pub dispatch_rules: std::vec::Vec<crate::model::UrlDispatchRule>,
4474
4475 /// Google Apps authentication domain that controls which users can access
4476 /// this application.
4477 ///
4478 /// Defaults to open access for any Google Account.
4479 pub auth_domain: std::string::String,
4480
4481 /// Location from which this application runs. Application instances
4482 /// run out of the data centers in the specified location, which is also where
4483 /// all of the application's end user content is stored.
4484 ///
4485 /// Defaults to `us-central`.
4486 ///
4487 /// View the list of
4488 /// [supported locations](https://cloud.google.com/appengine/docs/locations).
4489 pub location_id: std::string::String,
4490
4491 /// Google Cloud Storage bucket that can be used for storing files
4492 /// associated with this application. This bucket is associated with the
4493 /// application and can be used by the gcloud deployment commands.
4494 ///
4495 /// @OutputOnly
4496 pub code_bucket: std::string::String,
4497
4498 /// Cookie expiration policy for this application.
4499 pub default_cookie_expiration: std::option::Option<wkt::Duration>,
4500
4501 /// Serving status of this application.
4502 pub serving_status: crate::model::application::ServingStatus,
4503
4504 /// Hostname used to reach this application, as resolved by App Engine.
4505 ///
4506 /// @OutputOnly
4507 pub default_hostname: std::string::String,
4508
4509 /// Google Cloud Storage bucket that can be used by this application to store
4510 /// content.
4511 ///
4512 /// @OutputOnly
4513 pub default_bucket: std::string::String,
4514
4515 /// The service account associated with the application.
4516 /// This is the app-level default identity. If no identity provided during
4517 /// create version, Admin API will fallback to this one.
4518 pub service_account: std::string::String,
4519
4520 #[allow(missing_docs)]
4521 pub iap: std::option::Option<crate::model::application::IdentityAwareProxy>,
4522
4523 /// The Google Container Registry domain used for storing managed build docker
4524 /// images for this application.
4525 pub gcr_domain: std::string::String,
4526
4527 /// The type of the Cloud Firestore or Cloud Datastore database associated with
4528 /// this application.
4529 pub database_type: crate::model::application::DatabaseType,
4530
4531 /// The feature specific settings to be used in the application.
4532 pub feature_settings: std::option::Option<crate::model::application::FeatureSettings>,
4533
4534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4535}
4536
4537impl Application {
4538 /// Creates a new default instance.
4539 pub fn new() -> Self {
4540 std::default::Default::default()
4541 }
4542
4543 /// Sets the value of [name][crate::model::Application::name].
4544 ///
4545 /// # Example
4546 /// ```ignore,no_run
4547 /// # use google_cloud_appengine_v1::model::Application;
4548 /// let x = Application::new().set_name("example");
4549 /// ```
4550 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4551 self.name = v.into();
4552 self
4553 }
4554
4555 /// Sets the value of [id][crate::model::Application::id].
4556 ///
4557 /// # Example
4558 /// ```ignore,no_run
4559 /// # use google_cloud_appengine_v1::model::Application;
4560 /// let x = Application::new().set_id("example");
4561 /// ```
4562 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4563 self.id = v.into();
4564 self
4565 }
4566
4567 /// Sets the value of [dispatch_rules][crate::model::Application::dispatch_rules].
4568 ///
4569 /// # Example
4570 /// ```ignore,no_run
4571 /// # use google_cloud_appengine_v1::model::Application;
4572 /// use google_cloud_appengine_v1::model::UrlDispatchRule;
4573 /// let x = Application::new()
4574 /// .set_dispatch_rules([
4575 /// UrlDispatchRule::default()/* use setters */,
4576 /// UrlDispatchRule::default()/* use (different) setters */,
4577 /// ]);
4578 /// ```
4579 pub fn set_dispatch_rules<T, V>(mut self, v: T) -> Self
4580 where
4581 T: std::iter::IntoIterator<Item = V>,
4582 V: std::convert::Into<crate::model::UrlDispatchRule>,
4583 {
4584 use std::iter::Iterator;
4585 self.dispatch_rules = v.into_iter().map(|i| i.into()).collect();
4586 self
4587 }
4588
4589 /// Sets the value of [auth_domain][crate::model::Application::auth_domain].
4590 ///
4591 /// # Example
4592 /// ```ignore,no_run
4593 /// # use google_cloud_appengine_v1::model::Application;
4594 /// let x = Application::new().set_auth_domain("example");
4595 /// ```
4596 pub fn set_auth_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4597 self.auth_domain = v.into();
4598 self
4599 }
4600
4601 /// Sets the value of [location_id][crate::model::Application::location_id].
4602 ///
4603 /// # Example
4604 /// ```ignore,no_run
4605 /// # use google_cloud_appengine_v1::model::Application;
4606 /// let x = Application::new().set_location_id("example");
4607 /// ```
4608 pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4609 self.location_id = v.into();
4610 self
4611 }
4612
4613 /// Sets the value of [code_bucket][crate::model::Application::code_bucket].
4614 ///
4615 /// # Example
4616 /// ```ignore,no_run
4617 /// # use google_cloud_appengine_v1::model::Application;
4618 /// let x = Application::new().set_code_bucket("example");
4619 /// ```
4620 pub fn set_code_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4621 self.code_bucket = v.into();
4622 self
4623 }
4624
4625 /// Sets the value of [default_cookie_expiration][crate::model::Application::default_cookie_expiration].
4626 ///
4627 /// # Example
4628 /// ```ignore,no_run
4629 /// # use google_cloud_appengine_v1::model::Application;
4630 /// use wkt::Duration;
4631 /// let x = Application::new().set_default_cookie_expiration(Duration::default()/* use setters */);
4632 /// ```
4633 pub fn set_default_cookie_expiration<T>(mut self, v: T) -> Self
4634 where
4635 T: std::convert::Into<wkt::Duration>,
4636 {
4637 self.default_cookie_expiration = std::option::Option::Some(v.into());
4638 self
4639 }
4640
4641 /// Sets or clears the value of [default_cookie_expiration][crate::model::Application::default_cookie_expiration].
4642 ///
4643 /// # Example
4644 /// ```ignore,no_run
4645 /// # use google_cloud_appengine_v1::model::Application;
4646 /// use wkt::Duration;
4647 /// let x = Application::new().set_or_clear_default_cookie_expiration(Some(Duration::default()/* use setters */));
4648 /// let x = Application::new().set_or_clear_default_cookie_expiration(None::<Duration>);
4649 /// ```
4650 pub fn set_or_clear_default_cookie_expiration<T>(mut self, v: std::option::Option<T>) -> Self
4651 where
4652 T: std::convert::Into<wkt::Duration>,
4653 {
4654 self.default_cookie_expiration = v.map(|x| x.into());
4655 self
4656 }
4657
4658 /// Sets the value of [serving_status][crate::model::Application::serving_status].
4659 ///
4660 /// # Example
4661 /// ```ignore,no_run
4662 /// # use google_cloud_appengine_v1::model::Application;
4663 /// use google_cloud_appengine_v1::model::application::ServingStatus;
4664 /// let x0 = Application::new().set_serving_status(ServingStatus::Serving);
4665 /// let x1 = Application::new().set_serving_status(ServingStatus::UserDisabled);
4666 /// let x2 = Application::new().set_serving_status(ServingStatus::SystemDisabled);
4667 /// ```
4668 pub fn set_serving_status<T: std::convert::Into<crate::model::application::ServingStatus>>(
4669 mut self,
4670 v: T,
4671 ) -> Self {
4672 self.serving_status = v.into();
4673 self
4674 }
4675
4676 /// Sets the value of [default_hostname][crate::model::Application::default_hostname].
4677 ///
4678 /// # Example
4679 /// ```ignore,no_run
4680 /// # use google_cloud_appengine_v1::model::Application;
4681 /// let x = Application::new().set_default_hostname("example");
4682 /// ```
4683 pub fn set_default_hostname<T: std::convert::Into<std::string::String>>(
4684 mut self,
4685 v: T,
4686 ) -> Self {
4687 self.default_hostname = v.into();
4688 self
4689 }
4690
4691 /// Sets the value of [default_bucket][crate::model::Application::default_bucket].
4692 ///
4693 /// # Example
4694 /// ```ignore,no_run
4695 /// # use google_cloud_appengine_v1::model::Application;
4696 /// let x = Application::new().set_default_bucket("example");
4697 /// ```
4698 pub fn set_default_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4699 self.default_bucket = v.into();
4700 self
4701 }
4702
4703 /// Sets the value of [service_account][crate::model::Application::service_account].
4704 ///
4705 /// # Example
4706 /// ```ignore,no_run
4707 /// # use google_cloud_appengine_v1::model::Application;
4708 /// let x = Application::new().set_service_account("example");
4709 /// ```
4710 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4711 self.service_account = v.into();
4712 self
4713 }
4714
4715 /// Sets the value of [iap][crate::model::Application::iap].
4716 ///
4717 /// # Example
4718 /// ```ignore,no_run
4719 /// # use google_cloud_appengine_v1::model::Application;
4720 /// use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4721 /// let x = Application::new().set_iap(IdentityAwareProxy::default()/* use setters */);
4722 /// ```
4723 pub fn set_iap<T>(mut self, v: T) -> Self
4724 where
4725 T: std::convert::Into<crate::model::application::IdentityAwareProxy>,
4726 {
4727 self.iap = std::option::Option::Some(v.into());
4728 self
4729 }
4730
4731 /// Sets or clears the value of [iap][crate::model::Application::iap].
4732 ///
4733 /// # Example
4734 /// ```ignore,no_run
4735 /// # use google_cloud_appengine_v1::model::Application;
4736 /// use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4737 /// let x = Application::new().set_or_clear_iap(Some(IdentityAwareProxy::default()/* use setters */));
4738 /// let x = Application::new().set_or_clear_iap(None::<IdentityAwareProxy>);
4739 /// ```
4740 pub fn set_or_clear_iap<T>(mut self, v: std::option::Option<T>) -> Self
4741 where
4742 T: std::convert::Into<crate::model::application::IdentityAwareProxy>,
4743 {
4744 self.iap = v.map(|x| x.into());
4745 self
4746 }
4747
4748 /// Sets the value of [gcr_domain][crate::model::Application::gcr_domain].
4749 ///
4750 /// # Example
4751 /// ```ignore,no_run
4752 /// # use google_cloud_appengine_v1::model::Application;
4753 /// let x = Application::new().set_gcr_domain("example");
4754 /// ```
4755 pub fn set_gcr_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4756 self.gcr_domain = v.into();
4757 self
4758 }
4759
4760 /// Sets the value of [database_type][crate::model::Application::database_type].
4761 ///
4762 /// # Example
4763 /// ```ignore,no_run
4764 /// # use google_cloud_appengine_v1::model::Application;
4765 /// use google_cloud_appengine_v1::model::application::DatabaseType;
4766 /// let x0 = Application::new().set_database_type(DatabaseType::CloudDatastore);
4767 /// let x1 = Application::new().set_database_type(DatabaseType::CloudFirestore);
4768 /// let x2 = Application::new().set_database_type(DatabaseType::CloudDatastoreCompatibility);
4769 /// ```
4770 pub fn set_database_type<T: std::convert::Into<crate::model::application::DatabaseType>>(
4771 mut self,
4772 v: T,
4773 ) -> Self {
4774 self.database_type = v.into();
4775 self
4776 }
4777
4778 /// Sets the value of [feature_settings][crate::model::Application::feature_settings].
4779 ///
4780 /// # Example
4781 /// ```ignore,no_run
4782 /// # use google_cloud_appengine_v1::model::Application;
4783 /// use google_cloud_appengine_v1::model::application::FeatureSettings;
4784 /// let x = Application::new().set_feature_settings(FeatureSettings::default()/* use setters */);
4785 /// ```
4786 pub fn set_feature_settings<T>(mut self, v: T) -> Self
4787 where
4788 T: std::convert::Into<crate::model::application::FeatureSettings>,
4789 {
4790 self.feature_settings = std::option::Option::Some(v.into());
4791 self
4792 }
4793
4794 /// Sets or clears the value of [feature_settings][crate::model::Application::feature_settings].
4795 ///
4796 /// # Example
4797 /// ```ignore,no_run
4798 /// # use google_cloud_appengine_v1::model::Application;
4799 /// use google_cloud_appengine_v1::model::application::FeatureSettings;
4800 /// let x = Application::new().set_or_clear_feature_settings(Some(FeatureSettings::default()/* use setters */));
4801 /// let x = Application::new().set_or_clear_feature_settings(None::<FeatureSettings>);
4802 /// ```
4803 pub fn set_or_clear_feature_settings<T>(mut self, v: std::option::Option<T>) -> Self
4804 where
4805 T: std::convert::Into<crate::model::application::FeatureSettings>,
4806 {
4807 self.feature_settings = v.map(|x| x.into());
4808 self
4809 }
4810}
4811
4812impl wkt::message::Message for Application {
4813 fn typename() -> &'static str {
4814 "type.googleapis.com/google.appengine.v1.Application"
4815 }
4816}
4817
4818/// Defines additional types related to [Application].
4819pub mod application {
4820 #[allow(unused_imports)]
4821 use super::*;
4822
4823 /// Identity-Aware Proxy
4824 #[derive(Clone, Default, PartialEq)]
4825 #[non_exhaustive]
4826 pub struct IdentityAwareProxy {
4827 /// Whether the serving infrastructure will authenticate and
4828 /// authorize all incoming requests.
4829 ///
4830 /// If true, the `oauth2_client_id` and `oauth2_client_secret`
4831 /// fields must be non-empty.
4832 pub enabled: bool,
4833
4834 /// OAuth2 client ID to use for the authentication flow.
4835 pub oauth2_client_id: std::string::String,
4836
4837 /// OAuth2 client secret to use for the authentication flow.
4838 ///
4839 /// For security reasons, this value cannot be retrieved via the API.
4840 /// Instead, the SHA-256 hash of the value is returned in the
4841 /// `oauth2_client_secret_sha256` field.
4842 ///
4843 /// @InputOnly
4844 pub oauth2_client_secret: std::string::String,
4845
4846 /// Hex-encoded SHA-256 hash of the client secret.
4847 ///
4848 /// @OutputOnly
4849 pub oauth2_client_secret_sha256: std::string::String,
4850
4851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4852 }
4853
4854 impl IdentityAwareProxy {
4855 /// Creates a new default instance.
4856 pub fn new() -> Self {
4857 std::default::Default::default()
4858 }
4859
4860 /// Sets the value of [enabled][crate::model::application::IdentityAwareProxy::enabled].
4861 ///
4862 /// # Example
4863 /// ```ignore,no_run
4864 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4865 /// let x = IdentityAwareProxy::new().set_enabled(true);
4866 /// ```
4867 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4868 self.enabled = v.into();
4869 self
4870 }
4871
4872 /// Sets the value of [oauth2_client_id][crate::model::application::IdentityAwareProxy::oauth2_client_id].
4873 ///
4874 /// # Example
4875 /// ```ignore,no_run
4876 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4877 /// let x = IdentityAwareProxy::new().set_oauth2_client_id("example");
4878 /// ```
4879 pub fn set_oauth2_client_id<T: std::convert::Into<std::string::String>>(
4880 mut self,
4881 v: T,
4882 ) -> Self {
4883 self.oauth2_client_id = v.into();
4884 self
4885 }
4886
4887 /// Sets the value of [oauth2_client_secret][crate::model::application::IdentityAwareProxy::oauth2_client_secret].
4888 ///
4889 /// # Example
4890 /// ```ignore,no_run
4891 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4892 /// let x = IdentityAwareProxy::new().set_oauth2_client_secret("example");
4893 /// ```
4894 pub fn set_oauth2_client_secret<T: std::convert::Into<std::string::String>>(
4895 mut self,
4896 v: T,
4897 ) -> Self {
4898 self.oauth2_client_secret = v.into();
4899 self
4900 }
4901
4902 /// Sets the value of [oauth2_client_secret_sha256][crate::model::application::IdentityAwareProxy::oauth2_client_secret_sha256].
4903 ///
4904 /// # Example
4905 /// ```ignore,no_run
4906 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4907 /// let x = IdentityAwareProxy::new().set_oauth2_client_secret_sha256("example");
4908 /// ```
4909 pub fn set_oauth2_client_secret_sha256<T: std::convert::Into<std::string::String>>(
4910 mut self,
4911 v: T,
4912 ) -> Self {
4913 self.oauth2_client_secret_sha256 = v.into();
4914 self
4915 }
4916 }
4917
4918 impl wkt::message::Message for IdentityAwareProxy {
4919 fn typename() -> &'static str {
4920 "type.googleapis.com/google.appengine.v1.Application.IdentityAwareProxy"
4921 }
4922 }
4923
4924 /// The feature specific settings to be used in the application. These define
4925 /// behaviors that are user configurable.
4926 #[derive(Clone, Default, PartialEq)]
4927 #[non_exhaustive]
4928 pub struct FeatureSettings {
4929 /// Boolean value indicating if split health checks should be used instead
4930 /// of the legacy health checks. At an app.yaml level, this means defaulting
4931 /// to 'readiness_check' and 'liveness_check' values instead of
4932 /// 'health_check' ones. Once the legacy 'health_check' behavior is
4933 /// deprecated, and this value is always true, this setting can
4934 /// be removed.
4935 pub split_health_checks: bool,
4936
4937 /// If true, use [Container-Optimized OS](https://cloud.google.com/container-optimized-os/)
4938 /// base image for VMs, rather than a base Debian image.
4939 pub use_container_optimized_os: bool,
4940
4941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4942 }
4943
4944 impl FeatureSettings {
4945 /// Creates a new default instance.
4946 pub fn new() -> Self {
4947 std::default::Default::default()
4948 }
4949
4950 /// Sets the value of [split_health_checks][crate::model::application::FeatureSettings::split_health_checks].
4951 ///
4952 /// # Example
4953 /// ```ignore,no_run
4954 /// # use google_cloud_appengine_v1::model::application::FeatureSettings;
4955 /// let x = FeatureSettings::new().set_split_health_checks(true);
4956 /// ```
4957 pub fn set_split_health_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4958 self.split_health_checks = v.into();
4959 self
4960 }
4961
4962 /// Sets the value of [use_container_optimized_os][crate::model::application::FeatureSettings::use_container_optimized_os].
4963 ///
4964 /// # Example
4965 /// ```ignore,no_run
4966 /// # use google_cloud_appengine_v1::model::application::FeatureSettings;
4967 /// let x = FeatureSettings::new().set_use_container_optimized_os(true);
4968 /// ```
4969 pub fn set_use_container_optimized_os<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4970 self.use_container_optimized_os = v.into();
4971 self
4972 }
4973 }
4974
4975 impl wkt::message::Message for FeatureSettings {
4976 fn typename() -> &'static str {
4977 "type.googleapis.com/google.appengine.v1.Application.FeatureSettings"
4978 }
4979 }
4980
4981 /// Enum for [ServingStatus].
4982 ///
4983 /// # Working with unknown values
4984 ///
4985 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4986 /// additional enum variants at any time. Adding new variants is not considered
4987 /// a breaking change. Applications should write their code in anticipation of:
4988 ///
4989 /// - New values appearing in future releases of the client library, **and**
4990 /// - New values received dynamically, without application changes.
4991 ///
4992 /// Please consult the [Working with enums] section in the user guide for some
4993 /// guidelines.
4994 ///
4995 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4996 #[derive(Clone, Debug, PartialEq)]
4997 #[non_exhaustive]
4998 pub enum ServingStatus {
4999 /// Serving status is unspecified.
5000 Unspecified,
5001 /// Application is serving.
5002 Serving,
5003 /// Application has been disabled by the user.
5004 UserDisabled,
5005 /// Application has been disabled by the system.
5006 SystemDisabled,
5007 /// If set, the enum was initialized with an unknown value.
5008 ///
5009 /// Applications can examine the value using [ServingStatus::value] or
5010 /// [ServingStatus::name].
5011 UnknownValue(serving_status::UnknownValue),
5012 }
5013
5014 #[doc(hidden)]
5015 pub mod serving_status {
5016 #[allow(unused_imports)]
5017 use super::*;
5018 #[derive(Clone, Debug, PartialEq)]
5019 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5020 }
5021
5022 impl ServingStatus {
5023 /// Gets the enum value.
5024 ///
5025 /// Returns `None` if the enum contains an unknown value deserialized from
5026 /// the string representation of enums.
5027 pub fn value(&self) -> std::option::Option<i32> {
5028 match self {
5029 Self::Unspecified => std::option::Option::Some(0),
5030 Self::Serving => std::option::Option::Some(1),
5031 Self::UserDisabled => std::option::Option::Some(2),
5032 Self::SystemDisabled => std::option::Option::Some(3),
5033 Self::UnknownValue(u) => u.0.value(),
5034 }
5035 }
5036
5037 /// Gets the enum value as a string.
5038 ///
5039 /// Returns `None` if the enum contains an unknown value deserialized from
5040 /// the integer representation of enums.
5041 pub fn name(&self) -> std::option::Option<&str> {
5042 match self {
5043 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
5044 Self::Serving => std::option::Option::Some("SERVING"),
5045 Self::UserDisabled => std::option::Option::Some("USER_DISABLED"),
5046 Self::SystemDisabled => std::option::Option::Some("SYSTEM_DISABLED"),
5047 Self::UnknownValue(u) => u.0.name(),
5048 }
5049 }
5050 }
5051
5052 impl std::default::Default for ServingStatus {
5053 fn default() -> Self {
5054 use std::convert::From;
5055 Self::from(0)
5056 }
5057 }
5058
5059 impl std::fmt::Display for ServingStatus {
5060 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5061 wkt::internal::display_enum(f, self.name(), self.value())
5062 }
5063 }
5064
5065 impl std::convert::From<i32> for ServingStatus {
5066 fn from(value: i32) -> Self {
5067 match value {
5068 0 => Self::Unspecified,
5069 1 => Self::Serving,
5070 2 => Self::UserDisabled,
5071 3 => Self::SystemDisabled,
5072 _ => Self::UnknownValue(serving_status::UnknownValue(
5073 wkt::internal::UnknownEnumValue::Integer(value),
5074 )),
5075 }
5076 }
5077 }
5078
5079 impl std::convert::From<&str> for ServingStatus {
5080 fn from(value: &str) -> Self {
5081 use std::string::ToString;
5082 match value {
5083 "UNSPECIFIED" => Self::Unspecified,
5084 "SERVING" => Self::Serving,
5085 "USER_DISABLED" => Self::UserDisabled,
5086 "SYSTEM_DISABLED" => Self::SystemDisabled,
5087 _ => Self::UnknownValue(serving_status::UnknownValue(
5088 wkt::internal::UnknownEnumValue::String(value.to_string()),
5089 )),
5090 }
5091 }
5092 }
5093
5094 impl serde::ser::Serialize for ServingStatus {
5095 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5096 where
5097 S: serde::Serializer,
5098 {
5099 match self {
5100 Self::Unspecified => serializer.serialize_i32(0),
5101 Self::Serving => serializer.serialize_i32(1),
5102 Self::UserDisabled => serializer.serialize_i32(2),
5103 Self::SystemDisabled => serializer.serialize_i32(3),
5104 Self::UnknownValue(u) => u.0.serialize(serializer),
5105 }
5106 }
5107 }
5108
5109 impl<'de> serde::de::Deserialize<'de> for ServingStatus {
5110 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5111 where
5112 D: serde::Deserializer<'de>,
5113 {
5114 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServingStatus>::new(
5115 ".google.appengine.v1.Application.ServingStatus",
5116 ))
5117 }
5118 }
5119
5120 /// Enum for [DatabaseType].
5121 ///
5122 /// # Working with unknown values
5123 ///
5124 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5125 /// additional enum variants at any time. Adding new variants is not considered
5126 /// a breaking change. Applications should write their code in anticipation of:
5127 ///
5128 /// - New values appearing in future releases of the client library, **and**
5129 /// - New values received dynamically, without application changes.
5130 ///
5131 /// Please consult the [Working with enums] section in the user guide for some
5132 /// guidelines.
5133 ///
5134 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5135 #[derive(Clone, Debug, PartialEq)]
5136 #[non_exhaustive]
5137 pub enum DatabaseType {
5138 /// Database type is unspecified.
5139 Unspecified,
5140 /// Cloud Datastore
5141 CloudDatastore,
5142 /// Cloud Firestore Native
5143 CloudFirestore,
5144 /// Cloud Firestore in Datastore Mode
5145 CloudDatastoreCompatibility,
5146 /// If set, the enum was initialized with an unknown value.
5147 ///
5148 /// Applications can examine the value using [DatabaseType::value] or
5149 /// [DatabaseType::name].
5150 UnknownValue(database_type::UnknownValue),
5151 }
5152
5153 #[doc(hidden)]
5154 pub mod database_type {
5155 #[allow(unused_imports)]
5156 use super::*;
5157 #[derive(Clone, Debug, PartialEq)]
5158 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5159 }
5160
5161 impl DatabaseType {
5162 /// Gets the enum value.
5163 ///
5164 /// Returns `None` if the enum contains an unknown value deserialized from
5165 /// the string representation of enums.
5166 pub fn value(&self) -> std::option::Option<i32> {
5167 match self {
5168 Self::Unspecified => std::option::Option::Some(0),
5169 Self::CloudDatastore => std::option::Option::Some(1),
5170 Self::CloudFirestore => std::option::Option::Some(2),
5171 Self::CloudDatastoreCompatibility => std::option::Option::Some(3),
5172 Self::UnknownValue(u) => u.0.value(),
5173 }
5174 }
5175
5176 /// Gets the enum value as a string.
5177 ///
5178 /// Returns `None` if the enum contains an unknown value deserialized from
5179 /// the integer representation of enums.
5180 pub fn name(&self) -> std::option::Option<&str> {
5181 match self {
5182 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
5183 Self::CloudDatastore => std::option::Option::Some("CLOUD_DATASTORE"),
5184 Self::CloudFirestore => std::option::Option::Some("CLOUD_FIRESTORE"),
5185 Self::CloudDatastoreCompatibility => {
5186 std::option::Option::Some("CLOUD_DATASTORE_COMPATIBILITY")
5187 }
5188 Self::UnknownValue(u) => u.0.name(),
5189 }
5190 }
5191 }
5192
5193 impl std::default::Default for DatabaseType {
5194 fn default() -> Self {
5195 use std::convert::From;
5196 Self::from(0)
5197 }
5198 }
5199
5200 impl std::fmt::Display for DatabaseType {
5201 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5202 wkt::internal::display_enum(f, self.name(), self.value())
5203 }
5204 }
5205
5206 impl std::convert::From<i32> for DatabaseType {
5207 fn from(value: i32) -> Self {
5208 match value {
5209 0 => Self::Unspecified,
5210 1 => Self::CloudDatastore,
5211 2 => Self::CloudFirestore,
5212 3 => Self::CloudDatastoreCompatibility,
5213 _ => Self::UnknownValue(database_type::UnknownValue(
5214 wkt::internal::UnknownEnumValue::Integer(value),
5215 )),
5216 }
5217 }
5218 }
5219
5220 impl std::convert::From<&str> for DatabaseType {
5221 fn from(value: &str) -> Self {
5222 use std::string::ToString;
5223 match value {
5224 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
5225 "CLOUD_DATASTORE" => Self::CloudDatastore,
5226 "CLOUD_FIRESTORE" => Self::CloudFirestore,
5227 "CLOUD_DATASTORE_COMPATIBILITY" => Self::CloudDatastoreCompatibility,
5228 _ => Self::UnknownValue(database_type::UnknownValue(
5229 wkt::internal::UnknownEnumValue::String(value.to_string()),
5230 )),
5231 }
5232 }
5233 }
5234
5235 impl serde::ser::Serialize for DatabaseType {
5236 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5237 where
5238 S: serde::Serializer,
5239 {
5240 match self {
5241 Self::Unspecified => serializer.serialize_i32(0),
5242 Self::CloudDatastore => serializer.serialize_i32(1),
5243 Self::CloudFirestore => serializer.serialize_i32(2),
5244 Self::CloudDatastoreCompatibility => serializer.serialize_i32(3),
5245 Self::UnknownValue(u) => u.0.serialize(serializer),
5246 }
5247 }
5248 }
5249
5250 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
5251 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5252 where
5253 D: serde::Deserializer<'de>,
5254 {
5255 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
5256 ".google.appengine.v1.Application.DatabaseType",
5257 ))
5258 }
5259 }
5260}
5261
5262/// Rules to match an HTTP request and dispatch that request to a service.
5263#[derive(Clone, Default, PartialEq)]
5264#[non_exhaustive]
5265pub struct UrlDispatchRule {
5266 /// Domain name to match against. The wildcard "`*`" is supported if
5267 /// specified before a period: "`*.`".
5268 ///
5269 /// Defaults to matching all domains: "`*`".
5270 pub domain: std::string::String,
5271
5272 /// Pathname within the host. Must start with a "`/`". A
5273 /// single "`*`" can be included at the end of the path.
5274 ///
5275 /// The sum of the lengths of the domain and path may not
5276 /// exceed 100 characters.
5277 pub path: std::string::String,
5278
5279 /// Resource ID of a service in this application that should
5280 /// serve the matched request. The service must already
5281 /// exist. Example: `default`.
5282 pub service: std::string::String,
5283
5284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5285}
5286
5287impl UrlDispatchRule {
5288 /// Creates a new default instance.
5289 pub fn new() -> Self {
5290 std::default::Default::default()
5291 }
5292
5293 /// Sets the value of [domain][crate::model::UrlDispatchRule::domain].
5294 ///
5295 /// # Example
5296 /// ```ignore,no_run
5297 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5298 /// let x = UrlDispatchRule::new().set_domain("example");
5299 /// ```
5300 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5301 self.domain = v.into();
5302 self
5303 }
5304
5305 /// Sets the value of [path][crate::model::UrlDispatchRule::path].
5306 ///
5307 /// # Example
5308 /// ```ignore,no_run
5309 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5310 /// let x = UrlDispatchRule::new().set_path("example");
5311 /// ```
5312 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5313 self.path = v.into();
5314 self
5315 }
5316
5317 /// Sets the value of [service][crate::model::UrlDispatchRule::service].
5318 ///
5319 /// # Example
5320 /// ```ignore,no_run
5321 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5322 /// let x = UrlDispatchRule::new().set_service("example");
5323 /// ```
5324 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5325 self.service = v.into();
5326 self
5327 }
5328}
5329
5330impl wkt::message::Message for UrlDispatchRule {
5331 fn typename() -> &'static str {
5332 "type.googleapis.com/google.appengine.v1.UrlDispatchRule"
5333 }
5334}
5335
5336/// App Engine admin service audit log.
5337#[derive(Clone, Default, PartialEq)]
5338#[non_exhaustive]
5339pub struct AuditData {
5340 /// Detailed information about methods that require it. Does not include
5341 /// simple Get, List or Delete methods because all significant information
5342 /// (resource name, number of returned elements for List operations) is already
5343 /// included in parent audit log message.
5344 pub method: std::option::Option<crate::model::audit_data::Method>,
5345
5346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5347}
5348
5349impl AuditData {
5350 /// Creates a new default instance.
5351 pub fn new() -> Self {
5352 std::default::Default::default()
5353 }
5354
5355 /// Sets the value of [method][crate::model::AuditData::method].
5356 ///
5357 /// Note that all the setters affecting `method` are mutually
5358 /// exclusive.
5359 ///
5360 /// # Example
5361 /// ```ignore,no_run
5362 /// # use google_cloud_appengine_v1::model::AuditData;
5363 /// use google_cloud_appengine_v1::model::UpdateServiceMethod;
5364 /// let x = AuditData::new().set_method(Some(
5365 /// google_cloud_appengine_v1::model::audit_data::Method::UpdateService(UpdateServiceMethod::default().into())));
5366 /// ```
5367 pub fn set_method<
5368 T: std::convert::Into<std::option::Option<crate::model::audit_data::Method>>,
5369 >(
5370 mut self,
5371 v: T,
5372 ) -> Self {
5373 self.method = v.into();
5374 self
5375 }
5376
5377 /// The value of [method][crate::model::AuditData::method]
5378 /// if it holds a `UpdateService`, `None` if the field is not set or
5379 /// holds a different branch.
5380 pub fn update_service(
5381 &self,
5382 ) -> std::option::Option<&std::boxed::Box<crate::model::UpdateServiceMethod>> {
5383 #[allow(unreachable_patterns)]
5384 self.method.as_ref().and_then(|v| match v {
5385 crate::model::audit_data::Method::UpdateService(v) => std::option::Option::Some(v),
5386 _ => std::option::Option::None,
5387 })
5388 }
5389
5390 /// Sets the value of [method][crate::model::AuditData::method]
5391 /// to hold a `UpdateService`.
5392 ///
5393 /// Note that all the setters affecting `method` are
5394 /// mutually exclusive.
5395 ///
5396 /// # Example
5397 /// ```ignore,no_run
5398 /// # use google_cloud_appengine_v1::model::AuditData;
5399 /// use google_cloud_appengine_v1::model::UpdateServiceMethod;
5400 /// let x = AuditData::new().set_update_service(UpdateServiceMethod::default()/* use setters */);
5401 /// assert!(x.update_service().is_some());
5402 /// assert!(x.create_version().is_none());
5403 /// ```
5404 pub fn set_update_service<
5405 T: std::convert::Into<std::boxed::Box<crate::model::UpdateServiceMethod>>,
5406 >(
5407 mut self,
5408 v: T,
5409 ) -> Self {
5410 self.method =
5411 std::option::Option::Some(crate::model::audit_data::Method::UpdateService(v.into()));
5412 self
5413 }
5414
5415 /// The value of [method][crate::model::AuditData::method]
5416 /// if it holds a `CreateVersion`, `None` if the field is not set or
5417 /// holds a different branch.
5418 pub fn create_version(
5419 &self,
5420 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateVersionMethod>> {
5421 #[allow(unreachable_patterns)]
5422 self.method.as_ref().and_then(|v| match v {
5423 crate::model::audit_data::Method::CreateVersion(v) => std::option::Option::Some(v),
5424 _ => std::option::Option::None,
5425 })
5426 }
5427
5428 /// Sets the value of [method][crate::model::AuditData::method]
5429 /// to hold a `CreateVersion`.
5430 ///
5431 /// Note that all the setters affecting `method` are
5432 /// mutually exclusive.
5433 ///
5434 /// # Example
5435 /// ```ignore,no_run
5436 /// # use google_cloud_appengine_v1::model::AuditData;
5437 /// use google_cloud_appengine_v1::model::CreateVersionMethod;
5438 /// let x = AuditData::new().set_create_version(CreateVersionMethod::default()/* use setters */);
5439 /// assert!(x.create_version().is_some());
5440 /// assert!(x.update_service().is_none());
5441 /// ```
5442 pub fn set_create_version<
5443 T: std::convert::Into<std::boxed::Box<crate::model::CreateVersionMethod>>,
5444 >(
5445 mut self,
5446 v: T,
5447 ) -> Self {
5448 self.method =
5449 std::option::Option::Some(crate::model::audit_data::Method::CreateVersion(v.into()));
5450 self
5451 }
5452}
5453
5454impl wkt::message::Message for AuditData {
5455 fn typename() -> &'static str {
5456 "type.googleapis.com/google.appengine.v1.AuditData"
5457 }
5458}
5459
5460/// Defines additional types related to [AuditData].
5461pub mod audit_data {
5462 #[allow(unused_imports)]
5463 use super::*;
5464
5465 /// Detailed information about methods that require it. Does not include
5466 /// simple Get, List or Delete methods because all significant information
5467 /// (resource name, number of returned elements for List operations) is already
5468 /// included in parent audit log message.
5469 #[derive(Clone, Debug, PartialEq)]
5470 #[non_exhaustive]
5471 pub enum Method {
5472 /// Detailed information about UpdateService call.
5473 UpdateService(std::boxed::Box<crate::model::UpdateServiceMethod>),
5474 /// Detailed information about CreateVersion call.
5475 CreateVersion(std::boxed::Box<crate::model::CreateVersionMethod>),
5476 }
5477}
5478
5479/// Detailed information about UpdateService call.
5480#[derive(Clone, Default, PartialEq)]
5481#[non_exhaustive]
5482pub struct UpdateServiceMethod {
5483 /// Update service request.
5484 pub request: std::option::Option<crate::model::UpdateServiceRequest>,
5485
5486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5487}
5488
5489impl UpdateServiceMethod {
5490 /// Creates a new default instance.
5491 pub fn new() -> Self {
5492 std::default::Default::default()
5493 }
5494
5495 /// Sets the value of [request][crate::model::UpdateServiceMethod::request].
5496 ///
5497 /// # Example
5498 /// ```ignore,no_run
5499 /// # use google_cloud_appengine_v1::model::UpdateServiceMethod;
5500 /// use google_cloud_appengine_v1::model::UpdateServiceRequest;
5501 /// let x = UpdateServiceMethod::new().set_request(UpdateServiceRequest::default()/* use setters */);
5502 /// ```
5503 pub fn set_request<T>(mut self, v: T) -> Self
5504 where
5505 T: std::convert::Into<crate::model::UpdateServiceRequest>,
5506 {
5507 self.request = std::option::Option::Some(v.into());
5508 self
5509 }
5510
5511 /// Sets or clears the value of [request][crate::model::UpdateServiceMethod::request].
5512 ///
5513 /// # Example
5514 /// ```ignore,no_run
5515 /// # use google_cloud_appengine_v1::model::UpdateServiceMethod;
5516 /// use google_cloud_appengine_v1::model::UpdateServiceRequest;
5517 /// let x = UpdateServiceMethod::new().set_or_clear_request(Some(UpdateServiceRequest::default()/* use setters */));
5518 /// let x = UpdateServiceMethod::new().set_or_clear_request(None::<UpdateServiceRequest>);
5519 /// ```
5520 pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5521 where
5522 T: std::convert::Into<crate::model::UpdateServiceRequest>,
5523 {
5524 self.request = v.map(|x| x.into());
5525 self
5526 }
5527}
5528
5529impl wkt::message::Message for UpdateServiceMethod {
5530 fn typename() -> &'static str {
5531 "type.googleapis.com/google.appengine.v1.UpdateServiceMethod"
5532 }
5533}
5534
5535/// Detailed information about CreateVersion call.
5536#[derive(Clone, Default, PartialEq)]
5537#[non_exhaustive]
5538pub struct CreateVersionMethod {
5539 /// Create version request.
5540 pub request: std::option::Option<crate::model::CreateVersionRequest>,
5541
5542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5543}
5544
5545impl CreateVersionMethod {
5546 /// Creates a new default instance.
5547 pub fn new() -> Self {
5548 std::default::Default::default()
5549 }
5550
5551 /// Sets the value of [request][crate::model::CreateVersionMethod::request].
5552 ///
5553 /// # Example
5554 /// ```ignore,no_run
5555 /// # use google_cloud_appengine_v1::model::CreateVersionMethod;
5556 /// use google_cloud_appengine_v1::model::CreateVersionRequest;
5557 /// let x = CreateVersionMethod::new().set_request(CreateVersionRequest::default()/* use setters */);
5558 /// ```
5559 pub fn set_request<T>(mut self, v: T) -> Self
5560 where
5561 T: std::convert::Into<crate::model::CreateVersionRequest>,
5562 {
5563 self.request = std::option::Option::Some(v.into());
5564 self
5565 }
5566
5567 /// Sets or clears the value of [request][crate::model::CreateVersionMethod::request].
5568 ///
5569 /// # Example
5570 /// ```ignore,no_run
5571 /// # use google_cloud_appengine_v1::model::CreateVersionMethod;
5572 /// use google_cloud_appengine_v1::model::CreateVersionRequest;
5573 /// let x = CreateVersionMethod::new().set_or_clear_request(Some(CreateVersionRequest::default()/* use setters */));
5574 /// let x = CreateVersionMethod::new().set_or_clear_request(None::<CreateVersionRequest>);
5575 /// ```
5576 pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5577 where
5578 T: std::convert::Into<crate::model::CreateVersionRequest>,
5579 {
5580 self.request = v.map(|x| x.into());
5581 self
5582 }
5583}
5584
5585impl wkt::message::Message for CreateVersionMethod {
5586 fn typename() -> &'static str {
5587 "type.googleapis.com/google.appengine.v1.CreateVersionMethod"
5588 }
5589}
5590
5591/// An SSL certificate that a user has been authorized to administer. A user
5592/// is authorized to administer any certificate that applies to one of their
5593/// authorized domains.
5594#[derive(Clone, Default, PartialEq)]
5595#[non_exhaustive]
5596pub struct AuthorizedCertificate {
5597 /// Full path to the `AuthorizedCertificate` resource in the API. Example:
5598 /// `apps/myapp/authorizedCertificates/12345`.
5599 ///
5600 /// @OutputOnly
5601 pub name: std::string::String,
5602
5603 /// Relative name of the certificate. This is a unique value autogenerated
5604 /// on `AuthorizedCertificate` resource creation. Example: `12345`.
5605 ///
5606 /// @OutputOnly
5607 pub id: std::string::String,
5608
5609 /// The user-specified display name of the certificate. This is not
5610 /// guaranteed to be unique. Example: `My Certificate`.
5611 pub display_name: std::string::String,
5612
5613 /// Topmost applicable domains of this certificate. This certificate
5614 /// applies to these domains and their subdomains. Example: `example.com`.
5615 ///
5616 /// @OutputOnly
5617 pub domain_names: std::vec::Vec<std::string::String>,
5618
5619 /// The time when this certificate expires. To update the renewal time on this
5620 /// certificate, upload an SSL certificate with a different expiration time
5621 /// using [`AuthorizedCertificates.UpdateAuthorizedCertificate`]().
5622 ///
5623 /// @OutputOnly
5624 pub expire_time: std::option::Option<wkt::Timestamp>,
5625
5626 /// The SSL certificate serving the `AuthorizedCertificate` resource. This
5627 /// must be obtained independently from a certificate authority.
5628 pub certificate_raw_data: std::option::Option<crate::model::CertificateRawData>,
5629
5630 /// Only applicable if this certificate is managed by App Engine. Managed
5631 /// certificates are tied to the lifecycle of a `DomainMapping` and cannot be
5632 /// updated or deleted via the `AuthorizedCertificates` API. If this
5633 /// certificate is manually administered by the user, this field will be empty.
5634 ///
5635 /// @OutputOnly
5636 pub managed_certificate: std::option::Option<crate::model::ManagedCertificate>,
5637
5638 /// The full paths to user visible Domain Mapping resources that have this
5639 /// certificate mapped. Example: `apps/myapp/domainMappings/example.com`.
5640 ///
5641 /// This may not represent the full list of mapped domain mappings if the user
5642 /// does not have `VIEWER` permissions on all of the applications that have
5643 /// this certificate mapped. See `domain_mappings_count` for a complete count.
5644 ///
5645 /// Only returned by `GET` or `LIST` requests when specifically requested by
5646 /// the `view=FULL_CERTIFICATE` option.
5647 ///
5648 /// @OutputOnly
5649 pub visible_domain_mappings: std::vec::Vec<std::string::String>,
5650
5651 /// Aggregate count of the domain mappings with this certificate mapped. This
5652 /// count includes domain mappings on applications for which the user does not
5653 /// have `VIEWER` permissions.
5654 ///
5655 /// Only returned by `GET` or `LIST` requests when specifically requested by
5656 /// the `view=FULL_CERTIFICATE` option.
5657 ///
5658 /// @OutputOnly
5659 pub domain_mappings_count: i32,
5660
5661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5662}
5663
5664impl AuthorizedCertificate {
5665 /// Creates a new default instance.
5666 pub fn new() -> Self {
5667 std::default::Default::default()
5668 }
5669
5670 /// Sets the value of [name][crate::model::AuthorizedCertificate::name].
5671 ///
5672 /// # Example
5673 /// ```ignore,no_run
5674 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5675 /// let x = AuthorizedCertificate::new().set_name("example");
5676 /// ```
5677 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5678 self.name = v.into();
5679 self
5680 }
5681
5682 /// Sets the value of [id][crate::model::AuthorizedCertificate::id].
5683 ///
5684 /// # Example
5685 /// ```ignore,no_run
5686 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5687 /// let x = AuthorizedCertificate::new().set_id("example");
5688 /// ```
5689 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5690 self.id = v.into();
5691 self
5692 }
5693
5694 /// Sets the value of [display_name][crate::model::AuthorizedCertificate::display_name].
5695 ///
5696 /// # Example
5697 /// ```ignore,no_run
5698 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5699 /// let x = AuthorizedCertificate::new().set_display_name("example");
5700 /// ```
5701 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5702 self.display_name = v.into();
5703 self
5704 }
5705
5706 /// Sets the value of [domain_names][crate::model::AuthorizedCertificate::domain_names].
5707 ///
5708 /// # Example
5709 /// ```ignore,no_run
5710 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5711 /// let x = AuthorizedCertificate::new().set_domain_names(["a", "b", "c"]);
5712 /// ```
5713 pub fn set_domain_names<T, V>(mut self, v: T) -> Self
5714 where
5715 T: std::iter::IntoIterator<Item = V>,
5716 V: std::convert::Into<std::string::String>,
5717 {
5718 use std::iter::Iterator;
5719 self.domain_names = v.into_iter().map(|i| i.into()).collect();
5720 self
5721 }
5722
5723 /// Sets the value of [expire_time][crate::model::AuthorizedCertificate::expire_time].
5724 ///
5725 /// # Example
5726 /// ```ignore,no_run
5727 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5728 /// use wkt::Timestamp;
5729 /// let x = AuthorizedCertificate::new().set_expire_time(Timestamp::default()/* use setters */);
5730 /// ```
5731 pub fn set_expire_time<T>(mut self, v: T) -> Self
5732 where
5733 T: std::convert::Into<wkt::Timestamp>,
5734 {
5735 self.expire_time = std::option::Option::Some(v.into());
5736 self
5737 }
5738
5739 /// Sets or clears the value of [expire_time][crate::model::AuthorizedCertificate::expire_time].
5740 ///
5741 /// # Example
5742 /// ```ignore,no_run
5743 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5744 /// use wkt::Timestamp;
5745 /// let x = AuthorizedCertificate::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
5746 /// let x = AuthorizedCertificate::new().set_or_clear_expire_time(None::<Timestamp>);
5747 /// ```
5748 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
5749 where
5750 T: std::convert::Into<wkt::Timestamp>,
5751 {
5752 self.expire_time = v.map(|x| x.into());
5753 self
5754 }
5755
5756 /// Sets the value of [certificate_raw_data][crate::model::AuthorizedCertificate::certificate_raw_data].
5757 ///
5758 /// # Example
5759 /// ```ignore,no_run
5760 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5761 /// use google_cloud_appengine_v1::model::CertificateRawData;
5762 /// let x = AuthorizedCertificate::new().set_certificate_raw_data(CertificateRawData::default()/* use setters */);
5763 /// ```
5764 pub fn set_certificate_raw_data<T>(mut self, v: T) -> Self
5765 where
5766 T: std::convert::Into<crate::model::CertificateRawData>,
5767 {
5768 self.certificate_raw_data = std::option::Option::Some(v.into());
5769 self
5770 }
5771
5772 /// Sets or clears the value of [certificate_raw_data][crate::model::AuthorizedCertificate::certificate_raw_data].
5773 ///
5774 /// # Example
5775 /// ```ignore,no_run
5776 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5777 /// use google_cloud_appengine_v1::model::CertificateRawData;
5778 /// let x = AuthorizedCertificate::new().set_or_clear_certificate_raw_data(Some(CertificateRawData::default()/* use setters */));
5779 /// let x = AuthorizedCertificate::new().set_or_clear_certificate_raw_data(None::<CertificateRawData>);
5780 /// ```
5781 pub fn set_or_clear_certificate_raw_data<T>(mut self, v: std::option::Option<T>) -> Self
5782 where
5783 T: std::convert::Into<crate::model::CertificateRawData>,
5784 {
5785 self.certificate_raw_data = v.map(|x| x.into());
5786 self
5787 }
5788
5789 /// Sets the value of [managed_certificate][crate::model::AuthorizedCertificate::managed_certificate].
5790 ///
5791 /// # Example
5792 /// ```ignore,no_run
5793 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5794 /// use google_cloud_appengine_v1::model::ManagedCertificate;
5795 /// let x = AuthorizedCertificate::new().set_managed_certificate(ManagedCertificate::default()/* use setters */);
5796 /// ```
5797 pub fn set_managed_certificate<T>(mut self, v: T) -> Self
5798 where
5799 T: std::convert::Into<crate::model::ManagedCertificate>,
5800 {
5801 self.managed_certificate = std::option::Option::Some(v.into());
5802 self
5803 }
5804
5805 /// Sets or clears the value of [managed_certificate][crate::model::AuthorizedCertificate::managed_certificate].
5806 ///
5807 /// # Example
5808 /// ```ignore,no_run
5809 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5810 /// use google_cloud_appengine_v1::model::ManagedCertificate;
5811 /// let x = AuthorizedCertificate::new().set_or_clear_managed_certificate(Some(ManagedCertificate::default()/* use setters */));
5812 /// let x = AuthorizedCertificate::new().set_or_clear_managed_certificate(None::<ManagedCertificate>);
5813 /// ```
5814 pub fn set_or_clear_managed_certificate<T>(mut self, v: std::option::Option<T>) -> Self
5815 where
5816 T: std::convert::Into<crate::model::ManagedCertificate>,
5817 {
5818 self.managed_certificate = v.map(|x| x.into());
5819 self
5820 }
5821
5822 /// Sets the value of [visible_domain_mappings][crate::model::AuthorizedCertificate::visible_domain_mappings].
5823 ///
5824 /// # Example
5825 /// ```ignore,no_run
5826 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5827 /// let x = AuthorizedCertificate::new().set_visible_domain_mappings(["a", "b", "c"]);
5828 /// ```
5829 pub fn set_visible_domain_mappings<T, V>(mut self, v: T) -> Self
5830 where
5831 T: std::iter::IntoIterator<Item = V>,
5832 V: std::convert::Into<std::string::String>,
5833 {
5834 use std::iter::Iterator;
5835 self.visible_domain_mappings = v.into_iter().map(|i| i.into()).collect();
5836 self
5837 }
5838
5839 /// Sets the value of [domain_mappings_count][crate::model::AuthorizedCertificate::domain_mappings_count].
5840 ///
5841 /// # Example
5842 /// ```ignore,no_run
5843 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5844 /// let x = AuthorizedCertificate::new().set_domain_mappings_count(42);
5845 /// ```
5846 pub fn set_domain_mappings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5847 self.domain_mappings_count = v.into();
5848 self
5849 }
5850}
5851
5852impl wkt::message::Message for AuthorizedCertificate {
5853 fn typename() -> &'static str {
5854 "type.googleapis.com/google.appengine.v1.AuthorizedCertificate"
5855 }
5856}
5857
5858/// An SSL certificate obtained from a certificate authority.
5859#[derive(Clone, Default, PartialEq)]
5860#[non_exhaustive]
5861pub struct CertificateRawData {
5862 /// PEM encoded x.509 public key certificate. This field is set once on
5863 /// certificate creation. Must include the header and footer. Example:
5864 pub public_certificate: std::string::String,
5865
5866 /// Unencrypted PEM encoded RSA private key. This field is set once on
5867 /// certificate creation and then encrypted. The key size must be 2048
5868 /// bits or fewer. Must include the header and footer. Example:
5869 ///
5870 /// @InputOnly
5871 pub private_key: std::string::String,
5872
5873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5874}
5875
5876impl CertificateRawData {
5877 /// Creates a new default instance.
5878 pub fn new() -> Self {
5879 std::default::Default::default()
5880 }
5881
5882 /// Sets the value of [public_certificate][crate::model::CertificateRawData::public_certificate].
5883 ///
5884 /// # Example
5885 /// ```ignore,no_run
5886 /// # use google_cloud_appengine_v1::model::CertificateRawData;
5887 /// let x = CertificateRawData::new().set_public_certificate("example");
5888 /// ```
5889 pub fn set_public_certificate<T: std::convert::Into<std::string::String>>(
5890 mut self,
5891 v: T,
5892 ) -> Self {
5893 self.public_certificate = v.into();
5894 self
5895 }
5896
5897 /// Sets the value of [private_key][crate::model::CertificateRawData::private_key].
5898 ///
5899 /// # Example
5900 /// ```ignore,no_run
5901 /// # use google_cloud_appengine_v1::model::CertificateRawData;
5902 /// let x = CertificateRawData::new().set_private_key("example");
5903 /// ```
5904 pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5905 self.private_key = v.into();
5906 self
5907 }
5908}
5909
5910impl wkt::message::Message for CertificateRawData {
5911 fn typename() -> &'static str {
5912 "type.googleapis.com/google.appengine.v1.CertificateRawData"
5913 }
5914}
5915
5916/// A certificate managed by App Engine.
5917#[derive(Clone, Default, PartialEq)]
5918#[non_exhaustive]
5919pub struct ManagedCertificate {
5920 /// Time at which the certificate was last renewed. The renewal process is
5921 /// fully managed. Certificate renewal will automatically occur before the
5922 /// certificate expires. Renewal errors can be tracked via `ManagementStatus`.
5923 ///
5924 /// @OutputOnly
5925 pub last_renewal_time: std::option::Option<wkt::Timestamp>,
5926
5927 /// Status of certificate management. Refers to the most recent certificate
5928 /// acquisition or renewal attempt.
5929 ///
5930 /// @OutputOnly
5931 pub status: crate::model::ManagementStatus,
5932
5933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5934}
5935
5936impl ManagedCertificate {
5937 /// Creates a new default instance.
5938 pub fn new() -> Self {
5939 std::default::Default::default()
5940 }
5941
5942 /// Sets the value of [last_renewal_time][crate::model::ManagedCertificate::last_renewal_time].
5943 ///
5944 /// # Example
5945 /// ```ignore,no_run
5946 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5947 /// use wkt::Timestamp;
5948 /// let x = ManagedCertificate::new().set_last_renewal_time(Timestamp::default()/* use setters */);
5949 /// ```
5950 pub fn set_last_renewal_time<T>(mut self, v: T) -> Self
5951 where
5952 T: std::convert::Into<wkt::Timestamp>,
5953 {
5954 self.last_renewal_time = std::option::Option::Some(v.into());
5955 self
5956 }
5957
5958 /// Sets or clears the value of [last_renewal_time][crate::model::ManagedCertificate::last_renewal_time].
5959 ///
5960 /// # Example
5961 /// ```ignore,no_run
5962 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5963 /// use wkt::Timestamp;
5964 /// let x = ManagedCertificate::new().set_or_clear_last_renewal_time(Some(Timestamp::default()/* use setters */));
5965 /// let x = ManagedCertificate::new().set_or_clear_last_renewal_time(None::<Timestamp>);
5966 /// ```
5967 pub fn set_or_clear_last_renewal_time<T>(mut self, v: std::option::Option<T>) -> Self
5968 where
5969 T: std::convert::Into<wkt::Timestamp>,
5970 {
5971 self.last_renewal_time = v.map(|x| x.into());
5972 self
5973 }
5974
5975 /// Sets the value of [status][crate::model::ManagedCertificate::status].
5976 ///
5977 /// # Example
5978 /// ```ignore,no_run
5979 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5980 /// use google_cloud_appengine_v1::model::ManagementStatus;
5981 /// let x0 = ManagedCertificate::new().set_status(ManagementStatus::Ok);
5982 /// let x1 = ManagedCertificate::new().set_status(ManagementStatus::Pending);
5983 /// let x2 = ManagedCertificate::new().set_status(ManagementStatus::FailedRetryingNotVisible);
5984 /// ```
5985 pub fn set_status<T: std::convert::Into<crate::model::ManagementStatus>>(
5986 mut self,
5987 v: T,
5988 ) -> Self {
5989 self.status = v.into();
5990 self
5991 }
5992}
5993
5994impl wkt::message::Message for ManagedCertificate {
5995 fn typename() -> &'static str {
5996 "type.googleapis.com/google.appengine.v1.ManagedCertificate"
5997 }
5998}
5999
6000/// Code and application artifacts used to deploy a version to App Engine.
6001#[derive(Clone, Default, PartialEq)]
6002#[non_exhaustive]
6003pub struct Deployment {
6004 /// Manifest of the files stored in Google Cloud Storage that are included
6005 /// as part of this version. All files must be readable using the
6006 /// credentials supplied with this call.
6007 pub files: std::collections::HashMap<std::string::String, crate::model::FileInfo>,
6008
6009 /// The Docker image for the container that runs the version.
6010 /// Only applicable for instances running in the App Engine flexible environment.
6011 pub container: std::option::Option<crate::model::ContainerInfo>,
6012
6013 /// The zip file for this deployment, if this is a zip deployment.
6014 pub zip: std::option::Option<crate::model::ZipInfo>,
6015
6016 /// Options for any Google Cloud Build builds created as a part of this
6017 /// deployment.
6018 ///
6019 /// These options will only be used if a new build is created, such as when
6020 /// deploying to the App Engine flexible environment using files or zip.
6021 pub cloud_build_options: std::option::Option<crate::model::CloudBuildOptions>,
6022
6023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6024}
6025
6026impl Deployment {
6027 /// Creates a new default instance.
6028 pub fn new() -> Self {
6029 std::default::Default::default()
6030 }
6031
6032 /// Sets the value of [files][crate::model::Deployment::files].
6033 ///
6034 /// # Example
6035 /// ```ignore,no_run
6036 /// # use google_cloud_appengine_v1::model::Deployment;
6037 /// use google_cloud_appengine_v1::model::FileInfo;
6038 /// let x = Deployment::new().set_files([
6039 /// ("key0", FileInfo::default()/* use setters */),
6040 /// ("key1", FileInfo::default()/* use (different) setters */),
6041 /// ]);
6042 /// ```
6043 pub fn set_files<T, K, V>(mut self, v: T) -> Self
6044 where
6045 T: std::iter::IntoIterator<Item = (K, V)>,
6046 K: std::convert::Into<std::string::String>,
6047 V: std::convert::Into<crate::model::FileInfo>,
6048 {
6049 use std::iter::Iterator;
6050 self.files = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6051 self
6052 }
6053
6054 /// Sets the value of [container][crate::model::Deployment::container].
6055 ///
6056 /// # Example
6057 /// ```ignore,no_run
6058 /// # use google_cloud_appengine_v1::model::Deployment;
6059 /// use google_cloud_appengine_v1::model::ContainerInfo;
6060 /// let x = Deployment::new().set_container(ContainerInfo::default()/* use setters */);
6061 /// ```
6062 pub fn set_container<T>(mut self, v: T) -> Self
6063 where
6064 T: std::convert::Into<crate::model::ContainerInfo>,
6065 {
6066 self.container = std::option::Option::Some(v.into());
6067 self
6068 }
6069
6070 /// Sets or clears the value of [container][crate::model::Deployment::container].
6071 ///
6072 /// # Example
6073 /// ```ignore,no_run
6074 /// # use google_cloud_appengine_v1::model::Deployment;
6075 /// use google_cloud_appengine_v1::model::ContainerInfo;
6076 /// let x = Deployment::new().set_or_clear_container(Some(ContainerInfo::default()/* use setters */));
6077 /// let x = Deployment::new().set_or_clear_container(None::<ContainerInfo>);
6078 /// ```
6079 pub fn set_or_clear_container<T>(mut self, v: std::option::Option<T>) -> Self
6080 where
6081 T: std::convert::Into<crate::model::ContainerInfo>,
6082 {
6083 self.container = v.map(|x| x.into());
6084 self
6085 }
6086
6087 /// Sets the value of [zip][crate::model::Deployment::zip].
6088 ///
6089 /// # Example
6090 /// ```ignore,no_run
6091 /// # use google_cloud_appengine_v1::model::Deployment;
6092 /// use google_cloud_appengine_v1::model::ZipInfo;
6093 /// let x = Deployment::new().set_zip(ZipInfo::default()/* use setters */);
6094 /// ```
6095 pub fn set_zip<T>(mut self, v: T) -> Self
6096 where
6097 T: std::convert::Into<crate::model::ZipInfo>,
6098 {
6099 self.zip = std::option::Option::Some(v.into());
6100 self
6101 }
6102
6103 /// Sets or clears the value of [zip][crate::model::Deployment::zip].
6104 ///
6105 /// # Example
6106 /// ```ignore,no_run
6107 /// # use google_cloud_appengine_v1::model::Deployment;
6108 /// use google_cloud_appengine_v1::model::ZipInfo;
6109 /// let x = Deployment::new().set_or_clear_zip(Some(ZipInfo::default()/* use setters */));
6110 /// let x = Deployment::new().set_or_clear_zip(None::<ZipInfo>);
6111 /// ```
6112 pub fn set_or_clear_zip<T>(mut self, v: std::option::Option<T>) -> Self
6113 where
6114 T: std::convert::Into<crate::model::ZipInfo>,
6115 {
6116 self.zip = v.map(|x| x.into());
6117 self
6118 }
6119
6120 /// Sets the value of [cloud_build_options][crate::model::Deployment::cloud_build_options].
6121 ///
6122 /// # Example
6123 /// ```ignore,no_run
6124 /// # use google_cloud_appengine_v1::model::Deployment;
6125 /// use google_cloud_appengine_v1::model::CloudBuildOptions;
6126 /// let x = Deployment::new().set_cloud_build_options(CloudBuildOptions::default()/* use setters */);
6127 /// ```
6128 pub fn set_cloud_build_options<T>(mut self, v: T) -> Self
6129 where
6130 T: std::convert::Into<crate::model::CloudBuildOptions>,
6131 {
6132 self.cloud_build_options = std::option::Option::Some(v.into());
6133 self
6134 }
6135
6136 /// Sets or clears the value of [cloud_build_options][crate::model::Deployment::cloud_build_options].
6137 ///
6138 /// # Example
6139 /// ```ignore,no_run
6140 /// # use google_cloud_appengine_v1::model::Deployment;
6141 /// use google_cloud_appengine_v1::model::CloudBuildOptions;
6142 /// let x = Deployment::new().set_or_clear_cloud_build_options(Some(CloudBuildOptions::default()/* use setters */));
6143 /// let x = Deployment::new().set_or_clear_cloud_build_options(None::<CloudBuildOptions>);
6144 /// ```
6145 pub fn set_or_clear_cloud_build_options<T>(mut self, v: std::option::Option<T>) -> Self
6146 where
6147 T: std::convert::Into<crate::model::CloudBuildOptions>,
6148 {
6149 self.cloud_build_options = v.map(|x| x.into());
6150 self
6151 }
6152}
6153
6154impl wkt::message::Message for Deployment {
6155 fn typename() -> &'static str {
6156 "type.googleapis.com/google.appengine.v1.Deployment"
6157 }
6158}
6159
6160/// Single source file that is part of the version to be deployed. Each source
6161/// file that is deployed must be specified separately.
6162#[derive(Clone, Default, PartialEq)]
6163#[non_exhaustive]
6164pub struct FileInfo {
6165 /// URL source to use to fetch this file. Must be a URL to a resource in
6166 /// Google Cloud Storage in the form
6167 /// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
6168 pub source_url: std::string::String,
6169
6170 /// The SHA1 hash of the file, in hex.
6171 pub sha1_sum: std::string::String,
6172
6173 /// The MIME type of the file.
6174 ///
6175 /// Defaults to the value from Google Cloud Storage.
6176 pub mime_type: std::string::String,
6177
6178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6179}
6180
6181impl FileInfo {
6182 /// Creates a new default instance.
6183 pub fn new() -> Self {
6184 std::default::Default::default()
6185 }
6186
6187 /// Sets the value of [source_url][crate::model::FileInfo::source_url].
6188 ///
6189 /// # Example
6190 /// ```ignore,no_run
6191 /// # use google_cloud_appengine_v1::model::FileInfo;
6192 /// let x = FileInfo::new().set_source_url("example");
6193 /// ```
6194 pub fn set_source_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6195 self.source_url = v.into();
6196 self
6197 }
6198
6199 /// Sets the value of [sha1_sum][crate::model::FileInfo::sha1_sum].
6200 ///
6201 /// # Example
6202 /// ```ignore,no_run
6203 /// # use google_cloud_appengine_v1::model::FileInfo;
6204 /// let x = FileInfo::new().set_sha1_sum("example");
6205 /// ```
6206 pub fn set_sha1_sum<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6207 self.sha1_sum = v.into();
6208 self
6209 }
6210
6211 /// Sets the value of [mime_type][crate::model::FileInfo::mime_type].
6212 ///
6213 /// # Example
6214 /// ```ignore,no_run
6215 /// # use google_cloud_appengine_v1::model::FileInfo;
6216 /// let x = FileInfo::new().set_mime_type("example");
6217 /// ```
6218 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6219 self.mime_type = v.into();
6220 self
6221 }
6222}
6223
6224impl wkt::message::Message for FileInfo {
6225 fn typename() -> &'static str {
6226 "type.googleapis.com/google.appengine.v1.FileInfo"
6227 }
6228}
6229
6230/// Docker image that is used to create a container and start a VM instance for
6231/// the version that you deploy. Only applicable for instances running in the App
6232/// Engine flexible environment.
6233#[derive(Clone, Default, PartialEq)]
6234#[non_exhaustive]
6235pub struct ContainerInfo {
6236 /// URI to the hosted container image in Google Container Registry. The URI
6237 /// must be fully qualified and include a tag or digest.
6238 /// Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest"
6239 pub image: std::string::String,
6240
6241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6242}
6243
6244impl ContainerInfo {
6245 /// Creates a new default instance.
6246 pub fn new() -> Self {
6247 std::default::Default::default()
6248 }
6249
6250 /// Sets the value of [image][crate::model::ContainerInfo::image].
6251 ///
6252 /// # Example
6253 /// ```ignore,no_run
6254 /// # use google_cloud_appengine_v1::model::ContainerInfo;
6255 /// let x = ContainerInfo::new().set_image("example");
6256 /// ```
6257 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6258 self.image = v.into();
6259 self
6260 }
6261}
6262
6263impl wkt::message::Message for ContainerInfo {
6264 fn typename() -> &'static str {
6265 "type.googleapis.com/google.appengine.v1.ContainerInfo"
6266 }
6267}
6268
6269/// Options for the build operations performed as a part of the version
6270/// deployment. Only applicable for App Engine flexible environment when creating
6271/// a version using source code directly.
6272#[derive(Clone, Default, PartialEq)]
6273#[non_exhaustive]
6274pub struct CloudBuildOptions {
6275 /// Path to the yaml file used in deployment, used to determine runtime
6276 /// configuration details.
6277 ///
6278 /// Required for flexible environment builds.
6279 ///
6280 /// See <https://cloud.google.com/appengine/docs/standard/python/config/appref>
6281 /// for more details.
6282 pub app_yaml_path: std::string::String,
6283
6284 /// The Cloud Build timeout used as part of any dependent builds performed by
6285 /// version creation. Defaults to 10 minutes.
6286 pub cloud_build_timeout: std::option::Option<wkt::Duration>,
6287
6288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6289}
6290
6291impl CloudBuildOptions {
6292 /// Creates a new default instance.
6293 pub fn new() -> Self {
6294 std::default::Default::default()
6295 }
6296
6297 /// Sets the value of [app_yaml_path][crate::model::CloudBuildOptions::app_yaml_path].
6298 ///
6299 /// # Example
6300 /// ```ignore,no_run
6301 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6302 /// let x = CloudBuildOptions::new().set_app_yaml_path("example");
6303 /// ```
6304 pub fn set_app_yaml_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6305 self.app_yaml_path = v.into();
6306 self
6307 }
6308
6309 /// Sets the value of [cloud_build_timeout][crate::model::CloudBuildOptions::cloud_build_timeout].
6310 ///
6311 /// # Example
6312 /// ```ignore,no_run
6313 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6314 /// use wkt::Duration;
6315 /// let x = CloudBuildOptions::new().set_cloud_build_timeout(Duration::default()/* use setters */);
6316 /// ```
6317 pub fn set_cloud_build_timeout<T>(mut self, v: T) -> Self
6318 where
6319 T: std::convert::Into<wkt::Duration>,
6320 {
6321 self.cloud_build_timeout = std::option::Option::Some(v.into());
6322 self
6323 }
6324
6325 /// Sets or clears the value of [cloud_build_timeout][crate::model::CloudBuildOptions::cloud_build_timeout].
6326 ///
6327 /// # Example
6328 /// ```ignore,no_run
6329 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6330 /// use wkt::Duration;
6331 /// let x = CloudBuildOptions::new().set_or_clear_cloud_build_timeout(Some(Duration::default()/* use setters */));
6332 /// let x = CloudBuildOptions::new().set_or_clear_cloud_build_timeout(None::<Duration>);
6333 /// ```
6334 pub fn set_or_clear_cloud_build_timeout<T>(mut self, v: std::option::Option<T>) -> Self
6335 where
6336 T: std::convert::Into<wkt::Duration>,
6337 {
6338 self.cloud_build_timeout = v.map(|x| x.into());
6339 self
6340 }
6341}
6342
6343impl wkt::message::Message for CloudBuildOptions {
6344 fn typename() -> &'static str {
6345 "type.googleapis.com/google.appengine.v1.CloudBuildOptions"
6346 }
6347}
6348
6349/// The zip file information for a zip deployment.
6350#[derive(Clone, Default, PartialEq)]
6351#[non_exhaustive]
6352pub struct ZipInfo {
6353 /// URL of the zip file to deploy from. Must be a URL to a resource in
6354 /// Google Cloud Storage in the form
6355 /// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
6356 pub source_url: std::string::String,
6357
6358 /// An estimate of the number of files in a zip for a zip deployment.
6359 /// If set, must be greater than or equal to the actual number of files.
6360 /// Used for optimizing performance; if not provided, deployment may be slow.
6361 pub files_count: i32,
6362
6363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6364}
6365
6366impl ZipInfo {
6367 /// Creates a new default instance.
6368 pub fn new() -> Self {
6369 std::default::Default::default()
6370 }
6371
6372 /// Sets the value of [source_url][crate::model::ZipInfo::source_url].
6373 ///
6374 /// # Example
6375 /// ```ignore,no_run
6376 /// # use google_cloud_appengine_v1::model::ZipInfo;
6377 /// let x = ZipInfo::new().set_source_url("example");
6378 /// ```
6379 pub fn set_source_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6380 self.source_url = v.into();
6381 self
6382 }
6383
6384 /// Sets the value of [files_count][crate::model::ZipInfo::files_count].
6385 ///
6386 /// # Example
6387 /// ```ignore,no_run
6388 /// # use google_cloud_appengine_v1::model::ZipInfo;
6389 /// let x = ZipInfo::new().set_files_count(42);
6390 /// ```
6391 pub fn set_files_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6392 self.files_count = v.into();
6393 self
6394 }
6395}
6396
6397impl wkt::message::Message for ZipInfo {
6398 fn typename() -> &'static str {
6399 "type.googleapis.com/google.appengine.v1.ZipInfo"
6400 }
6401}
6402
6403/// A domain that a user has been authorized to administer. To authorize use
6404/// of a domain, verify ownership via
6405/// [Search Console](https://search.google.com/search-console/welcome).
6406#[derive(Clone, Default, PartialEq)]
6407#[non_exhaustive]
6408pub struct AuthorizedDomain {
6409 /// Full path to the `AuthorizedDomain` resource in the API. Example:
6410 /// `apps/myapp/authorizedDomains/example.com`.
6411 ///
6412 /// @OutputOnly
6413 pub name: std::string::String,
6414
6415 /// Fully qualified domain name of the domain authorized for use. Example:
6416 /// `example.com`.
6417 pub id: std::string::String,
6418
6419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6420}
6421
6422impl AuthorizedDomain {
6423 /// Creates a new default instance.
6424 pub fn new() -> Self {
6425 std::default::Default::default()
6426 }
6427
6428 /// Sets the value of [name][crate::model::AuthorizedDomain::name].
6429 ///
6430 /// # Example
6431 /// ```ignore,no_run
6432 /// # use google_cloud_appengine_v1::model::AuthorizedDomain;
6433 /// let x = AuthorizedDomain::new().set_name("example");
6434 /// ```
6435 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6436 self.name = v.into();
6437 self
6438 }
6439
6440 /// Sets the value of [id][crate::model::AuthorizedDomain::id].
6441 ///
6442 /// # Example
6443 /// ```ignore,no_run
6444 /// # use google_cloud_appengine_v1::model::AuthorizedDomain;
6445 /// let x = AuthorizedDomain::new().set_id("example");
6446 /// ```
6447 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6448 self.id = v.into();
6449 self
6450 }
6451}
6452
6453impl wkt::message::Message for AuthorizedDomain {
6454 fn typename() -> &'static str {
6455 "type.googleapis.com/google.appengine.v1.AuthorizedDomain"
6456 }
6457}
6458
6459/// A domain serving an App Engine application.
6460#[derive(Clone, Default, PartialEq)]
6461#[non_exhaustive]
6462pub struct DomainMapping {
6463 /// Full path to the `DomainMapping` resource in the API. Example:
6464 /// `apps/myapp/domainMapping/example.com`.
6465 ///
6466 /// @OutputOnly
6467 pub name: std::string::String,
6468
6469 /// Relative name of the domain serving the application. Example:
6470 /// `example.com`.
6471 pub id: std::string::String,
6472
6473 /// SSL configuration for this domain. If unconfigured, this domain will not
6474 /// serve with SSL.
6475 pub ssl_settings: std::option::Option<crate::model::SslSettings>,
6476
6477 /// The resource records required to configure this domain mapping. These
6478 /// records must be added to the domain's DNS configuration in order to
6479 /// serve the application via this domain mapping.
6480 ///
6481 /// @OutputOnly
6482 pub resource_records: std::vec::Vec<crate::model::ResourceRecord>,
6483
6484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6485}
6486
6487impl DomainMapping {
6488 /// Creates a new default instance.
6489 pub fn new() -> Self {
6490 std::default::Default::default()
6491 }
6492
6493 /// Sets the value of [name][crate::model::DomainMapping::name].
6494 ///
6495 /// # Example
6496 /// ```ignore,no_run
6497 /// # use google_cloud_appengine_v1::model::DomainMapping;
6498 /// let x = DomainMapping::new().set_name("example");
6499 /// ```
6500 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6501 self.name = v.into();
6502 self
6503 }
6504
6505 /// Sets the value of [id][crate::model::DomainMapping::id].
6506 ///
6507 /// # Example
6508 /// ```ignore,no_run
6509 /// # use google_cloud_appengine_v1::model::DomainMapping;
6510 /// let x = DomainMapping::new().set_id("example");
6511 /// ```
6512 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6513 self.id = v.into();
6514 self
6515 }
6516
6517 /// Sets the value of [ssl_settings][crate::model::DomainMapping::ssl_settings].
6518 ///
6519 /// # Example
6520 /// ```ignore,no_run
6521 /// # use google_cloud_appengine_v1::model::DomainMapping;
6522 /// use google_cloud_appengine_v1::model::SslSettings;
6523 /// let x = DomainMapping::new().set_ssl_settings(SslSettings::default()/* use setters */);
6524 /// ```
6525 pub fn set_ssl_settings<T>(mut self, v: T) -> Self
6526 where
6527 T: std::convert::Into<crate::model::SslSettings>,
6528 {
6529 self.ssl_settings = std::option::Option::Some(v.into());
6530 self
6531 }
6532
6533 /// Sets or clears the value of [ssl_settings][crate::model::DomainMapping::ssl_settings].
6534 ///
6535 /// # Example
6536 /// ```ignore,no_run
6537 /// # use google_cloud_appengine_v1::model::DomainMapping;
6538 /// use google_cloud_appengine_v1::model::SslSettings;
6539 /// let x = DomainMapping::new().set_or_clear_ssl_settings(Some(SslSettings::default()/* use setters */));
6540 /// let x = DomainMapping::new().set_or_clear_ssl_settings(None::<SslSettings>);
6541 /// ```
6542 pub fn set_or_clear_ssl_settings<T>(mut self, v: std::option::Option<T>) -> Self
6543 where
6544 T: std::convert::Into<crate::model::SslSettings>,
6545 {
6546 self.ssl_settings = v.map(|x| x.into());
6547 self
6548 }
6549
6550 /// Sets the value of [resource_records][crate::model::DomainMapping::resource_records].
6551 ///
6552 /// # Example
6553 /// ```ignore,no_run
6554 /// # use google_cloud_appengine_v1::model::DomainMapping;
6555 /// use google_cloud_appengine_v1::model::ResourceRecord;
6556 /// let x = DomainMapping::new()
6557 /// .set_resource_records([
6558 /// ResourceRecord::default()/* use setters */,
6559 /// ResourceRecord::default()/* use (different) setters */,
6560 /// ]);
6561 /// ```
6562 pub fn set_resource_records<T, V>(mut self, v: T) -> Self
6563 where
6564 T: std::iter::IntoIterator<Item = V>,
6565 V: std::convert::Into<crate::model::ResourceRecord>,
6566 {
6567 use std::iter::Iterator;
6568 self.resource_records = v.into_iter().map(|i| i.into()).collect();
6569 self
6570 }
6571}
6572
6573impl wkt::message::Message for DomainMapping {
6574 fn typename() -> &'static str {
6575 "type.googleapis.com/google.appengine.v1.DomainMapping"
6576 }
6577}
6578
6579/// SSL configuration for a `DomainMapping` resource.
6580#[derive(Clone, Default, PartialEq)]
6581#[non_exhaustive]
6582pub struct SslSettings {
6583 /// ID of the `AuthorizedCertificate` resource configuring SSL for the
6584 /// application. Clearing this field will remove SSL support.
6585 ///
6586 /// By default, a managed certificate is automatically created for every
6587 /// domain mapping. To omit SSL support or to configure SSL manually, specify
6588 /// `SslManagementType.MANUAL` on a `CREATE` or `UPDATE` request. You must
6589 /// be authorized to administer the `AuthorizedCertificate` resource to
6590 /// manually map it to a `DomainMapping` resource.
6591 /// Example: `12345`.
6592 pub certificate_id: std::string::String,
6593
6594 /// SSL management type for this domain. If `AUTOMATIC`, a managed certificate
6595 /// is automatically provisioned. If `MANUAL`, `certificate_id` must be
6596 /// manually specified in order to configure SSL for this domain.
6597 pub ssl_management_type: crate::model::ssl_settings::SslManagementType,
6598
6599 /// ID of the managed `AuthorizedCertificate` resource currently being
6600 /// provisioned, if applicable. Until the new managed certificate has been
6601 /// successfully provisioned, the previous SSL state will be preserved. Once
6602 /// the provisioning process completes, the `certificate_id` field will reflect
6603 /// the new managed certificate and this field will be left empty. To remove
6604 /// SSL support while there is still a pending managed certificate, clear the
6605 /// `certificate_id` field with an `UpdateDomainMappingRequest`.
6606 ///
6607 /// @OutputOnly
6608 pub pending_managed_certificate_id: std::string::String,
6609
6610 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6611}
6612
6613impl SslSettings {
6614 /// Creates a new default instance.
6615 pub fn new() -> Self {
6616 std::default::Default::default()
6617 }
6618
6619 /// Sets the value of [certificate_id][crate::model::SslSettings::certificate_id].
6620 ///
6621 /// # Example
6622 /// ```ignore,no_run
6623 /// # use google_cloud_appengine_v1::model::SslSettings;
6624 /// let x = SslSettings::new().set_certificate_id("example");
6625 /// ```
6626 pub fn set_certificate_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6627 self.certificate_id = v.into();
6628 self
6629 }
6630
6631 /// Sets the value of [ssl_management_type][crate::model::SslSettings::ssl_management_type].
6632 ///
6633 /// # Example
6634 /// ```ignore,no_run
6635 /// # use google_cloud_appengine_v1::model::SslSettings;
6636 /// use google_cloud_appengine_v1::model::ssl_settings::SslManagementType;
6637 /// let x0 = SslSettings::new().set_ssl_management_type(SslManagementType::Automatic);
6638 /// let x1 = SslSettings::new().set_ssl_management_type(SslManagementType::Manual);
6639 /// ```
6640 pub fn set_ssl_management_type<
6641 T: std::convert::Into<crate::model::ssl_settings::SslManagementType>,
6642 >(
6643 mut self,
6644 v: T,
6645 ) -> Self {
6646 self.ssl_management_type = v.into();
6647 self
6648 }
6649
6650 /// Sets the value of [pending_managed_certificate_id][crate::model::SslSettings::pending_managed_certificate_id].
6651 ///
6652 /// # Example
6653 /// ```ignore,no_run
6654 /// # use google_cloud_appengine_v1::model::SslSettings;
6655 /// let x = SslSettings::new().set_pending_managed_certificate_id("example");
6656 /// ```
6657 pub fn set_pending_managed_certificate_id<T: std::convert::Into<std::string::String>>(
6658 mut self,
6659 v: T,
6660 ) -> Self {
6661 self.pending_managed_certificate_id = v.into();
6662 self
6663 }
6664}
6665
6666impl wkt::message::Message for SslSettings {
6667 fn typename() -> &'static str {
6668 "type.googleapis.com/google.appengine.v1.SslSettings"
6669 }
6670}
6671
6672/// Defines additional types related to [SslSettings].
6673pub mod ssl_settings {
6674 #[allow(unused_imports)]
6675 use super::*;
6676
6677 /// The SSL management type for this domain.
6678 ///
6679 /// # Working with unknown values
6680 ///
6681 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6682 /// additional enum variants at any time. Adding new variants is not considered
6683 /// a breaking change. Applications should write their code in anticipation of:
6684 ///
6685 /// - New values appearing in future releases of the client library, **and**
6686 /// - New values received dynamically, without application changes.
6687 ///
6688 /// Please consult the [Working with enums] section in the user guide for some
6689 /// guidelines.
6690 ///
6691 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6692 #[derive(Clone, Debug, PartialEq)]
6693 #[non_exhaustive]
6694 pub enum SslManagementType {
6695 /// Defaults to `AUTOMATIC`.
6696 Unspecified,
6697 /// SSL support for this domain is configured automatically. The mapped SSL
6698 /// certificate will be automatically renewed.
6699 Automatic,
6700 /// SSL support for this domain is configured manually by the user. Either
6701 /// the domain has no SSL support or a user-obtained SSL certificate has been
6702 /// explictly mapped to this domain.
6703 Manual,
6704 /// If set, the enum was initialized with an unknown value.
6705 ///
6706 /// Applications can examine the value using [SslManagementType::value] or
6707 /// [SslManagementType::name].
6708 UnknownValue(ssl_management_type::UnknownValue),
6709 }
6710
6711 #[doc(hidden)]
6712 pub mod ssl_management_type {
6713 #[allow(unused_imports)]
6714 use super::*;
6715 #[derive(Clone, Debug, PartialEq)]
6716 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6717 }
6718
6719 impl SslManagementType {
6720 /// Gets the enum value.
6721 ///
6722 /// Returns `None` if the enum contains an unknown value deserialized from
6723 /// the string representation of enums.
6724 pub fn value(&self) -> std::option::Option<i32> {
6725 match self {
6726 Self::Unspecified => std::option::Option::Some(0),
6727 Self::Automatic => std::option::Option::Some(1),
6728 Self::Manual => std::option::Option::Some(2),
6729 Self::UnknownValue(u) => u.0.value(),
6730 }
6731 }
6732
6733 /// Gets the enum value as a string.
6734 ///
6735 /// Returns `None` if the enum contains an unknown value deserialized from
6736 /// the integer representation of enums.
6737 pub fn name(&self) -> std::option::Option<&str> {
6738 match self {
6739 Self::Unspecified => std::option::Option::Some("SSL_MANAGEMENT_TYPE_UNSPECIFIED"),
6740 Self::Automatic => std::option::Option::Some("AUTOMATIC"),
6741 Self::Manual => std::option::Option::Some("MANUAL"),
6742 Self::UnknownValue(u) => u.0.name(),
6743 }
6744 }
6745 }
6746
6747 impl std::default::Default for SslManagementType {
6748 fn default() -> Self {
6749 use std::convert::From;
6750 Self::from(0)
6751 }
6752 }
6753
6754 impl std::fmt::Display for SslManagementType {
6755 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6756 wkt::internal::display_enum(f, self.name(), self.value())
6757 }
6758 }
6759
6760 impl std::convert::From<i32> for SslManagementType {
6761 fn from(value: i32) -> Self {
6762 match value {
6763 0 => Self::Unspecified,
6764 1 => Self::Automatic,
6765 2 => Self::Manual,
6766 _ => Self::UnknownValue(ssl_management_type::UnknownValue(
6767 wkt::internal::UnknownEnumValue::Integer(value),
6768 )),
6769 }
6770 }
6771 }
6772
6773 impl std::convert::From<&str> for SslManagementType {
6774 fn from(value: &str) -> Self {
6775 use std::string::ToString;
6776 match value {
6777 "SSL_MANAGEMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
6778 "AUTOMATIC" => Self::Automatic,
6779 "MANUAL" => Self::Manual,
6780 _ => Self::UnknownValue(ssl_management_type::UnknownValue(
6781 wkt::internal::UnknownEnumValue::String(value.to_string()),
6782 )),
6783 }
6784 }
6785 }
6786
6787 impl serde::ser::Serialize for SslManagementType {
6788 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6789 where
6790 S: serde::Serializer,
6791 {
6792 match self {
6793 Self::Unspecified => serializer.serialize_i32(0),
6794 Self::Automatic => serializer.serialize_i32(1),
6795 Self::Manual => serializer.serialize_i32(2),
6796 Self::UnknownValue(u) => u.0.serialize(serializer),
6797 }
6798 }
6799 }
6800
6801 impl<'de> serde::de::Deserialize<'de> for SslManagementType {
6802 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6803 where
6804 D: serde::Deserializer<'de>,
6805 {
6806 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslManagementType>::new(
6807 ".google.appengine.v1.SslSettings.SslManagementType",
6808 ))
6809 }
6810 }
6811}
6812
6813/// A DNS resource record.
6814#[derive(Clone, Default, PartialEq)]
6815#[non_exhaustive]
6816pub struct ResourceRecord {
6817 /// Relative name of the object affected by this record. Only applicable for
6818 /// `CNAME` records. Example: 'www'.
6819 pub name: std::string::String,
6820
6821 /// Data for this record. Values vary by record type, as defined in RFC 1035
6822 /// (section 5) and RFC 1034 (section 3.6.1).
6823 pub rrdata: std::string::String,
6824
6825 /// Resource record type. Example: `AAAA`.
6826 pub r#type: crate::model::resource_record::RecordType,
6827
6828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6829}
6830
6831impl ResourceRecord {
6832 /// Creates a new default instance.
6833 pub fn new() -> Self {
6834 std::default::Default::default()
6835 }
6836
6837 /// Sets the value of [name][crate::model::ResourceRecord::name].
6838 ///
6839 /// # Example
6840 /// ```ignore,no_run
6841 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6842 /// let x = ResourceRecord::new().set_name("example");
6843 /// ```
6844 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6845 self.name = v.into();
6846 self
6847 }
6848
6849 /// Sets the value of [rrdata][crate::model::ResourceRecord::rrdata].
6850 ///
6851 /// # Example
6852 /// ```ignore,no_run
6853 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6854 /// let x = ResourceRecord::new().set_rrdata("example");
6855 /// ```
6856 pub fn set_rrdata<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6857 self.rrdata = v.into();
6858 self
6859 }
6860
6861 /// Sets the value of [r#type][crate::model::ResourceRecord::type].
6862 ///
6863 /// # Example
6864 /// ```ignore,no_run
6865 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6866 /// use google_cloud_appengine_v1::model::resource_record::RecordType;
6867 /// let x0 = ResourceRecord::new().set_type(RecordType::A);
6868 /// let x1 = ResourceRecord::new().set_type(RecordType::Aaaa);
6869 /// let x2 = ResourceRecord::new().set_type(RecordType::Cname);
6870 /// ```
6871 pub fn set_type<T: std::convert::Into<crate::model::resource_record::RecordType>>(
6872 mut self,
6873 v: T,
6874 ) -> Self {
6875 self.r#type = v.into();
6876 self
6877 }
6878}
6879
6880impl wkt::message::Message for ResourceRecord {
6881 fn typename() -> &'static str {
6882 "type.googleapis.com/google.appengine.v1.ResourceRecord"
6883 }
6884}
6885
6886/// Defines additional types related to [ResourceRecord].
6887pub mod resource_record {
6888 #[allow(unused_imports)]
6889 use super::*;
6890
6891 /// A resource record type.
6892 ///
6893 /// # Working with unknown values
6894 ///
6895 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6896 /// additional enum variants at any time. Adding new variants is not considered
6897 /// a breaking change. Applications should write their code in anticipation of:
6898 ///
6899 /// - New values appearing in future releases of the client library, **and**
6900 /// - New values received dynamically, without application changes.
6901 ///
6902 /// Please consult the [Working with enums] section in the user guide for some
6903 /// guidelines.
6904 ///
6905 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6906 #[derive(Clone, Debug, PartialEq)]
6907 #[non_exhaustive]
6908 pub enum RecordType {
6909 /// An unknown resource record.
6910 Unspecified,
6911 /// An A resource record. Data is an IPv4 address.
6912 A,
6913 /// An AAAA resource record. Data is an IPv6 address.
6914 Aaaa,
6915 /// A CNAME resource record. Data is a domain name to be aliased.
6916 Cname,
6917 /// If set, the enum was initialized with an unknown value.
6918 ///
6919 /// Applications can examine the value using [RecordType::value] or
6920 /// [RecordType::name].
6921 UnknownValue(record_type::UnknownValue),
6922 }
6923
6924 #[doc(hidden)]
6925 pub mod record_type {
6926 #[allow(unused_imports)]
6927 use super::*;
6928 #[derive(Clone, Debug, PartialEq)]
6929 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6930 }
6931
6932 impl RecordType {
6933 /// Gets the enum value.
6934 ///
6935 /// Returns `None` if the enum contains an unknown value deserialized from
6936 /// the string representation of enums.
6937 pub fn value(&self) -> std::option::Option<i32> {
6938 match self {
6939 Self::Unspecified => std::option::Option::Some(0),
6940 Self::A => std::option::Option::Some(1),
6941 Self::Aaaa => std::option::Option::Some(2),
6942 Self::Cname => std::option::Option::Some(3),
6943 Self::UnknownValue(u) => u.0.value(),
6944 }
6945 }
6946
6947 /// Gets the enum value as a string.
6948 ///
6949 /// Returns `None` if the enum contains an unknown value deserialized from
6950 /// the integer representation of enums.
6951 pub fn name(&self) -> std::option::Option<&str> {
6952 match self {
6953 Self::Unspecified => std::option::Option::Some("RECORD_TYPE_UNSPECIFIED"),
6954 Self::A => std::option::Option::Some("A"),
6955 Self::Aaaa => std::option::Option::Some("AAAA"),
6956 Self::Cname => std::option::Option::Some("CNAME"),
6957 Self::UnknownValue(u) => u.0.name(),
6958 }
6959 }
6960 }
6961
6962 impl std::default::Default for RecordType {
6963 fn default() -> Self {
6964 use std::convert::From;
6965 Self::from(0)
6966 }
6967 }
6968
6969 impl std::fmt::Display for RecordType {
6970 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6971 wkt::internal::display_enum(f, self.name(), self.value())
6972 }
6973 }
6974
6975 impl std::convert::From<i32> for RecordType {
6976 fn from(value: i32) -> Self {
6977 match value {
6978 0 => Self::Unspecified,
6979 1 => Self::A,
6980 2 => Self::Aaaa,
6981 3 => Self::Cname,
6982 _ => Self::UnknownValue(record_type::UnknownValue(
6983 wkt::internal::UnknownEnumValue::Integer(value),
6984 )),
6985 }
6986 }
6987 }
6988
6989 impl std::convert::From<&str> for RecordType {
6990 fn from(value: &str) -> Self {
6991 use std::string::ToString;
6992 match value {
6993 "RECORD_TYPE_UNSPECIFIED" => Self::Unspecified,
6994 "A" => Self::A,
6995 "AAAA" => Self::Aaaa,
6996 "CNAME" => Self::Cname,
6997 _ => Self::UnknownValue(record_type::UnknownValue(
6998 wkt::internal::UnknownEnumValue::String(value.to_string()),
6999 )),
7000 }
7001 }
7002 }
7003
7004 impl serde::ser::Serialize for RecordType {
7005 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7006 where
7007 S: serde::Serializer,
7008 {
7009 match self {
7010 Self::Unspecified => serializer.serialize_i32(0),
7011 Self::A => serializer.serialize_i32(1),
7012 Self::Aaaa => serializer.serialize_i32(2),
7013 Self::Cname => serializer.serialize_i32(3),
7014 Self::UnknownValue(u) => u.0.serialize(serializer),
7015 }
7016 }
7017 }
7018
7019 impl<'de> serde::de::Deserialize<'de> for RecordType {
7020 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7021 where
7022 D: serde::Deserializer<'de>,
7023 {
7024 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordType>::new(
7025 ".google.appengine.v1.ResourceRecord.RecordType",
7026 ))
7027 }
7028 }
7029}
7030
7031/// A single firewall rule that is evaluated against incoming traffic
7032/// and provides an action to take on matched requests.
7033#[derive(Clone, Default, PartialEq)]
7034#[non_exhaustive]
7035pub struct FirewallRule {
7036 /// A positive integer between [1, Int32.MaxValue-1] that defines the order of
7037 /// rule evaluation. Rules with the lowest priority are evaluated first.
7038 ///
7039 /// A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic
7040 /// when no previous rule matches. Only the action of this rule can be modified
7041 /// by the user.
7042 pub priority: i32,
7043
7044 /// The action to take on matched requests.
7045 pub action: crate::model::firewall_rule::Action,
7046
7047 /// IP address or range, defined using CIDR notation, of requests that this
7048 /// rule applies to. You can use the wildcard character "*" to match all IPs
7049 /// equivalent to "0/0" and "::/0" together.
7050 /// Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32`
7051 /// or `2001:0db8:0000:0042:0000:8a2e:0370:7334`.
7052 pub source_range: std::string::String,
7053
7054 /// An optional string description of this rule.
7055 /// This field has a maximum length of 100 characters.
7056 pub description: std::string::String,
7057
7058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7059}
7060
7061impl FirewallRule {
7062 /// Creates a new default instance.
7063 pub fn new() -> Self {
7064 std::default::Default::default()
7065 }
7066
7067 /// Sets the value of [priority][crate::model::FirewallRule::priority].
7068 ///
7069 /// # Example
7070 /// ```ignore,no_run
7071 /// # use google_cloud_appengine_v1::model::FirewallRule;
7072 /// let x = FirewallRule::new().set_priority(42);
7073 /// ```
7074 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7075 self.priority = v.into();
7076 self
7077 }
7078
7079 /// Sets the value of [action][crate::model::FirewallRule::action].
7080 ///
7081 /// # Example
7082 /// ```ignore,no_run
7083 /// # use google_cloud_appengine_v1::model::FirewallRule;
7084 /// use google_cloud_appengine_v1::model::firewall_rule::Action;
7085 /// let x0 = FirewallRule::new().set_action(Action::Allow);
7086 /// let x1 = FirewallRule::new().set_action(Action::Deny);
7087 /// ```
7088 pub fn set_action<T: std::convert::Into<crate::model::firewall_rule::Action>>(
7089 mut self,
7090 v: T,
7091 ) -> Self {
7092 self.action = v.into();
7093 self
7094 }
7095
7096 /// Sets the value of [source_range][crate::model::FirewallRule::source_range].
7097 ///
7098 /// # Example
7099 /// ```ignore,no_run
7100 /// # use google_cloud_appengine_v1::model::FirewallRule;
7101 /// let x = FirewallRule::new().set_source_range("example");
7102 /// ```
7103 pub fn set_source_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7104 self.source_range = v.into();
7105 self
7106 }
7107
7108 /// Sets the value of [description][crate::model::FirewallRule::description].
7109 ///
7110 /// # Example
7111 /// ```ignore,no_run
7112 /// # use google_cloud_appengine_v1::model::FirewallRule;
7113 /// let x = FirewallRule::new().set_description("example");
7114 /// ```
7115 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7116 self.description = v.into();
7117 self
7118 }
7119}
7120
7121impl wkt::message::Message for FirewallRule {
7122 fn typename() -> &'static str {
7123 "type.googleapis.com/google.appengine.v1.FirewallRule"
7124 }
7125}
7126
7127/// Defines additional types related to [FirewallRule].
7128pub mod firewall_rule {
7129 #[allow(unused_imports)]
7130 use super::*;
7131
7132 /// Available actions to take on matching requests.
7133 ///
7134 /// # Working with unknown values
7135 ///
7136 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7137 /// additional enum variants at any time. Adding new variants is not considered
7138 /// a breaking change. Applications should write their code in anticipation of:
7139 ///
7140 /// - New values appearing in future releases of the client library, **and**
7141 /// - New values received dynamically, without application changes.
7142 ///
7143 /// Please consult the [Working with enums] section in the user guide for some
7144 /// guidelines.
7145 ///
7146 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7147 #[derive(Clone, Debug, PartialEq)]
7148 #[non_exhaustive]
7149 pub enum Action {
7150 #[allow(missing_docs)]
7151 UnspecifiedAction,
7152 /// Matching requests are allowed.
7153 Allow,
7154 /// Matching requests are denied.
7155 Deny,
7156 /// If set, the enum was initialized with an unknown value.
7157 ///
7158 /// Applications can examine the value using [Action::value] or
7159 /// [Action::name].
7160 UnknownValue(action::UnknownValue),
7161 }
7162
7163 #[doc(hidden)]
7164 pub mod action {
7165 #[allow(unused_imports)]
7166 use super::*;
7167 #[derive(Clone, Debug, PartialEq)]
7168 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7169 }
7170
7171 impl Action {
7172 /// Gets the enum value.
7173 ///
7174 /// Returns `None` if the enum contains an unknown value deserialized from
7175 /// the string representation of enums.
7176 pub fn value(&self) -> std::option::Option<i32> {
7177 match self {
7178 Self::UnspecifiedAction => std::option::Option::Some(0),
7179 Self::Allow => std::option::Option::Some(1),
7180 Self::Deny => std::option::Option::Some(2),
7181 Self::UnknownValue(u) => u.0.value(),
7182 }
7183 }
7184
7185 /// Gets the enum value as a string.
7186 ///
7187 /// Returns `None` if the enum contains an unknown value deserialized from
7188 /// the integer representation of enums.
7189 pub fn name(&self) -> std::option::Option<&str> {
7190 match self {
7191 Self::UnspecifiedAction => std::option::Option::Some("UNSPECIFIED_ACTION"),
7192 Self::Allow => std::option::Option::Some("ALLOW"),
7193 Self::Deny => std::option::Option::Some("DENY"),
7194 Self::UnknownValue(u) => u.0.name(),
7195 }
7196 }
7197 }
7198
7199 impl std::default::Default for Action {
7200 fn default() -> Self {
7201 use std::convert::From;
7202 Self::from(0)
7203 }
7204 }
7205
7206 impl std::fmt::Display for Action {
7207 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7208 wkt::internal::display_enum(f, self.name(), self.value())
7209 }
7210 }
7211
7212 impl std::convert::From<i32> for Action {
7213 fn from(value: i32) -> Self {
7214 match value {
7215 0 => Self::UnspecifiedAction,
7216 1 => Self::Allow,
7217 2 => Self::Deny,
7218 _ => Self::UnknownValue(action::UnknownValue(
7219 wkt::internal::UnknownEnumValue::Integer(value),
7220 )),
7221 }
7222 }
7223 }
7224
7225 impl std::convert::From<&str> for Action {
7226 fn from(value: &str) -> Self {
7227 use std::string::ToString;
7228 match value {
7229 "UNSPECIFIED_ACTION" => Self::UnspecifiedAction,
7230 "ALLOW" => Self::Allow,
7231 "DENY" => Self::Deny,
7232 _ => Self::UnknownValue(action::UnknownValue(
7233 wkt::internal::UnknownEnumValue::String(value.to_string()),
7234 )),
7235 }
7236 }
7237 }
7238
7239 impl serde::ser::Serialize for Action {
7240 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7241 where
7242 S: serde::Serializer,
7243 {
7244 match self {
7245 Self::UnspecifiedAction => serializer.serialize_i32(0),
7246 Self::Allow => serializer.serialize_i32(1),
7247 Self::Deny => serializer.serialize_i32(2),
7248 Self::UnknownValue(u) => u.0.serialize(serializer),
7249 }
7250 }
7251 }
7252
7253 impl<'de> serde::de::Deserialize<'de> for Action {
7254 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7255 where
7256 D: serde::Deserializer<'de>,
7257 {
7258 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
7259 ".google.appengine.v1.FirewallRule.Action",
7260 ))
7261 }
7262 }
7263}
7264
7265/// An Instance resource is the computing unit that App Engine uses to
7266/// automatically scale an application.
7267#[derive(Clone, Default, PartialEq)]
7268#[non_exhaustive]
7269pub struct Instance {
7270 /// Output only. Full path to the Instance resource in the API.
7271 /// Example: `apps/myapp/services/default/versions/v1/instances/instance-1`.
7272 pub name: std::string::String,
7273
7274 /// Output only. Relative name of the instance within the version.
7275 /// Example: `instance-1`.
7276 pub id: std::string::String,
7277
7278 /// Output only. App Engine release this instance is running on.
7279 pub app_engine_release: std::string::String,
7280
7281 /// Output only. Availability of the instance.
7282 pub availability: crate::model::instance::Availability,
7283
7284 /// Output only. Name of the virtual machine where this instance lives. Only applicable
7285 /// for instances in App Engine flexible environment.
7286 pub vm_name: std::string::String,
7287
7288 /// Output only. Zone where the virtual machine is located. Only applicable for instances
7289 /// in App Engine flexible environment.
7290 pub vm_zone_name: std::string::String,
7291
7292 /// Output only. Virtual machine ID of this instance. Only applicable for instances in
7293 /// App Engine flexible environment.
7294 pub vm_id: std::string::String,
7295
7296 /// Output only. Time that this instance was started.
7297 ///
7298 /// @OutputOnly
7299 pub start_time: std::option::Option<wkt::Timestamp>,
7300
7301 /// Output only. Number of requests since this instance was started.
7302 pub requests: i32,
7303
7304 /// Output only. Number of errors since this instance was started.
7305 pub errors: i32,
7306
7307 /// Output only. Average queries per second (QPS) over the last minute.
7308 pub qps: f32,
7309
7310 /// Output only. Average latency (ms) over the last minute.
7311 pub average_latency: i32,
7312
7313 /// Output only. Total memory in use (bytes).
7314 pub memory_usage: i64,
7315
7316 /// Output only. Status of the virtual machine where this instance lives. Only applicable
7317 /// for instances in App Engine flexible environment.
7318 pub vm_status: std::string::String,
7319
7320 /// Output only. Whether this instance is in debug mode. Only applicable for instances in
7321 /// App Engine flexible environment.
7322 pub vm_debug_enabled: bool,
7323
7324 /// Output only. The IP address of this instance. Only applicable for instances in App
7325 /// Engine flexible environment.
7326 pub vm_ip: std::string::String,
7327
7328 /// Output only. The liveness health check of this instance. Only applicable for instances
7329 /// in App Engine flexible environment.
7330 pub vm_liveness: crate::model::instance::liveness::LivenessState,
7331
7332 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7333}
7334
7335impl Instance {
7336 /// Creates a new default instance.
7337 pub fn new() -> Self {
7338 std::default::Default::default()
7339 }
7340
7341 /// Sets the value of [name][crate::model::Instance::name].
7342 ///
7343 /// # Example
7344 /// ```ignore,no_run
7345 /// # use google_cloud_appengine_v1::model::Instance;
7346 /// # let app_id = "app_id";
7347 /// # let service_id = "service_id";
7348 /// # let version_id = "version_id";
7349 /// # let instance_id = "instance_id";
7350 /// let x = Instance::new().set_name(format!("apps/{app_id}/services/{service_id}/versions/{version_id}/instances/{instance_id}"));
7351 /// ```
7352 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7353 self.name = v.into();
7354 self
7355 }
7356
7357 /// Sets the value of [id][crate::model::Instance::id].
7358 ///
7359 /// # Example
7360 /// ```ignore,no_run
7361 /// # use google_cloud_appengine_v1::model::Instance;
7362 /// let x = Instance::new().set_id("example");
7363 /// ```
7364 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7365 self.id = v.into();
7366 self
7367 }
7368
7369 /// Sets the value of [app_engine_release][crate::model::Instance::app_engine_release].
7370 ///
7371 /// # Example
7372 /// ```ignore,no_run
7373 /// # use google_cloud_appengine_v1::model::Instance;
7374 /// let x = Instance::new().set_app_engine_release("example");
7375 /// ```
7376 pub fn set_app_engine_release<T: std::convert::Into<std::string::String>>(
7377 mut self,
7378 v: T,
7379 ) -> Self {
7380 self.app_engine_release = v.into();
7381 self
7382 }
7383
7384 /// Sets the value of [availability][crate::model::Instance::availability].
7385 ///
7386 /// # Example
7387 /// ```ignore,no_run
7388 /// # use google_cloud_appengine_v1::model::Instance;
7389 /// use google_cloud_appengine_v1::model::instance::Availability;
7390 /// let x0 = Instance::new().set_availability(Availability::Resident);
7391 /// let x1 = Instance::new().set_availability(Availability::Dynamic);
7392 /// ```
7393 pub fn set_availability<T: std::convert::Into<crate::model::instance::Availability>>(
7394 mut self,
7395 v: T,
7396 ) -> Self {
7397 self.availability = v.into();
7398 self
7399 }
7400
7401 /// Sets the value of [vm_name][crate::model::Instance::vm_name].
7402 ///
7403 /// # Example
7404 /// ```ignore,no_run
7405 /// # use google_cloud_appengine_v1::model::Instance;
7406 /// let x = Instance::new().set_vm_name("example");
7407 /// ```
7408 pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7409 self.vm_name = v.into();
7410 self
7411 }
7412
7413 /// Sets the value of [vm_zone_name][crate::model::Instance::vm_zone_name].
7414 ///
7415 /// # Example
7416 /// ```ignore,no_run
7417 /// # use google_cloud_appengine_v1::model::Instance;
7418 /// let x = Instance::new().set_vm_zone_name("example");
7419 /// ```
7420 pub fn set_vm_zone_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7421 self.vm_zone_name = v.into();
7422 self
7423 }
7424
7425 /// Sets the value of [vm_id][crate::model::Instance::vm_id].
7426 ///
7427 /// # Example
7428 /// ```ignore,no_run
7429 /// # use google_cloud_appengine_v1::model::Instance;
7430 /// let x = Instance::new().set_vm_id("example");
7431 /// ```
7432 pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7433 self.vm_id = v.into();
7434 self
7435 }
7436
7437 /// Sets the value of [start_time][crate::model::Instance::start_time].
7438 ///
7439 /// # Example
7440 /// ```ignore,no_run
7441 /// # use google_cloud_appengine_v1::model::Instance;
7442 /// use wkt::Timestamp;
7443 /// let x = Instance::new().set_start_time(Timestamp::default()/* use setters */);
7444 /// ```
7445 pub fn set_start_time<T>(mut self, v: T) -> Self
7446 where
7447 T: std::convert::Into<wkt::Timestamp>,
7448 {
7449 self.start_time = std::option::Option::Some(v.into());
7450 self
7451 }
7452
7453 /// Sets or clears the value of [start_time][crate::model::Instance::start_time].
7454 ///
7455 /// # Example
7456 /// ```ignore,no_run
7457 /// # use google_cloud_appengine_v1::model::Instance;
7458 /// use wkt::Timestamp;
7459 /// let x = Instance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7460 /// let x = Instance::new().set_or_clear_start_time(None::<Timestamp>);
7461 /// ```
7462 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7463 where
7464 T: std::convert::Into<wkt::Timestamp>,
7465 {
7466 self.start_time = v.map(|x| x.into());
7467 self
7468 }
7469
7470 /// Sets the value of [requests][crate::model::Instance::requests].
7471 ///
7472 /// # Example
7473 /// ```ignore,no_run
7474 /// # use google_cloud_appengine_v1::model::Instance;
7475 /// let x = Instance::new().set_requests(42);
7476 /// ```
7477 pub fn set_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7478 self.requests = v.into();
7479 self
7480 }
7481
7482 /// Sets the value of [errors][crate::model::Instance::errors].
7483 ///
7484 /// # Example
7485 /// ```ignore,no_run
7486 /// # use google_cloud_appengine_v1::model::Instance;
7487 /// let x = Instance::new().set_errors(42);
7488 /// ```
7489 pub fn set_errors<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7490 self.errors = v.into();
7491 self
7492 }
7493
7494 /// Sets the value of [qps][crate::model::Instance::qps].
7495 ///
7496 /// # Example
7497 /// ```ignore,no_run
7498 /// # use google_cloud_appengine_v1::model::Instance;
7499 /// let x = Instance::new().set_qps(42.0);
7500 /// ```
7501 pub fn set_qps<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7502 self.qps = v.into();
7503 self
7504 }
7505
7506 /// Sets the value of [average_latency][crate::model::Instance::average_latency].
7507 ///
7508 /// # Example
7509 /// ```ignore,no_run
7510 /// # use google_cloud_appengine_v1::model::Instance;
7511 /// let x = Instance::new().set_average_latency(42);
7512 /// ```
7513 pub fn set_average_latency<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7514 self.average_latency = v.into();
7515 self
7516 }
7517
7518 /// Sets the value of [memory_usage][crate::model::Instance::memory_usage].
7519 ///
7520 /// # Example
7521 /// ```ignore,no_run
7522 /// # use google_cloud_appengine_v1::model::Instance;
7523 /// let x = Instance::new().set_memory_usage(42);
7524 /// ```
7525 pub fn set_memory_usage<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7526 self.memory_usage = v.into();
7527 self
7528 }
7529
7530 /// Sets the value of [vm_status][crate::model::Instance::vm_status].
7531 ///
7532 /// # Example
7533 /// ```ignore,no_run
7534 /// # use google_cloud_appengine_v1::model::Instance;
7535 /// let x = Instance::new().set_vm_status("example");
7536 /// ```
7537 pub fn set_vm_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7538 self.vm_status = v.into();
7539 self
7540 }
7541
7542 /// Sets the value of [vm_debug_enabled][crate::model::Instance::vm_debug_enabled].
7543 ///
7544 /// # Example
7545 /// ```ignore,no_run
7546 /// # use google_cloud_appengine_v1::model::Instance;
7547 /// let x = Instance::new().set_vm_debug_enabled(true);
7548 /// ```
7549 pub fn set_vm_debug_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7550 self.vm_debug_enabled = v.into();
7551 self
7552 }
7553
7554 /// Sets the value of [vm_ip][crate::model::Instance::vm_ip].
7555 ///
7556 /// # Example
7557 /// ```ignore,no_run
7558 /// # use google_cloud_appengine_v1::model::Instance;
7559 /// let x = Instance::new().set_vm_ip("example");
7560 /// ```
7561 pub fn set_vm_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7562 self.vm_ip = v.into();
7563 self
7564 }
7565
7566 /// Sets the value of [vm_liveness][crate::model::Instance::vm_liveness].
7567 ///
7568 /// # Example
7569 /// ```ignore,no_run
7570 /// # use google_cloud_appengine_v1::model::Instance;
7571 /// use google_cloud_appengine_v1::model::instance::liveness::LivenessState;
7572 /// let x0 = Instance::new().set_vm_liveness(LivenessState::Unknown);
7573 /// let x1 = Instance::new().set_vm_liveness(LivenessState::Healthy);
7574 /// let x2 = Instance::new().set_vm_liveness(LivenessState::Unhealthy);
7575 /// ```
7576 pub fn set_vm_liveness<
7577 T: std::convert::Into<crate::model::instance::liveness::LivenessState>,
7578 >(
7579 mut self,
7580 v: T,
7581 ) -> Self {
7582 self.vm_liveness = v.into();
7583 self
7584 }
7585}
7586
7587impl wkt::message::Message for Instance {
7588 fn typename() -> &'static str {
7589 "type.googleapis.com/google.appengine.v1.Instance"
7590 }
7591}
7592
7593/// Defines additional types related to [Instance].
7594pub mod instance {
7595 #[allow(unused_imports)]
7596 use super::*;
7597
7598 /// Wrapper for LivenessState enum.
7599 #[derive(Clone, Default, PartialEq)]
7600 #[non_exhaustive]
7601 pub struct Liveness {
7602 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7603 }
7604
7605 impl Liveness {
7606 /// Creates a new default instance.
7607 pub fn new() -> Self {
7608 std::default::Default::default()
7609 }
7610 }
7611
7612 impl wkt::message::Message for Liveness {
7613 fn typename() -> &'static str {
7614 "type.googleapis.com/google.appengine.v1.Instance.Liveness"
7615 }
7616 }
7617
7618 /// Defines additional types related to [Liveness].
7619 pub mod liveness {
7620 #[allow(unused_imports)]
7621 use super::*;
7622
7623 /// Liveness health check status for Flex instances.
7624 ///
7625 /// # Working with unknown values
7626 ///
7627 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7628 /// additional enum variants at any time. Adding new variants is not considered
7629 /// a breaking change. Applications should write their code in anticipation of:
7630 ///
7631 /// - New values appearing in future releases of the client library, **and**
7632 /// - New values received dynamically, without application changes.
7633 ///
7634 /// Please consult the [Working with enums] section in the user guide for some
7635 /// guidelines.
7636 ///
7637 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7638 #[derive(Clone, Debug, PartialEq)]
7639 #[non_exhaustive]
7640 pub enum LivenessState {
7641 /// There is no liveness health check for the instance. Only applicable for
7642 /// instances in App Engine standard environment.
7643 Unspecified,
7644 /// The health checking system is aware of the instance but its health is
7645 /// not known at the moment.
7646 Unknown,
7647 /// The instance is reachable i.e. a connection to the application health
7648 /// checking endpoint can be established, and conforms to the requirements
7649 /// defined by the health check.
7650 Healthy,
7651 /// The instance is reachable, but does not conform to the requirements
7652 /// defined by the health check.
7653 Unhealthy,
7654 /// The instance is being drained. The existing connections to the instance
7655 /// have time to complete, but the new ones are being refused.
7656 Draining,
7657 /// The instance is unreachable i.e. a connection to the application health
7658 /// checking endpoint cannot be established, or the server does not respond
7659 /// within the specified timeout.
7660 Timeout,
7661 /// If set, the enum was initialized with an unknown value.
7662 ///
7663 /// Applications can examine the value using [LivenessState::value] or
7664 /// [LivenessState::name].
7665 UnknownValue(liveness_state::UnknownValue),
7666 }
7667
7668 #[doc(hidden)]
7669 pub mod liveness_state {
7670 #[allow(unused_imports)]
7671 use super::*;
7672 #[derive(Clone, Debug, PartialEq)]
7673 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7674 }
7675
7676 impl LivenessState {
7677 /// Gets the enum value.
7678 ///
7679 /// Returns `None` if the enum contains an unknown value deserialized from
7680 /// the string representation of enums.
7681 pub fn value(&self) -> std::option::Option<i32> {
7682 match self {
7683 Self::Unspecified => std::option::Option::Some(0),
7684 Self::Unknown => std::option::Option::Some(1),
7685 Self::Healthy => std::option::Option::Some(2),
7686 Self::Unhealthy => std::option::Option::Some(3),
7687 Self::Draining => std::option::Option::Some(4),
7688 Self::Timeout => std::option::Option::Some(5),
7689 Self::UnknownValue(u) => u.0.value(),
7690 }
7691 }
7692
7693 /// Gets the enum value as a string.
7694 ///
7695 /// Returns `None` if the enum contains an unknown value deserialized from
7696 /// the integer representation of enums.
7697 pub fn name(&self) -> std::option::Option<&str> {
7698 match self {
7699 Self::Unspecified => std::option::Option::Some("LIVENESS_STATE_UNSPECIFIED"),
7700 Self::Unknown => std::option::Option::Some("UNKNOWN"),
7701 Self::Healthy => std::option::Option::Some("HEALTHY"),
7702 Self::Unhealthy => std::option::Option::Some("UNHEALTHY"),
7703 Self::Draining => std::option::Option::Some("DRAINING"),
7704 Self::Timeout => std::option::Option::Some("TIMEOUT"),
7705 Self::UnknownValue(u) => u.0.name(),
7706 }
7707 }
7708 }
7709
7710 impl std::default::Default for LivenessState {
7711 fn default() -> Self {
7712 use std::convert::From;
7713 Self::from(0)
7714 }
7715 }
7716
7717 impl std::fmt::Display for LivenessState {
7718 fn fmt(
7719 &self,
7720 f: &mut std::fmt::Formatter<'_>,
7721 ) -> std::result::Result<(), std::fmt::Error> {
7722 wkt::internal::display_enum(f, self.name(), self.value())
7723 }
7724 }
7725
7726 impl std::convert::From<i32> for LivenessState {
7727 fn from(value: i32) -> Self {
7728 match value {
7729 0 => Self::Unspecified,
7730 1 => Self::Unknown,
7731 2 => Self::Healthy,
7732 3 => Self::Unhealthy,
7733 4 => Self::Draining,
7734 5 => Self::Timeout,
7735 _ => Self::UnknownValue(liveness_state::UnknownValue(
7736 wkt::internal::UnknownEnumValue::Integer(value),
7737 )),
7738 }
7739 }
7740 }
7741
7742 impl std::convert::From<&str> for LivenessState {
7743 fn from(value: &str) -> Self {
7744 use std::string::ToString;
7745 match value {
7746 "LIVENESS_STATE_UNSPECIFIED" => Self::Unspecified,
7747 "UNKNOWN" => Self::Unknown,
7748 "HEALTHY" => Self::Healthy,
7749 "UNHEALTHY" => Self::Unhealthy,
7750 "DRAINING" => Self::Draining,
7751 "TIMEOUT" => Self::Timeout,
7752 _ => Self::UnknownValue(liveness_state::UnknownValue(
7753 wkt::internal::UnknownEnumValue::String(value.to_string()),
7754 )),
7755 }
7756 }
7757 }
7758
7759 impl serde::ser::Serialize for LivenessState {
7760 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7761 where
7762 S: serde::Serializer,
7763 {
7764 match self {
7765 Self::Unspecified => serializer.serialize_i32(0),
7766 Self::Unknown => serializer.serialize_i32(1),
7767 Self::Healthy => serializer.serialize_i32(2),
7768 Self::Unhealthy => serializer.serialize_i32(3),
7769 Self::Draining => serializer.serialize_i32(4),
7770 Self::Timeout => serializer.serialize_i32(5),
7771 Self::UnknownValue(u) => u.0.serialize(serializer),
7772 }
7773 }
7774 }
7775
7776 impl<'de> serde::de::Deserialize<'de> for LivenessState {
7777 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7778 where
7779 D: serde::Deserializer<'de>,
7780 {
7781 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LivenessState>::new(
7782 ".google.appengine.v1.Instance.Liveness.LivenessState",
7783 ))
7784 }
7785 }
7786 }
7787
7788 /// Availability of the instance.
7789 ///
7790 /// # Working with unknown values
7791 ///
7792 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7793 /// additional enum variants at any time. Adding new variants is not considered
7794 /// a breaking change. Applications should write their code in anticipation of:
7795 ///
7796 /// - New values appearing in future releases of the client library, **and**
7797 /// - New values received dynamically, without application changes.
7798 ///
7799 /// Please consult the [Working with enums] section in the user guide for some
7800 /// guidelines.
7801 ///
7802 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7803 #[derive(Clone, Debug, PartialEq)]
7804 #[non_exhaustive]
7805 pub enum Availability {
7806 #[allow(missing_docs)]
7807 Unspecified,
7808 #[allow(missing_docs)]
7809 Resident,
7810 #[allow(missing_docs)]
7811 Dynamic,
7812 /// If set, the enum was initialized with an unknown value.
7813 ///
7814 /// Applications can examine the value using [Availability::value] or
7815 /// [Availability::name].
7816 UnknownValue(availability::UnknownValue),
7817 }
7818
7819 #[doc(hidden)]
7820 pub mod availability {
7821 #[allow(unused_imports)]
7822 use super::*;
7823 #[derive(Clone, Debug, PartialEq)]
7824 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7825 }
7826
7827 impl Availability {
7828 /// Gets the enum value.
7829 ///
7830 /// Returns `None` if the enum contains an unknown value deserialized from
7831 /// the string representation of enums.
7832 pub fn value(&self) -> std::option::Option<i32> {
7833 match self {
7834 Self::Unspecified => std::option::Option::Some(0),
7835 Self::Resident => std::option::Option::Some(1),
7836 Self::Dynamic => std::option::Option::Some(2),
7837 Self::UnknownValue(u) => u.0.value(),
7838 }
7839 }
7840
7841 /// Gets the enum value as a string.
7842 ///
7843 /// Returns `None` if the enum contains an unknown value deserialized from
7844 /// the integer representation of enums.
7845 pub fn name(&self) -> std::option::Option<&str> {
7846 match self {
7847 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
7848 Self::Resident => std::option::Option::Some("RESIDENT"),
7849 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
7850 Self::UnknownValue(u) => u.0.name(),
7851 }
7852 }
7853 }
7854
7855 impl std::default::Default for Availability {
7856 fn default() -> Self {
7857 use std::convert::From;
7858 Self::from(0)
7859 }
7860 }
7861
7862 impl std::fmt::Display for Availability {
7863 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7864 wkt::internal::display_enum(f, self.name(), self.value())
7865 }
7866 }
7867
7868 impl std::convert::From<i32> for Availability {
7869 fn from(value: i32) -> Self {
7870 match value {
7871 0 => Self::Unspecified,
7872 1 => Self::Resident,
7873 2 => Self::Dynamic,
7874 _ => Self::UnknownValue(availability::UnknownValue(
7875 wkt::internal::UnknownEnumValue::Integer(value),
7876 )),
7877 }
7878 }
7879 }
7880
7881 impl std::convert::From<&str> for Availability {
7882 fn from(value: &str) -> Self {
7883 use std::string::ToString;
7884 match value {
7885 "UNSPECIFIED" => Self::Unspecified,
7886 "RESIDENT" => Self::Resident,
7887 "DYNAMIC" => Self::Dynamic,
7888 _ => Self::UnknownValue(availability::UnknownValue(
7889 wkt::internal::UnknownEnumValue::String(value.to_string()),
7890 )),
7891 }
7892 }
7893 }
7894
7895 impl serde::ser::Serialize for Availability {
7896 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7897 where
7898 S: serde::Serializer,
7899 {
7900 match self {
7901 Self::Unspecified => serializer.serialize_i32(0),
7902 Self::Resident => serializer.serialize_i32(1),
7903 Self::Dynamic => serializer.serialize_i32(2),
7904 Self::UnknownValue(u) => u.0.serialize(serializer),
7905 }
7906 }
7907 }
7908
7909 impl<'de> serde::de::Deserialize<'de> for Availability {
7910 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7911 where
7912 D: serde::Deserializer<'de>,
7913 {
7914 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Availability>::new(
7915 ".google.appengine.v1.Instance.Availability",
7916 ))
7917 }
7918 }
7919}
7920
7921/// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location].
7922#[derive(Clone, Default, PartialEq)]
7923#[non_exhaustive]
7924pub struct LocationMetadata {
7925 /// App Engine standard environment is available in the given location.
7926 ///
7927 /// @OutputOnly
7928 pub standard_environment_available: bool,
7929
7930 /// App Engine flexible environment is available in the given location.
7931 ///
7932 /// @OutputOnly
7933 pub flexible_environment_available: bool,
7934
7935 /// Output only. [Search API](https://cloud.google.com/appengine/docs/standard/python/search)
7936 /// is available in the given location.
7937 pub search_api_available: bool,
7938
7939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7940}
7941
7942impl LocationMetadata {
7943 /// Creates a new default instance.
7944 pub fn new() -> Self {
7945 std::default::Default::default()
7946 }
7947
7948 /// Sets the value of [standard_environment_available][crate::model::LocationMetadata::standard_environment_available].
7949 ///
7950 /// # Example
7951 /// ```ignore,no_run
7952 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7953 /// let x = LocationMetadata::new().set_standard_environment_available(true);
7954 /// ```
7955 pub fn set_standard_environment_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7956 self.standard_environment_available = v.into();
7957 self
7958 }
7959
7960 /// Sets the value of [flexible_environment_available][crate::model::LocationMetadata::flexible_environment_available].
7961 ///
7962 /// # Example
7963 /// ```ignore,no_run
7964 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7965 /// let x = LocationMetadata::new().set_flexible_environment_available(true);
7966 /// ```
7967 pub fn set_flexible_environment_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7968 self.flexible_environment_available = v.into();
7969 self
7970 }
7971
7972 /// Sets the value of [search_api_available][crate::model::LocationMetadata::search_api_available].
7973 ///
7974 /// # Example
7975 /// ```ignore,no_run
7976 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7977 /// let x = LocationMetadata::new().set_search_api_available(true);
7978 /// ```
7979 pub fn set_search_api_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7980 self.search_api_available = v.into();
7981 self
7982 }
7983}
7984
7985impl wkt::message::Message for LocationMetadata {
7986 fn typename() -> &'static str {
7987 "type.googleapis.com/google.appengine.v1.LocationMetadata"
7988 }
7989}
7990
7991/// A NetworkSettings resource is a container for ingress settings for a version
7992/// or service.
7993#[derive(Clone, Default, PartialEq)]
7994#[non_exhaustive]
7995pub struct NetworkSettings {
7996 /// The ingress settings for version or service.
7997 pub ingress_traffic_allowed: crate::model::network_settings::IngressTrafficAllowed,
7998
7999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8000}
8001
8002impl NetworkSettings {
8003 /// Creates a new default instance.
8004 pub fn new() -> Self {
8005 std::default::Default::default()
8006 }
8007
8008 /// Sets the value of [ingress_traffic_allowed][crate::model::NetworkSettings::ingress_traffic_allowed].
8009 ///
8010 /// # Example
8011 /// ```ignore,no_run
8012 /// # use google_cloud_appengine_v1::model::NetworkSettings;
8013 /// use google_cloud_appengine_v1::model::network_settings::IngressTrafficAllowed;
8014 /// let x0 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::All);
8015 /// let x1 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::InternalOnly);
8016 /// let x2 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::InternalAndLb);
8017 /// ```
8018 pub fn set_ingress_traffic_allowed<
8019 T: std::convert::Into<crate::model::network_settings::IngressTrafficAllowed>,
8020 >(
8021 mut self,
8022 v: T,
8023 ) -> Self {
8024 self.ingress_traffic_allowed = v.into();
8025 self
8026 }
8027}
8028
8029impl wkt::message::Message for NetworkSettings {
8030 fn typename() -> &'static str {
8031 "type.googleapis.com/google.appengine.v1.NetworkSettings"
8032 }
8033}
8034
8035/// Defines additional types related to [NetworkSettings].
8036pub mod network_settings {
8037 #[allow(unused_imports)]
8038 use super::*;
8039
8040 /// If unspecified, INGRESS_TRAFFIC_ALLOWED_ALL will be used.
8041 ///
8042 /// # Working with unknown values
8043 ///
8044 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8045 /// additional enum variants at any time. Adding new variants is not considered
8046 /// a breaking change. Applications should write their code in anticipation of:
8047 ///
8048 /// - New values appearing in future releases of the client library, **and**
8049 /// - New values received dynamically, without application changes.
8050 ///
8051 /// Please consult the [Working with enums] section in the user guide for some
8052 /// guidelines.
8053 ///
8054 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8055 #[derive(Clone, Debug, PartialEq)]
8056 #[non_exhaustive]
8057 pub enum IngressTrafficAllowed {
8058 /// Unspecified
8059 Unspecified,
8060 /// Allow HTTP traffic from public and private sources.
8061 All,
8062 /// Allow HTTP traffic from only private VPC sources.
8063 InternalOnly,
8064 /// Allow HTTP traffic from private VPC sources and through load balancers.
8065 InternalAndLb,
8066 /// If set, the enum was initialized with an unknown value.
8067 ///
8068 /// Applications can examine the value using [IngressTrafficAllowed::value] or
8069 /// [IngressTrafficAllowed::name].
8070 UnknownValue(ingress_traffic_allowed::UnknownValue),
8071 }
8072
8073 #[doc(hidden)]
8074 pub mod ingress_traffic_allowed {
8075 #[allow(unused_imports)]
8076 use super::*;
8077 #[derive(Clone, Debug, PartialEq)]
8078 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8079 }
8080
8081 impl IngressTrafficAllowed {
8082 /// Gets the enum value.
8083 ///
8084 /// Returns `None` if the enum contains an unknown value deserialized from
8085 /// the string representation of enums.
8086 pub fn value(&self) -> std::option::Option<i32> {
8087 match self {
8088 Self::Unspecified => std::option::Option::Some(0),
8089 Self::All => std::option::Option::Some(1),
8090 Self::InternalOnly => std::option::Option::Some(2),
8091 Self::InternalAndLb => std::option::Option::Some(3),
8092 Self::UnknownValue(u) => u.0.value(),
8093 }
8094 }
8095
8096 /// Gets the enum value as a string.
8097 ///
8098 /// Returns `None` if the enum contains an unknown value deserialized from
8099 /// the integer representation of enums.
8100 pub fn name(&self) -> std::option::Option<&str> {
8101 match self {
8102 Self::Unspecified => {
8103 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED")
8104 }
8105 Self::All => std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_ALL"),
8106 Self::InternalOnly => {
8107 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY")
8108 }
8109 Self::InternalAndLb => {
8110 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB")
8111 }
8112 Self::UnknownValue(u) => u.0.name(),
8113 }
8114 }
8115 }
8116
8117 impl std::default::Default for IngressTrafficAllowed {
8118 fn default() -> Self {
8119 use std::convert::From;
8120 Self::from(0)
8121 }
8122 }
8123
8124 impl std::fmt::Display for IngressTrafficAllowed {
8125 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8126 wkt::internal::display_enum(f, self.name(), self.value())
8127 }
8128 }
8129
8130 impl std::convert::From<i32> for IngressTrafficAllowed {
8131 fn from(value: i32) -> Self {
8132 match value {
8133 0 => Self::Unspecified,
8134 1 => Self::All,
8135 2 => Self::InternalOnly,
8136 3 => Self::InternalAndLb,
8137 _ => Self::UnknownValue(ingress_traffic_allowed::UnknownValue(
8138 wkt::internal::UnknownEnumValue::Integer(value),
8139 )),
8140 }
8141 }
8142 }
8143
8144 impl std::convert::From<&str> for IngressTrafficAllowed {
8145 fn from(value: &str) -> Self {
8146 use std::string::ToString;
8147 match value {
8148 "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED" => Self::Unspecified,
8149 "INGRESS_TRAFFIC_ALLOWED_ALL" => Self::All,
8150 "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY" => Self::InternalOnly,
8151 "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB" => Self::InternalAndLb,
8152 _ => Self::UnknownValue(ingress_traffic_allowed::UnknownValue(
8153 wkt::internal::UnknownEnumValue::String(value.to_string()),
8154 )),
8155 }
8156 }
8157 }
8158
8159 impl serde::ser::Serialize for IngressTrafficAllowed {
8160 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8161 where
8162 S: serde::Serializer,
8163 {
8164 match self {
8165 Self::Unspecified => serializer.serialize_i32(0),
8166 Self::All => serializer.serialize_i32(1),
8167 Self::InternalOnly => serializer.serialize_i32(2),
8168 Self::InternalAndLb => serializer.serialize_i32(3),
8169 Self::UnknownValue(u) => u.0.serialize(serializer),
8170 }
8171 }
8172 }
8173
8174 impl<'de> serde::de::Deserialize<'de> for IngressTrafficAllowed {
8175 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8176 where
8177 D: serde::Deserializer<'de>,
8178 {
8179 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngressTrafficAllowed>::new(
8180 ".google.appengine.v1.NetworkSettings.IngressTrafficAllowed",
8181 ))
8182 }
8183 }
8184}
8185
8186/// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation].
8187///
8188/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8189#[derive(Clone, Default, PartialEq)]
8190#[non_exhaustive]
8191pub struct OperationMetadataV1 {
8192 /// API method that initiated this operation. Example:
8193 /// `google.appengine.v1.Versions.CreateVersion`.
8194 ///
8195 /// @OutputOnly
8196 pub method: std::string::String,
8197
8198 /// Time that this operation was created.
8199 ///
8200 /// @OutputOnly
8201 pub insert_time: std::option::Option<wkt::Timestamp>,
8202
8203 /// Time that this operation completed.
8204 ///
8205 /// @OutputOnly
8206 pub end_time: std::option::Option<wkt::Timestamp>,
8207
8208 /// User who requested this operation.
8209 ///
8210 /// @OutputOnly
8211 pub user: std::string::String,
8212
8213 /// Name of the resource that this operation is acting on. Example:
8214 /// `apps/myapp/services/default`.
8215 ///
8216 /// @OutputOnly
8217 pub target: std::string::String,
8218
8219 /// Ephemeral message that may change every time the operation is polled.
8220 /// @OutputOnly
8221 pub ephemeral_message: std::string::String,
8222
8223 /// Durable messages that persist on every operation poll.
8224 /// @OutputOnly
8225 pub warning: std::vec::Vec<std::string::String>,
8226
8227 /// Metadata specific to the type of operation in progress.
8228 /// @OutputOnly
8229 pub method_metadata: std::option::Option<crate::model::operation_metadata_v_1::MethodMetadata>,
8230
8231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8232}
8233
8234impl OperationMetadataV1 {
8235 /// Creates a new default instance.
8236 pub fn new() -> Self {
8237 std::default::Default::default()
8238 }
8239
8240 /// Sets the value of [method][crate::model::OperationMetadataV1::method].
8241 ///
8242 /// # Example
8243 /// ```ignore,no_run
8244 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8245 /// let x = OperationMetadataV1::new().set_method("example");
8246 /// ```
8247 pub fn set_method<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8248 self.method = v.into();
8249 self
8250 }
8251
8252 /// Sets the value of [insert_time][crate::model::OperationMetadataV1::insert_time].
8253 ///
8254 /// # Example
8255 /// ```ignore,no_run
8256 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8257 /// use wkt::Timestamp;
8258 /// let x = OperationMetadataV1::new().set_insert_time(Timestamp::default()/* use setters */);
8259 /// ```
8260 pub fn set_insert_time<T>(mut self, v: T) -> Self
8261 where
8262 T: std::convert::Into<wkt::Timestamp>,
8263 {
8264 self.insert_time = std::option::Option::Some(v.into());
8265 self
8266 }
8267
8268 /// Sets or clears the value of [insert_time][crate::model::OperationMetadataV1::insert_time].
8269 ///
8270 /// # Example
8271 /// ```ignore,no_run
8272 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8273 /// use wkt::Timestamp;
8274 /// let x = OperationMetadataV1::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
8275 /// let x = OperationMetadataV1::new().set_or_clear_insert_time(None::<Timestamp>);
8276 /// ```
8277 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
8278 where
8279 T: std::convert::Into<wkt::Timestamp>,
8280 {
8281 self.insert_time = v.map(|x| x.into());
8282 self
8283 }
8284
8285 /// Sets the value of [end_time][crate::model::OperationMetadataV1::end_time].
8286 ///
8287 /// # Example
8288 /// ```ignore,no_run
8289 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8290 /// use wkt::Timestamp;
8291 /// let x = OperationMetadataV1::new().set_end_time(Timestamp::default()/* use setters */);
8292 /// ```
8293 pub fn set_end_time<T>(mut self, v: T) -> Self
8294 where
8295 T: std::convert::Into<wkt::Timestamp>,
8296 {
8297 self.end_time = std::option::Option::Some(v.into());
8298 self
8299 }
8300
8301 /// Sets or clears the value of [end_time][crate::model::OperationMetadataV1::end_time].
8302 ///
8303 /// # Example
8304 /// ```ignore,no_run
8305 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8306 /// use wkt::Timestamp;
8307 /// let x = OperationMetadataV1::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8308 /// let x = OperationMetadataV1::new().set_or_clear_end_time(None::<Timestamp>);
8309 /// ```
8310 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8311 where
8312 T: std::convert::Into<wkt::Timestamp>,
8313 {
8314 self.end_time = v.map(|x| x.into());
8315 self
8316 }
8317
8318 /// Sets the value of [user][crate::model::OperationMetadataV1::user].
8319 ///
8320 /// # Example
8321 /// ```ignore,no_run
8322 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8323 /// let x = OperationMetadataV1::new().set_user("example");
8324 /// ```
8325 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8326 self.user = v.into();
8327 self
8328 }
8329
8330 /// Sets the value of [target][crate::model::OperationMetadataV1::target].
8331 ///
8332 /// # Example
8333 /// ```ignore,no_run
8334 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8335 /// let x = OperationMetadataV1::new().set_target("example");
8336 /// ```
8337 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8338 self.target = v.into();
8339 self
8340 }
8341
8342 /// Sets the value of [ephemeral_message][crate::model::OperationMetadataV1::ephemeral_message].
8343 ///
8344 /// # Example
8345 /// ```ignore,no_run
8346 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8347 /// let x = OperationMetadataV1::new().set_ephemeral_message("example");
8348 /// ```
8349 pub fn set_ephemeral_message<T: std::convert::Into<std::string::String>>(
8350 mut self,
8351 v: T,
8352 ) -> Self {
8353 self.ephemeral_message = v.into();
8354 self
8355 }
8356
8357 /// Sets the value of [warning][crate::model::OperationMetadataV1::warning].
8358 ///
8359 /// # Example
8360 /// ```ignore,no_run
8361 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8362 /// let x = OperationMetadataV1::new().set_warning(["a", "b", "c"]);
8363 /// ```
8364 pub fn set_warning<T, V>(mut self, v: T) -> Self
8365 where
8366 T: std::iter::IntoIterator<Item = V>,
8367 V: std::convert::Into<std::string::String>,
8368 {
8369 use std::iter::Iterator;
8370 self.warning = v.into_iter().map(|i| i.into()).collect();
8371 self
8372 }
8373
8374 /// Sets the value of [method_metadata][crate::model::OperationMetadataV1::method_metadata].
8375 ///
8376 /// Note that all the setters affecting `method_metadata` are mutually
8377 /// exclusive.
8378 ///
8379 /// # Example
8380 /// ```ignore,no_run
8381 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8382 /// use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8383 /// let x = OperationMetadataV1::new().set_method_metadata(Some(
8384 /// google_cloud_appengine_v1::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(CreateVersionMetadataV1::default().into())));
8385 /// ```
8386 pub fn set_method_metadata<
8387 T: std::convert::Into<
8388 std::option::Option<crate::model::operation_metadata_v_1::MethodMetadata>,
8389 >,
8390 >(
8391 mut self,
8392 v: T,
8393 ) -> Self {
8394 self.method_metadata = v.into();
8395 self
8396 }
8397
8398 /// The value of [method_metadata][crate::model::OperationMetadataV1::method_metadata]
8399 /// if it holds a `CreateVersionMetadata`, `None` if the field is not set or
8400 /// holds a different branch.
8401 pub fn create_version_metadata(
8402 &self,
8403 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateVersionMetadataV1>> {
8404 #[allow(unreachable_patterns)]
8405 self.method_metadata.as_ref().and_then(|v| match v {
8406 crate::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(v) => {
8407 std::option::Option::Some(v)
8408 }
8409 _ => std::option::Option::None,
8410 })
8411 }
8412
8413 /// Sets the value of [method_metadata][crate::model::OperationMetadataV1::method_metadata]
8414 /// to hold a `CreateVersionMetadata`.
8415 ///
8416 /// Note that all the setters affecting `method_metadata` are
8417 /// mutually exclusive.
8418 ///
8419 /// # Example
8420 /// ```ignore,no_run
8421 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8422 /// use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8423 /// let x = OperationMetadataV1::new().set_create_version_metadata(CreateVersionMetadataV1::default()/* use setters */);
8424 /// assert!(x.create_version_metadata().is_some());
8425 /// ```
8426 pub fn set_create_version_metadata<
8427 T: std::convert::Into<std::boxed::Box<crate::model::CreateVersionMetadataV1>>,
8428 >(
8429 mut self,
8430 v: T,
8431 ) -> Self {
8432 self.method_metadata = std::option::Option::Some(
8433 crate::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(v.into()),
8434 );
8435 self
8436 }
8437}
8438
8439impl wkt::message::Message for OperationMetadataV1 {
8440 fn typename() -> &'static str {
8441 "type.googleapis.com/google.appengine.v1.OperationMetadataV1"
8442 }
8443}
8444
8445/// Defines additional types related to [OperationMetadataV1].
8446pub mod operation_metadata_v_1 {
8447 #[allow(unused_imports)]
8448 use super::*;
8449
8450 /// Metadata specific to the type of operation in progress.
8451 /// @OutputOnly
8452 #[derive(Clone, Debug, PartialEq)]
8453 #[non_exhaustive]
8454 pub enum MethodMetadata {
8455 #[allow(missing_docs)]
8456 CreateVersionMetadata(std::boxed::Box<crate::model::CreateVersionMetadataV1>),
8457 }
8458}
8459
8460/// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation] during a
8461/// [google.appengine.v1.CreateVersionRequest][google.appengine.v1.CreateVersionRequest].
8462///
8463/// [google.appengine.v1.CreateVersionRequest]: crate::model::CreateVersionRequest
8464/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8465#[derive(Clone, Default, PartialEq)]
8466#[non_exhaustive]
8467pub struct CreateVersionMetadataV1 {
8468 /// The Cloud Build ID if one was created as part of the version create.
8469 /// @OutputOnly
8470 pub cloud_build_id: std::string::String,
8471
8472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8473}
8474
8475impl CreateVersionMetadataV1 {
8476 /// Creates a new default instance.
8477 pub fn new() -> Self {
8478 std::default::Default::default()
8479 }
8480
8481 /// Sets the value of [cloud_build_id][crate::model::CreateVersionMetadataV1::cloud_build_id].
8482 ///
8483 /// # Example
8484 /// ```ignore,no_run
8485 /// # use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8486 /// let x = CreateVersionMetadataV1::new().set_cloud_build_id("example");
8487 /// ```
8488 pub fn set_cloud_build_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8489 self.cloud_build_id = v.into();
8490 self
8491 }
8492}
8493
8494impl wkt::message::Message for CreateVersionMetadataV1 {
8495 fn typename() -> &'static str {
8496 "type.googleapis.com/google.appengine.v1.CreateVersionMetadataV1"
8497 }
8498}
8499
8500/// A Service resource is a logical component of an application that can share
8501/// state and communicate in a secure fashion with other services.
8502/// For example, an application that handles customer requests might
8503/// include separate services to handle tasks such as backend data
8504/// analysis or API requests from mobile devices. Each service has a
8505/// collection of versions that define a specific set of code used to
8506/// implement the functionality of that service.
8507#[derive(Clone, Default, PartialEq)]
8508#[non_exhaustive]
8509pub struct Service {
8510 /// Full path to the Service resource in the API.
8511 /// Example: `apps/myapp/services/default`.
8512 ///
8513 /// @OutputOnly
8514 pub name: std::string::String,
8515
8516 /// Relative name of the service within the application.
8517 /// Example: `default`.
8518 ///
8519 /// @OutputOnly
8520 pub id: std::string::String,
8521
8522 /// Mapping that defines fractional HTTP traffic diversion to
8523 /// different versions within the service.
8524 pub split: std::option::Option<crate::model::TrafficSplit>,
8525
8526 /// A set of labels to apply to this service. Labels are key/value pairs that
8527 /// describe the service and all resources that belong to it (e.g.,
8528 /// versions). The labels can be used to search and group resources, and are
8529 /// propagated to the usage and billing reports, enabling fine-grain analysis
8530 /// of costs. An example of using labels is to tag resources belonging to
8531 /// different environments (e.g., "env=prod", "env=qa").
8532 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8533
8534 /// Ingress settings for this service. Will apply to all versions.
8535 pub network_settings: std::option::Option<crate::model::NetworkSettings>,
8536
8537 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8538}
8539
8540impl Service {
8541 /// Creates a new default instance.
8542 pub fn new() -> Self {
8543 std::default::Default::default()
8544 }
8545
8546 /// Sets the value of [name][crate::model::Service::name].
8547 ///
8548 /// # Example
8549 /// ```ignore,no_run
8550 /// # use google_cloud_appengine_v1::model::Service;
8551 /// let x = Service::new().set_name("example");
8552 /// ```
8553 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8554 self.name = v.into();
8555 self
8556 }
8557
8558 /// Sets the value of [id][crate::model::Service::id].
8559 ///
8560 /// # Example
8561 /// ```ignore,no_run
8562 /// # use google_cloud_appengine_v1::model::Service;
8563 /// let x = Service::new().set_id("example");
8564 /// ```
8565 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8566 self.id = v.into();
8567 self
8568 }
8569
8570 /// Sets the value of [split][crate::model::Service::split].
8571 ///
8572 /// # Example
8573 /// ```ignore,no_run
8574 /// # use google_cloud_appengine_v1::model::Service;
8575 /// use google_cloud_appengine_v1::model::TrafficSplit;
8576 /// let x = Service::new().set_split(TrafficSplit::default()/* use setters */);
8577 /// ```
8578 pub fn set_split<T>(mut self, v: T) -> Self
8579 where
8580 T: std::convert::Into<crate::model::TrafficSplit>,
8581 {
8582 self.split = std::option::Option::Some(v.into());
8583 self
8584 }
8585
8586 /// Sets or clears the value of [split][crate::model::Service::split].
8587 ///
8588 /// # Example
8589 /// ```ignore,no_run
8590 /// # use google_cloud_appengine_v1::model::Service;
8591 /// use google_cloud_appengine_v1::model::TrafficSplit;
8592 /// let x = Service::new().set_or_clear_split(Some(TrafficSplit::default()/* use setters */));
8593 /// let x = Service::new().set_or_clear_split(None::<TrafficSplit>);
8594 /// ```
8595 pub fn set_or_clear_split<T>(mut self, v: std::option::Option<T>) -> Self
8596 where
8597 T: std::convert::Into<crate::model::TrafficSplit>,
8598 {
8599 self.split = v.map(|x| x.into());
8600 self
8601 }
8602
8603 /// Sets the value of [labels][crate::model::Service::labels].
8604 ///
8605 /// # Example
8606 /// ```ignore,no_run
8607 /// # use google_cloud_appengine_v1::model::Service;
8608 /// let x = Service::new().set_labels([
8609 /// ("key0", "abc"),
8610 /// ("key1", "xyz"),
8611 /// ]);
8612 /// ```
8613 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8614 where
8615 T: std::iter::IntoIterator<Item = (K, V)>,
8616 K: std::convert::Into<std::string::String>,
8617 V: std::convert::Into<std::string::String>,
8618 {
8619 use std::iter::Iterator;
8620 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8621 self
8622 }
8623
8624 /// Sets the value of [network_settings][crate::model::Service::network_settings].
8625 ///
8626 /// # Example
8627 /// ```ignore,no_run
8628 /// # use google_cloud_appengine_v1::model::Service;
8629 /// use google_cloud_appengine_v1::model::NetworkSettings;
8630 /// let x = Service::new().set_network_settings(NetworkSettings::default()/* use setters */);
8631 /// ```
8632 pub fn set_network_settings<T>(mut self, v: T) -> Self
8633 where
8634 T: std::convert::Into<crate::model::NetworkSettings>,
8635 {
8636 self.network_settings = std::option::Option::Some(v.into());
8637 self
8638 }
8639
8640 /// Sets or clears the value of [network_settings][crate::model::Service::network_settings].
8641 ///
8642 /// # Example
8643 /// ```ignore,no_run
8644 /// # use google_cloud_appengine_v1::model::Service;
8645 /// use google_cloud_appengine_v1::model::NetworkSettings;
8646 /// let x = Service::new().set_or_clear_network_settings(Some(NetworkSettings::default()/* use setters */));
8647 /// let x = Service::new().set_or_clear_network_settings(None::<NetworkSettings>);
8648 /// ```
8649 pub fn set_or_clear_network_settings<T>(mut self, v: std::option::Option<T>) -> Self
8650 where
8651 T: std::convert::Into<crate::model::NetworkSettings>,
8652 {
8653 self.network_settings = v.map(|x| x.into());
8654 self
8655 }
8656}
8657
8658impl wkt::message::Message for Service {
8659 fn typename() -> &'static str {
8660 "type.googleapis.com/google.appengine.v1.Service"
8661 }
8662}
8663
8664/// Traffic routing configuration for versions within a single service. Traffic
8665/// splits define how traffic directed to the service is assigned to versions.
8666#[derive(Clone, Default, PartialEq)]
8667#[non_exhaustive]
8668pub struct TrafficSplit {
8669 /// Mechanism used to determine which version a request is sent to.
8670 /// The traffic selection algorithm will
8671 /// be stable for either type until allocations are changed.
8672 pub shard_by: crate::model::traffic_split::ShardBy,
8673
8674 /// Mapping from version IDs within the service to fractional
8675 /// (0.000, 1] allocations of traffic for that version. Each version can
8676 /// be specified only once, but some versions in the service may not
8677 /// have any traffic allocation. Services that have traffic allocated
8678 /// cannot be deleted until either the service is deleted or
8679 /// their traffic allocation is removed. Allocations must sum to 1.
8680 /// Up to two decimal place precision is supported for IP-based splits and
8681 /// up to three decimal places is supported for cookie-based splits.
8682 pub allocations: std::collections::HashMap<std::string::String, f64>,
8683
8684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8685}
8686
8687impl TrafficSplit {
8688 /// Creates a new default instance.
8689 pub fn new() -> Self {
8690 std::default::Default::default()
8691 }
8692
8693 /// Sets the value of [shard_by][crate::model::TrafficSplit::shard_by].
8694 ///
8695 /// # Example
8696 /// ```ignore,no_run
8697 /// # use google_cloud_appengine_v1::model::TrafficSplit;
8698 /// use google_cloud_appengine_v1::model::traffic_split::ShardBy;
8699 /// let x0 = TrafficSplit::new().set_shard_by(ShardBy::Cookie);
8700 /// let x1 = TrafficSplit::new().set_shard_by(ShardBy::Ip);
8701 /// let x2 = TrafficSplit::new().set_shard_by(ShardBy::Random);
8702 /// ```
8703 pub fn set_shard_by<T: std::convert::Into<crate::model::traffic_split::ShardBy>>(
8704 mut self,
8705 v: T,
8706 ) -> Self {
8707 self.shard_by = v.into();
8708 self
8709 }
8710
8711 /// Sets the value of [allocations][crate::model::TrafficSplit::allocations].
8712 ///
8713 /// # Example
8714 /// ```ignore,no_run
8715 /// # use google_cloud_appengine_v1::model::TrafficSplit;
8716 /// let x = TrafficSplit::new().set_allocations([
8717 /// ("key0", 123.5),
8718 /// ("key1", 456.5),
8719 /// ]);
8720 /// ```
8721 pub fn set_allocations<T, K, V>(mut self, v: T) -> Self
8722 where
8723 T: std::iter::IntoIterator<Item = (K, V)>,
8724 K: std::convert::Into<std::string::String>,
8725 V: std::convert::Into<f64>,
8726 {
8727 use std::iter::Iterator;
8728 self.allocations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8729 self
8730 }
8731}
8732
8733impl wkt::message::Message for TrafficSplit {
8734 fn typename() -> &'static str {
8735 "type.googleapis.com/google.appengine.v1.TrafficSplit"
8736 }
8737}
8738
8739/// Defines additional types related to [TrafficSplit].
8740pub mod traffic_split {
8741 #[allow(unused_imports)]
8742 use super::*;
8743
8744 /// Available sharding mechanisms.
8745 ///
8746 /// # Working with unknown values
8747 ///
8748 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8749 /// additional enum variants at any time. Adding new variants is not considered
8750 /// a breaking change. Applications should write their code in anticipation of:
8751 ///
8752 /// - New values appearing in future releases of the client library, **and**
8753 /// - New values received dynamically, without application changes.
8754 ///
8755 /// Please consult the [Working with enums] section in the user guide for some
8756 /// guidelines.
8757 ///
8758 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8759 #[derive(Clone, Debug, PartialEq)]
8760 #[non_exhaustive]
8761 pub enum ShardBy {
8762 /// Diversion method unspecified.
8763 Unspecified,
8764 /// Diversion based on a specially named cookie, "GOOGAPPUID." The cookie
8765 /// must be set by the application itself or no diversion will occur.
8766 Cookie,
8767 /// Diversion based on applying the modulus operation to a fingerprint
8768 /// of the IP address.
8769 Ip,
8770 /// Diversion based on weighted random assignment. An incoming request is
8771 /// randomly routed to a version in the traffic split, with probability
8772 /// proportional to the version's traffic share.
8773 Random,
8774 /// If set, the enum was initialized with an unknown value.
8775 ///
8776 /// Applications can examine the value using [ShardBy::value] or
8777 /// [ShardBy::name].
8778 UnknownValue(shard_by::UnknownValue),
8779 }
8780
8781 #[doc(hidden)]
8782 pub mod shard_by {
8783 #[allow(unused_imports)]
8784 use super::*;
8785 #[derive(Clone, Debug, PartialEq)]
8786 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8787 }
8788
8789 impl ShardBy {
8790 /// Gets the enum value.
8791 ///
8792 /// Returns `None` if the enum contains an unknown value deserialized from
8793 /// the string representation of enums.
8794 pub fn value(&self) -> std::option::Option<i32> {
8795 match self {
8796 Self::Unspecified => std::option::Option::Some(0),
8797 Self::Cookie => std::option::Option::Some(1),
8798 Self::Ip => std::option::Option::Some(2),
8799 Self::Random => std::option::Option::Some(3),
8800 Self::UnknownValue(u) => u.0.value(),
8801 }
8802 }
8803
8804 /// Gets the enum value as a string.
8805 ///
8806 /// Returns `None` if the enum contains an unknown value deserialized from
8807 /// the integer representation of enums.
8808 pub fn name(&self) -> std::option::Option<&str> {
8809 match self {
8810 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
8811 Self::Cookie => std::option::Option::Some("COOKIE"),
8812 Self::Ip => std::option::Option::Some("IP"),
8813 Self::Random => std::option::Option::Some("RANDOM"),
8814 Self::UnknownValue(u) => u.0.name(),
8815 }
8816 }
8817 }
8818
8819 impl std::default::Default for ShardBy {
8820 fn default() -> Self {
8821 use std::convert::From;
8822 Self::from(0)
8823 }
8824 }
8825
8826 impl std::fmt::Display for ShardBy {
8827 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8828 wkt::internal::display_enum(f, self.name(), self.value())
8829 }
8830 }
8831
8832 impl std::convert::From<i32> for ShardBy {
8833 fn from(value: i32) -> Self {
8834 match value {
8835 0 => Self::Unspecified,
8836 1 => Self::Cookie,
8837 2 => Self::Ip,
8838 3 => Self::Random,
8839 _ => Self::UnknownValue(shard_by::UnknownValue(
8840 wkt::internal::UnknownEnumValue::Integer(value),
8841 )),
8842 }
8843 }
8844 }
8845
8846 impl std::convert::From<&str> for ShardBy {
8847 fn from(value: &str) -> Self {
8848 use std::string::ToString;
8849 match value {
8850 "UNSPECIFIED" => Self::Unspecified,
8851 "COOKIE" => Self::Cookie,
8852 "IP" => Self::Ip,
8853 "RANDOM" => Self::Random,
8854 _ => Self::UnknownValue(shard_by::UnknownValue(
8855 wkt::internal::UnknownEnumValue::String(value.to_string()),
8856 )),
8857 }
8858 }
8859 }
8860
8861 impl serde::ser::Serialize for ShardBy {
8862 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8863 where
8864 S: serde::Serializer,
8865 {
8866 match self {
8867 Self::Unspecified => serializer.serialize_i32(0),
8868 Self::Cookie => serializer.serialize_i32(1),
8869 Self::Ip => serializer.serialize_i32(2),
8870 Self::Random => serializer.serialize_i32(3),
8871 Self::UnknownValue(u) => u.0.serialize(serializer),
8872 }
8873 }
8874 }
8875
8876 impl<'de> serde::de::Deserialize<'de> for ShardBy {
8877 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8878 where
8879 D: serde::Deserializer<'de>,
8880 {
8881 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ShardBy>::new(
8882 ".google.appengine.v1.TrafficSplit.ShardBy",
8883 ))
8884 }
8885 }
8886}
8887
8888/// A Version resource is a specific set of source code and configuration files
8889/// that are deployed into a service.
8890#[derive(Clone, Default, PartialEq)]
8891#[non_exhaustive]
8892pub struct Version {
8893 /// Full path to the Version resource in the API. Example:
8894 /// `apps/myapp/services/default/versions/v1`.
8895 ///
8896 /// @OutputOnly
8897 pub name: std::string::String,
8898
8899 /// Relative name of the version within the service. Example: `v1`.
8900 /// Version names can contain only lowercase letters, numbers, or hyphens.
8901 /// Reserved names: "default", "latest", and any name with the prefix "ah-".
8902 pub id: std::string::String,
8903
8904 /// Before an application can receive email or XMPP messages, the application
8905 /// must be configured to enable the service.
8906 pub inbound_services: std::vec::Vec<crate::model::InboundServiceType>,
8907
8908 /// Instance class that is used to run this version. Valid values are:
8909 ///
8910 /// * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G`
8911 /// * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
8912 ///
8913 /// Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
8914 /// BasicScaling.
8915 pub instance_class: std::string::String,
8916
8917 /// Extra network settings.
8918 /// Only applicable in the App Engine flexible environment.
8919 pub network: std::option::Option<crate::model::Network>,
8920
8921 /// The Google Compute Engine zones that are supported by this version in the
8922 /// App Engine flexible environment. Deprecated.
8923 pub zones: std::vec::Vec<std::string::String>,
8924
8925 /// Machine resources for this version.
8926 /// Only applicable in the App Engine flexible environment.
8927 pub resources: std::option::Option<crate::model::Resources>,
8928
8929 /// Desired runtime. Example: `python27`.
8930 pub runtime: std::string::String,
8931
8932 /// The channel of the runtime to use. Only available for some
8933 /// runtimes. Defaults to the `default` channel.
8934 pub runtime_channel: std::string::String,
8935
8936 /// Whether multiple requests can be dispatched to this version at once.
8937 pub threadsafe: bool,
8938
8939 /// Whether to deploy this version in a container on a virtual machine.
8940 pub vm: bool,
8941
8942 /// Allows App Engine second generation runtimes to access the legacy bundled
8943 /// services.
8944 pub app_engine_apis: bool,
8945
8946 /// Metadata settings that are supplied to this version to enable
8947 /// beta runtime features.
8948 pub beta_settings: std::collections::HashMap<std::string::String, std::string::String>,
8949
8950 /// App Engine execution environment for this version.
8951 ///
8952 /// Defaults to `standard`.
8953 pub env: std::string::String,
8954
8955 /// Current serving status of this version. Only the versions with a
8956 /// `SERVING` status create instances and can be billed.
8957 ///
8958 /// `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`.
8959 pub serving_status: crate::model::ServingStatus,
8960
8961 /// Email address of the user who created this version.
8962 ///
8963 /// @OutputOnly
8964 pub created_by: std::string::String,
8965
8966 /// Time that this version was created.
8967 ///
8968 /// @OutputOnly
8969 pub create_time: std::option::Option<wkt::Timestamp>,
8970
8971 /// Total size in bytes of all the files that are included in this version
8972 /// and currently hosted on the App Engine disk.
8973 ///
8974 /// @OutputOnly
8975 pub disk_usage_bytes: i64,
8976
8977 /// The version of the API in the given runtime environment. Please see the
8978 /// app.yaml reference for valid values at
8979 /// <https://cloud.google.com/appengine/docs/standard/>\<language\>/config/appref
8980 pub runtime_api_version: std::string::String,
8981
8982 /// The path or name of the app's main executable.
8983 pub runtime_main_executable_path: std::string::String,
8984
8985 /// The identity that the deployed version will run as.
8986 /// Admin API will use the App Engine Appspot service account as default if
8987 /// this field is neither provided in app.yaml file nor through CLI flag.
8988 pub service_account: std::string::String,
8989
8990 /// An ordered list of URL-matching patterns that should be applied to incoming
8991 /// requests. The first matching URL handles the request and other request
8992 /// handlers are not attempted.
8993 ///
8994 /// Only returned in `GET` requests if `view=FULL` is set.
8995 pub handlers: std::vec::Vec<crate::model::UrlMap>,
8996
8997 /// Custom static error pages. Limited to 10KB per page.
8998 ///
8999 /// Only returned in `GET` requests if `view=FULL` is set.
9000 pub error_handlers: std::vec::Vec<crate::model::ErrorHandler>,
9001
9002 /// Configuration for third-party Python runtime libraries that are required
9003 /// by the application.
9004 ///
9005 /// Only returned in `GET` requests if `view=FULL` is set.
9006 pub libraries: std::vec::Vec<crate::model::Library>,
9007
9008 /// Serving configuration for
9009 /// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
9010 ///
9011 /// Only returned in `GET` requests if `view=FULL` is set.
9012 pub api_config: std::option::Option<crate::model::ApiConfigHandler>,
9013
9014 /// Environment variables available to the application.
9015 ///
9016 /// Only returned in `GET` requests if `view=FULL` is set.
9017 pub env_variables: std::collections::HashMap<std::string::String, std::string::String>,
9018
9019 /// Environment variables available to the build environment.
9020 ///
9021 /// Only returned in `GET` requests if `view=FULL` is set.
9022 pub build_env_variables: std::collections::HashMap<std::string::String, std::string::String>,
9023
9024 /// Duration that static files should be cached by web proxies and browsers.
9025 /// Only applicable if the corresponding
9026 /// [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StaticFilesHandler)
9027 /// does not specify its own expiration time.
9028 ///
9029 /// Only returned in `GET` requests if `view=FULL` is set.
9030 pub default_expiration: std::option::Option<wkt::Duration>,
9031
9032 /// Configures health checking for instances. Unhealthy instances are
9033 /// stopped and replaced with new instances.
9034 /// Only applicable in the App Engine flexible environment.
9035 ///
9036 /// Only returned in `GET` requests if `view=FULL` is set.
9037 pub health_check: std::option::Option<crate::model::HealthCheck>,
9038
9039 /// Configures readiness health checking for instances.
9040 /// Unhealthy instances are not put into the backend traffic rotation.
9041 ///
9042 /// Only returned in `GET` requests if `view=FULL` is set.
9043 pub readiness_check: std::option::Option<crate::model::ReadinessCheck>,
9044
9045 /// Configures liveness health checking for instances.
9046 /// Unhealthy instances are stopped and replaced with new instances
9047 ///
9048 /// Only returned in `GET` requests if `view=FULL` is set.
9049 pub liveness_check: std::option::Option<crate::model::LivenessCheck>,
9050
9051 /// Files that match this pattern will not be built into this version.
9052 /// Only applicable for Go runtimes.
9053 ///
9054 /// Only returned in `GET` requests if `view=FULL` is set.
9055 pub nobuild_files_regex: std::string::String,
9056
9057 /// Code and application artifacts that make up this version.
9058 ///
9059 /// Only returned in `GET` requests if `view=FULL` is set.
9060 pub deployment: std::option::Option<crate::model::Deployment>,
9061
9062 /// Serving URL for this version. Example:
9063 /// `https://myversion-dot-myservice-dot-myapp.appspot.com`
9064 ///
9065 /// @OutputOnly
9066 pub version_url: std::string::String,
9067
9068 /// Cloud Endpoints configuration.
9069 ///
9070 /// If endpoints_api_service is set, the Cloud Endpoints Extensible Service
9071 /// Proxy will be provided to serve the API implemented by the app.
9072 pub endpoints_api_service: std::option::Option<crate::model::EndpointsApiService>,
9073
9074 /// The entrypoint for the application.
9075 pub entrypoint: std::option::Option<crate::model::Entrypoint>,
9076
9077 /// Enables VPC connectivity for standard apps.
9078 pub vpc_access_connector: std::option::Option<crate::model::VpcAccessConnector>,
9079
9080 /// Controls how instances are created, scaled, and reaped.
9081 ///
9082 /// Defaults to `AutomaticScaling`.
9083 pub scaling: std::option::Option<crate::model::version::Scaling>,
9084
9085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9086}
9087
9088impl Version {
9089 /// Creates a new default instance.
9090 pub fn new() -> Self {
9091 std::default::Default::default()
9092 }
9093
9094 /// Sets the value of [name][crate::model::Version::name].
9095 ///
9096 /// # Example
9097 /// ```ignore,no_run
9098 /// # use google_cloud_appengine_v1::model::Version;
9099 /// let x = Version::new().set_name("example");
9100 /// ```
9101 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9102 self.name = v.into();
9103 self
9104 }
9105
9106 /// Sets the value of [id][crate::model::Version::id].
9107 ///
9108 /// # Example
9109 /// ```ignore,no_run
9110 /// # use google_cloud_appengine_v1::model::Version;
9111 /// let x = Version::new().set_id("example");
9112 /// ```
9113 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9114 self.id = v.into();
9115 self
9116 }
9117
9118 /// Sets the value of [inbound_services][crate::model::Version::inbound_services].
9119 ///
9120 /// # Example
9121 /// ```ignore,no_run
9122 /// # use google_cloud_appengine_v1::model::Version;
9123 /// use google_cloud_appengine_v1::model::InboundServiceType;
9124 /// let x = Version::new().set_inbound_services([
9125 /// InboundServiceType::InboundServiceMail,
9126 /// InboundServiceType::InboundServiceMailBounce,
9127 /// InboundServiceType::InboundServiceXmppError,
9128 /// ]);
9129 /// ```
9130 pub fn set_inbound_services<T, V>(mut self, v: T) -> Self
9131 where
9132 T: std::iter::IntoIterator<Item = V>,
9133 V: std::convert::Into<crate::model::InboundServiceType>,
9134 {
9135 use std::iter::Iterator;
9136 self.inbound_services = v.into_iter().map(|i| i.into()).collect();
9137 self
9138 }
9139
9140 /// Sets the value of [instance_class][crate::model::Version::instance_class].
9141 ///
9142 /// # Example
9143 /// ```ignore,no_run
9144 /// # use google_cloud_appengine_v1::model::Version;
9145 /// let x = Version::new().set_instance_class("example");
9146 /// ```
9147 pub fn set_instance_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9148 self.instance_class = v.into();
9149 self
9150 }
9151
9152 /// Sets the value of [network][crate::model::Version::network].
9153 ///
9154 /// # Example
9155 /// ```ignore,no_run
9156 /// # use google_cloud_appengine_v1::model::Version;
9157 /// use google_cloud_appengine_v1::model::Network;
9158 /// let x = Version::new().set_network(Network::default()/* use setters */);
9159 /// ```
9160 pub fn set_network<T>(mut self, v: T) -> Self
9161 where
9162 T: std::convert::Into<crate::model::Network>,
9163 {
9164 self.network = std::option::Option::Some(v.into());
9165 self
9166 }
9167
9168 /// Sets or clears the value of [network][crate::model::Version::network].
9169 ///
9170 /// # Example
9171 /// ```ignore,no_run
9172 /// # use google_cloud_appengine_v1::model::Version;
9173 /// use google_cloud_appengine_v1::model::Network;
9174 /// let x = Version::new().set_or_clear_network(Some(Network::default()/* use setters */));
9175 /// let x = Version::new().set_or_clear_network(None::<Network>);
9176 /// ```
9177 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
9178 where
9179 T: std::convert::Into<crate::model::Network>,
9180 {
9181 self.network = v.map(|x| x.into());
9182 self
9183 }
9184
9185 /// Sets the value of [zones][crate::model::Version::zones].
9186 ///
9187 /// # Example
9188 /// ```ignore,no_run
9189 /// # use google_cloud_appengine_v1::model::Version;
9190 /// let x = Version::new().set_zones(["a", "b", "c"]);
9191 /// ```
9192 pub fn set_zones<T, V>(mut self, v: T) -> Self
9193 where
9194 T: std::iter::IntoIterator<Item = V>,
9195 V: std::convert::Into<std::string::String>,
9196 {
9197 use std::iter::Iterator;
9198 self.zones = v.into_iter().map(|i| i.into()).collect();
9199 self
9200 }
9201
9202 /// Sets the value of [resources][crate::model::Version::resources].
9203 ///
9204 /// # Example
9205 /// ```ignore,no_run
9206 /// # use google_cloud_appengine_v1::model::Version;
9207 /// use google_cloud_appengine_v1::model::Resources;
9208 /// let x = Version::new().set_resources(Resources::default()/* use setters */);
9209 /// ```
9210 pub fn set_resources<T>(mut self, v: T) -> Self
9211 where
9212 T: std::convert::Into<crate::model::Resources>,
9213 {
9214 self.resources = std::option::Option::Some(v.into());
9215 self
9216 }
9217
9218 /// Sets or clears the value of [resources][crate::model::Version::resources].
9219 ///
9220 /// # Example
9221 /// ```ignore,no_run
9222 /// # use google_cloud_appengine_v1::model::Version;
9223 /// use google_cloud_appengine_v1::model::Resources;
9224 /// let x = Version::new().set_or_clear_resources(Some(Resources::default()/* use setters */));
9225 /// let x = Version::new().set_or_clear_resources(None::<Resources>);
9226 /// ```
9227 pub fn set_or_clear_resources<T>(mut self, v: std::option::Option<T>) -> Self
9228 where
9229 T: std::convert::Into<crate::model::Resources>,
9230 {
9231 self.resources = v.map(|x| x.into());
9232 self
9233 }
9234
9235 /// Sets the value of [runtime][crate::model::Version::runtime].
9236 ///
9237 /// # Example
9238 /// ```ignore,no_run
9239 /// # use google_cloud_appengine_v1::model::Version;
9240 /// let x = Version::new().set_runtime("example");
9241 /// ```
9242 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9243 self.runtime = v.into();
9244 self
9245 }
9246
9247 /// Sets the value of [runtime_channel][crate::model::Version::runtime_channel].
9248 ///
9249 /// # Example
9250 /// ```ignore,no_run
9251 /// # use google_cloud_appengine_v1::model::Version;
9252 /// let x = Version::new().set_runtime_channel("example");
9253 /// ```
9254 pub fn set_runtime_channel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9255 self.runtime_channel = v.into();
9256 self
9257 }
9258
9259 /// Sets the value of [threadsafe][crate::model::Version::threadsafe].
9260 ///
9261 /// # Example
9262 /// ```ignore,no_run
9263 /// # use google_cloud_appengine_v1::model::Version;
9264 /// let x = Version::new().set_threadsafe(true);
9265 /// ```
9266 pub fn set_threadsafe<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9267 self.threadsafe = v.into();
9268 self
9269 }
9270
9271 /// Sets the value of [vm][crate::model::Version::vm].
9272 ///
9273 /// # Example
9274 /// ```ignore,no_run
9275 /// # use google_cloud_appengine_v1::model::Version;
9276 /// let x = Version::new().set_vm(true);
9277 /// ```
9278 pub fn set_vm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9279 self.vm = v.into();
9280 self
9281 }
9282
9283 /// Sets the value of [app_engine_apis][crate::model::Version::app_engine_apis].
9284 ///
9285 /// # Example
9286 /// ```ignore,no_run
9287 /// # use google_cloud_appengine_v1::model::Version;
9288 /// let x = Version::new().set_app_engine_apis(true);
9289 /// ```
9290 pub fn set_app_engine_apis<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9291 self.app_engine_apis = v.into();
9292 self
9293 }
9294
9295 /// Sets the value of [beta_settings][crate::model::Version::beta_settings].
9296 ///
9297 /// # Example
9298 /// ```ignore,no_run
9299 /// # use google_cloud_appengine_v1::model::Version;
9300 /// let x = Version::new().set_beta_settings([
9301 /// ("key0", "abc"),
9302 /// ("key1", "xyz"),
9303 /// ]);
9304 /// ```
9305 pub fn set_beta_settings<T, K, V>(mut self, v: T) -> Self
9306 where
9307 T: std::iter::IntoIterator<Item = (K, V)>,
9308 K: std::convert::Into<std::string::String>,
9309 V: std::convert::Into<std::string::String>,
9310 {
9311 use std::iter::Iterator;
9312 self.beta_settings = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9313 self
9314 }
9315
9316 /// Sets the value of [env][crate::model::Version::env].
9317 ///
9318 /// # Example
9319 /// ```ignore,no_run
9320 /// # use google_cloud_appengine_v1::model::Version;
9321 /// let x = Version::new().set_env("example");
9322 /// ```
9323 pub fn set_env<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9324 self.env = v.into();
9325 self
9326 }
9327
9328 /// Sets the value of [serving_status][crate::model::Version::serving_status].
9329 ///
9330 /// # Example
9331 /// ```ignore,no_run
9332 /// # use google_cloud_appengine_v1::model::Version;
9333 /// use google_cloud_appengine_v1::model::ServingStatus;
9334 /// let x0 = Version::new().set_serving_status(ServingStatus::Serving);
9335 /// let x1 = Version::new().set_serving_status(ServingStatus::Stopped);
9336 /// ```
9337 pub fn set_serving_status<T: std::convert::Into<crate::model::ServingStatus>>(
9338 mut self,
9339 v: T,
9340 ) -> Self {
9341 self.serving_status = v.into();
9342 self
9343 }
9344
9345 /// Sets the value of [created_by][crate::model::Version::created_by].
9346 ///
9347 /// # Example
9348 /// ```ignore,no_run
9349 /// # use google_cloud_appengine_v1::model::Version;
9350 /// let x = Version::new().set_created_by("example");
9351 /// ```
9352 pub fn set_created_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9353 self.created_by = v.into();
9354 self
9355 }
9356
9357 /// Sets the value of [create_time][crate::model::Version::create_time].
9358 ///
9359 /// # Example
9360 /// ```ignore,no_run
9361 /// # use google_cloud_appengine_v1::model::Version;
9362 /// use wkt::Timestamp;
9363 /// let x = Version::new().set_create_time(Timestamp::default()/* use setters */);
9364 /// ```
9365 pub fn set_create_time<T>(mut self, v: T) -> Self
9366 where
9367 T: std::convert::Into<wkt::Timestamp>,
9368 {
9369 self.create_time = std::option::Option::Some(v.into());
9370 self
9371 }
9372
9373 /// Sets or clears the value of [create_time][crate::model::Version::create_time].
9374 ///
9375 /// # Example
9376 /// ```ignore,no_run
9377 /// # use google_cloud_appengine_v1::model::Version;
9378 /// use wkt::Timestamp;
9379 /// let x = Version::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9380 /// let x = Version::new().set_or_clear_create_time(None::<Timestamp>);
9381 /// ```
9382 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9383 where
9384 T: std::convert::Into<wkt::Timestamp>,
9385 {
9386 self.create_time = v.map(|x| x.into());
9387 self
9388 }
9389
9390 /// Sets the value of [disk_usage_bytes][crate::model::Version::disk_usage_bytes].
9391 ///
9392 /// # Example
9393 /// ```ignore,no_run
9394 /// # use google_cloud_appengine_v1::model::Version;
9395 /// let x = Version::new().set_disk_usage_bytes(42);
9396 /// ```
9397 pub fn set_disk_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9398 self.disk_usage_bytes = v.into();
9399 self
9400 }
9401
9402 /// Sets the value of [runtime_api_version][crate::model::Version::runtime_api_version].
9403 ///
9404 /// # Example
9405 /// ```ignore,no_run
9406 /// # use google_cloud_appengine_v1::model::Version;
9407 /// let x = Version::new().set_runtime_api_version("example");
9408 /// ```
9409 pub fn set_runtime_api_version<T: std::convert::Into<std::string::String>>(
9410 mut self,
9411 v: T,
9412 ) -> Self {
9413 self.runtime_api_version = v.into();
9414 self
9415 }
9416
9417 /// Sets the value of [runtime_main_executable_path][crate::model::Version::runtime_main_executable_path].
9418 ///
9419 /// # Example
9420 /// ```ignore,no_run
9421 /// # use google_cloud_appengine_v1::model::Version;
9422 /// let x = Version::new().set_runtime_main_executable_path("example");
9423 /// ```
9424 pub fn set_runtime_main_executable_path<T: std::convert::Into<std::string::String>>(
9425 mut self,
9426 v: T,
9427 ) -> Self {
9428 self.runtime_main_executable_path = v.into();
9429 self
9430 }
9431
9432 /// Sets the value of [service_account][crate::model::Version::service_account].
9433 ///
9434 /// # Example
9435 /// ```ignore,no_run
9436 /// # use google_cloud_appengine_v1::model::Version;
9437 /// let x = Version::new().set_service_account("example");
9438 /// ```
9439 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9440 self.service_account = v.into();
9441 self
9442 }
9443
9444 /// Sets the value of [handlers][crate::model::Version::handlers].
9445 ///
9446 /// # Example
9447 /// ```ignore,no_run
9448 /// # use google_cloud_appengine_v1::model::Version;
9449 /// use google_cloud_appengine_v1::model::UrlMap;
9450 /// let x = Version::new()
9451 /// .set_handlers([
9452 /// UrlMap::default()/* use setters */,
9453 /// UrlMap::default()/* use (different) setters */,
9454 /// ]);
9455 /// ```
9456 pub fn set_handlers<T, V>(mut self, v: T) -> Self
9457 where
9458 T: std::iter::IntoIterator<Item = V>,
9459 V: std::convert::Into<crate::model::UrlMap>,
9460 {
9461 use std::iter::Iterator;
9462 self.handlers = v.into_iter().map(|i| i.into()).collect();
9463 self
9464 }
9465
9466 /// Sets the value of [error_handlers][crate::model::Version::error_handlers].
9467 ///
9468 /// # Example
9469 /// ```ignore,no_run
9470 /// # use google_cloud_appengine_v1::model::Version;
9471 /// use google_cloud_appengine_v1::model::ErrorHandler;
9472 /// let x = Version::new()
9473 /// .set_error_handlers([
9474 /// ErrorHandler::default()/* use setters */,
9475 /// ErrorHandler::default()/* use (different) setters */,
9476 /// ]);
9477 /// ```
9478 pub fn set_error_handlers<T, V>(mut self, v: T) -> Self
9479 where
9480 T: std::iter::IntoIterator<Item = V>,
9481 V: std::convert::Into<crate::model::ErrorHandler>,
9482 {
9483 use std::iter::Iterator;
9484 self.error_handlers = v.into_iter().map(|i| i.into()).collect();
9485 self
9486 }
9487
9488 /// Sets the value of [libraries][crate::model::Version::libraries].
9489 ///
9490 /// # Example
9491 /// ```ignore,no_run
9492 /// # use google_cloud_appengine_v1::model::Version;
9493 /// use google_cloud_appengine_v1::model::Library;
9494 /// let x = Version::new()
9495 /// .set_libraries([
9496 /// Library::default()/* use setters */,
9497 /// Library::default()/* use (different) setters */,
9498 /// ]);
9499 /// ```
9500 pub fn set_libraries<T, V>(mut self, v: T) -> Self
9501 where
9502 T: std::iter::IntoIterator<Item = V>,
9503 V: std::convert::Into<crate::model::Library>,
9504 {
9505 use std::iter::Iterator;
9506 self.libraries = v.into_iter().map(|i| i.into()).collect();
9507 self
9508 }
9509
9510 /// Sets the value of [api_config][crate::model::Version::api_config].
9511 ///
9512 /// # Example
9513 /// ```ignore,no_run
9514 /// # use google_cloud_appengine_v1::model::Version;
9515 /// use google_cloud_appengine_v1::model::ApiConfigHandler;
9516 /// let x = Version::new().set_api_config(ApiConfigHandler::default()/* use setters */);
9517 /// ```
9518 pub fn set_api_config<T>(mut self, v: T) -> Self
9519 where
9520 T: std::convert::Into<crate::model::ApiConfigHandler>,
9521 {
9522 self.api_config = std::option::Option::Some(v.into());
9523 self
9524 }
9525
9526 /// Sets or clears the value of [api_config][crate::model::Version::api_config].
9527 ///
9528 /// # Example
9529 /// ```ignore,no_run
9530 /// # use google_cloud_appengine_v1::model::Version;
9531 /// use google_cloud_appengine_v1::model::ApiConfigHandler;
9532 /// let x = Version::new().set_or_clear_api_config(Some(ApiConfigHandler::default()/* use setters */));
9533 /// let x = Version::new().set_or_clear_api_config(None::<ApiConfigHandler>);
9534 /// ```
9535 pub fn set_or_clear_api_config<T>(mut self, v: std::option::Option<T>) -> Self
9536 where
9537 T: std::convert::Into<crate::model::ApiConfigHandler>,
9538 {
9539 self.api_config = v.map(|x| x.into());
9540 self
9541 }
9542
9543 /// Sets the value of [env_variables][crate::model::Version::env_variables].
9544 ///
9545 /// # Example
9546 /// ```ignore,no_run
9547 /// # use google_cloud_appengine_v1::model::Version;
9548 /// let x = Version::new().set_env_variables([
9549 /// ("key0", "abc"),
9550 /// ("key1", "xyz"),
9551 /// ]);
9552 /// ```
9553 pub fn set_env_variables<T, K, V>(mut self, v: T) -> Self
9554 where
9555 T: std::iter::IntoIterator<Item = (K, V)>,
9556 K: std::convert::Into<std::string::String>,
9557 V: std::convert::Into<std::string::String>,
9558 {
9559 use std::iter::Iterator;
9560 self.env_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9561 self
9562 }
9563
9564 /// Sets the value of [build_env_variables][crate::model::Version::build_env_variables].
9565 ///
9566 /// # Example
9567 /// ```ignore,no_run
9568 /// # use google_cloud_appengine_v1::model::Version;
9569 /// let x = Version::new().set_build_env_variables([
9570 /// ("key0", "abc"),
9571 /// ("key1", "xyz"),
9572 /// ]);
9573 /// ```
9574 pub fn set_build_env_variables<T, K, V>(mut self, v: T) -> Self
9575 where
9576 T: std::iter::IntoIterator<Item = (K, V)>,
9577 K: std::convert::Into<std::string::String>,
9578 V: std::convert::Into<std::string::String>,
9579 {
9580 use std::iter::Iterator;
9581 self.build_env_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9582 self
9583 }
9584
9585 /// Sets the value of [default_expiration][crate::model::Version::default_expiration].
9586 ///
9587 /// # Example
9588 /// ```ignore,no_run
9589 /// # use google_cloud_appengine_v1::model::Version;
9590 /// use wkt::Duration;
9591 /// let x = Version::new().set_default_expiration(Duration::default()/* use setters */);
9592 /// ```
9593 pub fn set_default_expiration<T>(mut self, v: T) -> Self
9594 where
9595 T: std::convert::Into<wkt::Duration>,
9596 {
9597 self.default_expiration = std::option::Option::Some(v.into());
9598 self
9599 }
9600
9601 /// Sets or clears the value of [default_expiration][crate::model::Version::default_expiration].
9602 ///
9603 /// # Example
9604 /// ```ignore,no_run
9605 /// # use google_cloud_appengine_v1::model::Version;
9606 /// use wkt::Duration;
9607 /// let x = Version::new().set_or_clear_default_expiration(Some(Duration::default()/* use setters */));
9608 /// let x = Version::new().set_or_clear_default_expiration(None::<Duration>);
9609 /// ```
9610 pub fn set_or_clear_default_expiration<T>(mut self, v: std::option::Option<T>) -> Self
9611 where
9612 T: std::convert::Into<wkt::Duration>,
9613 {
9614 self.default_expiration = v.map(|x| x.into());
9615 self
9616 }
9617
9618 /// Sets the value of [health_check][crate::model::Version::health_check].
9619 ///
9620 /// # Example
9621 /// ```ignore,no_run
9622 /// # use google_cloud_appengine_v1::model::Version;
9623 /// use google_cloud_appengine_v1::model::HealthCheck;
9624 /// let x = Version::new().set_health_check(HealthCheck::default()/* use setters */);
9625 /// ```
9626 pub fn set_health_check<T>(mut self, v: T) -> Self
9627 where
9628 T: std::convert::Into<crate::model::HealthCheck>,
9629 {
9630 self.health_check = std::option::Option::Some(v.into());
9631 self
9632 }
9633
9634 /// Sets or clears the value of [health_check][crate::model::Version::health_check].
9635 ///
9636 /// # Example
9637 /// ```ignore,no_run
9638 /// # use google_cloud_appengine_v1::model::Version;
9639 /// use google_cloud_appengine_v1::model::HealthCheck;
9640 /// let x = Version::new().set_or_clear_health_check(Some(HealthCheck::default()/* use setters */));
9641 /// let x = Version::new().set_or_clear_health_check(None::<HealthCheck>);
9642 /// ```
9643 pub fn set_or_clear_health_check<T>(mut self, v: std::option::Option<T>) -> Self
9644 where
9645 T: std::convert::Into<crate::model::HealthCheck>,
9646 {
9647 self.health_check = v.map(|x| x.into());
9648 self
9649 }
9650
9651 /// Sets the value of [readiness_check][crate::model::Version::readiness_check].
9652 ///
9653 /// # Example
9654 /// ```ignore,no_run
9655 /// # use google_cloud_appengine_v1::model::Version;
9656 /// use google_cloud_appengine_v1::model::ReadinessCheck;
9657 /// let x = Version::new().set_readiness_check(ReadinessCheck::default()/* use setters */);
9658 /// ```
9659 pub fn set_readiness_check<T>(mut self, v: T) -> Self
9660 where
9661 T: std::convert::Into<crate::model::ReadinessCheck>,
9662 {
9663 self.readiness_check = std::option::Option::Some(v.into());
9664 self
9665 }
9666
9667 /// Sets or clears the value of [readiness_check][crate::model::Version::readiness_check].
9668 ///
9669 /// # Example
9670 /// ```ignore,no_run
9671 /// # use google_cloud_appengine_v1::model::Version;
9672 /// use google_cloud_appengine_v1::model::ReadinessCheck;
9673 /// let x = Version::new().set_or_clear_readiness_check(Some(ReadinessCheck::default()/* use setters */));
9674 /// let x = Version::new().set_or_clear_readiness_check(None::<ReadinessCheck>);
9675 /// ```
9676 pub fn set_or_clear_readiness_check<T>(mut self, v: std::option::Option<T>) -> Self
9677 where
9678 T: std::convert::Into<crate::model::ReadinessCheck>,
9679 {
9680 self.readiness_check = v.map(|x| x.into());
9681 self
9682 }
9683
9684 /// Sets the value of [liveness_check][crate::model::Version::liveness_check].
9685 ///
9686 /// # Example
9687 /// ```ignore,no_run
9688 /// # use google_cloud_appengine_v1::model::Version;
9689 /// use google_cloud_appengine_v1::model::LivenessCheck;
9690 /// let x = Version::new().set_liveness_check(LivenessCheck::default()/* use setters */);
9691 /// ```
9692 pub fn set_liveness_check<T>(mut self, v: T) -> Self
9693 where
9694 T: std::convert::Into<crate::model::LivenessCheck>,
9695 {
9696 self.liveness_check = std::option::Option::Some(v.into());
9697 self
9698 }
9699
9700 /// Sets or clears the value of [liveness_check][crate::model::Version::liveness_check].
9701 ///
9702 /// # Example
9703 /// ```ignore,no_run
9704 /// # use google_cloud_appengine_v1::model::Version;
9705 /// use google_cloud_appengine_v1::model::LivenessCheck;
9706 /// let x = Version::new().set_or_clear_liveness_check(Some(LivenessCheck::default()/* use setters */));
9707 /// let x = Version::new().set_or_clear_liveness_check(None::<LivenessCheck>);
9708 /// ```
9709 pub fn set_or_clear_liveness_check<T>(mut self, v: std::option::Option<T>) -> Self
9710 where
9711 T: std::convert::Into<crate::model::LivenessCheck>,
9712 {
9713 self.liveness_check = v.map(|x| x.into());
9714 self
9715 }
9716
9717 /// Sets the value of [nobuild_files_regex][crate::model::Version::nobuild_files_regex].
9718 ///
9719 /// # Example
9720 /// ```ignore,no_run
9721 /// # use google_cloud_appengine_v1::model::Version;
9722 /// let x = Version::new().set_nobuild_files_regex("example");
9723 /// ```
9724 pub fn set_nobuild_files_regex<T: std::convert::Into<std::string::String>>(
9725 mut self,
9726 v: T,
9727 ) -> Self {
9728 self.nobuild_files_regex = v.into();
9729 self
9730 }
9731
9732 /// Sets the value of [deployment][crate::model::Version::deployment].
9733 ///
9734 /// # Example
9735 /// ```ignore,no_run
9736 /// # use google_cloud_appengine_v1::model::Version;
9737 /// use google_cloud_appengine_v1::model::Deployment;
9738 /// let x = Version::new().set_deployment(Deployment::default()/* use setters */);
9739 /// ```
9740 pub fn set_deployment<T>(mut self, v: T) -> Self
9741 where
9742 T: std::convert::Into<crate::model::Deployment>,
9743 {
9744 self.deployment = std::option::Option::Some(v.into());
9745 self
9746 }
9747
9748 /// Sets or clears the value of [deployment][crate::model::Version::deployment].
9749 ///
9750 /// # Example
9751 /// ```ignore,no_run
9752 /// # use google_cloud_appengine_v1::model::Version;
9753 /// use google_cloud_appengine_v1::model::Deployment;
9754 /// let x = Version::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
9755 /// let x = Version::new().set_or_clear_deployment(None::<Deployment>);
9756 /// ```
9757 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9758 where
9759 T: std::convert::Into<crate::model::Deployment>,
9760 {
9761 self.deployment = v.map(|x| x.into());
9762 self
9763 }
9764
9765 /// Sets the value of [version_url][crate::model::Version::version_url].
9766 ///
9767 /// # Example
9768 /// ```ignore,no_run
9769 /// # use google_cloud_appengine_v1::model::Version;
9770 /// let x = Version::new().set_version_url("example");
9771 /// ```
9772 pub fn set_version_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9773 self.version_url = v.into();
9774 self
9775 }
9776
9777 /// Sets the value of [endpoints_api_service][crate::model::Version::endpoints_api_service].
9778 ///
9779 /// # Example
9780 /// ```ignore,no_run
9781 /// # use google_cloud_appengine_v1::model::Version;
9782 /// use google_cloud_appengine_v1::model::EndpointsApiService;
9783 /// let x = Version::new().set_endpoints_api_service(EndpointsApiService::default()/* use setters */);
9784 /// ```
9785 pub fn set_endpoints_api_service<T>(mut self, v: T) -> Self
9786 where
9787 T: std::convert::Into<crate::model::EndpointsApiService>,
9788 {
9789 self.endpoints_api_service = std::option::Option::Some(v.into());
9790 self
9791 }
9792
9793 /// Sets or clears the value of [endpoints_api_service][crate::model::Version::endpoints_api_service].
9794 ///
9795 /// # Example
9796 /// ```ignore,no_run
9797 /// # use google_cloud_appengine_v1::model::Version;
9798 /// use google_cloud_appengine_v1::model::EndpointsApiService;
9799 /// let x = Version::new().set_or_clear_endpoints_api_service(Some(EndpointsApiService::default()/* use setters */));
9800 /// let x = Version::new().set_or_clear_endpoints_api_service(None::<EndpointsApiService>);
9801 /// ```
9802 pub fn set_or_clear_endpoints_api_service<T>(mut self, v: std::option::Option<T>) -> Self
9803 where
9804 T: std::convert::Into<crate::model::EndpointsApiService>,
9805 {
9806 self.endpoints_api_service = v.map(|x| x.into());
9807 self
9808 }
9809
9810 /// Sets the value of [entrypoint][crate::model::Version::entrypoint].
9811 ///
9812 /// # Example
9813 /// ```ignore,no_run
9814 /// # use google_cloud_appengine_v1::model::Version;
9815 /// use google_cloud_appengine_v1::model::Entrypoint;
9816 /// let x = Version::new().set_entrypoint(Entrypoint::default()/* use setters */);
9817 /// ```
9818 pub fn set_entrypoint<T>(mut self, v: T) -> Self
9819 where
9820 T: std::convert::Into<crate::model::Entrypoint>,
9821 {
9822 self.entrypoint = std::option::Option::Some(v.into());
9823 self
9824 }
9825
9826 /// Sets or clears the value of [entrypoint][crate::model::Version::entrypoint].
9827 ///
9828 /// # Example
9829 /// ```ignore,no_run
9830 /// # use google_cloud_appengine_v1::model::Version;
9831 /// use google_cloud_appengine_v1::model::Entrypoint;
9832 /// let x = Version::new().set_or_clear_entrypoint(Some(Entrypoint::default()/* use setters */));
9833 /// let x = Version::new().set_or_clear_entrypoint(None::<Entrypoint>);
9834 /// ```
9835 pub fn set_or_clear_entrypoint<T>(mut self, v: std::option::Option<T>) -> Self
9836 where
9837 T: std::convert::Into<crate::model::Entrypoint>,
9838 {
9839 self.entrypoint = v.map(|x| x.into());
9840 self
9841 }
9842
9843 /// Sets the value of [vpc_access_connector][crate::model::Version::vpc_access_connector].
9844 ///
9845 /// # Example
9846 /// ```ignore,no_run
9847 /// # use google_cloud_appengine_v1::model::Version;
9848 /// use google_cloud_appengine_v1::model::VpcAccessConnector;
9849 /// let x = Version::new().set_vpc_access_connector(VpcAccessConnector::default()/* use setters */);
9850 /// ```
9851 pub fn set_vpc_access_connector<T>(mut self, v: T) -> Self
9852 where
9853 T: std::convert::Into<crate::model::VpcAccessConnector>,
9854 {
9855 self.vpc_access_connector = std::option::Option::Some(v.into());
9856 self
9857 }
9858
9859 /// Sets or clears the value of [vpc_access_connector][crate::model::Version::vpc_access_connector].
9860 ///
9861 /// # Example
9862 /// ```ignore,no_run
9863 /// # use google_cloud_appengine_v1::model::Version;
9864 /// use google_cloud_appengine_v1::model::VpcAccessConnector;
9865 /// let x = Version::new().set_or_clear_vpc_access_connector(Some(VpcAccessConnector::default()/* use setters */));
9866 /// let x = Version::new().set_or_clear_vpc_access_connector(None::<VpcAccessConnector>);
9867 /// ```
9868 pub fn set_or_clear_vpc_access_connector<T>(mut self, v: std::option::Option<T>) -> Self
9869 where
9870 T: std::convert::Into<crate::model::VpcAccessConnector>,
9871 {
9872 self.vpc_access_connector = v.map(|x| x.into());
9873 self
9874 }
9875
9876 /// Sets the value of [scaling][crate::model::Version::scaling].
9877 ///
9878 /// Note that all the setters affecting `scaling` are mutually
9879 /// exclusive.
9880 ///
9881 /// # Example
9882 /// ```ignore,no_run
9883 /// # use google_cloud_appengine_v1::model::Version;
9884 /// use google_cloud_appengine_v1::model::AutomaticScaling;
9885 /// let x = Version::new().set_scaling(Some(
9886 /// google_cloud_appengine_v1::model::version::Scaling::AutomaticScaling(AutomaticScaling::default().into())));
9887 /// ```
9888 pub fn set_scaling<
9889 T: std::convert::Into<std::option::Option<crate::model::version::Scaling>>,
9890 >(
9891 mut self,
9892 v: T,
9893 ) -> Self {
9894 self.scaling = v.into();
9895 self
9896 }
9897
9898 /// The value of [scaling][crate::model::Version::scaling]
9899 /// if it holds a `AutomaticScaling`, `None` if the field is not set or
9900 /// holds a different branch.
9901 pub fn automatic_scaling(
9902 &self,
9903 ) -> std::option::Option<&std::boxed::Box<crate::model::AutomaticScaling>> {
9904 #[allow(unreachable_patterns)]
9905 self.scaling.as_ref().and_then(|v| match v {
9906 crate::model::version::Scaling::AutomaticScaling(v) => std::option::Option::Some(v),
9907 _ => std::option::Option::None,
9908 })
9909 }
9910
9911 /// Sets the value of [scaling][crate::model::Version::scaling]
9912 /// to hold a `AutomaticScaling`.
9913 ///
9914 /// Note that all the setters affecting `scaling` are
9915 /// mutually exclusive.
9916 ///
9917 /// # Example
9918 /// ```ignore,no_run
9919 /// # use google_cloud_appengine_v1::model::Version;
9920 /// use google_cloud_appengine_v1::model::AutomaticScaling;
9921 /// let x = Version::new().set_automatic_scaling(AutomaticScaling::default()/* use setters */);
9922 /// assert!(x.automatic_scaling().is_some());
9923 /// assert!(x.basic_scaling().is_none());
9924 /// assert!(x.manual_scaling().is_none());
9925 /// ```
9926 pub fn set_automatic_scaling<
9927 T: std::convert::Into<std::boxed::Box<crate::model::AutomaticScaling>>,
9928 >(
9929 mut self,
9930 v: T,
9931 ) -> Self {
9932 self.scaling =
9933 std::option::Option::Some(crate::model::version::Scaling::AutomaticScaling(v.into()));
9934 self
9935 }
9936
9937 /// The value of [scaling][crate::model::Version::scaling]
9938 /// if it holds a `BasicScaling`, `None` if the field is not set or
9939 /// holds a different branch.
9940 pub fn basic_scaling(
9941 &self,
9942 ) -> std::option::Option<&std::boxed::Box<crate::model::BasicScaling>> {
9943 #[allow(unreachable_patterns)]
9944 self.scaling.as_ref().and_then(|v| match v {
9945 crate::model::version::Scaling::BasicScaling(v) => std::option::Option::Some(v),
9946 _ => std::option::Option::None,
9947 })
9948 }
9949
9950 /// Sets the value of [scaling][crate::model::Version::scaling]
9951 /// to hold a `BasicScaling`.
9952 ///
9953 /// Note that all the setters affecting `scaling` are
9954 /// mutually exclusive.
9955 ///
9956 /// # Example
9957 /// ```ignore,no_run
9958 /// # use google_cloud_appengine_v1::model::Version;
9959 /// use google_cloud_appengine_v1::model::BasicScaling;
9960 /// let x = Version::new().set_basic_scaling(BasicScaling::default()/* use setters */);
9961 /// assert!(x.basic_scaling().is_some());
9962 /// assert!(x.automatic_scaling().is_none());
9963 /// assert!(x.manual_scaling().is_none());
9964 /// ```
9965 pub fn set_basic_scaling<T: std::convert::Into<std::boxed::Box<crate::model::BasicScaling>>>(
9966 mut self,
9967 v: T,
9968 ) -> Self {
9969 self.scaling =
9970 std::option::Option::Some(crate::model::version::Scaling::BasicScaling(v.into()));
9971 self
9972 }
9973
9974 /// The value of [scaling][crate::model::Version::scaling]
9975 /// if it holds a `ManualScaling`, `None` if the field is not set or
9976 /// holds a different branch.
9977 pub fn manual_scaling(
9978 &self,
9979 ) -> std::option::Option<&std::boxed::Box<crate::model::ManualScaling>> {
9980 #[allow(unreachable_patterns)]
9981 self.scaling.as_ref().and_then(|v| match v {
9982 crate::model::version::Scaling::ManualScaling(v) => std::option::Option::Some(v),
9983 _ => std::option::Option::None,
9984 })
9985 }
9986
9987 /// Sets the value of [scaling][crate::model::Version::scaling]
9988 /// to hold a `ManualScaling`.
9989 ///
9990 /// Note that all the setters affecting `scaling` are
9991 /// mutually exclusive.
9992 ///
9993 /// # Example
9994 /// ```ignore,no_run
9995 /// # use google_cloud_appengine_v1::model::Version;
9996 /// use google_cloud_appengine_v1::model::ManualScaling;
9997 /// let x = Version::new().set_manual_scaling(ManualScaling::default()/* use setters */);
9998 /// assert!(x.manual_scaling().is_some());
9999 /// assert!(x.automatic_scaling().is_none());
10000 /// assert!(x.basic_scaling().is_none());
10001 /// ```
10002 pub fn set_manual_scaling<
10003 T: std::convert::Into<std::boxed::Box<crate::model::ManualScaling>>,
10004 >(
10005 mut self,
10006 v: T,
10007 ) -> Self {
10008 self.scaling =
10009 std::option::Option::Some(crate::model::version::Scaling::ManualScaling(v.into()));
10010 self
10011 }
10012}
10013
10014impl wkt::message::Message for Version {
10015 fn typename() -> &'static str {
10016 "type.googleapis.com/google.appengine.v1.Version"
10017 }
10018}
10019
10020/// Defines additional types related to [Version].
10021pub mod version {
10022 #[allow(unused_imports)]
10023 use super::*;
10024
10025 /// Controls how instances are created, scaled, and reaped.
10026 ///
10027 /// Defaults to `AutomaticScaling`.
10028 #[derive(Clone, Debug, PartialEq)]
10029 #[non_exhaustive]
10030 pub enum Scaling {
10031 /// Automatic scaling is based on request rate, response latencies, and other
10032 /// application metrics. Instances are dynamically created and destroyed as
10033 /// needed in order to handle traffic.
10034 AutomaticScaling(std::boxed::Box<crate::model::AutomaticScaling>),
10035 /// A service with basic scaling will create an instance when the application
10036 /// receives a request. The instance will be turned down when the app becomes
10037 /// idle. Basic scaling is ideal for work that is intermittent or driven by
10038 /// user activity.
10039 BasicScaling(std::boxed::Box<crate::model::BasicScaling>),
10040 /// A service with manual scaling runs continuously, allowing you to perform
10041 /// complex initialization and rely on the state of its memory over time.
10042 /// Manually scaled versions are sometimes referred to as "backends".
10043 ManualScaling(std::boxed::Box<crate::model::ManualScaling>),
10044 }
10045}
10046
10047/// [Cloud Endpoints](https://cloud.google.com/endpoints) configuration.
10048/// The Endpoints API Service provides tooling for serving Open API and gRPC
10049/// endpoints via an NGINX proxy. Only valid for App Engine Flexible environment
10050/// deployments.
10051///
10052/// The fields here refer to the name and configuration ID of a "service"
10053/// resource in the [Service Management API](https://cloud.google.com/service-management/overview).
10054#[derive(Clone, Default, PartialEq)]
10055#[non_exhaustive]
10056pub struct EndpointsApiService {
10057 /// Endpoints service name which is the name of the "service" resource in the
10058 /// Service Management API. For example "myapi.endpoints.myproject.cloud.goog"
10059 pub name: std::string::String,
10060
10061 /// Endpoints service configuration ID as specified by the Service Management
10062 /// API. For example "2016-09-19r1".
10063 ///
10064 /// By default, the rollout strategy for Endpoints is `RolloutStrategy.FIXED`.
10065 /// This means that Endpoints starts up with a particular configuration ID.
10066 /// When a new configuration is rolled out, Endpoints must be given the new
10067 /// configuration ID. The `config_id` field is used to give the configuration
10068 /// ID and is required in this case.
10069 ///
10070 /// Endpoints also has a rollout strategy called `RolloutStrategy.MANAGED`.
10071 /// When using this, Endpoints fetches the latest configuration and does not
10072 /// need the configuration ID. In this case, `config_id` must be omitted.
10073 pub config_id: std::string::String,
10074
10075 /// Endpoints rollout strategy. If `FIXED`, `config_id` must be specified. If
10076 /// `MANAGED`, `config_id` must be omitted.
10077 pub rollout_strategy: crate::model::endpoints_api_service::RolloutStrategy,
10078
10079 /// Enable or disable trace sampling. By default, this is set to false for
10080 /// enabled.
10081 pub disable_trace_sampling: bool,
10082
10083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10084}
10085
10086impl EndpointsApiService {
10087 /// Creates a new default instance.
10088 pub fn new() -> Self {
10089 std::default::Default::default()
10090 }
10091
10092 /// Sets the value of [name][crate::model::EndpointsApiService::name].
10093 ///
10094 /// # Example
10095 /// ```ignore,no_run
10096 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10097 /// let x = EndpointsApiService::new().set_name("example");
10098 /// ```
10099 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10100 self.name = v.into();
10101 self
10102 }
10103
10104 /// Sets the value of [config_id][crate::model::EndpointsApiService::config_id].
10105 ///
10106 /// # Example
10107 /// ```ignore,no_run
10108 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10109 /// let x = EndpointsApiService::new().set_config_id("example");
10110 /// ```
10111 pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10112 self.config_id = v.into();
10113 self
10114 }
10115
10116 /// Sets the value of [rollout_strategy][crate::model::EndpointsApiService::rollout_strategy].
10117 ///
10118 /// # Example
10119 /// ```ignore,no_run
10120 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10121 /// use google_cloud_appengine_v1::model::endpoints_api_service::RolloutStrategy;
10122 /// let x0 = EndpointsApiService::new().set_rollout_strategy(RolloutStrategy::Fixed);
10123 /// let x1 = EndpointsApiService::new().set_rollout_strategy(RolloutStrategy::Managed);
10124 /// ```
10125 pub fn set_rollout_strategy<
10126 T: std::convert::Into<crate::model::endpoints_api_service::RolloutStrategy>,
10127 >(
10128 mut self,
10129 v: T,
10130 ) -> Self {
10131 self.rollout_strategy = v.into();
10132 self
10133 }
10134
10135 /// Sets the value of [disable_trace_sampling][crate::model::EndpointsApiService::disable_trace_sampling].
10136 ///
10137 /// # Example
10138 /// ```ignore,no_run
10139 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10140 /// let x = EndpointsApiService::new().set_disable_trace_sampling(true);
10141 /// ```
10142 pub fn set_disable_trace_sampling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10143 self.disable_trace_sampling = v.into();
10144 self
10145 }
10146}
10147
10148impl wkt::message::Message for EndpointsApiService {
10149 fn typename() -> &'static str {
10150 "type.googleapis.com/google.appengine.v1.EndpointsApiService"
10151 }
10152}
10153
10154/// Defines additional types related to [EndpointsApiService].
10155pub mod endpoints_api_service {
10156 #[allow(unused_imports)]
10157 use super::*;
10158
10159 /// Available rollout strategies.
10160 ///
10161 /// # Working with unknown values
10162 ///
10163 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10164 /// additional enum variants at any time. Adding new variants is not considered
10165 /// a breaking change. Applications should write their code in anticipation of:
10166 ///
10167 /// - New values appearing in future releases of the client library, **and**
10168 /// - New values received dynamically, without application changes.
10169 ///
10170 /// Please consult the [Working with enums] section in the user guide for some
10171 /// guidelines.
10172 ///
10173 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10174 #[derive(Clone, Debug, PartialEq)]
10175 #[non_exhaustive]
10176 pub enum RolloutStrategy {
10177 /// Not specified. Defaults to `FIXED`.
10178 UnspecifiedRolloutStrategy,
10179 /// Endpoints service configuration ID will be fixed to the configuration ID
10180 /// specified by `config_id`.
10181 Fixed,
10182 /// Endpoints service configuration ID will be updated with each rollout.
10183 Managed,
10184 /// If set, the enum was initialized with an unknown value.
10185 ///
10186 /// Applications can examine the value using [RolloutStrategy::value] or
10187 /// [RolloutStrategy::name].
10188 UnknownValue(rollout_strategy::UnknownValue),
10189 }
10190
10191 #[doc(hidden)]
10192 pub mod rollout_strategy {
10193 #[allow(unused_imports)]
10194 use super::*;
10195 #[derive(Clone, Debug, PartialEq)]
10196 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10197 }
10198
10199 impl RolloutStrategy {
10200 /// Gets the enum value.
10201 ///
10202 /// Returns `None` if the enum contains an unknown value deserialized from
10203 /// the string representation of enums.
10204 pub fn value(&self) -> std::option::Option<i32> {
10205 match self {
10206 Self::UnspecifiedRolloutStrategy => std::option::Option::Some(0),
10207 Self::Fixed => std::option::Option::Some(1),
10208 Self::Managed => std::option::Option::Some(2),
10209 Self::UnknownValue(u) => u.0.value(),
10210 }
10211 }
10212
10213 /// Gets the enum value as a string.
10214 ///
10215 /// Returns `None` if the enum contains an unknown value deserialized from
10216 /// the integer representation of enums.
10217 pub fn name(&self) -> std::option::Option<&str> {
10218 match self {
10219 Self::UnspecifiedRolloutStrategy => {
10220 std::option::Option::Some("UNSPECIFIED_ROLLOUT_STRATEGY")
10221 }
10222 Self::Fixed => std::option::Option::Some("FIXED"),
10223 Self::Managed => std::option::Option::Some("MANAGED"),
10224 Self::UnknownValue(u) => u.0.name(),
10225 }
10226 }
10227 }
10228
10229 impl std::default::Default for RolloutStrategy {
10230 fn default() -> Self {
10231 use std::convert::From;
10232 Self::from(0)
10233 }
10234 }
10235
10236 impl std::fmt::Display for RolloutStrategy {
10237 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10238 wkt::internal::display_enum(f, self.name(), self.value())
10239 }
10240 }
10241
10242 impl std::convert::From<i32> for RolloutStrategy {
10243 fn from(value: i32) -> Self {
10244 match value {
10245 0 => Self::UnspecifiedRolloutStrategy,
10246 1 => Self::Fixed,
10247 2 => Self::Managed,
10248 _ => Self::UnknownValue(rollout_strategy::UnknownValue(
10249 wkt::internal::UnknownEnumValue::Integer(value),
10250 )),
10251 }
10252 }
10253 }
10254
10255 impl std::convert::From<&str> for RolloutStrategy {
10256 fn from(value: &str) -> Self {
10257 use std::string::ToString;
10258 match value {
10259 "UNSPECIFIED_ROLLOUT_STRATEGY" => Self::UnspecifiedRolloutStrategy,
10260 "FIXED" => Self::Fixed,
10261 "MANAGED" => Self::Managed,
10262 _ => Self::UnknownValue(rollout_strategy::UnknownValue(
10263 wkt::internal::UnknownEnumValue::String(value.to_string()),
10264 )),
10265 }
10266 }
10267 }
10268
10269 impl serde::ser::Serialize for RolloutStrategy {
10270 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10271 where
10272 S: serde::Serializer,
10273 {
10274 match self {
10275 Self::UnspecifiedRolloutStrategy => serializer.serialize_i32(0),
10276 Self::Fixed => serializer.serialize_i32(1),
10277 Self::Managed => serializer.serialize_i32(2),
10278 Self::UnknownValue(u) => u.0.serialize(serializer),
10279 }
10280 }
10281 }
10282
10283 impl<'de> serde::de::Deserialize<'de> for RolloutStrategy {
10284 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10285 where
10286 D: serde::Deserializer<'de>,
10287 {
10288 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutStrategy>::new(
10289 ".google.appengine.v1.EndpointsApiService.RolloutStrategy",
10290 ))
10291 }
10292 }
10293}
10294
10295/// Automatic scaling is based on request rate, response latencies, and other
10296/// application metrics.
10297#[derive(Clone, Default, PartialEq)]
10298#[non_exhaustive]
10299pub struct AutomaticScaling {
10300 /// The time period that the
10301 /// [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
10302 /// should wait before it starts collecting information from a new instance.
10303 /// This prevents the autoscaler from collecting information when the instance
10304 /// is initializing, during which the collected usage would not be reliable.
10305 /// Only applicable in the App Engine flexible environment.
10306 pub cool_down_period: std::option::Option<wkt::Duration>,
10307
10308 /// Target scaling by CPU usage.
10309 pub cpu_utilization: std::option::Option<crate::model::CpuUtilization>,
10310
10311 /// Number of concurrent requests an automatic scaling instance can accept
10312 /// before the scheduler spawns a new instance.
10313 ///
10314 /// Defaults to a runtime-specific value.
10315 pub max_concurrent_requests: i32,
10316
10317 /// Maximum number of idle instances that should be maintained for this
10318 /// version.
10319 pub max_idle_instances: i32,
10320
10321 /// Maximum number of instances that should be started to handle requests for
10322 /// this version.
10323 pub max_total_instances: i32,
10324
10325 /// Maximum amount of time that a request should wait in the pending queue
10326 /// before starting a new instance to handle it.
10327 pub max_pending_latency: std::option::Option<wkt::Duration>,
10328
10329 /// Minimum number of idle instances that should be maintained for
10330 /// this version. Only applicable for the default version of a service.
10331 pub min_idle_instances: i32,
10332
10333 /// Minimum number of running instances that should be maintained for this
10334 /// version.
10335 pub min_total_instances: i32,
10336
10337 /// Minimum amount of time a request should wait in the pending queue before
10338 /// starting a new instance to handle it.
10339 pub min_pending_latency: std::option::Option<wkt::Duration>,
10340
10341 /// Target scaling by request utilization.
10342 pub request_utilization: std::option::Option<crate::model::RequestUtilization>,
10343
10344 /// Target scaling by disk usage.
10345 pub disk_utilization: std::option::Option<crate::model::DiskUtilization>,
10346
10347 /// Target scaling by network usage.
10348 pub network_utilization: std::option::Option<crate::model::NetworkUtilization>,
10349
10350 /// Scheduler settings for standard environment.
10351 pub standard_scheduler_settings: std::option::Option<crate::model::StandardSchedulerSettings>,
10352
10353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10354}
10355
10356impl AutomaticScaling {
10357 /// Creates a new default instance.
10358 pub fn new() -> Self {
10359 std::default::Default::default()
10360 }
10361
10362 /// Sets the value of [cool_down_period][crate::model::AutomaticScaling::cool_down_period].
10363 ///
10364 /// # Example
10365 /// ```ignore,no_run
10366 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10367 /// use wkt::Duration;
10368 /// let x = AutomaticScaling::new().set_cool_down_period(Duration::default()/* use setters */);
10369 /// ```
10370 pub fn set_cool_down_period<T>(mut self, v: T) -> Self
10371 where
10372 T: std::convert::Into<wkt::Duration>,
10373 {
10374 self.cool_down_period = std::option::Option::Some(v.into());
10375 self
10376 }
10377
10378 /// Sets or clears the value of [cool_down_period][crate::model::AutomaticScaling::cool_down_period].
10379 ///
10380 /// # Example
10381 /// ```ignore,no_run
10382 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10383 /// use wkt::Duration;
10384 /// let x = AutomaticScaling::new().set_or_clear_cool_down_period(Some(Duration::default()/* use setters */));
10385 /// let x = AutomaticScaling::new().set_or_clear_cool_down_period(None::<Duration>);
10386 /// ```
10387 pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
10388 where
10389 T: std::convert::Into<wkt::Duration>,
10390 {
10391 self.cool_down_period = v.map(|x| x.into());
10392 self
10393 }
10394
10395 /// Sets the value of [cpu_utilization][crate::model::AutomaticScaling::cpu_utilization].
10396 ///
10397 /// # Example
10398 /// ```ignore,no_run
10399 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10400 /// use google_cloud_appengine_v1::model::CpuUtilization;
10401 /// let x = AutomaticScaling::new().set_cpu_utilization(CpuUtilization::default()/* use setters */);
10402 /// ```
10403 pub fn set_cpu_utilization<T>(mut self, v: T) -> Self
10404 where
10405 T: std::convert::Into<crate::model::CpuUtilization>,
10406 {
10407 self.cpu_utilization = std::option::Option::Some(v.into());
10408 self
10409 }
10410
10411 /// Sets or clears the value of [cpu_utilization][crate::model::AutomaticScaling::cpu_utilization].
10412 ///
10413 /// # Example
10414 /// ```ignore,no_run
10415 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10416 /// use google_cloud_appengine_v1::model::CpuUtilization;
10417 /// let x = AutomaticScaling::new().set_or_clear_cpu_utilization(Some(CpuUtilization::default()/* use setters */));
10418 /// let x = AutomaticScaling::new().set_or_clear_cpu_utilization(None::<CpuUtilization>);
10419 /// ```
10420 pub fn set_or_clear_cpu_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10421 where
10422 T: std::convert::Into<crate::model::CpuUtilization>,
10423 {
10424 self.cpu_utilization = v.map(|x| x.into());
10425 self
10426 }
10427
10428 /// Sets the value of [max_concurrent_requests][crate::model::AutomaticScaling::max_concurrent_requests].
10429 ///
10430 /// # Example
10431 /// ```ignore,no_run
10432 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10433 /// let x = AutomaticScaling::new().set_max_concurrent_requests(42);
10434 /// ```
10435 pub fn set_max_concurrent_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10436 self.max_concurrent_requests = v.into();
10437 self
10438 }
10439
10440 /// Sets the value of [max_idle_instances][crate::model::AutomaticScaling::max_idle_instances].
10441 ///
10442 /// # Example
10443 /// ```ignore,no_run
10444 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10445 /// let x = AutomaticScaling::new().set_max_idle_instances(42);
10446 /// ```
10447 pub fn set_max_idle_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10448 self.max_idle_instances = v.into();
10449 self
10450 }
10451
10452 /// Sets the value of [max_total_instances][crate::model::AutomaticScaling::max_total_instances].
10453 ///
10454 /// # Example
10455 /// ```ignore,no_run
10456 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10457 /// let x = AutomaticScaling::new().set_max_total_instances(42);
10458 /// ```
10459 pub fn set_max_total_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10460 self.max_total_instances = v.into();
10461 self
10462 }
10463
10464 /// Sets the value of [max_pending_latency][crate::model::AutomaticScaling::max_pending_latency].
10465 ///
10466 /// # Example
10467 /// ```ignore,no_run
10468 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10469 /// use wkt::Duration;
10470 /// let x = AutomaticScaling::new().set_max_pending_latency(Duration::default()/* use setters */);
10471 /// ```
10472 pub fn set_max_pending_latency<T>(mut self, v: T) -> Self
10473 where
10474 T: std::convert::Into<wkt::Duration>,
10475 {
10476 self.max_pending_latency = std::option::Option::Some(v.into());
10477 self
10478 }
10479
10480 /// Sets or clears the value of [max_pending_latency][crate::model::AutomaticScaling::max_pending_latency].
10481 ///
10482 /// # Example
10483 /// ```ignore,no_run
10484 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10485 /// use wkt::Duration;
10486 /// let x = AutomaticScaling::new().set_or_clear_max_pending_latency(Some(Duration::default()/* use setters */));
10487 /// let x = AutomaticScaling::new().set_or_clear_max_pending_latency(None::<Duration>);
10488 /// ```
10489 pub fn set_or_clear_max_pending_latency<T>(mut self, v: std::option::Option<T>) -> Self
10490 where
10491 T: std::convert::Into<wkt::Duration>,
10492 {
10493 self.max_pending_latency = v.map(|x| x.into());
10494 self
10495 }
10496
10497 /// Sets the value of [min_idle_instances][crate::model::AutomaticScaling::min_idle_instances].
10498 ///
10499 /// # Example
10500 /// ```ignore,no_run
10501 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10502 /// let x = AutomaticScaling::new().set_min_idle_instances(42);
10503 /// ```
10504 pub fn set_min_idle_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10505 self.min_idle_instances = v.into();
10506 self
10507 }
10508
10509 /// Sets the value of [min_total_instances][crate::model::AutomaticScaling::min_total_instances].
10510 ///
10511 /// # Example
10512 /// ```ignore,no_run
10513 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10514 /// let x = AutomaticScaling::new().set_min_total_instances(42);
10515 /// ```
10516 pub fn set_min_total_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10517 self.min_total_instances = v.into();
10518 self
10519 }
10520
10521 /// Sets the value of [min_pending_latency][crate::model::AutomaticScaling::min_pending_latency].
10522 ///
10523 /// # Example
10524 /// ```ignore,no_run
10525 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10526 /// use wkt::Duration;
10527 /// let x = AutomaticScaling::new().set_min_pending_latency(Duration::default()/* use setters */);
10528 /// ```
10529 pub fn set_min_pending_latency<T>(mut self, v: T) -> Self
10530 where
10531 T: std::convert::Into<wkt::Duration>,
10532 {
10533 self.min_pending_latency = std::option::Option::Some(v.into());
10534 self
10535 }
10536
10537 /// Sets or clears the value of [min_pending_latency][crate::model::AutomaticScaling::min_pending_latency].
10538 ///
10539 /// # Example
10540 /// ```ignore,no_run
10541 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10542 /// use wkt::Duration;
10543 /// let x = AutomaticScaling::new().set_or_clear_min_pending_latency(Some(Duration::default()/* use setters */));
10544 /// let x = AutomaticScaling::new().set_or_clear_min_pending_latency(None::<Duration>);
10545 /// ```
10546 pub fn set_or_clear_min_pending_latency<T>(mut self, v: std::option::Option<T>) -> Self
10547 where
10548 T: std::convert::Into<wkt::Duration>,
10549 {
10550 self.min_pending_latency = v.map(|x| x.into());
10551 self
10552 }
10553
10554 /// Sets the value of [request_utilization][crate::model::AutomaticScaling::request_utilization].
10555 ///
10556 /// # Example
10557 /// ```ignore,no_run
10558 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10559 /// use google_cloud_appengine_v1::model::RequestUtilization;
10560 /// let x = AutomaticScaling::new().set_request_utilization(RequestUtilization::default()/* use setters */);
10561 /// ```
10562 pub fn set_request_utilization<T>(mut self, v: T) -> Self
10563 where
10564 T: std::convert::Into<crate::model::RequestUtilization>,
10565 {
10566 self.request_utilization = std::option::Option::Some(v.into());
10567 self
10568 }
10569
10570 /// Sets or clears the value of [request_utilization][crate::model::AutomaticScaling::request_utilization].
10571 ///
10572 /// # Example
10573 /// ```ignore,no_run
10574 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10575 /// use google_cloud_appengine_v1::model::RequestUtilization;
10576 /// let x = AutomaticScaling::new().set_or_clear_request_utilization(Some(RequestUtilization::default()/* use setters */));
10577 /// let x = AutomaticScaling::new().set_or_clear_request_utilization(None::<RequestUtilization>);
10578 /// ```
10579 pub fn set_or_clear_request_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10580 where
10581 T: std::convert::Into<crate::model::RequestUtilization>,
10582 {
10583 self.request_utilization = v.map(|x| x.into());
10584 self
10585 }
10586
10587 /// Sets the value of [disk_utilization][crate::model::AutomaticScaling::disk_utilization].
10588 ///
10589 /// # Example
10590 /// ```ignore,no_run
10591 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10592 /// use google_cloud_appengine_v1::model::DiskUtilization;
10593 /// let x = AutomaticScaling::new().set_disk_utilization(DiskUtilization::default()/* use setters */);
10594 /// ```
10595 pub fn set_disk_utilization<T>(mut self, v: T) -> Self
10596 where
10597 T: std::convert::Into<crate::model::DiskUtilization>,
10598 {
10599 self.disk_utilization = std::option::Option::Some(v.into());
10600 self
10601 }
10602
10603 /// Sets or clears the value of [disk_utilization][crate::model::AutomaticScaling::disk_utilization].
10604 ///
10605 /// # Example
10606 /// ```ignore,no_run
10607 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10608 /// use google_cloud_appengine_v1::model::DiskUtilization;
10609 /// let x = AutomaticScaling::new().set_or_clear_disk_utilization(Some(DiskUtilization::default()/* use setters */));
10610 /// let x = AutomaticScaling::new().set_or_clear_disk_utilization(None::<DiskUtilization>);
10611 /// ```
10612 pub fn set_or_clear_disk_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10613 where
10614 T: std::convert::Into<crate::model::DiskUtilization>,
10615 {
10616 self.disk_utilization = v.map(|x| x.into());
10617 self
10618 }
10619
10620 /// Sets the value of [network_utilization][crate::model::AutomaticScaling::network_utilization].
10621 ///
10622 /// # Example
10623 /// ```ignore,no_run
10624 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10625 /// use google_cloud_appengine_v1::model::NetworkUtilization;
10626 /// let x = AutomaticScaling::new().set_network_utilization(NetworkUtilization::default()/* use setters */);
10627 /// ```
10628 pub fn set_network_utilization<T>(mut self, v: T) -> Self
10629 where
10630 T: std::convert::Into<crate::model::NetworkUtilization>,
10631 {
10632 self.network_utilization = std::option::Option::Some(v.into());
10633 self
10634 }
10635
10636 /// Sets or clears the value of [network_utilization][crate::model::AutomaticScaling::network_utilization].
10637 ///
10638 /// # Example
10639 /// ```ignore,no_run
10640 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10641 /// use google_cloud_appengine_v1::model::NetworkUtilization;
10642 /// let x = AutomaticScaling::new().set_or_clear_network_utilization(Some(NetworkUtilization::default()/* use setters */));
10643 /// let x = AutomaticScaling::new().set_or_clear_network_utilization(None::<NetworkUtilization>);
10644 /// ```
10645 pub fn set_or_clear_network_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10646 where
10647 T: std::convert::Into<crate::model::NetworkUtilization>,
10648 {
10649 self.network_utilization = v.map(|x| x.into());
10650 self
10651 }
10652
10653 /// Sets the value of [standard_scheduler_settings][crate::model::AutomaticScaling::standard_scheduler_settings].
10654 ///
10655 /// # Example
10656 /// ```ignore,no_run
10657 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10658 /// use google_cloud_appengine_v1::model::StandardSchedulerSettings;
10659 /// let x = AutomaticScaling::new().set_standard_scheduler_settings(StandardSchedulerSettings::default()/* use setters */);
10660 /// ```
10661 pub fn set_standard_scheduler_settings<T>(mut self, v: T) -> Self
10662 where
10663 T: std::convert::Into<crate::model::StandardSchedulerSettings>,
10664 {
10665 self.standard_scheduler_settings = std::option::Option::Some(v.into());
10666 self
10667 }
10668
10669 /// Sets or clears the value of [standard_scheduler_settings][crate::model::AutomaticScaling::standard_scheduler_settings].
10670 ///
10671 /// # Example
10672 /// ```ignore,no_run
10673 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10674 /// use google_cloud_appengine_v1::model::StandardSchedulerSettings;
10675 /// let x = AutomaticScaling::new().set_or_clear_standard_scheduler_settings(Some(StandardSchedulerSettings::default()/* use setters */));
10676 /// let x = AutomaticScaling::new().set_or_clear_standard_scheduler_settings(None::<StandardSchedulerSettings>);
10677 /// ```
10678 pub fn set_or_clear_standard_scheduler_settings<T>(mut self, v: std::option::Option<T>) -> Self
10679 where
10680 T: std::convert::Into<crate::model::StandardSchedulerSettings>,
10681 {
10682 self.standard_scheduler_settings = v.map(|x| x.into());
10683 self
10684 }
10685}
10686
10687impl wkt::message::Message for AutomaticScaling {
10688 fn typename() -> &'static str {
10689 "type.googleapis.com/google.appengine.v1.AutomaticScaling"
10690 }
10691}
10692
10693/// A service with basic scaling will create an instance when the application
10694/// receives a request. The instance will be turned down when the app becomes
10695/// idle. Basic scaling is ideal for work that is intermittent or driven by
10696/// user activity.
10697#[derive(Clone, Default, PartialEq)]
10698#[non_exhaustive]
10699pub struct BasicScaling {
10700 /// Duration of time after the last request that an instance must wait before
10701 /// the instance is shut down.
10702 pub idle_timeout: std::option::Option<wkt::Duration>,
10703
10704 /// Maximum number of instances to create for this version.
10705 pub max_instances: i32,
10706
10707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10708}
10709
10710impl BasicScaling {
10711 /// Creates a new default instance.
10712 pub fn new() -> Self {
10713 std::default::Default::default()
10714 }
10715
10716 /// Sets the value of [idle_timeout][crate::model::BasicScaling::idle_timeout].
10717 ///
10718 /// # Example
10719 /// ```ignore,no_run
10720 /// # use google_cloud_appengine_v1::model::BasicScaling;
10721 /// use wkt::Duration;
10722 /// let x = BasicScaling::new().set_idle_timeout(Duration::default()/* use setters */);
10723 /// ```
10724 pub fn set_idle_timeout<T>(mut self, v: T) -> Self
10725 where
10726 T: std::convert::Into<wkt::Duration>,
10727 {
10728 self.idle_timeout = std::option::Option::Some(v.into());
10729 self
10730 }
10731
10732 /// Sets or clears the value of [idle_timeout][crate::model::BasicScaling::idle_timeout].
10733 ///
10734 /// # Example
10735 /// ```ignore,no_run
10736 /// # use google_cloud_appengine_v1::model::BasicScaling;
10737 /// use wkt::Duration;
10738 /// let x = BasicScaling::new().set_or_clear_idle_timeout(Some(Duration::default()/* use setters */));
10739 /// let x = BasicScaling::new().set_or_clear_idle_timeout(None::<Duration>);
10740 /// ```
10741 pub fn set_or_clear_idle_timeout<T>(mut self, v: std::option::Option<T>) -> Self
10742 where
10743 T: std::convert::Into<wkt::Duration>,
10744 {
10745 self.idle_timeout = v.map(|x| x.into());
10746 self
10747 }
10748
10749 /// Sets the value of [max_instances][crate::model::BasicScaling::max_instances].
10750 ///
10751 /// # Example
10752 /// ```ignore,no_run
10753 /// # use google_cloud_appengine_v1::model::BasicScaling;
10754 /// let x = BasicScaling::new().set_max_instances(42);
10755 /// ```
10756 pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10757 self.max_instances = v.into();
10758 self
10759 }
10760}
10761
10762impl wkt::message::Message for BasicScaling {
10763 fn typename() -> &'static str {
10764 "type.googleapis.com/google.appengine.v1.BasicScaling"
10765 }
10766}
10767
10768/// A service with manual scaling runs continuously, allowing you to perform
10769/// complex initialization and rely on the state of its memory over time.
10770#[derive(Clone, Default, PartialEq)]
10771#[non_exhaustive]
10772pub struct ManualScaling {
10773 /// Number of instances to assign to the service at the start. This number
10774 /// can later be altered by using the
10775 /// [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions)
10776 /// `set_num_instances()` function.
10777 pub instances: i32,
10778
10779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10780}
10781
10782impl ManualScaling {
10783 /// Creates a new default instance.
10784 pub fn new() -> Self {
10785 std::default::Default::default()
10786 }
10787
10788 /// Sets the value of [instances][crate::model::ManualScaling::instances].
10789 ///
10790 /// # Example
10791 /// ```ignore,no_run
10792 /// # use google_cloud_appengine_v1::model::ManualScaling;
10793 /// let x = ManualScaling::new().set_instances(42);
10794 /// ```
10795 pub fn set_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10796 self.instances = v.into();
10797 self
10798 }
10799}
10800
10801impl wkt::message::Message for ManualScaling {
10802 fn typename() -> &'static str {
10803 "type.googleapis.com/google.appengine.v1.ManualScaling"
10804 }
10805}
10806
10807/// Target scaling by CPU usage.
10808#[derive(Clone, Default, PartialEq)]
10809#[non_exhaustive]
10810pub struct CpuUtilization {
10811 /// Period of time over which CPU utilization is calculated.
10812 pub aggregation_window_length: std::option::Option<wkt::Duration>,
10813
10814 /// Target CPU utilization ratio to maintain when scaling. Must be between 0
10815 /// and 1.
10816 pub target_utilization: f64,
10817
10818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10819}
10820
10821impl CpuUtilization {
10822 /// Creates a new default instance.
10823 pub fn new() -> Self {
10824 std::default::Default::default()
10825 }
10826
10827 /// Sets the value of [aggregation_window_length][crate::model::CpuUtilization::aggregation_window_length].
10828 ///
10829 /// # Example
10830 /// ```ignore,no_run
10831 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10832 /// use wkt::Duration;
10833 /// let x = CpuUtilization::new().set_aggregation_window_length(Duration::default()/* use setters */);
10834 /// ```
10835 pub fn set_aggregation_window_length<T>(mut self, v: T) -> Self
10836 where
10837 T: std::convert::Into<wkt::Duration>,
10838 {
10839 self.aggregation_window_length = std::option::Option::Some(v.into());
10840 self
10841 }
10842
10843 /// Sets or clears the value of [aggregation_window_length][crate::model::CpuUtilization::aggregation_window_length].
10844 ///
10845 /// # Example
10846 /// ```ignore,no_run
10847 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10848 /// use wkt::Duration;
10849 /// let x = CpuUtilization::new().set_or_clear_aggregation_window_length(Some(Duration::default()/* use setters */));
10850 /// let x = CpuUtilization::new().set_or_clear_aggregation_window_length(None::<Duration>);
10851 /// ```
10852 pub fn set_or_clear_aggregation_window_length<T>(mut self, v: std::option::Option<T>) -> Self
10853 where
10854 T: std::convert::Into<wkt::Duration>,
10855 {
10856 self.aggregation_window_length = v.map(|x| x.into());
10857 self
10858 }
10859
10860 /// Sets the value of [target_utilization][crate::model::CpuUtilization::target_utilization].
10861 ///
10862 /// # Example
10863 /// ```ignore,no_run
10864 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10865 /// let x = CpuUtilization::new().set_target_utilization(42.0);
10866 /// ```
10867 pub fn set_target_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10868 self.target_utilization = v.into();
10869 self
10870 }
10871}
10872
10873impl wkt::message::Message for CpuUtilization {
10874 fn typename() -> &'static str {
10875 "type.googleapis.com/google.appengine.v1.CpuUtilization"
10876 }
10877}
10878
10879/// Target scaling by request utilization.
10880/// Only applicable in the App Engine flexible environment.
10881#[derive(Clone, Default, PartialEq)]
10882#[non_exhaustive]
10883pub struct RequestUtilization {
10884 /// Target requests per second.
10885 pub target_request_count_per_second: i32,
10886
10887 /// Target number of concurrent requests.
10888 pub target_concurrent_requests: i32,
10889
10890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10891}
10892
10893impl RequestUtilization {
10894 /// Creates a new default instance.
10895 pub fn new() -> Self {
10896 std::default::Default::default()
10897 }
10898
10899 /// Sets the value of [target_request_count_per_second][crate::model::RequestUtilization::target_request_count_per_second].
10900 ///
10901 /// # Example
10902 /// ```ignore,no_run
10903 /// # use google_cloud_appengine_v1::model::RequestUtilization;
10904 /// let x = RequestUtilization::new().set_target_request_count_per_second(42);
10905 /// ```
10906 pub fn set_target_request_count_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10907 self.target_request_count_per_second = v.into();
10908 self
10909 }
10910
10911 /// Sets the value of [target_concurrent_requests][crate::model::RequestUtilization::target_concurrent_requests].
10912 ///
10913 /// # Example
10914 /// ```ignore,no_run
10915 /// # use google_cloud_appengine_v1::model::RequestUtilization;
10916 /// let x = RequestUtilization::new().set_target_concurrent_requests(42);
10917 /// ```
10918 pub fn set_target_concurrent_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10919 self.target_concurrent_requests = v.into();
10920 self
10921 }
10922}
10923
10924impl wkt::message::Message for RequestUtilization {
10925 fn typename() -> &'static str {
10926 "type.googleapis.com/google.appengine.v1.RequestUtilization"
10927 }
10928}
10929
10930/// Target scaling by disk usage.
10931/// Only applicable in the App Engine flexible environment.
10932#[derive(Clone, Default, PartialEq)]
10933#[non_exhaustive]
10934pub struct DiskUtilization {
10935 /// Target bytes written per second.
10936 pub target_write_bytes_per_second: i32,
10937
10938 /// Target ops written per second.
10939 pub target_write_ops_per_second: i32,
10940
10941 /// Target bytes read per second.
10942 pub target_read_bytes_per_second: i32,
10943
10944 /// Target ops read per seconds.
10945 pub target_read_ops_per_second: i32,
10946
10947 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10948}
10949
10950impl DiskUtilization {
10951 /// Creates a new default instance.
10952 pub fn new() -> Self {
10953 std::default::Default::default()
10954 }
10955
10956 /// Sets the value of [target_write_bytes_per_second][crate::model::DiskUtilization::target_write_bytes_per_second].
10957 ///
10958 /// # Example
10959 /// ```ignore,no_run
10960 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10961 /// let x = DiskUtilization::new().set_target_write_bytes_per_second(42);
10962 /// ```
10963 pub fn set_target_write_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10964 self.target_write_bytes_per_second = v.into();
10965 self
10966 }
10967
10968 /// Sets the value of [target_write_ops_per_second][crate::model::DiskUtilization::target_write_ops_per_second].
10969 ///
10970 /// # Example
10971 /// ```ignore,no_run
10972 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10973 /// let x = DiskUtilization::new().set_target_write_ops_per_second(42);
10974 /// ```
10975 pub fn set_target_write_ops_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10976 self.target_write_ops_per_second = v.into();
10977 self
10978 }
10979
10980 /// Sets the value of [target_read_bytes_per_second][crate::model::DiskUtilization::target_read_bytes_per_second].
10981 ///
10982 /// # Example
10983 /// ```ignore,no_run
10984 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10985 /// let x = DiskUtilization::new().set_target_read_bytes_per_second(42);
10986 /// ```
10987 pub fn set_target_read_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10988 self.target_read_bytes_per_second = v.into();
10989 self
10990 }
10991
10992 /// Sets the value of [target_read_ops_per_second][crate::model::DiskUtilization::target_read_ops_per_second].
10993 ///
10994 /// # Example
10995 /// ```ignore,no_run
10996 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10997 /// let x = DiskUtilization::new().set_target_read_ops_per_second(42);
10998 /// ```
10999 pub fn set_target_read_ops_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11000 self.target_read_ops_per_second = v.into();
11001 self
11002 }
11003}
11004
11005impl wkt::message::Message for DiskUtilization {
11006 fn typename() -> &'static str {
11007 "type.googleapis.com/google.appengine.v1.DiskUtilization"
11008 }
11009}
11010
11011/// Target scaling by network usage.
11012/// Only applicable in the App Engine flexible environment.
11013#[derive(Clone, Default, PartialEq)]
11014#[non_exhaustive]
11015pub struct NetworkUtilization {
11016 /// Target bytes sent per second.
11017 pub target_sent_bytes_per_second: i32,
11018
11019 /// Target packets sent per second.
11020 pub target_sent_packets_per_second: i32,
11021
11022 /// Target bytes received per second.
11023 pub target_received_bytes_per_second: i32,
11024
11025 /// Target packets received per second.
11026 pub target_received_packets_per_second: i32,
11027
11028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11029}
11030
11031impl NetworkUtilization {
11032 /// Creates a new default instance.
11033 pub fn new() -> Self {
11034 std::default::Default::default()
11035 }
11036
11037 /// Sets the value of [target_sent_bytes_per_second][crate::model::NetworkUtilization::target_sent_bytes_per_second].
11038 ///
11039 /// # Example
11040 /// ```ignore,no_run
11041 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
11042 /// let x = NetworkUtilization::new().set_target_sent_bytes_per_second(42);
11043 /// ```
11044 pub fn set_target_sent_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11045 self.target_sent_bytes_per_second = v.into();
11046 self
11047 }
11048
11049 /// Sets the value of [target_sent_packets_per_second][crate::model::NetworkUtilization::target_sent_packets_per_second].
11050 ///
11051 /// # Example
11052 /// ```ignore,no_run
11053 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
11054 /// let x = NetworkUtilization::new().set_target_sent_packets_per_second(42);
11055 /// ```
11056 pub fn set_target_sent_packets_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11057 self.target_sent_packets_per_second = v.into();
11058 self
11059 }
11060
11061 /// Sets the value of [target_received_bytes_per_second][crate::model::NetworkUtilization::target_received_bytes_per_second].
11062 ///
11063 /// # Example
11064 /// ```ignore,no_run
11065 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
11066 /// let x = NetworkUtilization::new().set_target_received_bytes_per_second(42);
11067 /// ```
11068 pub fn set_target_received_bytes_per_second<T: std::convert::Into<i32>>(
11069 mut self,
11070 v: T,
11071 ) -> Self {
11072 self.target_received_bytes_per_second = v.into();
11073 self
11074 }
11075
11076 /// Sets the value of [target_received_packets_per_second][crate::model::NetworkUtilization::target_received_packets_per_second].
11077 ///
11078 /// # Example
11079 /// ```ignore,no_run
11080 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
11081 /// let x = NetworkUtilization::new().set_target_received_packets_per_second(42);
11082 /// ```
11083 pub fn set_target_received_packets_per_second<T: std::convert::Into<i32>>(
11084 mut self,
11085 v: T,
11086 ) -> Self {
11087 self.target_received_packets_per_second = v.into();
11088 self
11089 }
11090}
11091
11092impl wkt::message::Message for NetworkUtilization {
11093 fn typename() -> &'static str {
11094 "type.googleapis.com/google.appengine.v1.NetworkUtilization"
11095 }
11096}
11097
11098/// Scheduler settings for standard environment.
11099#[derive(Clone, Default, PartialEq)]
11100#[non_exhaustive]
11101pub struct StandardSchedulerSettings {
11102 /// Target CPU utilization ratio to maintain when scaling.
11103 pub target_cpu_utilization: f64,
11104
11105 /// Target throughput utilization ratio to maintain when scaling
11106 pub target_throughput_utilization: f64,
11107
11108 /// Minimum number of instances to run for this version. Set to zero to disable
11109 /// `min_instances` configuration.
11110 pub min_instances: i32,
11111
11112 /// Maximum number of instances to run for this version. Set to zero to disable
11113 /// `max_instances` configuration.
11114 pub max_instances: i32,
11115
11116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11117}
11118
11119impl StandardSchedulerSettings {
11120 /// Creates a new default instance.
11121 pub fn new() -> Self {
11122 std::default::Default::default()
11123 }
11124
11125 /// Sets the value of [target_cpu_utilization][crate::model::StandardSchedulerSettings::target_cpu_utilization].
11126 ///
11127 /// # Example
11128 /// ```ignore,no_run
11129 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11130 /// let x = StandardSchedulerSettings::new().set_target_cpu_utilization(42.0);
11131 /// ```
11132 pub fn set_target_cpu_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11133 self.target_cpu_utilization = v.into();
11134 self
11135 }
11136
11137 /// Sets the value of [target_throughput_utilization][crate::model::StandardSchedulerSettings::target_throughput_utilization].
11138 ///
11139 /// # Example
11140 /// ```ignore,no_run
11141 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11142 /// let x = StandardSchedulerSettings::new().set_target_throughput_utilization(42.0);
11143 /// ```
11144 pub fn set_target_throughput_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11145 self.target_throughput_utilization = v.into();
11146 self
11147 }
11148
11149 /// Sets the value of [min_instances][crate::model::StandardSchedulerSettings::min_instances].
11150 ///
11151 /// # Example
11152 /// ```ignore,no_run
11153 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11154 /// let x = StandardSchedulerSettings::new().set_min_instances(42);
11155 /// ```
11156 pub fn set_min_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11157 self.min_instances = v.into();
11158 self
11159 }
11160
11161 /// Sets the value of [max_instances][crate::model::StandardSchedulerSettings::max_instances].
11162 ///
11163 /// # Example
11164 /// ```ignore,no_run
11165 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11166 /// let x = StandardSchedulerSettings::new().set_max_instances(42);
11167 /// ```
11168 pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11169 self.max_instances = v.into();
11170 self
11171 }
11172}
11173
11174impl wkt::message::Message for StandardSchedulerSettings {
11175 fn typename() -> &'static str {
11176 "type.googleapis.com/google.appengine.v1.StandardSchedulerSettings"
11177 }
11178}
11179
11180/// Extra network settings.
11181/// Only applicable in the App Engine flexible environment.
11182#[derive(Clone, Default, PartialEq)]
11183#[non_exhaustive]
11184pub struct Network {
11185 /// List of ports, or port pairs, to forward from the virtual machine to the
11186 /// application container.
11187 /// Only applicable in the App Engine flexible environment.
11188 pub forwarded_ports: std::vec::Vec<std::string::String>,
11189
11190 /// Tag to apply to the instance during creation.
11191 /// Only applicable in the App Engine flexible environment.
11192 pub instance_tag: std::string::String,
11193
11194 /// Google Compute Engine network where the virtual machines are created.
11195 /// Specify the short name, not the resource path.
11196 ///
11197 /// Defaults to `default`.
11198 pub name: std::string::String,
11199
11200 /// Google Cloud Platform sub-network where the virtual machines are created.
11201 /// Specify the short name, not the resource path.
11202 ///
11203 /// If a subnetwork name is specified, a network name will also be required
11204 /// unless it is for the default network.
11205 ///
11206 /// * If the network that the instance is being created in is a Legacy network,
11207 /// then the IP address is allocated from the IPv4Range.
11208 /// * If the network that the instance is being created in is an auto Subnet
11209 /// Mode Network, then only network name should be specified (not the
11210 /// subnetwork_name) and the IP address is created from the IPCidrRange of the
11211 /// subnetwork that exists in that zone for that network.
11212 /// * If the network that the instance is being created in is a custom Subnet
11213 /// Mode Network, then the subnetwork_name must be specified and the
11214 /// IP address is created from the IPCidrRange of the subnetwork.
11215 ///
11216 /// If specified, the subnetwork must exist in the same region as the
11217 /// App Engine flexible environment application.
11218 pub subnetwork_name: std::string::String,
11219
11220 /// Enable session affinity.
11221 /// Only applicable in the App Engine flexible environment.
11222 pub session_affinity: bool,
11223
11224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11225}
11226
11227impl Network {
11228 /// Creates a new default instance.
11229 pub fn new() -> Self {
11230 std::default::Default::default()
11231 }
11232
11233 /// Sets the value of [forwarded_ports][crate::model::Network::forwarded_ports].
11234 ///
11235 /// # Example
11236 /// ```ignore,no_run
11237 /// # use google_cloud_appengine_v1::model::Network;
11238 /// let x = Network::new().set_forwarded_ports(["a", "b", "c"]);
11239 /// ```
11240 pub fn set_forwarded_ports<T, V>(mut self, v: T) -> Self
11241 where
11242 T: std::iter::IntoIterator<Item = V>,
11243 V: std::convert::Into<std::string::String>,
11244 {
11245 use std::iter::Iterator;
11246 self.forwarded_ports = v.into_iter().map(|i| i.into()).collect();
11247 self
11248 }
11249
11250 /// Sets the value of [instance_tag][crate::model::Network::instance_tag].
11251 ///
11252 /// # Example
11253 /// ```ignore,no_run
11254 /// # use google_cloud_appengine_v1::model::Network;
11255 /// let x = Network::new().set_instance_tag("example");
11256 /// ```
11257 pub fn set_instance_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11258 self.instance_tag = v.into();
11259 self
11260 }
11261
11262 /// Sets the value of [name][crate::model::Network::name].
11263 ///
11264 /// # Example
11265 /// ```ignore,no_run
11266 /// # use google_cloud_appengine_v1::model::Network;
11267 /// let x = Network::new().set_name("example");
11268 /// ```
11269 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11270 self.name = v.into();
11271 self
11272 }
11273
11274 /// Sets the value of [subnetwork_name][crate::model::Network::subnetwork_name].
11275 ///
11276 /// # Example
11277 /// ```ignore,no_run
11278 /// # use google_cloud_appengine_v1::model::Network;
11279 /// let x = Network::new().set_subnetwork_name("example");
11280 /// ```
11281 pub fn set_subnetwork_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11282 self.subnetwork_name = v.into();
11283 self
11284 }
11285
11286 /// Sets the value of [session_affinity][crate::model::Network::session_affinity].
11287 ///
11288 /// # Example
11289 /// ```ignore,no_run
11290 /// # use google_cloud_appengine_v1::model::Network;
11291 /// let x = Network::new().set_session_affinity(true);
11292 /// ```
11293 pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11294 self.session_affinity = v.into();
11295 self
11296 }
11297}
11298
11299impl wkt::message::Message for Network {
11300 fn typename() -> &'static str {
11301 "type.googleapis.com/google.appengine.v1.Network"
11302 }
11303}
11304
11305/// Volumes mounted within the app container.
11306/// Only applicable in the App Engine flexible environment.
11307#[derive(Clone, Default, PartialEq)]
11308#[non_exhaustive]
11309pub struct Volume {
11310 /// Unique name for the volume.
11311 pub name: std::string::String,
11312
11313 /// Underlying volume type, e.g. 'tmpfs'.
11314 pub volume_type: std::string::String,
11315
11316 /// Volume size in gigabytes.
11317 pub size_gb: f64,
11318
11319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11320}
11321
11322impl Volume {
11323 /// Creates a new default instance.
11324 pub fn new() -> Self {
11325 std::default::Default::default()
11326 }
11327
11328 /// Sets the value of [name][crate::model::Volume::name].
11329 ///
11330 /// # Example
11331 /// ```ignore,no_run
11332 /// # use google_cloud_appengine_v1::model::Volume;
11333 /// let x = Volume::new().set_name("example");
11334 /// ```
11335 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11336 self.name = v.into();
11337 self
11338 }
11339
11340 /// Sets the value of [volume_type][crate::model::Volume::volume_type].
11341 ///
11342 /// # Example
11343 /// ```ignore,no_run
11344 /// # use google_cloud_appengine_v1::model::Volume;
11345 /// let x = Volume::new().set_volume_type("example");
11346 /// ```
11347 pub fn set_volume_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11348 self.volume_type = v.into();
11349 self
11350 }
11351
11352 /// Sets the value of [size_gb][crate::model::Volume::size_gb].
11353 ///
11354 /// # Example
11355 /// ```ignore,no_run
11356 /// # use google_cloud_appengine_v1::model::Volume;
11357 /// let x = Volume::new().set_size_gb(42.0);
11358 /// ```
11359 pub fn set_size_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11360 self.size_gb = v.into();
11361 self
11362 }
11363}
11364
11365impl wkt::message::Message for Volume {
11366 fn typename() -> &'static str {
11367 "type.googleapis.com/google.appengine.v1.Volume"
11368 }
11369}
11370
11371/// Machine resources for a version.
11372#[derive(Clone, Default, PartialEq)]
11373#[non_exhaustive]
11374pub struct Resources {
11375 /// Number of CPU cores needed.
11376 pub cpu: f64,
11377
11378 /// Disk size (GB) needed.
11379 pub disk_gb: f64,
11380
11381 /// Memory (GB) needed.
11382 pub memory_gb: f64,
11383
11384 /// User specified volumes.
11385 pub volumes: std::vec::Vec<crate::model::Volume>,
11386
11387 /// The name of the encryption key that is stored in Google Cloud KMS.
11388 /// Only should be used by Cloud Composer to encrypt the vm disk
11389 pub kms_key_reference: std::string::String,
11390
11391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11392}
11393
11394impl Resources {
11395 /// Creates a new default instance.
11396 pub fn new() -> Self {
11397 std::default::Default::default()
11398 }
11399
11400 /// Sets the value of [cpu][crate::model::Resources::cpu].
11401 ///
11402 /// # Example
11403 /// ```ignore,no_run
11404 /// # use google_cloud_appengine_v1::model::Resources;
11405 /// let x = Resources::new().set_cpu(42.0);
11406 /// ```
11407 pub fn set_cpu<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11408 self.cpu = v.into();
11409 self
11410 }
11411
11412 /// Sets the value of [disk_gb][crate::model::Resources::disk_gb].
11413 ///
11414 /// # Example
11415 /// ```ignore,no_run
11416 /// # use google_cloud_appengine_v1::model::Resources;
11417 /// let x = Resources::new().set_disk_gb(42.0);
11418 /// ```
11419 pub fn set_disk_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11420 self.disk_gb = v.into();
11421 self
11422 }
11423
11424 /// Sets the value of [memory_gb][crate::model::Resources::memory_gb].
11425 ///
11426 /// # Example
11427 /// ```ignore,no_run
11428 /// # use google_cloud_appengine_v1::model::Resources;
11429 /// let x = Resources::new().set_memory_gb(42.0);
11430 /// ```
11431 pub fn set_memory_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11432 self.memory_gb = v.into();
11433 self
11434 }
11435
11436 /// Sets the value of [volumes][crate::model::Resources::volumes].
11437 ///
11438 /// # Example
11439 /// ```ignore,no_run
11440 /// # use google_cloud_appengine_v1::model::Resources;
11441 /// use google_cloud_appengine_v1::model::Volume;
11442 /// let x = Resources::new()
11443 /// .set_volumes([
11444 /// Volume::default()/* use setters */,
11445 /// Volume::default()/* use (different) setters */,
11446 /// ]);
11447 /// ```
11448 pub fn set_volumes<T, V>(mut self, v: T) -> Self
11449 where
11450 T: std::iter::IntoIterator<Item = V>,
11451 V: std::convert::Into<crate::model::Volume>,
11452 {
11453 use std::iter::Iterator;
11454 self.volumes = v.into_iter().map(|i| i.into()).collect();
11455 self
11456 }
11457
11458 /// Sets the value of [kms_key_reference][crate::model::Resources::kms_key_reference].
11459 ///
11460 /// # Example
11461 /// ```ignore,no_run
11462 /// # use google_cloud_appengine_v1::model::Resources;
11463 /// let x = Resources::new().set_kms_key_reference("example");
11464 /// ```
11465 pub fn set_kms_key_reference<T: std::convert::Into<std::string::String>>(
11466 mut self,
11467 v: T,
11468 ) -> Self {
11469 self.kms_key_reference = v.into();
11470 self
11471 }
11472}
11473
11474impl wkt::message::Message for Resources {
11475 fn typename() -> &'static str {
11476 "type.googleapis.com/google.appengine.v1.Resources"
11477 }
11478}
11479
11480/// VPC access connector specification.
11481#[derive(Clone, Default, PartialEq)]
11482#[non_exhaustive]
11483pub struct VpcAccessConnector {
11484 /// Full Serverless VPC Access Connector name e.g.
11485 /// /projects/my-project/locations/us-central1/connectors/c1.
11486 pub name: std::string::String,
11487
11488 /// The egress setting for the connector, controlling what traffic is diverted
11489 /// through it.
11490 pub egress_setting: crate::model::vpc_access_connector::EgressSetting,
11491
11492 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11493}
11494
11495impl VpcAccessConnector {
11496 /// Creates a new default instance.
11497 pub fn new() -> Self {
11498 std::default::Default::default()
11499 }
11500
11501 /// Sets the value of [name][crate::model::VpcAccessConnector::name].
11502 ///
11503 /// # Example
11504 /// ```ignore,no_run
11505 /// # use google_cloud_appengine_v1::model::VpcAccessConnector;
11506 /// let x = VpcAccessConnector::new().set_name("example");
11507 /// ```
11508 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11509 self.name = v.into();
11510 self
11511 }
11512
11513 /// Sets the value of [egress_setting][crate::model::VpcAccessConnector::egress_setting].
11514 ///
11515 /// # Example
11516 /// ```ignore,no_run
11517 /// # use google_cloud_appengine_v1::model::VpcAccessConnector;
11518 /// use google_cloud_appengine_v1::model::vpc_access_connector::EgressSetting;
11519 /// let x0 = VpcAccessConnector::new().set_egress_setting(EgressSetting::AllTraffic);
11520 /// let x1 = VpcAccessConnector::new().set_egress_setting(EgressSetting::PrivateIpRanges);
11521 /// ```
11522 pub fn set_egress_setting<
11523 T: std::convert::Into<crate::model::vpc_access_connector::EgressSetting>,
11524 >(
11525 mut self,
11526 v: T,
11527 ) -> Self {
11528 self.egress_setting = v.into();
11529 self
11530 }
11531}
11532
11533impl wkt::message::Message for VpcAccessConnector {
11534 fn typename() -> &'static str {
11535 "type.googleapis.com/google.appengine.v1.VpcAccessConnector"
11536 }
11537}
11538
11539/// Defines additional types related to [VpcAccessConnector].
11540pub mod vpc_access_connector {
11541 #[allow(unused_imports)]
11542 use super::*;
11543
11544 /// Available egress settings.
11545 ///
11546 /// This controls what traffic is diverted through the VPC Access Connector
11547 /// resource. By default PRIVATE_IP_RANGES will be used.
11548 ///
11549 /// # Working with unknown values
11550 ///
11551 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11552 /// additional enum variants at any time. Adding new variants is not considered
11553 /// a breaking change. Applications should write their code in anticipation of:
11554 ///
11555 /// - New values appearing in future releases of the client library, **and**
11556 /// - New values received dynamically, without application changes.
11557 ///
11558 /// Please consult the [Working with enums] section in the user guide for some
11559 /// guidelines.
11560 ///
11561 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11562 #[derive(Clone, Debug, PartialEq)]
11563 #[non_exhaustive]
11564 pub enum EgressSetting {
11565 #[allow(missing_docs)]
11566 Unspecified,
11567 /// Force the use of VPC Access for all egress traffic from the function.
11568 AllTraffic,
11569 /// Use the VPC Access Connector for private IP space from RFC1918.
11570 PrivateIpRanges,
11571 /// If set, the enum was initialized with an unknown value.
11572 ///
11573 /// Applications can examine the value using [EgressSetting::value] or
11574 /// [EgressSetting::name].
11575 UnknownValue(egress_setting::UnknownValue),
11576 }
11577
11578 #[doc(hidden)]
11579 pub mod egress_setting {
11580 #[allow(unused_imports)]
11581 use super::*;
11582 #[derive(Clone, Debug, PartialEq)]
11583 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11584 }
11585
11586 impl EgressSetting {
11587 /// Gets the enum value.
11588 ///
11589 /// Returns `None` if the enum contains an unknown value deserialized from
11590 /// the string representation of enums.
11591 pub fn value(&self) -> std::option::Option<i32> {
11592 match self {
11593 Self::Unspecified => std::option::Option::Some(0),
11594 Self::AllTraffic => std::option::Option::Some(1),
11595 Self::PrivateIpRanges => std::option::Option::Some(2),
11596 Self::UnknownValue(u) => u.0.value(),
11597 }
11598 }
11599
11600 /// Gets the enum value as a string.
11601 ///
11602 /// Returns `None` if the enum contains an unknown value deserialized from
11603 /// the integer representation of enums.
11604 pub fn name(&self) -> std::option::Option<&str> {
11605 match self {
11606 Self::Unspecified => std::option::Option::Some("EGRESS_SETTING_UNSPECIFIED"),
11607 Self::AllTraffic => std::option::Option::Some("ALL_TRAFFIC"),
11608 Self::PrivateIpRanges => std::option::Option::Some("PRIVATE_IP_RANGES"),
11609 Self::UnknownValue(u) => u.0.name(),
11610 }
11611 }
11612 }
11613
11614 impl std::default::Default for EgressSetting {
11615 fn default() -> Self {
11616 use std::convert::From;
11617 Self::from(0)
11618 }
11619 }
11620
11621 impl std::fmt::Display for EgressSetting {
11622 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11623 wkt::internal::display_enum(f, self.name(), self.value())
11624 }
11625 }
11626
11627 impl std::convert::From<i32> for EgressSetting {
11628 fn from(value: i32) -> Self {
11629 match value {
11630 0 => Self::Unspecified,
11631 1 => Self::AllTraffic,
11632 2 => Self::PrivateIpRanges,
11633 _ => Self::UnknownValue(egress_setting::UnknownValue(
11634 wkt::internal::UnknownEnumValue::Integer(value),
11635 )),
11636 }
11637 }
11638 }
11639
11640 impl std::convert::From<&str> for EgressSetting {
11641 fn from(value: &str) -> Self {
11642 use std::string::ToString;
11643 match value {
11644 "EGRESS_SETTING_UNSPECIFIED" => Self::Unspecified,
11645 "ALL_TRAFFIC" => Self::AllTraffic,
11646 "PRIVATE_IP_RANGES" => Self::PrivateIpRanges,
11647 _ => Self::UnknownValue(egress_setting::UnknownValue(
11648 wkt::internal::UnknownEnumValue::String(value.to_string()),
11649 )),
11650 }
11651 }
11652 }
11653
11654 impl serde::ser::Serialize for EgressSetting {
11655 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11656 where
11657 S: serde::Serializer,
11658 {
11659 match self {
11660 Self::Unspecified => serializer.serialize_i32(0),
11661 Self::AllTraffic => serializer.serialize_i32(1),
11662 Self::PrivateIpRanges => serializer.serialize_i32(2),
11663 Self::UnknownValue(u) => u.0.serialize(serializer),
11664 }
11665 }
11666 }
11667
11668 impl<'de> serde::de::Deserialize<'de> for EgressSetting {
11669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11670 where
11671 D: serde::Deserializer<'de>,
11672 {
11673 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EgressSetting>::new(
11674 ".google.appengine.v1.VpcAccessConnector.EgressSetting",
11675 ))
11676 }
11677 }
11678}
11679
11680/// The entrypoint for the application.
11681#[derive(Clone, Default, PartialEq)]
11682#[non_exhaustive]
11683pub struct Entrypoint {
11684 /// The command to run.
11685 pub command: std::option::Option<crate::model::entrypoint::Command>,
11686
11687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11688}
11689
11690impl Entrypoint {
11691 /// Creates a new default instance.
11692 pub fn new() -> Self {
11693 std::default::Default::default()
11694 }
11695
11696 /// Sets the value of [command][crate::model::Entrypoint::command].
11697 ///
11698 /// Note that all the setters affecting `command` are mutually
11699 /// exclusive.
11700 ///
11701 /// # Example
11702 /// ```ignore,no_run
11703 /// # use google_cloud_appengine_v1::model::Entrypoint;
11704 /// use google_cloud_appengine_v1::model::entrypoint::Command;
11705 /// let x = Entrypoint::new().set_command(Some(Command::Shell("example".to_string())));
11706 /// ```
11707 pub fn set_command<
11708 T: std::convert::Into<std::option::Option<crate::model::entrypoint::Command>>,
11709 >(
11710 mut self,
11711 v: T,
11712 ) -> Self {
11713 self.command = v.into();
11714 self
11715 }
11716
11717 /// The value of [command][crate::model::Entrypoint::command]
11718 /// if it holds a `Shell`, `None` if the field is not set or
11719 /// holds a different branch.
11720 pub fn shell(&self) -> std::option::Option<&std::string::String> {
11721 #[allow(unreachable_patterns)]
11722 self.command.as_ref().and_then(|v| match v {
11723 crate::model::entrypoint::Command::Shell(v) => std::option::Option::Some(v),
11724 _ => std::option::Option::None,
11725 })
11726 }
11727
11728 /// Sets the value of [command][crate::model::Entrypoint::command]
11729 /// to hold a `Shell`.
11730 ///
11731 /// Note that all the setters affecting `command` are
11732 /// mutually exclusive.
11733 ///
11734 /// # Example
11735 /// ```ignore,no_run
11736 /// # use google_cloud_appengine_v1::model::Entrypoint;
11737 /// let x = Entrypoint::new().set_shell("example");
11738 /// assert!(x.shell().is_some());
11739 /// ```
11740 pub fn set_shell<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11741 self.command =
11742 std::option::Option::Some(crate::model::entrypoint::Command::Shell(v.into()));
11743 self
11744 }
11745}
11746
11747impl wkt::message::Message for Entrypoint {
11748 fn typename() -> &'static str {
11749 "type.googleapis.com/google.appengine.v1.Entrypoint"
11750 }
11751}
11752
11753/// Defines additional types related to [Entrypoint].
11754pub mod entrypoint {
11755 #[allow(unused_imports)]
11756 use super::*;
11757
11758 /// The command to run.
11759 #[derive(Clone, Debug, PartialEq)]
11760 #[non_exhaustive]
11761 pub enum Command {
11762 /// The format should be a shell command that can be fed to `bash -c`.
11763 Shell(std::string::String),
11764 }
11765}
11766
11767/// Actions to take when the user is not logged in.
11768///
11769/// # Working with unknown values
11770///
11771/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11772/// additional enum variants at any time. Adding new variants is not considered
11773/// a breaking change. Applications should write their code in anticipation of:
11774///
11775/// - New values appearing in future releases of the client library, **and**
11776/// - New values received dynamically, without application changes.
11777///
11778/// Please consult the [Working with enums] section in the user guide for some
11779/// guidelines.
11780///
11781/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11782#[derive(Clone, Debug, PartialEq)]
11783#[non_exhaustive]
11784pub enum AuthFailAction {
11785 /// Not specified. `AUTH_FAIL_ACTION_REDIRECT` is assumed.
11786 Unspecified,
11787 /// Redirects user to "accounts.google.com". The user is redirected back to the
11788 /// application URL after signing in or creating an account.
11789 Redirect,
11790 /// Rejects request with a `401` HTTP status code and an error
11791 /// message.
11792 Unauthorized,
11793 /// If set, the enum was initialized with an unknown value.
11794 ///
11795 /// Applications can examine the value using [AuthFailAction::value] or
11796 /// [AuthFailAction::name].
11797 UnknownValue(auth_fail_action::UnknownValue),
11798}
11799
11800#[doc(hidden)]
11801pub mod auth_fail_action {
11802 #[allow(unused_imports)]
11803 use super::*;
11804 #[derive(Clone, Debug, PartialEq)]
11805 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11806}
11807
11808impl AuthFailAction {
11809 /// Gets the enum value.
11810 ///
11811 /// Returns `None` if the enum contains an unknown value deserialized from
11812 /// the string representation of enums.
11813 pub fn value(&self) -> std::option::Option<i32> {
11814 match self {
11815 Self::Unspecified => std::option::Option::Some(0),
11816 Self::Redirect => std::option::Option::Some(1),
11817 Self::Unauthorized => std::option::Option::Some(2),
11818 Self::UnknownValue(u) => u.0.value(),
11819 }
11820 }
11821
11822 /// Gets the enum value as a string.
11823 ///
11824 /// Returns `None` if the enum contains an unknown value deserialized from
11825 /// the integer representation of enums.
11826 pub fn name(&self) -> std::option::Option<&str> {
11827 match self {
11828 Self::Unspecified => std::option::Option::Some("AUTH_FAIL_ACTION_UNSPECIFIED"),
11829 Self::Redirect => std::option::Option::Some("AUTH_FAIL_ACTION_REDIRECT"),
11830 Self::Unauthorized => std::option::Option::Some("AUTH_FAIL_ACTION_UNAUTHORIZED"),
11831 Self::UnknownValue(u) => u.0.name(),
11832 }
11833 }
11834}
11835
11836impl std::default::Default for AuthFailAction {
11837 fn default() -> Self {
11838 use std::convert::From;
11839 Self::from(0)
11840 }
11841}
11842
11843impl std::fmt::Display for AuthFailAction {
11844 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11845 wkt::internal::display_enum(f, self.name(), self.value())
11846 }
11847}
11848
11849impl std::convert::From<i32> for AuthFailAction {
11850 fn from(value: i32) -> Self {
11851 match value {
11852 0 => Self::Unspecified,
11853 1 => Self::Redirect,
11854 2 => Self::Unauthorized,
11855 _ => Self::UnknownValue(auth_fail_action::UnknownValue(
11856 wkt::internal::UnknownEnumValue::Integer(value),
11857 )),
11858 }
11859 }
11860}
11861
11862impl std::convert::From<&str> for AuthFailAction {
11863 fn from(value: &str) -> Self {
11864 use std::string::ToString;
11865 match value {
11866 "AUTH_FAIL_ACTION_UNSPECIFIED" => Self::Unspecified,
11867 "AUTH_FAIL_ACTION_REDIRECT" => Self::Redirect,
11868 "AUTH_FAIL_ACTION_UNAUTHORIZED" => Self::Unauthorized,
11869 _ => Self::UnknownValue(auth_fail_action::UnknownValue(
11870 wkt::internal::UnknownEnumValue::String(value.to_string()),
11871 )),
11872 }
11873 }
11874}
11875
11876impl serde::ser::Serialize for AuthFailAction {
11877 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11878 where
11879 S: serde::Serializer,
11880 {
11881 match self {
11882 Self::Unspecified => serializer.serialize_i32(0),
11883 Self::Redirect => serializer.serialize_i32(1),
11884 Self::Unauthorized => serializer.serialize_i32(2),
11885 Self::UnknownValue(u) => u.0.serialize(serializer),
11886 }
11887 }
11888}
11889
11890impl<'de> serde::de::Deserialize<'de> for AuthFailAction {
11891 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11892 where
11893 D: serde::Deserializer<'de>,
11894 {
11895 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthFailAction>::new(
11896 ".google.appengine.v1.AuthFailAction",
11897 ))
11898 }
11899}
11900
11901/// Methods to restrict access to a URL based on login status.
11902///
11903/// # Working with unknown values
11904///
11905/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11906/// additional enum variants at any time. Adding new variants is not considered
11907/// a breaking change. Applications should write their code in anticipation of:
11908///
11909/// - New values appearing in future releases of the client library, **and**
11910/// - New values received dynamically, without application changes.
11911///
11912/// Please consult the [Working with enums] section in the user guide for some
11913/// guidelines.
11914///
11915/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11916#[derive(Clone, Debug, PartialEq)]
11917#[non_exhaustive]
11918pub enum LoginRequirement {
11919 /// Not specified. `LOGIN_OPTIONAL` is assumed.
11920 LoginUnspecified,
11921 /// Does not require that the user is signed in.
11922 LoginOptional,
11923 /// If the user is not signed in, the `auth_fail_action` is taken.
11924 /// In addition, if the user is not an administrator for the
11925 /// application, they are given an error message regardless of
11926 /// `auth_fail_action`. If the user is an administrator, the handler
11927 /// proceeds.
11928 LoginAdmin,
11929 /// If the user has signed in, the handler proceeds normally. Otherwise, the
11930 /// auth_fail_action is taken.
11931 LoginRequired,
11932 /// If set, the enum was initialized with an unknown value.
11933 ///
11934 /// Applications can examine the value using [LoginRequirement::value] or
11935 /// [LoginRequirement::name].
11936 UnknownValue(login_requirement::UnknownValue),
11937}
11938
11939#[doc(hidden)]
11940pub mod login_requirement {
11941 #[allow(unused_imports)]
11942 use super::*;
11943 #[derive(Clone, Debug, PartialEq)]
11944 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11945}
11946
11947impl LoginRequirement {
11948 /// Gets the enum value.
11949 ///
11950 /// Returns `None` if the enum contains an unknown value deserialized from
11951 /// the string representation of enums.
11952 pub fn value(&self) -> std::option::Option<i32> {
11953 match self {
11954 Self::LoginUnspecified => std::option::Option::Some(0),
11955 Self::LoginOptional => std::option::Option::Some(1),
11956 Self::LoginAdmin => std::option::Option::Some(2),
11957 Self::LoginRequired => std::option::Option::Some(3),
11958 Self::UnknownValue(u) => u.0.value(),
11959 }
11960 }
11961
11962 /// Gets the enum value as a string.
11963 ///
11964 /// Returns `None` if the enum contains an unknown value deserialized from
11965 /// the integer representation of enums.
11966 pub fn name(&self) -> std::option::Option<&str> {
11967 match self {
11968 Self::LoginUnspecified => std::option::Option::Some("LOGIN_UNSPECIFIED"),
11969 Self::LoginOptional => std::option::Option::Some("LOGIN_OPTIONAL"),
11970 Self::LoginAdmin => std::option::Option::Some("LOGIN_ADMIN"),
11971 Self::LoginRequired => std::option::Option::Some("LOGIN_REQUIRED"),
11972 Self::UnknownValue(u) => u.0.name(),
11973 }
11974 }
11975}
11976
11977impl std::default::Default for LoginRequirement {
11978 fn default() -> Self {
11979 use std::convert::From;
11980 Self::from(0)
11981 }
11982}
11983
11984impl std::fmt::Display for LoginRequirement {
11985 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11986 wkt::internal::display_enum(f, self.name(), self.value())
11987 }
11988}
11989
11990impl std::convert::From<i32> for LoginRequirement {
11991 fn from(value: i32) -> Self {
11992 match value {
11993 0 => Self::LoginUnspecified,
11994 1 => Self::LoginOptional,
11995 2 => Self::LoginAdmin,
11996 3 => Self::LoginRequired,
11997 _ => Self::UnknownValue(login_requirement::UnknownValue(
11998 wkt::internal::UnknownEnumValue::Integer(value),
11999 )),
12000 }
12001 }
12002}
12003
12004impl std::convert::From<&str> for LoginRequirement {
12005 fn from(value: &str) -> Self {
12006 use std::string::ToString;
12007 match value {
12008 "LOGIN_UNSPECIFIED" => Self::LoginUnspecified,
12009 "LOGIN_OPTIONAL" => Self::LoginOptional,
12010 "LOGIN_ADMIN" => Self::LoginAdmin,
12011 "LOGIN_REQUIRED" => Self::LoginRequired,
12012 _ => Self::UnknownValue(login_requirement::UnknownValue(
12013 wkt::internal::UnknownEnumValue::String(value.to_string()),
12014 )),
12015 }
12016 }
12017}
12018
12019impl serde::ser::Serialize for LoginRequirement {
12020 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12021 where
12022 S: serde::Serializer,
12023 {
12024 match self {
12025 Self::LoginUnspecified => serializer.serialize_i32(0),
12026 Self::LoginOptional => serializer.serialize_i32(1),
12027 Self::LoginAdmin => serializer.serialize_i32(2),
12028 Self::LoginRequired => serializer.serialize_i32(3),
12029 Self::UnknownValue(u) => u.0.serialize(serializer),
12030 }
12031 }
12032}
12033
12034impl<'de> serde::de::Deserialize<'de> for LoginRequirement {
12035 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12036 where
12037 D: serde::Deserializer<'de>,
12038 {
12039 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoginRequirement>::new(
12040 ".google.appengine.v1.LoginRequirement",
12041 ))
12042 }
12043}
12044
12045/// Methods to enforce security (HTTPS) on a URL.
12046///
12047/// # Working with unknown values
12048///
12049/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12050/// additional enum variants at any time. Adding new variants is not considered
12051/// a breaking change. Applications should write their code in anticipation of:
12052///
12053/// - New values appearing in future releases of the client library, **and**
12054/// - New values received dynamically, without application changes.
12055///
12056/// Please consult the [Working with enums] section in the user guide for some
12057/// guidelines.
12058///
12059/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12060#[derive(Clone, Debug, PartialEq)]
12061#[non_exhaustive]
12062pub enum SecurityLevel {
12063 /// Not specified.
12064 SecureUnspecified,
12065 /// Both HTTP and HTTPS requests with URLs that match the handler succeed
12066 /// without redirects. The application can examine the request to determine
12067 /// which protocol was used, and respond accordingly.
12068 SecureDefault,
12069 /// Requests for a URL that match this handler that use HTTPS are automatically
12070 /// redirected to the HTTP equivalent URL.
12071 SecureNever,
12072 /// Both HTTP and HTTPS requests with URLs that match the handler succeed
12073 /// without redirects. The application can examine the request to determine
12074 /// which protocol was used and respond accordingly.
12075 SecureOptional,
12076 /// Requests for a URL that match this handler that do not use HTTPS are
12077 /// automatically redirected to the HTTPS URL with the same path. Query
12078 /// parameters are reserved for the redirect.
12079 SecureAlways,
12080 /// If set, the enum was initialized with an unknown value.
12081 ///
12082 /// Applications can examine the value using [SecurityLevel::value] or
12083 /// [SecurityLevel::name].
12084 UnknownValue(security_level::UnknownValue),
12085}
12086
12087#[doc(hidden)]
12088pub mod security_level {
12089 #[allow(unused_imports)]
12090 use super::*;
12091 #[derive(Clone, Debug, PartialEq)]
12092 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12093}
12094
12095impl SecurityLevel {
12096 /// Gets the enum value.
12097 ///
12098 /// Returns `None` if the enum contains an unknown value deserialized from
12099 /// the string representation of enums.
12100 pub fn value(&self) -> std::option::Option<i32> {
12101 match self {
12102 Self::SecureUnspecified => std::option::Option::Some(0),
12103 Self::SecureDefault => std::option::Option::Some(0),
12104 Self::SecureNever => std::option::Option::Some(1),
12105 Self::SecureOptional => std::option::Option::Some(2),
12106 Self::SecureAlways => std::option::Option::Some(3),
12107 Self::UnknownValue(u) => u.0.value(),
12108 }
12109 }
12110
12111 /// Gets the enum value as a string.
12112 ///
12113 /// Returns `None` if the enum contains an unknown value deserialized from
12114 /// the integer representation of enums.
12115 pub fn name(&self) -> std::option::Option<&str> {
12116 match self {
12117 Self::SecureUnspecified => std::option::Option::Some("SECURE_UNSPECIFIED"),
12118 Self::SecureDefault => std::option::Option::Some("SECURE_DEFAULT"),
12119 Self::SecureNever => std::option::Option::Some("SECURE_NEVER"),
12120 Self::SecureOptional => std::option::Option::Some("SECURE_OPTIONAL"),
12121 Self::SecureAlways => std::option::Option::Some("SECURE_ALWAYS"),
12122 Self::UnknownValue(u) => u.0.name(),
12123 }
12124 }
12125}
12126
12127impl std::default::Default for SecurityLevel {
12128 fn default() -> Self {
12129 use std::convert::From;
12130 Self::from(0)
12131 }
12132}
12133
12134impl std::fmt::Display for SecurityLevel {
12135 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12136 wkt::internal::display_enum(f, self.name(), self.value())
12137 }
12138}
12139
12140impl std::convert::From<i32> for SecurityLevel {
12141 fn from(value: i32) -> Self {
12142 match value {
12143 0 => Self::SecureDefault,
12144 1 => Self::SecureNever,
12145 2 => Self::SecureOptional,
12146 3 => Self::SecureAlways,
12147 _ => Self::UnknownValue(security_level::UnknownValue(
12148 wkt::internal::UnknownEnumValue::Integer(value),
12149 )),
12150 }
12151 }
12152}
12153
12154impl std::convert::From<&str> for SecurityLevel {
12155 fn from(value: &str) -> Self {
12156 use std::string::ToString;
12157 match value {
12158 "SECURE_UNSPECIFIED" => Self::SecureUnspecified,
12159 "SECURE_DEFAULT" => Self::SecureDefault,
12160 "SECURE_NEVER" => Self::SecureNever,
12161 "SECURE_OPTIONAL" => Self::SecureOptional,
12162 "SECURE_ALWAYS" => Self::SecureAlways,
12163 _ => Self::UnknownValue(security_level::UnknownValue(
12164 wkt::internal::UnknownEnumValue::String(value.to_string()),
12165 )),
12166 }
12167 }
12168}
12169
12170impl serde::ser::Serialize for SecurityLevel {
12171 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12172 where
12173 S: serde::Serializer,
12174 {
12175 match self {
12176 Self::SecureUnspecified => serializer.serialize_i32(0),
12177 Self::SecureDefault => serializer.serialize_i32(0),
12178 Self::SecureNever => serializer.serialize_i32(1),
12179 Self::SecureOptional => serializer.serialize_i32(2),
12180 Self::SecureAlways => serializer.serialize_i32(3),
12181 Self::UnknownValue(u) => u.0.serialize(serializer),
12182 }
12183 }
12184}
12185
12186impl<'de> serde::de::Deserialize<'de> for SecurityLevel {
12187 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12188 where
12189 D: serde::Deserializer<'de>,
12190 {
12191 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityLevel>::new(
12192 ".google.appengine.v1.SecurityLevel",
12193 ))
12194 }
12195}
12196
12197/// Fields that should be returned when [Version][google.appengine.v1.Version] resources
12198/// are retrieved.
12199///
12200/// [google.appengine.v1.Version]: crate::model::Version
12201///
12202/// # Working with unknown values
12203///
12204/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12205/// additional enum variants at any time. Adding new variants is not considered
12206/// a breaking change. Applications should write their code in anticipation of:
12207///
12208/// - New values appearing in future releases of the client library, **and**
12209/// - New values received dynamically, without application changes.
12210///
12211/// Please consult the [Working with enums] section in the user guide for some
12212/// guidelines.
12213///
12214/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12215#[derive(Clone, Debug, PartialEq)]
12216#[non_exhaustive]
12217pub enum VersionView {
12218 /// Basic version information including scaling and inbound services,
12219 /// but not detailed deployment information.
12220 Basic,
12221 /// The information from `BASIC`, plus detailed information about the
12222 /// deployment. This format is required when creating resources, but
12223 /// is not returned in `Get` or `List` by default.
12224 Full,
12225 /// If set, the enum was initialized with an unknown value.
12226 ///
12227 /// Applications can examine the value using [VersionView::value] or
12228 /// [VersionView::name].
12229 UnknownValue(version_view::UnknownValue),
12230}
12231
12232#[doc(hidden)]
12233pub mod version_view {
12234 #[allow(unused_imports)]
12235 use super::*;
12236 #[derive(Clone, Debug, PartialEq)]
12237 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12238}
12239
12240impl VersionView {
12241 /// Gets the enum value.
12242 ///
12243 /// Returns `None` if the enum contains an unknown value deserialized from
12244 /// the string representation of enums.
12245 pub fn value(&self) -> std::option::Option<i32> {
12246 match self {
12247 Self::Basic => std::option::Option::Some(0),
12248 Self::Full => std::option::Option::Some(1),
12249 Self::UnknownValue(u) => u.0.value(),
12250 }
12251 }
12252
12253 /// Gets the enum value as a string.
12254 ///
12255 /// Returns `None` if the enum contains an unknown value deserialized from
12256 /// the integer representation of enums.
12257 pub fn name(&self) -> std::option::Option<&str> {
12258 match self {
12259 Self::Basic => std::option::Option::Some("BASIC"),
12260 Self::Full => std::option::Option::Some("FULL"),
12261 Self::UnknownValue(u) => u.0.name(),
12262 }
12263 }
12264}
12265
12266impl std::default::Default for VersionView {
12267 fn default() -> Self {
12268 use std::convert::From;
12269 Self::from(0)
12270 }
12271}
12272
12273impl std::fmt::Display for VersionView {
12274 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12275 wkt::internal::display_enum(f, self.name(), self.value())
12276 }
12277}
12278
12279impl std::convert::From<i32> for VersionView {
12280 fn from(value: i32) -> Self {
12281 match value {
12282 0 => Self::Basic,
12283 1 => Self::Full,
12284 _ => Self::UnknownValue(version_view::UnknownValue(
12285 wkt::internal::UnknownEnumValue::Integer(value),
12286 )),
12287 }
12288 }
12289}
12290
12291impl std::convert::From<&str> for VersionView {
12292 fn from(value: &str) -> Self {
12293 use std::string::ToString;
12294 match value {
12295 "BASIC" => Self::Basic,
12296 "FULL" => Self::Full,
12297 _ => Self::UnknownValue(version_view::UnknownValue(
12298 wkt::internal::UnknownEnumValue::String(value.to_string()),
12299 )),
12300 }
12301 }
12302}
12303
12304impl serde::ser::Serialize for VersionView {
12305 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12306 where
12307 S: serde::Serializer,
12308 {
12309 match self {
12310 Self::Basic => serializer.serialize_i32(0),
12311 Self::Full => serializer.serialize_i32(1),
12312 Self::UnknownValue(u) => u.0.serialize(serializer),
12313 }
12314 }
12315}
12316
12317impl<'de> serde::de::Deserialize<'de> for VersionView {
12318 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12319 where
12320 D: serde::Deserializer<'de>,
12321 {
12322 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VersionView>::new(
12323 ".google.appengine.v1.VersionView",
12324 ))
12325 }
12326}
12327
12328/// Fields that should be returned when an AuthorizedCertificate resource is
12329/// retrieved.
12330///
12331/// # Working with unknown values
12332///
12333/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12334/// additional enum variants at any time. Adding new variants is not considered
12335/// a breaking change. Applications should write their code in anticipation of:
12336///
12337/// - New values appearing in future releases of the client library, **and**
12338/// - New values received dynamically, without application changes.
12339///
12340/// Please consult the [Working with enums] section in the user guide for some
12341/// guidelines.
12342///
12343/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12344#[derive(Clone, Debug, PartialEq)]
12345#[non_exhaustive]
12346pub enum AuthorizedCertificateView {
12347 /// Basic certificate information, including applicable domains and expiration
12348 /// date.
12349 BasicCertificate,
12350 /// The information from `BASIC_CERTIFICATE`, plus detailed information on the
12351 /// domain mappings that have this certificate mapped.
12352 FullCertificate,
12353 /// If set, the enum was initialized with an unknown value.
12354 ///
12355 /// Applications can examine the value using [AuthorizedCertificateView::value] or
12356 /// [AuthorizedCertificateView::name].
12357 UnknownValue(authorized_certificate_view::UnknownValue),
12358}
12359
12360#[doc(hidden)]
12361pub mod authorized_certificate_view {
12362 #[allow(unused_imports)]
12363 use super::*;
12364 #[derive(Clone, Debug, PartialEq)]
12365 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12366}
12367
12368impl AuthorizedCertificateView {
12369 /// Gets the enum value.
12370 ///
12371 /// Returns `None` if the enum contains an unknown value deserialized from
12372 /// the string representation of enums.
12373 pub fn value(&self) -> std::option::Option<i32> {
12374 match self {
12375 Self::BasicCertificate => std::option::Option::Some(0),
12376 Self::FullCertificate => std::option::Option::Some(1),
12377 Self::UnknownValue(u) => u.0.value(),
12378 }
12379 }
12380
12381 /// Gets the enum value as a string.
12382 ///
12383 /// Returns `None` if the enum contains an unknown value deserialized from
12384 /// the integer representation of enums.
12385 pub fn name(&self) -> std::option::Option<&str> {
12386 match self {
12387 Self::BasicCertificate => std::option::Option::Some("BASIC_CERTIFICATE"),
12388 Self::FullCertificate => std::option::Option::Some("FULL_CERTIFICATE"),
12389 Self::UnknownValue(u) => u.0.name(),
12390 }
12391 }
12392}
12393
12394impl std::default::Default for AuthorizedCertificateView {
12395 fn default() -> Self {
12396 use std::convert::From;
12397 Self::from(0)
12398 }
12399}
12400
12401impl std::fmt::Display for AuthorizedCertificateView {
12402 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12403 wkt::internal::display_enum(f, self.name(), self.value())
12404 }
12405}
12406
12407impl std::convert::From<i32> for AuthorizedCertificateView {
12408 fn from(value: i32) -> Self {
12409 match value {
12410 0 => Self::BasicCertificate,
12411 1 => Self::FullCertificate,
12412 _ => Self::UnknownValue(authorized_certificate_view::UnknownValue(
12413 wkt::internal::UnknownEnumValue::Integer(value),
12414 )),
12415 }
12416 }
12417}
12418
12419impl std::convert::From<&str> for AuthorizedCertificateView {
12420 fn from(value: &str) -> Self {
12421 use std::string::ToString;
12422 match value {
12423 "BASIC_CERTIFICATE" => Self::BasicCertificate,
12424 "FULL_CERTIFICATE" => Self::FullCertificate,
12425 _ => Self::UnknownValue(authorized_certificate_view::UnknownValue(
12426 wkt::internal::UnknownEnumValue::String(value.to_string()),
12427 )),
12428 }
12429 }
12430}
12431
12432impl serde::ser::Serialize for AuthorizedCertificateView {
12433 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12434 where
12435 S: serde::Serializer,
12436 {
12437 match self {
12438 Self::BasicCertificate => serializer.serialize_i32(0),
12439 Self::FullCertificate => serializer.serialize_i32(1),
12440 Self::UnknownValue(u) => u.0.serialize(serializer),
12441 }
12442 }
12443}
12444
12445impl<'de> serde::de::Deserialize<'de> for AuthorizedCertificateView {
12446 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12447 where
12448 D: serde::Deserializer<'de>,
12449 {
12450 deserializer.deserialize_any(
12451 wkt::internal::EnumVisitor::<AuthorizedCertificateView>::new(
12452 ".google.appengine.v1.AuthorizedCertificateView",
12453 ),
12454 )
12455 }
12456}
12457
12458/// Override strategy for mutating an existing mapping.
12459///
12460/// # Working with unknown values
12461///
12462/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12463/// additional enum variants at any time. Adding new variants is not considered
12464/// a breaking change. Applications should write their code in anticipation of:
12465///
12466/// - New values appearing in future releases of the client library, **and**
12467/// - New values received dynamically, without application changes.
12468///
12469/// Please consult the [Working with enums] section in the user guide for some
12470/// guidelines.
12471///
12472/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12473#[derive(Clone, Debug, PartialEq)]
12474#[non_exhaustive]
12475pub enum DomainOverrideStrategy {
12476 /// Strategy unspecified. Defaults to `STRICT`.
12477 UnspecifiedDomainOverrideStrategy,
12478 /// Overrides not allowed. If a mapping already exists for the
12479 /// specified domain, the request will return an ALREADY_EXISTS (409).
12480 Strict,
12481 /// Overrides allowed. If a mapping already exists for the specified domain,
12482 /// the request will overwrite it. Note that this might stop another
12483 /// Google product from serving. For example, if the domain is
12484 /// mapped to another App Engine application, that app will no
12485 /// longer serve from that domain.
12486 Override,
12487 /// If set, the enum was initialized with an unknown value.
12488 ///
12489 /// Applications can examine the value using [DomainOverrideStrategy::value] or
12490 /// [DomainOverrideStrategy::name].
12491 UnknownValue(domain_override_strategy::UnknownValue),
12492}
12493
12494#[doc(hidden)]
12495pub mod domain_override_strategy {
12496 #[allow(unused_imports)]
12497 use super::*;
12498 #[derive(Clone, Debug, PartialEq)]
12499 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12500}
12501
12502impl DomainOverrideStrategy {
12503 /// Gets the enum value.
12504 ///
12505 /// Returns `None` if the enum contains an unknown value deserialized from
12506 /// the string representation of enums.
12507 pub fn value(&self) -> std::option::Option<i32> {
12508 match self {
12509 Self::UnspecifiedDomainOverrideStrategy => std::option::Option::Some(0),
12510 Self::Strict => std::option::Option::Some(1),
12511 Self::Override => std::option::Option::Some(2),
12512 Self::UnknownValue(u) => u.0.value(),
12513 }
12514 }
12515
12516 /// Gets the enum value as a string.
12517 ///
12518 /// Returns `None` if the enum contains an unknown value deserialized from
12519 /// the integer representation of enums.
12520 pub fn name(&self) -> std::option::Option<&str> {
12521 match self {
12522 Self::UnspecifiedDomainOverrideStrategy => {
12523 std::option::Option::Some("UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY")
12524 }
12525 Self::Strict => std::option::Option::Some("STRICT"),
12526 Self::Override => std::option::Option::Some("OVERRIDE"),
12527 Self::UnknownValue(u) => u.0.name(),
12528 }
12529 }
12530}
12531
12532impl std::default::Default for DomainOverrideStrategy {
12533 fn default() -> Self {
12534 use std::convert::From;
12535 Self::from(0)
12536 }
12537}
12538
12539impl std::fmt::Display for DomainOverrideStrategy {
12540 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12541 wkt::internal::display_enum(f, self.name(), self.value())
12542 }
12543}
12544
12545impl std::convert::From<i32> for DomainOverrideStrategy {
12546 fn from(value: i32) -> Self {
12547 match value {
12548 0 => Self::UnspecifiedDomainOverrideStrategy,
12549 1 => Self::Strict,
12550 2 => Self::Override,
12551 _ => Self::UnknownValue(domain_override_strategy::UnknownValue(
12552 wkt::internal::UnknownEnumValue::Integer(value),
12553 )),
12554 }
12555 }
12556}
12557
12558impl std::convert::From<&str> for DomainOverrideStrategy {
12559 fn from(value: &str) -> Self {
12560 use std::string::ToString;
12561 match value {
12562 "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY" => Self::UnspecifiedDomainOverrideStrategy,
12563 "STRICT" => Self::Strict,
12564 "OVERRIDE" => Self::Override,
12565 _ => Self::UnknownValue(domain_override_strategy::UnknownValue(
12566 wkt::internal::UnknownEnumValue::String(value.to_string()),
12567 )),
12568 }
12569 }
12570}
12571
12572impl serde::ser::Serialize for DomainOverrideStrategy {
12573 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12574 where
12575 S: serde::Serializer,
12576 {
12577 match self {
12578 Self::UnspecifiedDomainOverrideStrategy => serializer.serialize_i32(0),
12579 Self::Strict => serializer.serialize_i32(1),
12580 Self::Override => serializer.serialize_i32(2),
12581 Self::UnknownValue(u) => u.0.serialize(serializer),
12582 }
12583 }
12584}
12585
12586impl<'de> serde::de::Deserialize<'de> for DomainOverrideStrategy {
12587 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12588 where
12589 D: serde::Deserializer<'de>,
12590 {
12591 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DomainOverrideStrategy>::new(
12592 ".google.appengine.v1.DomainOverrideStrategy",
12593 ))
12594 }
12595}
12596
12597/// State of certificate management. Refers to the most recent certificate
12598/// acquisition or renewal attempt.
12599///
12600/// # Working with unknown values
12601///
12602/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12603/// additional enum variants at any time. Adding new variants is not considered
12604/// a breaking change. Applications should write their code in anticipation of:
12605///
12606/// - New values appearing in future releases of the client library, **and**
12607/// - New values received dynamically, without application changes.
12608///
12609/// Please consult the [Working with enums] section in the user guide for some
12610/// guidelines.
12611///
12612/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12613#[derive(Clone, Debug, PartialEq)]
12614#[non_exhaustive]
12615pub enum ManagementStatus {
12616 #[allow(missing_docs)]
12617 Unspecified,
12618 /// Certificate was successfully obtained and inserted into the serving
12619 /// system.
12620 Ok,
12621 /// Certificate is under active attempts to acquire or renew.
12622 Pending,
12623 /// Most recent renewal failed due to an invalid DNS setup and will be
12624 /// retried. Renewal attempts will continue to fail until the certificate
12625 /// domain's DNS configuration is fixed. The last successfully provisioned
12626 /// certificate may still be serving.
12627 FailedRetryingNotVisible,
12628 /// All renewal attempts have been exhausted, likely due to an invalid DNS
12629 /// setup.
12630 FailedPermanent,
12631 /// Most recent renewal failed due to an explicit CAA record that does not
12632 /// include one of the in-use CAs (Google CA and Let's Encrypt). Renewals will
12633 /// continue to fail until the CAA is reconfigured. The last successfully
12634 /// provisioned certificate may still be serving.
12635 FailedRetryingCaaForbidden,
12636 /// Most recent renewal failed due to a CAA retrieval failure. This means that
12637 /// the domain's DNS provider does not properly handle CAA records, failing
12638 /// requests for CAA records when no CAA records are defined. Renewals will
12639 /// continue to fail until the DNS provider is changed or a CAA record is
12640 /// added for the given domain. The last successfully provisioned certificate
12641 /// may still be serving.
12642 FailedRetryingCaaChecking,
12643 /// If set, the enum was initialized with an unknown value.
12644 ///
12645 /// Applications can examine the value using [ManagementStatus::value] or
12646 /// [ManagementStatus::name].
12647 UnknownValue(management_status::UnknownValue),
12648}
12649
12650#[doc(hidden)]
12651pub mod management_status {
12652 #[allow(unused_imports)]
12653 use super::*;
12654 #[derive(Clone, Debug, PartialEq)]
12655 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12656}
12657
12658impl ManagementStatus {
12659 /// Gets the enum value.
12660 ///
12661 /// Returns `None` if the enum contains an unknown value deserialized from
12662 /// the string representation of enums.
12663 pub fn value(&self) -> std::option::Option<i32> {
12664 match self {
12665 Self::Unspecified => std::option::Option::Some(0),
12666 Self::Ok => std::option::Option::Some(1),
12667 Self::Pending => std::option::Option::Some(2),
12668 Self::FailedRetryingNotVisible => std::option::Option::Some(4),
12669 Self::FailedPermanent => std::option::Option::Some(6),
12670 Self::FailedRetryingCaaForbidden => std::option::Option::Some(7),
12671 Self::FailedRetryingCaaChecking => std::option::Option::Some(8),
12672 Self::UnknownValue(u) => u.0.value(),
12673 }
12674 }
12675
12676 /// Gets the enum value as a string.
12677 ///
12678 /// Returns `None` if the enum contains an unknown value deserialized from
12679 /// the integer representation of enums.
12680 pub fn name(&self) -> std::option::Option<&str> {
12681 match self {
12682 Self::Unspecified => std::option::Option::Some("MANAGEMENT_STATUS_UNSPECIFIED"),
12683 Self::Ok => std::option::Option::Some("OK"),
12684 Self::Pending => std::option::Option::Some("PENDING"),
12685 Self::FailedRetryingNotVisible => {
12686 std::option::Option::Some("FAILED_RETRYING_NOT_VISIBLE")
12687 }
12688 Self::FailedPermanent => std::option::Option::Some("FAILED_PERMANENT"),
12689 Self::FailedRetryingCaaForbidden => {
12690 std::option::Option::Some("FAILED_RETRYING_CAA_FORBIDDEN")
12691 }
12692 Self::FailedRetryingCaaChecking => {
12693 std::option::Option::Some("FAILED_RETRYING_CAA_CHECKING")
12694 }
12695 Self::UnknownValue(u) => u.0.name(),
12696 }
12697 }
12698}
12699
12700impl std::default::Default for ManagementStatus {
12701 fn default() -> Self {
12702 use std::convert::From;
12703 Self::from(0)
12704 }
12705}
12706
12707impl std::fmt::Display for ManagementStatus {
12708 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12709 wkt::internal::display_enum(f, self.name(), self.value())
12710 }
12711}
12712
12713impl std::convert::From<i32> for ManagementStatus {
12714 fn from(value: i32) -> Self {
12715 match value {
12716 0 => Self::Unspecified,
12717 1 => Self::Ok,
12718 2 => Self::Pending,
12719 4 => Self::FailedRetryingNotVisible,
12720 6 => Self::FailedPermanent,
12721 7 => Self::FailedRetryingCaaForbidden,
12722 8 => Self::FailedRetryingCaaChecking,
12723 _ => Self::UnknownValue(management_status::UnknownValue(
12724 wkt::internal::UnknownEnumValue::Integer(value),
12725 )),
12726 }
12727 }
12728}
12729
12730impl std::convert::From<&str> for ManagementStatus {
12731 fn from(value: &str) -> Self {
12732 use std::string::ToString;
12733 match value {
12734 "MANAGEMENT_STATUS_UNSPECIFIED" => Self::Unspecified,
12735 "OK" => Self::Ok,
12736 "PENDING" => Self::Pending,
12737 "FAILED_RETRYING_NOT_VISIBLE" => Self::FailedRetryingNotVisible,
12738 "FAILED_PERMANENT" => Self::FailedPermanent,
12739 "FAILED_RETRYING_CAA_FORBIDDEN" => Self::FailedRetryingCaaForbidden,
12740 "FAILED_RETRYING_CAA_CHECKING" => Self::FailedRetryingCaaChecking,
12741 _ => Self::UnknownValue(management_status::UnknownValue(
12742 wkt::internal::UnknownEnumValue::String(value.to_string()),
12743 )),
12744 }
12745 }
12746}
12747
12748impl serde::ser::Serialize for ManagementStatus {
12749 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12750 where
12751 S: serde::Serializer,
12752 {
12753 match self {
12754 Self::Unspecified => serializer.serialize_i32(0),
12755 Self::Ok => serializer.serialize_i32(1),
12756 Self::Pending => serializer.serialize_i32(2),
12757 Self::FailedRetryingNotVisible => serializer.serialize_i32(4),
12758 Self::FailedPermanent => serializer.serialize_i32(6),
12759 Self::FailedRetryingCaaForbidden => serializer.serialize_i32(7),
12760 Self::FailedRetryingCaaChecking => serializer.serialize_i32(8),
12761 Self::UnknownValue(u) => u.0.serialize(serializer),
12762 }
12763 }
12764}
12765
12766impl<'de> serde::de::Deserialize<'de> for ManagementStatus {
12767 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12768 where
12769 D: serde::Deserializer<'de>,
12770 {
12771 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManagementStatus>::new(
12772 ".google.appengine.v1.ManagementStatus",
12773 ))
12774 }
12775}
12776
12777/// Available inbound services.
12778///
12779/// # Working with unknown values
12780///
12781/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12782/// additional enum variants at any time. Adding new variants is not considered
12783/// a breaking change. Applications should write their code in anticipation of:
12784///
12785/// - New values appearing in future releases of the client library, **and**
12786/// - New values received dynamically, without application changes.
12787///
12788/// Please consult the [Working with enums] section in the user guide for some
12789/// guidelines.
12790///
12791/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12792#[derive(Clone, Debug, PartialEq)]
12793#[non_exhaustive]
12794pub enum InboundServiceType {
12795 /// Not specified.
12796 InboundServiceUnspecified,
12797 /// Allows an application to receive mail.
12798 InboundServiceMail,
12799 /// Allows an application to receive email-bound notifications.
12800 InboundServiceMailBounce,
12801 /// Allows an application to receive error stanzas.
12802 InboundServiceXmppError,
12803 /// Allows an application to receive instant messages.
12804 InboundServiceXmppMessage,
12805 /// Allows an application to receive user subscription POSTs.
12806 InboundServiceXmppSubscribe,
12807 /// Allows an application to receive a user's chat presence.
12808 InboundServiceXmppPresence,
12809 /// Registers an application for notifications when a client connects or
12810 /// disconnects from a channel.
12811 InboundServiceChannelPresence,
12812 /// Enables warmup requests.
12813 InboundServiceWarmup,
12814 /// If set, the enum was initialized with an unknown value.
12815 ///
12816 /// Applications can examine the value using [InboundServiceType::value] or
12817 /// [InboundServiceType::name].
12818 UnknownValue(inbound_service_type::UnknownValue),
12819}
12820
12821#[doc(hidden)]
12822pub mod inbound_service_type {
12823 #[allow(unused_imports)]
12824 use super::*;
12825 #[derive(Clone, Debug, PartialEq)]
12826 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12827}
12828
12829impl InboundServiceType {
12830 /// Gets the enum value.
12831 ///
12832 /// Returns `None` if the enum contains an unknown value deserialized from
12833 /// the string representation of enums.
12834 pub fn value(&self) -> std::option::Option<i32> {
12835 match self {
12836 Self::InboundServiceUnspecified => std::option::Option::Some(0),
12837 Self::InboundServiceMail => std::option::Option::Some(1),
12838 Self::InboundServiceMailBounce => std::option::Option::Some(2),
12839 Self::InboundServiceXmppError => std::option::Option::Some(3),
12840 Self::InboundServiceXmppMessage => std::option::Option::Some(4),
12841 Self::InboundServiceXmppSubscribe => std::option::Option::Some(5),
12842 Self::InboundServiceXmppPresence => std::option::Option::Some(6),
12843 Self::InboundServiceChannelPresence => std::option::Option::Some(7),
12844 Self::InboundServiceWarmup => std::option::Option::Some(9),
12845 Self::UnknownValue(u) => u.0.value(),
12846 }
12847 }
12848
12849 /// Gets the enum value as a string.
12850 ///
12851 /// Returns `None` if the enum contains an unknown value deserialized from
12852 /// the integer representation of enums.
12853 pub fn name(&self) -> std::option::Option<&str> {
12854 match self {
12855 Self::InboundServiceUnspecified => {
12856 std::option::Option::Some("INBOUND_SERVICE_UNSPECIFIED")
12857 }
12858 Self::InboundServiceMail => std::option::Option::Some("INBOUND_SERVICE_MAIL"),
12859 Self::InboundServiceMailBounce => {
12860 std::option::Option::Some("INBOUND_SERVICE_MAIL_BOUNCE")
12861 }
12862 Self::InboundServiceXmppError => {
12863 std::option::Option::Some("INBOUND_SERVICE_XMPP_ERROR")
12864 }
12865 Self::InboundServiceXmppMessage => {
12866 std::option::Option::Some("INBOUND_SERVICE_XMPP_MESSAGE")
12867 }
12868 Self::InboundServiceXmppSubscribe => {
12869 std::option::Option::Some("INBOUND_SERVICE_XMPP_SUBSCRIBE")
12870 }
12871 Self::InboundServiceXmppPresence => {
12872 std::option::Option::Some("INBOUND_SERVICE_XMPP_PRESENCE")
12873 }
12874 Self::InboundServiceChannelPresence => {
12875 std::option::Option::Some("INBOUND_SERVICE_CHANNEL_PRESENCE")
12876 }
12877 Self::InboundServiceWarmup => std::option::Option::Some("INBOUND_SERVICE_WARMUP"),
12878 Self::UnknownValue(u) => u.0.name(),
12879 }
12880 }
12881}
12882
12883impl std::default::Default for InboundServiceType {
12884 fn default() -> Self {
12885 use std::convert::From;
12886 Self::from(0)
12887 }
12888}
12889
12890impl std::fmt::Display for InboundServiceType {
12891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12892 wkt::internal::display_enum(f, self.name(), self.value())
12893 }
12894}
12895
12896impl std::convert::From<i32> for InboundServiceType {
12897 fn from(value: i32) -> Self {
12898 match value {
12899 0 => Self::InboundServiceUnspecified,
12900 1 => Self::InboundServiceMail,
12901 2 => Self::InboundServiceMailBounce,
12902 3 => Self::InboundServiceXmppError,
12903 4 => Self::InboundServiceXmppMessage,
12904 5 => Self::InboundServiceXmppSubscribe,
12905 6 => Self::InboundServiceXmppPresence,
12906 7 => Self::InboundServiceChannelPresence,
12907 9 => Self::InboundServiceWarmup,
12908 _ => Self::UnknownValue(inbound_service_type::UnknownValue(
12909 wkt::internal::UnknownEnumValue::Integer(value),
12910 )),
12911 }
12912 }
12913}
12914
12915impl std::convert::From<&str> for InboundServiceType {
12916 fn from(value: &str) -> Self {
12917 use std::string::ToString;
12918 match value {
12919 "INBOUND_SERVICE_UNSPECIFIED" => Self::InboundServiceUnspecified,
12920 "INBOUND_SERVICE_MAIL" => Self::InboundServiceMail,
12921 "INBOUND_SERVICE_MAIL_BOUNCE" => Self::InboundServiceMailBounce,
12922 "INBOUND_SERVICE_XMPP_ERROR" => Self::InboundServiceXmppError,
12923 "INBOUND_SERVICE_XMPP_MESSAGE" => Self::InboundServiceXmppMessage,
12924 "INBOUND_SERVICE_XMPP_SUBSCRIBE" => Self::InboundServiceXmppSubscribe,
12925 "INBOUND_SERVICE_XMPP_PRESENCE" => Self::InboundServiceXmppPresence,
12926 "INBOUND_SERVICE_CHANNEL_PRESENCE" => Self::InboundServiceChannelPresence,
12927 "INBOUND_SERVICE_WARMUP" => Self::InboundServiceWarmup,
12928 _ => Self::UnknownValue(inbound_service_type::UnknownValue(
12929 wkt::internal::UnknownEnumValue::String(value.to_string()),
12930 )),
12931 }
12932 }
12933}
12934
12935impl serde::ser::Serialize for InboundServiceType {
12936 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12937 where
12938 S: serde::Serializer,
12939 {
12940 match self {
12941 Self::InboundServiceUnspecified => serializer.serialize_i32(0),
12942 Self::InboundServiceMail => serializer.serialize_i32(1),
12943 Self::InboundServiceMailBounce => serializer.serialize_i32(2),
12944 Self::InboundServiceXmppError => serializer.serialize_i32(3),
12945 Self::InboundServiceXmppMessage => serializer.serialize_i32(4),
12946 Self::InboundServiceXmppSubscribe => serializer.serialize_i32(5),
12947 Self::InboundServiceXmppPresence => serializer.serialize_i32(6),
12948 Self::InboundServiceChannelPresence => serializer.serialize_i32(7),
12949 Self::InboundServiceWarmup => serializer.serialize_i32(9),
12950 Self::UnknownValue(u) => u.0.serialize(serializer),
12951 }
12952 }
12953}
12954
12955impl<'de> serde::de::Deserialize<'de> for InboundServiceType {
12956 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12957 where
12958 D: serde::Deserializer<'de>,
12959 {
12960 deserializer.deserialize_any(wkt::internal::EnumVisitor::<InboundServiceType>::new(
12961 ".google.appengine.v1.InboundServiceType",
12962 ))
12963 }
12964}
12965
12966/// Run states of a version.
12967///
12968/// # Working with unknown values
12969///
12970/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12971/// additional enum variants at any time. Adding new variants is not considered
12972/// a breaking change. Applications should write their code in anticipation of:
12973///
12974/// - New values appearing in future releases of the client library, **and**
12975/// - New values received dynamically, without application changes.
12976///
12977/// Please consult the [Working with enums] section in the user guide for some
12978/// guidelines.
12979///
12980/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12981#[derive(Clone, Debug, PartialEq)]
12982#[non_exhaustive]
12983pub enum ServingStatus {
12984 /// Not specified.
12985 Unspecified,
12986 /// Currently serving. Instances are created according to the
12987 /// scaling settings of the version.
12988 Serving,
12989 /// Disabled. No instances will be created and the scaling
12990 /// settings are ignored until the state of the version changes
12991 /// to `SERVING`.
12992 Stopped,
12993 /// If set, the enum was initialized with an unknown value.
12994 ///
12995 /// Applications can examine the value using [ServingStatus::value] or
12996 /// [ServingStatus::name].
12997 UnknownValue(serving_status::UnknownValue),
12998}
12999
13000#[doc(hidden)]
13001pub mod serving_status {
13002 #[allow(unused_imports)]
13003 use super::*;
13004 #[derive(Clone, Debug, PartialEq)]
13005 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13006}
13007
13008impl ServingStatus {
13009 /// Gets the enum value.
13010 ///
13011 /// Returns `None` if the enum contains an unknown value deserialized from
13012 /// the string representation of enums.
13013 pub fn value(&self) -> std::option::Option<i32> {
13014 match self {
13015 Self::Unspecified => std::option::Option::Some(0),
13016 Self::Serving => std::option::Option::Some(1),
13017 Self::Stopped => std::option::Option::Some(2),
13018 Self::UnknownValue(u) => u.0.value(),
13019 }
13020 }
13021
13022 /// Gets the enum value as a string.
13023 ///
13024 /// Returns `None` if the enum contains an unknown value deserialized from
13025 /// the integer representation of enums.
13026 pub fn name(&self) -> std::option::Option<&str> {
13027 match self {
13028 Self::Unspecified => std::option::Option::Some("SERVING_STATUS_UNSPECIFIED"),
13029 Self::Serving => std::option::Option::Some("SERVING"),
13030 Self::Stopped => std::option::Option::Some("STOPPED"),
13031 Self::UnknownValue(u) => u.0.name(),
13032 }
13033 }
13034}
13035
13036impl std::default::Default for ServingStatus {
13037 fn default() -> Self {
13038 use std::convert::From;
13039 Self::from(0)
13040 }
13041}
13042
13043impl std::fmt::Display for ServingStatus {
13044 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13045 wkt::internal::display_enum(f, self.name(), self.value())
13046 }
13047}
13048
13049impl std::convert::From<i32> for ServingStatus {
13050 fn from(value: i32) -> Self {
13051 match value {
13052 0 => Self::Unspecified,
13053 1 => Self::Serving,
13054 2 => Self::Stopped,
13055 _ => Self::UnknownValue(serving_status::UnknownValue(
13056 wkt::internal::UnknownEnumValue::Integer(value),
13057 )),
13058 }
13059 }
13060}
13061
13062impl std::convert::From<&str> for ServingStatus {
13063 fn from(value: &str) -> Self {
13064 use std::string::ToString;
13065 match value {
13066 "SERVING_STATUS_UNSPECIFIED" => Self::Unspecified,
13067 "SERVING" => Self::Serving,
13068 "STOPPED" => Self::Stopped,
13069 _ => Self::UnknownValue(serving_status::UnknownValue(
13070 wkt::internal::UnknownEnumValue::String(value.to_string()),
13071 )),
13072 }
13073 }
13074}
13075
13076impl serde::ser::Serialize for ServingStatus {
13077 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13078 where
13079 S: serde::Serializer,
13080 {
13081 match self {
13082 Self::Unspecified => serializer.serialize_i32(0),
13083 Self::Serving => serializer.serialize_i32(1),
13084 Self::Stopped => serializer.serialize_i32(2),
13085 Self::UnknownValue(u) => u.0.serialize(serializer),
13086 }
13087 }
13088}
13089
13090impl<'de> serde::de::Deserialize<'de> for ServingStatus {
13091 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13092 where
13093 D: serde::Deserializer<'de>,
13094 {
13095 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServingStatus>::new(
13096 ".google.appengine.v1.ServingStatus",
13097 ))
13098 }
13099}