google_cloud_appengine_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_longrunning;
25extern crate google_cloud_lro;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/)
38/// configuration for API handlers.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct ApiConfigHandler {
42 /// Action to take when users access resources that require
43 /// authentication. Defaults to `redirect`.
44 pub auth_fail_action: crate::model::AuthFailAction,
45
46 /// Level of login required to access this resource. Defaults to
47 /// `optional`.
48 pub login: crate::model::LoginRequirement,
49
50 /// Path to the script from the application root directory.
51 pub script: std::string::String,
52
53 /// Security (HTTPS) enforcement for this URL.
54 pub security_level: crate::model::SecurityLevel,
55
56 /// URL to serve the endpoint at.
57 pub url: std::string::String,
58
59 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl ApiConfigHandler {
63 pub fn new() -> Self {
64 std::default::Default::default()
65 }
66
67 /// Sets the value of [auth_fail_action][crate::model::ApiConfigHandler::auth_fail_action].
68 ///
69 /// # Example
70 /// ```ignore,no_run
71 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
72 /// use google_cloud_appengine_v1::model::AuthFailAction;
73 /// let x0 = ApiConfigHandler::new().set_auth_fail_action(AuthFailAction::Redirect);
74 /// let x1 = ApiConfigHandler::new().set_auth_fail_action(AuthFailAction::Unauthorized);
75 /// ```
76 pub fn set_auth_fail_action<T: std::convert::Into<crate::model::AuthFailAction>>(
77 mut self,
78 v: T,
79 ) -> Self {
80 self.auth_fail_action = v.into();
81 self
82 }
83
84 /// Sets the value of [login][crate::model::ApiConfigHandler::login].
85 ///
86 /// # Example
87 /// ```ignore,no_run
88 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
89 /// use google_cloud_appengine_v1::model::LoginRequirement;
90 /// let x0 = ApiConfigHandler::new().set_login(LoginRequirement::LoginOptional);
91 /// let x1 = ApiConfigHandler::new().set_login(LoginRequirement::LoginAdmin);
92 /// let x2 = ApiConfigHandler::new().set_login(LoginRequirement::LoginRequired);
93 /// ```
94 pub fn set_login<T: std::convert::Into<crate::model::LoginRequirement>>(
95 mut self,
96 v: T,
97 ) -> Self {
98 self.login = v.into();
99 self
100 }
101
102 /// Sets the value of [script][crate::model::ApiConfigHandler::script].
103 ///
104 /// # Example
105 /// ```ignore,no_run
106 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
107 /// let x = ApiConfigHandler::new().set_script("example");
108 /// ```
109 pub fn set_script<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110 self.script = v.into();
111 self
112 }
113
114 /// Sets the value of [security_level][crate::model::ApiConfigHandler::security_level].
115 ///
116 /// # Example
117 /// ```ignore,no_run
118 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
119 /// use google_cloud_appengine_v1::model::SecurityLevel;
120 /// let x0 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureNever);
121 /// let x1 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureOptional);
122 /// let x2 = ApiConfigHandler::new().set_security_level(SecurityLevel::SecureAlways);
123 /// ```
124 pub fn set_security_level<T: std::convert::Into<crate::model::SecurityLevel>>(
125 mut self,
126 v: T,
127 ) -> Self {
128 self.security_level = v.into();
129 self
130 }
131
132 /// Sets the value of [url][crate::model::ApiConfigHandler::url].
133 ///
134 /// # Example
135 /// ```ignore,no_run
136 /// # use google_cloud_appengine_v1::model::ApiConfigHandler;
137 /// let x = ApiConfigHandler::new().set_url("example");
138 /// ```
139 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
140 self.url = v.into();
141 self
142 }
143}
144
145impl wkt::message::Message for ApiConfigHandler {
146 fn typename() -> &'static str {
147 "type.googleapis.com/google.appengine.v1.ApiConfigHandler"
148 }
149}
150
151/// Custom static error page to be served when an error occurs.
152#[derive(Clone, Default, PartialEq)]
153#[non_exhaustive]
154pub struct ErrorHandler {
155 /// Error condition this handler applies to.
156 pub error_code: crate::model::error_handler::ErrorCode,
157
158 /// Static file content to be served for this error.
159 pub static_file: std::string::String,
160
161 /// MIME type of file. Defaults to `text/html`.
162 pub mime_type: std::string::String,
163
164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
165}
166
167impl ErrorHandler {
168 pub fn new() -> Self {
169 std::default::Default::default()
170 }
171
172 /// Sets the value of [error_code][crate::model::ErrorHandler::error_code].
173 ///
174 /// # Example
175 /// ```ignore,no_run
176 /// # use google_cloud_appengine_v1::model::ErrorHandler;
177 /// use google_cloud_appengine_v1::model::error_handler::ErrorCode;
178 /// let x0 = ErrorHandler::new().set_error_code(ErrorCode::OverQuota);
179 /// let x1 = ErrorHandler::new().set_error_code(ErrorCode::DosApiDenial);
180 /// let x2 = ErrorHandler::new().set_error_code(ErrorCode::Timeout);
181 /// ```
182 pub fn set_error_code<T: std::convert::Into<crate::model::error_handler::ErrorCode>>(
183 mut self,
184 v: T,
185 ) -> Self {
186 self.error_code = v.into();
187 self
188 }
189
190 /// Sets the value of [static_file][crate::model::ErrorHandler::static_file].
191 ///
192 /// # Example
193 /// ```ignore,no_run
194 /// # use google_cloud_appengine_v1::model::ErrorHandler;
195 /// let x = ErrorHandler::new().set_static_file("example");
196 /// ```
197 pub fn set_static_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
198 self.static_file = v.into();
199 self
200 }
201
202 /// Sets the value of [mime_type][crate::model::ErrorHandler::mime_type].
203 ///
204 /// # Example
205 /// ```ignore,no_run
206 /// # use google_cloud_appengine_v1::model::ErrorHandler;
207 /// let x = ErrorHandler::new().set_mime_type("example");
208 /// ```
209 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
210 self.mime_type = v.into();
211 self
212 }
213}
214
215impl wkt::message::Message for ErrorHandler {
216 fn typename() -> &'static str {
217 "type.googleapis.com/google.appengine.v1.ErrorHandler"
218 }
219}
220
221/// Defines additional types related to [ErrorHandler].
222pub mod error_handler {
223 #[allow(unused_imports)]
224 use super::*;
225
226 /// Error codes.
227 ///
228 /// # Working with unknown values
229 ///
230 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
231 /// additional enum variants at any time. Adding new variants is not considered
232 /// a breaking change. Applications should write their code in anticipation of:
233 ///
234 /// - New values appearing in future releases of the client library, **and**
235 /// - New values received dynamically, without application changes.
236 ///
237 /// Please consult the [Working with enums] section in the user guide for some
238 /// guidelines.
239 ///
240 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
241 #[derive(Clone, Debug, PartialEq)]
242 #[non_exhaustive]
243 pub enum ErrorCode {
244 /// Not specified. ERROR_CODE_DEFAULT is assumed.
245 Unspecified,
246 /// All other error types.
247 Default,
248 /// Application has exceeded a resource quota.
249 OverQuota,
250 /// Client blocked by the application's Denial of Service protection
251 /// configuration.
252 DosApiDenial,
253 /// Deadline reached before the application responds.
254 Timeout,
255 /// If set, the enum was initialized with an unknown value.
256 ///
257 /// Applications can examine the value using [ErrorCode::value] or
258 /// [ErrorCode::name].
259 UnknownValue(error_code::UnknownValue),
260 }
261
262 #[doc(hidden)]
263 pub mod error_code {
264 #[allow(unused_imports)]
265 use super::*;
266 #[derive(Clone, Debug, PartialEq)]
267 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
268 }
269
270 impl ErrorCode {
271 /// Gets the enum value.
272 ///
273 /// Returns `None` if the enum contains an unknown value deserialized from
274 /// the string representation of enums.
275 pub fn value(&self) -> std::option::Option<i32> {
276 match self {
277 Self::Unspecified => std::option::Option::Some(0),
278 Self::Default => std::option::Option::Some(0),
279 Self::OverQuota => std::option::Option::Some(1),
280 Self::DosApiDenial => std::option::Option::Some(2),
281 Self::Timeout => std::option::Option::Some(3),
282 Self::UnknownValue(u) => u.0.value(),
283 }
284 }
285
286 /// Gets the enum value as a string.
287 ///
288 /// Returns `None` if the enum contains an unknown value deserialized from
289 /// the integer representation of enums.
290 pub fn name(&self) -> std::option::Option<&str> {
291 match self {
292 Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
293 Self::Default => std::option::Option::Some("ERROR_CODE_DEFAULT"),
294 Self::OverQuota => std::option::Option::Some("ERROR_CODE_OVER_QUOTA"),
295 Self::DosApiDenial => std::option::Option::Some("ERROR_CODE_DOS_API_DENIAL"),
296 Self::Timeout => std::option::Option::Some("ERROR_CODE_TIMEOUT"),
297 Self::UnknownValue(u) => u.0.name(),
298 }
299 }
300 }
301
302 impl std::default::Default for ErrorCode {
303 fn default() -> Self {
304 use std::convert::From;
305 Self::from(0)
306 }
307 }
308
309 impl std::fmt::Display for ErrorCode {
310 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
311 wkt::internal::display_enum(f, self.name(), self.value())
312 }
313 }
314
315 impl std::convert::From<i32> for ErrorCode {
316 fn from(value: i32) -> Self {
317 match value {
318 0 => Self::Default,
319 1 => Self::OverQuota,
320 2 => Self::DosApiDenial,
321 3 => Self::Timeout,
322 _ => Self::UnknownValue(error_code::UnknownValue(
323 wkt::internal::UnknownEnumValue::Integer(value),
324 )),
325 }
326 }
327 }
328
329 impl std::convert::From<&str> for ErrorCode {
330 fn from(value: &str) -> Self {
331 use std::string::ToString;
332 match value {
333 "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
334 "ERROR_CODE_DEFAULT" => Self::Default,
335 "ERROR_CODE_OVER_QUOTA" => Self::OverQuota,
336 "ERROR_CODE_DOS_API_DENIAL" => Self::DosApiDenial,
337 "ERROR_CODE_TIMEOUT" => Self::Timeout,
338 _ => Self::UnknownValue(error_code::UnknownValue(
339 wkt::internal::UnknownEnumValue::String(value.to_string()),
340 )),
341 }
342 }
343 }
344
345 impl serde::ser::Serialize for ErrorCode {
346 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
347 where
348 S: serde::Serializer,
349 {
350 match self {
351 Self::Unspecified => serializer.serialize_i32(0),
352 Self::Default => serializer.serialize_i32(0),
353 Self::OverQuota => serializer.serialize_i32(1),
354 Self::DosApiDenial => serializer.serialize_i32(2),
355 Self::Timeout => serializer.serialize_i32(3),
356 Self::UnknownValue(u) => u.0.serialize(serializer),
357 }
358 }
359 }
360
361 impl<'de> serde::de::Deserialize<'de> for ErrorCode {
362 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
363 where
364 D: serde::Deserializer<'de>,
365 {
366 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
367 ".google.appengine.v1.ErrorHandler.ErrorCode",
368 ))
369 }
370 }
371}
372
373/// URL pattern and description of how the URL should be handled. App Engine can
374/// handle URLs by executing application code or by serving static files
375/// uploaded with the version, such as images, CSS, or JavaScript.
376#[derive(Clone, Default, PartialEq)]
377#[non_exhaustive]
378pub struct UrlMap {
379 /// URL prefix. Uses regular expression syntax, which means regexp
380 /// special characters must be escaped, but should not contain groupings.
381 /// All URLs that begin with this prefix are handled by this handler, using the
382 /// portion of the URL after the prefix as part of the file path.
383 pub url_regex: std::string::String,
384
385 /// Security (HTTPS) enforcement for this URL.
386 pub security_level: crate::model::SecurityLevel,
387
388 /// Level of login required to access this resource. Not supported for Node.js
389 /// in the App Engine standard environment.
390 pub login: crate::model::LoginRequirement,
391
392 /// Action to take when users access resources that require
393 /// authentication. Defaults to `redirect`.
394 pub auth_fail_action: crate::model::AuthFailAction,
395
396 /// `30x` code to use when performing redirects for the `secure` field.
397 /// Defaults to `302`.
398 pub redirect_http_response_code: crate::model::url_map::RedirectHttpResponseCode,
399
400 /// Type of handler for this URL pattern.
401 pub handler_type: std::option::Option<crate::model::url_map::HandlerType>,
402
403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
404}
405
406impl UrlMap {
407 pub fn new() -> Self {
408 std::default::Default::default()
409 }
410
411 /// Sets the value of [url_regex][crate::model::UrlMap::url_regex].
412 ///
413 /// # Example
414 /// ```ignore,no_run
415 /// # use google_cloud_appengine_v1::model::UrlMap;
416 /// let x = UrlMap::new().set_url_regex("example");
417 /// ```
418 pub fn set_url_regex<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
419 self.url_regex = v.into();
420 self
421 }
422
423 /// Sets the value of [security_level][crate::model::UrlMap::security_level].
424 ///
425 /// # Example
426 /// ```ignore,no_run
427 /// # use google_cloud_appengine_v1::model::UrlMap;
428 /// use google_cloud_appengine_v1::model::SecurityLevel;
429 /// let x0 = UrlMap::new().set_security_level(SecurityLevel::SecureNever);
430 /// let x1 = UrlMap::new().set_security_level(SecurityLevel::SecureOptional);
431 /// let x2 = UrlMap::new().set_security_level(SecurityLevel::SecureAlways);
432 /// ```
433 pub fn set_security_level<T: std::convert::Into<crate::model::SecurityLevel>>(
434 mut self,
435 v: T,
436 ) -> Self {
437 self.security_level = v.into();
438 self
439 }
440
441 /// Sets the value of [login][crate::model::UrlMap::login].
442 ///
443 /// # Example
444 /// ```ignore,no_run
445 /// # use google_cloud_appengine_v1::model::UrlMap;
446 /// use google_cloud_appengine_v1::model::LoginRequirement;
447 /// let x0 = UrlMap::new().set_login(LoginRequirement::LoginOptional);
448 /// let x1 = UrlMap::new().set_login(LoginRequirement::LoginAdmin);
449 /// let x2 = UrlMap::new().set_login(LoginRequirement::LoginRequired);
450 /// ```
451 pub fn set_login<T: std::convert::Into<crate::model::LoginRequirement>>(
452 mut self,
453 v: T,
454 ) -> Self {
455 self.login = v.into();
456 self
457 }
458
459 /// Sets the value of [auth_fail_action][crate::model::UrlMap::auth_fail_action].
460 ///
461 /// # Example
462 /// ```ignore,no_run
463 /// # use google_cloud_appengine_v1::model::UrlMap;
464 /// use google_cloud_appengine_v1::model::AuthFailAction;
465 /// let x0 = UrlMap::new().set_auth_fail_action(AuthFailAction::Redirect);
466 /// let x1 = UrlMap::new().set_auth_fail_action(AuthFailAction::Unauthorized);
467 /// ```
468 pub fn set_auth_fail_action<T: std::convert::Into<crate::model::AuthFailAction>>(
469 mut self,
470 v: T,
471 ) -> Self {
472 self.auth_fail_action = v.into();
473 self
474 }
475
476 /// Sets the value of [redirect_http_response_code][crate::model::UrlMap::redirect_http_response_code].
477 ///
478 /// # Example
479 /// ```ignore,no_run
480 /// # use google_cloud_appengine_v1::model::UrlMap;
481 /// use google_cloud_appengine_v1::model::url_map::RedirectHttpResponseCode;
482 /// let x0 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode301);
483 /// let x1 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode302);
484 /// let x2 = UrlMap::new().set_redirect_http_response_code(RedirectHttpResponseCode::RedirectHttpResponseCode303);
485 /// ```
486 pub fn set_redirect_http_response_code<
487 T: std::convert::Into<crate::model::url_map::RedirectHttpResponseCode>,
488 >(
489 mut self,
490 v: T,
491 ) -> Self {
492 self.redirect_http_response_code = v.into();
493 self
494 }
495
496 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type].
497 ///
498 /// Note that all the setters affecting `handler_type` are mutually
499 /// exclusive.
500 ///
501 /// # Example
502 /// ```ignore,no_run
503 /// # use google_cloud_appengine_v1::model::UrlMap;
504 /// use google_cloud_appengine_v1::model::StaticFilesHandler;
505 /// let x = UrlMap::new().set_handler_type(Some(
506 /// google_cloud_appengine_v1::model::url_map::HandlerType::StaticFiles(StaticFilesHandler::default().into())));
507 /// ```
508 pub fn set_handler_type<
509 T: std::convert::Into<std::option::Option<crate::model::url_map::HandlerType>>,
510 >(
511 mut self,
512 v: T,
513 ) -> Self {
514 self.handler_type = v.into();
515 self
516 }
517
518 /// The value of [handler_type][crate::model::UrlMap::handler_type]
519 /// if it holds a `StaticFiles`, `None` if the field is not set or
520 /// holds a different branch.
521 pub fn static_files(
522 &self,
523 ) -> std::option::Option<&std::boxed::Box<crate::model::StaticFilesHandler>> {
524 #[allow(unreachable_patterns)]
525 self.handler_type.as_ref().and_then(|v| match v {
526 crate::model::url_map::HandlerType::StaticFiles(v) => std::option::Option::Some(v),
527 _ => std::option::Option::None,
528 })
529 }
530
531 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
532 /// to hold a `StaticFiles`.
533 ///
534 /// Note that all the setters affecting `handler_type` are
535 /// mutually exclusive.
536 ///
537 /// # Example
538 /// ```ignore,no_run
539 /// # use google_cloud_appengine_v1::model::UrlMap;
540 /// use google_cloud_appengine_v1::model::StaticFilesHandler;
541 /// let x = UrlMap::new().set_static_files(StaticFilesHandler::default()/* use setters */);
542 /// assert!(x.static_files().is_some());
543 /// assert!(x.script().is_none());
544 /// assert!(x.api_endpoint().is_none());
545 /// ```
546 pub fn set_static_files<
547 T: std::convert::Into<std::boxed::Box<crate::model::StaticFilesHandler>>,
548 >(
549 mut self,
550 v: T,
551 ) -> Self {
552 self.handler_type =
553 std::option::Option::Some(crate::model::url_map::HandlerType::StaticFiles(v.into()));
554 self
555 }
556
557 /// The value of [handler_type][crate::model::UrlMap::handler_type]
558 /// if it holds a `Script`, `None` if the field is not set or
559 /// holds a different branch.
560 pub fn script(&self) -> std::option::Option<&std::boxed::Box<crate::model::ScriptHandler>> {
561 #[allow(unreachable_patterns)]
562 self.handler_type.as_ref().and_then(|v| match v {
563 crate::model::url_map::HandlerType::Script(v) => std::option::Option::Some(v),
564 _ => std::option::Option::None,
565 })
566 }
567
568 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
569 /// to hold a `Script`.
570 ///
571 /// Note that all the setters affecting `handler_type` are
572 /// mutually exclusive.
573 ///
574 /// # Example
575 /// ```ignore,no_run
576 /// # use google_cloud_appengine_v1::model::UrlMap;
577 /// use google_cloud_appengine_v1::model::ScriptHandler;
578 /// let x = UrlMap::new().set_script(ScriptHandler::default()/* use setters */);
579 /// assert!(x.script().is_some());
580 /// assert!(x.static_files().is_none());
581 /// assert!(x.api_endpoint().is_none());
582 /// ```
583 pub fn set_script<T: std::convert::Into<std::boxed::Box<crate::model::ScriptHandler>>>(
584 mut self,
585 v: T,
586 ) -> Self {
587 self.handler_type =
588 std::option::Option::Some(crate::model::url_map::HandlerType::Script(v.into()));
589 self
590 }
591
592 /// The value of [handler_type][crate::model::UrlMap::handler_type]
593 /// if it holds a `ApiEndpoint`, `None` if the field is not set or
594 /// holds a different branch.
595 pub fn api_endpoint(
596 &self,
597 ) -> std::option::Option<&std::boxed::Box<crate::model::ApiEndpointHandler>> {
598 #[allow(unreachable_patterns)]
599 self.handler_type.as_ref().and_then(|v| match v {
600 crate::model::url_map::HandlerType::ApiEndpoint(v) => std::option::Option::Some(v),
601 _ => std::option::Option::None,
602 })
603 }
604
605 /// Sets the value of [handler_type][crate::model::UrlMap::handler_type]
606 /// to hold a `ApiEndpoint`.
607 ///
608 /// Note that all the setters affecting `handler_type` are
609 /// mutually exclusive.
610 ///
611 /// # Example
612 /// ```ignore,no_run
613 /// # use google_cloud_appengine_v1::model::UrlMap;
614 /// use google_cloud_appengine_v1::model::ApiEndpointHandler;
615 /// let x = UrlMap::new().set_api_endpoint(ApiEndpointHandler::default()/* use setters */);
616 /// assert!(x.api_endpoint().is_some());
617 /// assert!(x.static_files().is_none());
618 /// assert!(x.script().is_none());
619 /// ```
620 pub fn set_api_endpoint<
621 T: std::convert::Into<std::boxed::Box<crate::model::ApiEndpointHandler>>,
622 >(
623 mut self,
624 v: T,
625 ) -> Self {
626 self.handler_type =
627 std::option::Option::Some(crate::model::url_map::HandlerType::ApiEndpoint(v.into()));
628 self
629 }
630}
631
632impl wkt::message::Message for UrlMap {
633 fn typename() -> &'static str {
634 "type.googleapis.com/google.appengine.v1.UrlMap"
635 }
636}
637
638/// Defines additional types related to [UrlMap].
639pub mod url_map {
640 #[allow(unused_imports)]
641 use super::*;
642
643 /// Redirect codes.
644 ///
645 /// # Working with unknown values
646 ///
647 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
648 /// additional enum variants at any time. Adding new variants is not considered
649 /// a breaking change. Applications should write their code in anticipation of:
650 ///
651 /// - New values appearing in future releases of the client library, **and**
652 /// - New values received dynamically, without application changes.
653 ///
654 /// Please consult the [Working with enums] section in the user guide for some
655 /// guidelines.
656 ///
657 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
658 #[derive(Clone, Debug, PartialEq)]
659 #[non_exhaustive]
660 pub enum RedirectHttpResponseCode {
661 /// Not specified. `302` is assumed.
662 Unspecified,
663 /// `301 Moved Permanently` code.
664 RedirectHttpResponseCode301,
665 /// `302 Moved Temporarily` code.
666 RedirectHttpResponseCode302,
667 /// `303 See Other` code.
668 RedirectHttpResponseCode303,
669 /// `307 Temporary Redirect` code.
670 RedirectHttpResponseCode307,
671 /// If set, the enum was initialized with an unknown value.
672 ///
673 /// Applications can examine the value using [RedirectHttpResponseCode::value] or
674 /// [RedirectHttpResponseCode::name].
675 UnknownValue(redirect_http_response_code::UnknownValue),
676 }
677
678 #[doc(hidden)]
679 pub mod redirect_http_response_code {
680 #[allow(unused_imports)]
681 use super::*;
682 #[derive(Clone, Debug, PartialEq)]
683 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
684 }
685
686 impl RedirectHttpResponseCode {
687 /// Gets the enum value.
688 ///
689 /// Returns `None` if the enum contains an unknown value deserialized from
690 /// the string representation of enums.
691 pub fn value(&self) -> std::option::Option<i32> {
692 match self {
693 Self::Unspecified => std::option::Option::Some(0),
694 Self::RedirectHttpResponseCode301 => std::option::Option::Some(1),
695 Self::RedirectHttpResponseCode302 => std::option::Option::Some(2),
696 Self::RedirectHttpResponseCode303 => std::option::Option::Some(3),
697 Self::RedirectHttpResponseCode307 => std::option::Option::Some(4),
698 Self::UnknownValue(u) => u.0.value(),
699 }
700 }
701
702 /// Gets the enum value as a string.
703 ///
704 /// Returns `None` if the enum contains an unknown value deserialized from
705 /// the integer representation of enums.
706 pub fn name(&self) -> std::option::Option<&str> {
707 match self {
708 Self::Unspecified => {
709 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED")
710 }
711 Self::RedirectHttpResponseCode301 => {
712 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_301")
713 }
714 Self::RedirectHttpResponseCode302 => {
715 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_302")
716 }
717 Self::RedirectHttpResponseCode303 => {
718 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_303")
719 }
720 Self::RedirectHttpResponseCode307 => {
721 std::option::Option::Some("REDIRECT_HTTP_RESPONSE_CODE_307")
722 }
723 Self::UnknownValue(u) => u.0.name(),
724 }
725 }
726 }
727
728 impl std::default::Default for RedirectHttpResponseCode {
729 fn default() -> Self {
730 use std::convert::From;
731 Self::from(0)
732 }
733 }
734
735 impl std::fmt::Display for RedirectHttpResponseCode {
736 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
737 wkt::internal::display_enum(f, self.name(), self.value())
738 }
739 }
740
741 impl std::convert::From<i32> for RedirectHttpResponseCode {
742 fn from(value: i32) -> Self {
743 match value {
744 0 => Self::Unspecified,
745 1 => Self::RedirectHttpResponseCode301,
746 2 => Self::RedirectHttpResponseCode302,
747 3 => Self::RedirectHttpResponseCode303,
748 4 => Self::RedirectHttpResponseCode307,
749 _ => Self::UnknownValue(redirect_http_response_code::UnknownValue(
750 wkt::internal::UnknownEnumValue::Integer(value),
751 )),
752 }
753 }
754 }
755
756 impl std::convert::From<&str> for RedirectHttpResponseCode {
757 fn from(value: &str) -> Self {
758 use std::string::ToString;
759 match value {
760 "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED" => Self::Unspecified,
761 "REDIRECT_HTTP_RESPONSE_CODE_301" => Self::RedirectHttpResponseCode301,
762 "REDIRECT_HTTP_RESPONSE_CODE_302" => Self::RedirectHttpResponseCode302,
763 "REDIRECT_HTTP_RESPONSE_CODE_303" => Self::RedirectHttpResponseCode303,
764 "REDIRECT_HTTP_RESPONSE_CODE_307" => Self::RedirectHttpResponseCode307,
765 _ => Self::UnknownValue(redirect_http_response_code::UnknownValue(
766 wkt::internal::UnknownEnumValue::String(value.to_string()),
767 )),
768 }
769 }
770 }
771
772 impl serde::ser::Serialize for RedirectHttpResponseCode {
773 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
774 where
775 S: serde::Serializer,
776 {
777 match self {
778 Self::Unspecified => serializer.serialize_i32(0),
779 Self::RedirectHttpResponseCode301 => serializer.serialize_i32(1),
780 Self::RedirectHttpResponseCode302 => serializer.serialize_i32(2),
781 Self::RedirectHttpResponseCode303 => serializer.serialize_i32(3),
782 Self::RedirectHttpResponseCode307 => serializer.serialize_i32(4),
783 Self::UnknownValue(u) => u.0.serialize(serializer),
784 }
785 }
786 }
787
788 impl<'de> serde::de::Deserialize<'de> for RedirectHttpResponseCode {
789 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
790 where
791 D: serde::Deserializer<'de>,
792 {
793 deserializer.deserialize_any(
794 wkt::internal::EnumVisitor::<RedirectHttpResponseCode>::new(
795 ".google.appengine.v1.UrlMap.RedirectHttpResponseCode",
796 ),
797 )
798 }
799 }
800
801 /// Type of handler for this URL pattern.
802 #[derive(Clone, Debug, PartialEq)]
803 #[non_exhaustive]
804 pub enum HandlerType {
805 /// Returns the contents of a file, such as an image, as the response.
806 StaticFiles(std::boxed::Box<crate::model::StaticFilesHandler>),
807 /// Executes a script to handle the requests that match this URL
808 /// pattern. Only the `auto` value is supported for Node.js in the
809 /// App Engine standard environment, for example `"script": "auto"`.
810 Script(std::boxed::Box<crate::model::ScriptHandler>),
811 /// Uses API Endpoints to handle requests.
812 ApiEndpoint(std::boxed::Box<crate::model::ApiEndpointHandler>),
813 }
814}
815
816/// Files served directly to the user for a given URL, such as images, CSS
817/// stylesheets, or JavaScript source files. Static file handlers describe which
818/// files in the application directory are static files, and which URLs serve
819/// them.
820#[derive(Clone, Default, PartialEq)]
821#[non_exhaustive]
822pub struct StaticFilesHandler {
823 /// Path to the static files matched by the URL pattern, from the
824 /// application root directory. The path can refer to text matched in groupings
825 /// in the URL pattern.
826 pub path: std::string::String,
827
828 /// Regular expression that matches the file paths for all files that should be
829 /// referenced by this handler.
830 pub upload_path_regex: std::string::String,
831
832 /// HTTP headers to use for all responses from these URLs.
833 pub http_headers: std::collections::HashMap<std::string::String, std::string::String>,
834
835 /// MIME type used to serve all files served by this handler.
836 ///
837 /// Defaults to file-specific MIME types, which are derived from each file's
838 /// filename extension.
839 pub mime_type: std::string::String,
840
841 /// Time a static file served by this handler should be cached
842 /// by web proxies and browsers.
843 pub expiration: std::option::Option<wkt::Duration>,
844
845 /// Whether this handler should match the request if the file
846 /// referenced by the handler does not exist.
847 pub require_matching_file: bool,
848
849 /// Whether files should also be uploaded as code data. By default, files
850 /// declared in static file handlers are uploaded as static
851 /// data and are only served to end users; they cannot be read by the
852 /// application. If enabled, uploads are charged against both your code and
853 /// static data storage resource quotas.
854 pub application_readable: bool,
855
856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
857}
858
859impl StaticFilesHandler {
860 pub fn new() -> Self {
861 std::default::Default::default()
862 }
863
864 /// Sets the value of [path][crate::model::StaticFilesHandler::path].
865 ///
866 /// # Example
867 /// ```ignore,no_run
868 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
869 /// let x = StaticFilesHandler::new().set_path("example");
870 /// ```
871 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
872 self.path = v.into();
873 self
874 }
875
876 /// Sets the value of [upload_path_regex][crate::model::StaticFilesHandler::upload_path_regex].
877 ///
878 /// # Example
879 /// ```ignore,no_run
880 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
881 /// let x = StaticFilesHandler::new().set_upload_path_regex("example");
882 /// ```
883 pub fn set_upload_path_regex<T: std::convert::Into<std::string::String>>(
884 mut self,
885 v: T,
886 ) -> Self {
887 self.upload_path_regex = v.into();
888 self
889 }
890
891 /// Sets the value of [http_headers][crate::model::StaticFilesHandler::http_headers].
892 ///
893 /// # Example
894 /// ```ignore,no_run
895 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
896 /// let x = StaticFilesHandler::new().set_http_headers([
897 /// ("key0", "abc"),
898 /// ("key1", "xyz"),
899 /// ]);
900 /// ```
901 pub fn set_http_headers<T, K, V>(mut self, v: T) -> Self
902 where
903 T: std::iter::IntoIterator<Item = (K, V)>,
904 K: std::convert::Into<std::string::String>,
905 V: std::convert::Into<std::string::String>,
906 {
907 use std::iter::Iterator;
908 self.http_headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
909 self
910 }
911
912 /// Sets the value of [mime_type][crate::model::StaticFilesHandler::mime_type].
913 ///
914 /// # Example
915 /// ```ignore,no_run
916 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
917 /// let x = StaticFilesHandler::new().set_mime_type("example");
918 /// ```
919 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
920 self.mime_type = v.into();
921 self
922 }
923
924 /// Sets the value of [expiration][crate::model::StaticFilesHandler::expiration].
925 ///
926 /// # Example
927 /// ```ignore,no_run
928 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
929 /// use wkt::Duration;
930 /// let x = StaticFilesHandler::new().set_expiration(Duration::default()/* use setters */);
931 /// ```
932 pub fn set_expiration<T>(mut self, v: T) -> Self
933 where
934 T: std::convert::Into<wkt::Duration>,
935 {
936 self.expiration = std::option::Option::Some(v.into());
937 self
938 }
939
940 /// Sets or clears the value of [expiration][crate::model::StaticFilesHandler::expiration].
941 ///
942 /// # Example
943 /// ```ignore,no_run
944 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
945 /// use wkt::Duration;
946 /// let x = StaticFilesHandler::new().set_or_clear_expiration(Some(Duration::default()/* use setters */));
947 /// let x = StaticFilesHandler::new().set_or_clear_expiration(None::<Duration>);
948 /// ```
949 pub fn set_or_clear_expiration<T>(mut self, v: std::option::Option<T>) -> Self
950 where
951 T: std::convert::Into<wkt::Duration>,
952 {
953 self.expiration = v.map(|x| x.into());
954 self
955 }
956
957 /// Sets the value of [require_matching_file][crate::model::StaticFilesHandler::require_matching_file].
958 ///
959 /// # Example
960 /// ```ignore,no_run
961 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
962 /// let x = StaticFilesHandler::new().set_require_matching_file(true);
963 /// ```
964 pub fn set_require_matching_file<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
965 self.require_matching_file = v.into();
966 self
967 }
968
969 /// Sets the value of [application_readable][crate::model::StaticFilesHandler::application_readable].
970 ///
971 /// # Example
972 /// ```ignore,no_run
973 /// # use google_cloud_appengine_v1::model::StaticFilesHandler;
974 /// let x = StaticFilesHandler::new().set_application_readable(true);
975 /// ```
976 pub fn set_application_readable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
977 self.application_readable = v.into();
978 self
979 }
980}
981
982impl wkt::message::Message for StaticFilesHandler {
983 fn typename() -> &'static str {
984 "type.googleapis.com/google.appengine.v1.StaticFilesHandler"
985 }
986}
987
988/// Executes a script to handle the request that matches the URL pattern.
989#[derive(Clone, Default, PartialEq)]
990#[non_exhaustive]
991pub struct ScriptHandler {
992 /// Path to the script from the application root directory.
993 pub script_path: std::string::String,
994
995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
996}
997
998impl ScriptHandler {
999 pub fn new() -> Self {
1000 std::default::Default::default()
1001 }
1002
1003 /// Sets the value of [script_path][crate::model::ScriptHandler::script_path].
1004 ///
1005 /// # Example
1006 /// ```ignore,no_run
1007 /// # use google_cloud_appengine_v1::model::ScriptHandler;
1008 /// let x = ScriptHandler::new().set_script_path("example");
1009 /// ```
1010 pub fn set_script_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1011 self.script_path = v.into();
1012 self
1013 }
1014}
1015
1016impl wkt::message::Message for ScriptHandler {
1017 fn typename() -> &'static str {
1018 "type.googleapis.com/google.appengine.v1.ScriptHandler"
1019 }
1020}
1021
1022/// Uses Google Cloud Endpoints to handle requests.
1023#[derive(Clone, Default, PartialEq)]
1024#[non_exhaustive]
1025pub struct ApiEndpointHandler {
1026 /// Path to the script from the application root directory.
1027 pub script_path: std::string::String,
1028
1029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1030}
1031
1032impl ApiEndpointHandler {
1033 pub fn new() -> Self {
1034 std::default::Default::default()
1035 }
1036
1037 /// Sets the value of [script_path][crate::model::ApiEndpointHandler::script_path].
1038 ///
1039 /// # Example
1040 /// ```ignore,no_run
1041 /// # use google_cloud_appengine_v1::model::ApiEndpointHandler;
1042 /// let x = ApiEndpointHandler::new().set_script_path("example");
1043 /// ```
1044 pub fn set_script_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1045 self.script_path = v.into();
1046 self
1047 }
1048}
1049
1050impl wkt::message::Message for ApiEndpointHandler {
1051 fn typename() -> &'static str {
1052 "type.googleapis.com/google.appengine.v1.ApiEndpointHandler"
1053 }
1054}
1055
1056/// Health checking configuration for VM instances. Unhealthy instances
1057/// are killed and replaced with new instances. Only applicable for
1058/// instances in App Engine flexible environment.
1059#[derive(Clone, Default, PartialEq)]
1060#[non_exhaustive]
1061pub struct HealthCheck {
1062 /// Whether to explicitly disable health checks for this instance.
1063 pub disable_health_check: bool,
1064
1065 /// Host header to send when performing an HTTP health check.
1066 /// Example: "myapp.appspot.com"
1067 pub host: std::string::String,
1068
1069 /// Number of consecutive successful health checks required before receiving
1070 /// traffic.
1071 pub healthy_threshold: u32,
1072
1073 /// Number of consecutive failed health checks required before removing
1074 /// traffic.
1075 pub unhealthy_threshold: u32,
1076
1077 /// Number of consecutive failed health checks required before an instance is
1078 /// restarted.
1079 pub restart_threshold: u32,
1080
1081 /// Interval between health checks.
1082 pub check_interval: std::option::Option<wkt::Duration>,
1083
1084 /// Time before the health check is considered failed.
1085 pub timeout: std::option::Option<wkt::Duration>,
1086
1087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1088}
1089
1090impl HealthCheck {
1091 pub fn new() -> Self {
1092 std::default::Default::default()
1093 }
1094
1095 /// Sets the value of [disable_health_check][crate::model::HealthCheck::disable_health_check].
1096 ///
1097 /// # Example
1098 /// ```ignore,no_run
1099 /// # use google_cloud_appengine_v1::model::HealthCheck;
1100 /// let x = HealthCheck::new().set_disable_health_check(true);
1101 /// ```
1102 pub fn set_disable_health_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1103 self.disable_health_check = v.into();
1104 self
1105 }
1106
1107 /// Sets the value of [host][crate::model::HealthCheck::host].
1108 ///
1109 /// # Example
1110 /// ```ignore,no_run
1111 /// # use google_cloud_appengine_v1::model::HealthCheck;
1112 /// let x = HealthCheck::new().set_host("example");
1113 /// ```
1114 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1115 self.host = v.into();
1116 self
1117 }
1118
1119 /// Sets the value of [healthy_threshold][crate::model::HealthCheck::healthy_threshold].
1120 ///
1121 /// # Example
1122 /// ```ignore,no_run
1123 /// # use google_cloud_appengine_v1::model::HealthCheck;
1124 /// let x = HealthCheck::new().set_healthy_threshold(42_u32);
1125 /// ```
1126 pub fn set_healthy_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1127 self.healthy_threshold = v.into();
1128 self
1129 }
1130
1131 /// Sets the value of [unhealthy_threshold][crate::model::HealthCheck::unhealthy_threshold].
1132 ///
1133 /// # Example
1134 /// ```ignore,no_run
1135 /// # use google_cloud_appengine_v1::model::HealthCheck;
1136 /// let x = HealthCheck::new().set_unhealthy_threshold(42_u32);
1137 /// ```
1138 pub fn set_unhealthy_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1139 self.unhealthy_threshold = v.into();
1140 self
1141 }
1142
1143 /// Sets the value of [restart_threshold][crate::model::HealthCheck::restart_threshold].
1144 ///
1145 /// # Example
1146 /// ```ignore,no_run
1147 /// # use google_cloud_appengine_v1::model::HealthCheck;
1148 /// let x = HealthCheck::new().set_restart_threshold(42_u32);
1149 /// ```
1150 pub fn set_restart_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1151 self.restart_threshold = v.into();
1152 self
1153 }
1154
1155 /// Sets the value of [check_interval][crate::model::HealthCheck::check_interval].
1156 ///
1157 /// # Example
1158 /// ```ignore,no_run
1159 /// # use google_cloud_appengine_v1::model::HealthCheck;
1160 /// use wkt::Duration;
1161 /// let x = HealthCheck::new().set_check_interval(Duration::default()/* use setters */);
1162 /// ```
1163 pub fn set_check_interval<T>(mut self, v: T) -> Self
1164 where
1165 T: std::convert::Into<wkt::Duration>,
1166 {
1167 self.check_interval = std::option::Option::Some(v.into());
1168 self
1169 }
1170
1171 /// Sets or clears the value of [check_interval][crate::model::HealthCheck::check_interval].
1172 ///
1173 /// # Example
1174 /// ```ignore,no_run
1175 /// # use google_cloud_appengine_v1::model::HealthCheck;
1176 /// use wkt::Duration;
1177 /// let x = HealthCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1178 /// let x = HealthCheck::new().set_or_clear_check_interval(None::<Duration>);
1179 /// ```
1180 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1181 where
1182 T: std::convert::Into<wkt::Duration>,
1183 {
1184 self.check_interval = v.map(|x| x.into());
1185 self
1186 }
1187
1188 /// Sets the value of [timeout][crate::model::HealthCheck::timeout].
1189 ///
1190 /// # Example
1191 /// ```ignore,no_run
1192 /// # use google_cloud_appengine_v1::model::HealthCheck;
1193 /// use wkt::Duration;
1194 /// let x = HealthCheck::new().set_timeout(Duration::default()/* use setters */);
1195 /// ```
1196 pub fn set_timeout<T>(mut self, v: T) -> Self
1197 where
1198 T: std::convert::Into<wkt::Duration>,
1199 {
1200 self.timeout = std::option::Option::Some(v.into());
1201 self
1202 }
1203
1204 /// Sets or clears the value of [timeout][crate::model::HealthCheck::timeout].
1205 ///
1206 /// # Example
1207 /// ```ignore,no_run
1208 /// # use google_cloud_appengine_v1::model::HealthCheck;
1209 /// use wkt::Duration;
1210 /// let x = HealthCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1211 /// let x = HealthCheck::new().set_or_clear_timeout(None::<Duration>);
1212 /// ```
1213 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1214 where
1215 T: std::convert::Into<wkt::Duration>,
1216 {
1217 self.timeout = v.map(|x| x.into());
1218 self
1219 }
1220}
1221
1222impl wkt::message::Message for HealthCheck {
1223 fn typename() -> &'static str {
1224 "type.googleapis.com/google.appengine.v1.HealthCheck"
1225 }
1226}
1227
1228/// Readiness checking configuration for VM instances. Unhealthy instances
1229/// are removed from traffic rotation.
1230#[derive(Clone, Default, PartialEq)]
1231#[non_exhaustive]
1232pub struct ReadinessCheck {
1233 /// The request path.
1234 pub path: std::string::String,
1235
1236 /// Host header to send when performing a HTTP Readiness check.
1237 /// Example: "myapp.appspot.com"
1238 pub host: std::string::String,
1239
1240 /// Number of consecutive failed checks required before removing
1241 /// traffic.
1242 pub failure_threshold: u32,
1243
1244 /// Number of consecutive successful checks required before receiving
1245 /// traffic.
1246 pub success_threshold: u32,
1247
1248 /// Interval between health checks.
1249 pub check_interval: std::option::Option<wkt::Duration>,
1250
1251 /// Time before the check is considered failed.
1252 pub timeout: std::option::Option<wkt::Duration>,
1253
1254 /// A maximum time limit on application initialization, measured from moment
1255 /// the application successfully replies to a healthcheck until it is ready to
1256 /// serve traffic.
1257 pub app_start_timeout: std::option::Option<wkt::Duration>,
1258
1259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1260}
1261
1262impl ReadinessCheck {
1263 pub fn new() -> Self {
1264 std::default::Default::default()
1265 }
1266
1267 /// Sets the value of [path][crate::model::ReadinessCheck::path].
1268 ///
1269 /// # Example
1270 /// ```ignore,no_run
1271 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1272 /// let x = ReadinessCheck::new().set_path("example");
1273 /// ```
1274 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1275 self.path = v.into();
1276 self
1277 }
1278
1279 /// Sets the value of [host][crate::model::ReadinessCheck::host].
1280 ///
1281 /// # Example
1282 /// ```ignore,no_run
1283 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1284 /// let x = ReadinessCheck::new().set_host("example");
1285 /// ```
1286 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1287 self.host = v.into();
1288 self
1289 }
1290
1291 /// Sets the value of [failure_threshold][crate::model::ReadinessCheck::failure_threshold].
1292 ///
1293 /// # Example
1294 /// ```ignore,no_run
1295 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1296 /// let x = ReadinessCheck::new().set_failure_threshold(42_u32);
1297 /// ```
1298 pub fn set_failure_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1299 self.failure_threshold = v.into();
1300 self
1301 }
1302
1303 /// Sets the value of [success_threshold][crate::model::ReadinessCheck::success_threshold].
1304 ///
1305 /// # Example
1306 /// ```ignore,no_run
1307 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1308 /// let x = ReadinessCheck::new().set_success_threshold(42_u32);
1309 /// ```
1310 pub fn set_success_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1311 self.success_threshold = v.into();
1312 self
1313 }
1314
1315 /// Sets the value of [check_interval][crate::model::ReadinessCheck::check_interval].
1316 ///
1317 /// # Example
1318 /// ```ignore,no_run
1319 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1320 /// use wkt::Duration;
1321 /// let x = ReadinessCheck::new().set_check_interval(Duration::default()/* use setters */);
1322 /// ```
1323 pub fn set_check_interval<T>(mut self, v: T) -> Self
1324 where
1325 T: std::convert::Into<wkt::Duration>,
1326 {
1327 self.check_interval = std::option::Option::Some(v.into());
1328 self
1329 }
1330
1331 /// Sets or clears the value of [check_interval][crate::model::ReadinessCheck::check_interval].
1332 ///
1333 /// # Example
1334 /// ```ignore,no_run
1335 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1336 /// use wkt::Duration;
1337 /// let x = ReadinessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1338 /// let x = ReadinessCheck::new().set_or_clear_check_interval(None::<Duration>);
1339 /// ```
1340 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1341 where
1342 T: std::convert::Into<wkt::Duration>,
1343 {
1344 self.check_interval = v.map(|x| x.into());
1345 self
1346 }
1347
1348 /// Sets the value of [timeout][crate::model::ReadinessCheck::timeout].
1349 ///
1350 /// # Example
1351 /// ```ignore,no_run
1352 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1353 /// use wkt::Duration;
1354 /// let x = ReadinessCheck::new().set_timeout(Duration::default()/* use setters */);
1355 /// ```
1356 pub fn set_timeout<T>(mut self, v: T) -> Self
1357 where
1358 T: std::convert::Into<wkt::Duration>,
1359 {
1360 self.timeout = std::option::Option::Some(v.into());
1361 self
1362 }
1363
1364 /// Sets or clears the value of [timeout][crate::model::ReadinessCheck::timeout].
1365 ///
1366 /// # Example
1367 /// ```ignore,no_run
1368 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1369 /// use wkt::Duration;
1370 /// let x = ReadinessCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1371 /// let x = ReadinessCheck::new().set_or_clear_timeout(None::<Duration>);
1372 /// ```
1373 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1374 where
1375 T: std::convert::Into<wkt::Duration>,
1376 {
1377 self.timeout = v.map(|x| x.into());
1378 self
1379 }
1380
1381 /// Sets the value of [app_start_timeout][crate::model::ReadinessCheck::app_start_timeout].
1382 ///
1383 /// # Example
1384 /// ```ignore,no_run
1385 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1386 /// use wkt::Duration;
1387 /// let x = ReadinessCheck::new().set_app_start_timeout(Duration::default()/* use setters */);
1388 /// ```
1389 pub fn set_app_start_timeout<T>(mut self, v: T) -> Self
1390 where
1391 T: std::convert::Into<wkt::Duration>,
1392 {
1393 self.app_start_timeout = std::option::Option::Some(v.into());
1394 self
1395 }
1396
1397 /// Sets or clears the value of [app_start_timeout][crate::model::ReadinessCheck::app_start_timeout].
1398 ///
1399 /// # Example
1400 /// ```ignore,no_run
1401 /// # use google_cloud_appengine_v1::model::ReadinessCheck;
1402 /// use wkt::Duration;
1403 /// let x = ReadinessCheck::new().set_or_clear_app_start_timeout(Some(Duration::default()/* use setters */));
1404 /// let x = ReadinessCheck::new().set_or_clear_app_start_timeout(None::<Duration>);
1405 /// ```
1406 pub fn set_or_clear_app_start_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1407 where
1408 T: std::convert::Into<wkt::Duration>,
1409 {
1410 self.app_start_timeout = v.map(|x| x.into());
1411 self
1412 }
1413}
1414
1415impl wkt::message::Message for ReadinessCheck {
1416 fn typename() -> &'static str {
1417 "type.googleapis.com/google.appengine.v1.ReadinessCheck"
1418 }
1419}
1420
1421/// Health checking configuration for VM instances. Unhealthy instances
1422/// are killed and replaced with new instances.
1423#[derive(Clone, Default, PartialEq)]
1424#[non_exhaustive]
1425pub struct LivenessCheck {
1426 /// The request path.
1427 pub path: std::string::String,
1428
1429 /// Host header to send when performing a HTTP Liveness check.
1430 /// Example: "myapp.appspot.com"
1431 pub host: std::string::String,
1432
1433 /// Number of consecutive failed checks required before considering the
1434 /// VM unhealthy.
1435 pub failure_threshold: u32,
1436
1437 /// Number of consecutive successful checks required before considering
1438 /// the VM healthy.
1439 pub success_threshold: u32,
1440
1441 /// Interval between health checks.
1442 pub check_interval: std::option::Option<wkt::Duration>,
1443
1444 /// Time before the check is considered failed.
1445 pub timeout: std::option::Option<wkt::Duration>,
1446
1447 /// The initial delay before starting to execute the checks.
1448 pub initial_delay: std::option::Option<wkt::Duration>,
1449
1450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1451}
1452
1453impl LivenessCheck {
1454 pub fn new() -> Self {
1455 std::default::Default::default()
1456 }
1457
1458 /// Sets the value of [path][crate::model::LivenessCheck::path].
1459 ///
1460 /// # Example
1461 /// ```ignore,no_run
1462 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1463 /// let x = LivenessCheck::new().set_path("example");
1464 /// ```
1465 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1466 self.path = v.into();
1467 self
1468 }
1469
1470 /// Sets the value of [host][crate::model::LivenessCheck::host].
1471 ///
1472 /// # Example
1473 /// ```ignore,no_run
1474 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1475 /// let x = LivenessCheck::new().set_host("example");
1476 /// ```
1477 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1478 self.host = v.into();
1479 self
1480 }
1481
1482 /// Sets the value of [failure_threshold][crate::model::LivenessCheck::failure_threshold].
1483 ///
1484 /// # Example
1485 /// ```ignore,no_run
1486 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1487 /// let x = LivenessCheck::new().set_failure_threshold(42_u32);
1488 /// ```
1489 pub fn set_failure_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1490 self.failure_threshold = v.into();
1491 self
1492 }
1493
1494 /// Sets the value of [success_threshold][crate::model::LivenessCheck::success_threshold].
1495 ///
1496 /// # Example
1497 /// ```ignore,no_run
1498 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1499 /// let x = LivenessCheck::new().set_success_threshold(42_u32);
1500 /// ```
1501 pub fn set_success_threshold<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
1502 self.success_threshold = v.into();
1503 self
1504 }
1505
1506 /// Sets the value of [check_interval][crate::model::LivenessCheck::check_interval].
1507 ///
1508 /// # Example
1509 /// ```ignore,no_run
1510 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1511 /// use wkt::Duration;
1512 /// let x = LivenessCheck::new().set_check_interval(Duration::default()/* use setters */);
1513 /// ```
1514 pub fn set_check_interval<T>(mut self, v: T) -> Self
1515 where
1516 T: std::convert::Into<wkt::Duration>,
1517 {
1518 self.check_interval = std::option::Option::Some(v.into());
1519 self
1520 }
1521
1522 /// Sets or clears the value of [check_interval][crate::model::LivenessCheck::check_interval].
1523 ///
1524 /// # Example
1525 /// ```ignore,no_run
1526 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1527 /// use wkt::Duration;
1528 /// let x = LivenessCheck::new().set_or_clear_check_interval(Some(Duration::default()/* use setters */));
1529 /// let x = LivenessCheck::new().set_or_clear_check_interval(None::<Duration>);
1530 /// ```
1531 pub fn set_or_clear_check_interval<T>(mut self, v: std::option::Option<T>) -> Self
1532 where
1533 T: std::convert::Into<wkt::Duration>,
1534 {
1535 self.check_interval = v.map(|x| x.into());
1536 self
1537 }
1538
1539 /// Sets the value of [timeout][crate::model::LivenessCheck::timeout].
1540 ///
1541 /// # Example
1542 /// ```ignore,no_run
1543 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1544 /// use wkt::Duration;
1545 /// let x = LivenessCheck::new().set_timeout(Duration::default()/* use setters */);
1546 /// ```
1547 pub fn set_timeout<T>(mut self, v: T) -> Self
1548 where
1549 T: std::convert::Into<wkt::Duration>,
1550 {
1551 self.timeout = std::option::Option::Some(v.into());
1552 self
1553 }
1554
1555 /// Sets or clears the value of [timeout][crate::model::LivenessCheck::timeout].
1556 ///
1557 /// # Example
1558 /// ```ignore,no_run
1559 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1560 /// use wkt::Duration;
1561 /// let x = LivenessCheck::new().set_or_clear_timeout(Some(Duration::default()/* use setters */));
1562 /// let x = LivenessCheck::new().set_or_clear_timeout(None::<Duration>);
1563 /// ```
1564 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1565 where
1566 T: std::convert::Into<wkt::Duration>,
1567 {
1568 self.timeout = v.map(|x| x.into());
1569 self
1570 }
1571
1572 /// Sets the value of [initial_delay][crate::model::LivenessCheck::initial_delay].
1573 ///
1574 /// # Example
1575 /// ```ignore,no_run
1576 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1577 /// use wkt::Duration;
1578 /// let x = LivenessCheck::new().set_initial_delay(Duration::default()/* use setters */);
1579 /// ```
1580 pub fn set_initial_delay<T>(mut self, v: T) -> Self
1581 where
1582 T: std::convert::Into<wkt::Duration>,
1583 {
1584 self.initial_delay = std::option::Option::Some(v.into());
1585 self
1586 }
1587
1588 /// Sets or clears the value of [initial_delay][crate::model::LivenessCheck::initial_delay].
1589 ///
1590 /// # Example
1591 /// ```ignore,no_run
1592 /// # use google_cloud_appengine_v1::model::LivenessCheck;
1593 /// use wkt::Duration;
1594 /// let x = LivenessCheck::new().set_or_clear_initial_delay(Some(Duration::default()/* use setters */));
1595 /// let x = LivenessCheck::new().set_or_clear_initial_delay(None::<Duration>);
1596 /// ```
1597 pub fn set_or_clear_initial_delay<T>(mut self, v: std::option::Option<T>) -> Self
1598 where
1599 T: std::convert::Into<wkt::Duration>,
1600 {
1601 self.initial_delay = v.map(|x| x.into());
1602 self
1603 }
1604}
1605
1606impl wkt::message::Message for LivenessCheck {
1607 fn typename() -> &'static str {
1608 "type.googleapis.com/google.appengine.v1.LivenessCheck"
1609 }
1610}
1611
1612/// Third-party Python runtime library that is required by the application.
1613#[derive(Clone, Default, PartialEq)]
1614#[non_exhaustive]
1615pub struct Library {
1616 /// Name of the library. Example: "django".
1617 pub name: std::string::String,
1618
1619 /// Version of the library to select, or "latest".
1620 pub version: std::string::String,
1621
1622 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1623}
1624
1625impl Library {
1626 pub fn new() -> Self {
1627 std::default::Default::default()
1628 }
1629
1630 /// Sets the value of [name][crate::model::Library::name].
1631 ///
1632 /// # Example
1633 /// ```ignore,no_run
1634 /// # use google_cloud_appengine_v1::model::Library;
1635 /// let x = Library::new().set_name("example");
1636 /// ```
1637 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1638 self.name = v.into();
1639 self
1640 }
1641
1642 /// Sets the value of [version][crate::model::Library::version].
1643 ///
1644 /// # Example
1645 /// ```ignore,no_run
1646 /// # use google_cloud_appengine_v1::model::Library;
1647 /// let x = Library::new().set_version("example");
1648 /// ```
1649 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1650 self.version = v.into();
1651 self
1652 }
1653}
1654
1655impl wkt::message::Message for Library {
1656 fn typename() -> &'static str {
1657 "type.googleapis.com/google.appengine.v1.Library"
1658 }
1659}
1660
1661/// Request message for `Applications.GetApplication`.
1662#[derive(Clone, Default, PartialEq)]
1663#[non_exhaustive]
1664pub struct GetApplicationRequest {
1665 /// Name of the Application resource to get. Example: `apps/myapp`.
1666 pub name: std::string::String,
1667
1668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1669}
1670
1671impl GetApplicationRequest {
1672 pub fn new() -> Self {
1673 std::default::Default::default()
1674 }
1675
1676 /// Sets the value of [name][crate::model::GetApplicationRequest::name].
1677 ///
1678 /// # Example
1679 /// ```ignore,no_run
1680 /// # use google_cloud_appengine_v1::model::GetApplicationRequest;
1681 /// let x = GetApplicationRequest::new().set_name("example");
1682 /// ```
1683 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1684 self.name = v.into();
1685 self
1686 }
1687}
1688
1689impl wkt::message::Message for GetApplicationRequest {
1690 fn typename() -> &'static str {
1691 "type.googleapis.com/google.appengine.v1.GetApplicationRequest"
1692 }
1693}
1694
1695/// Request message for `Applications.CreateApplication`.
1696#[derive(Clone, Default, PartialEq)]
1697#[non_exhaustive]
1698pub struct CreateApplicationRequest {
1699 /// Application configuration.
1700 pub application: std::option::Option<crate::model::Application>,
1701
1702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1703}
1704
1705impl CreateApplicationRequest {
1706 pub fn new() -> Self {
1707 std::default::Default::default()
1708 }
1709
1710 /// Sets the value of [application][crate::model::CreateApplicationRequest::application].
1711 ///
1712 /// # Example
1713 /// ```ignore,no_run
1714 /// # use google_cloud_appengine_v1::model::CreateApplicationRequest;
1715 /// use google_cloud_appengine_v1::model::Application;
1716 /// let x = CreateApplicationRequest::new().set_application(Application::default()/* use setters */);
1717 /// ```
1718 pub fn set_application<T>(mut self, v: T) -> Self
1719 where
1720 T: std::convert::Into<crate::model::Application>,
1721 {
1722 self.application = std::option::Option::Some(v.into());
1723 self
1724 }
1725
1726 /// Sets or clears the value of [application][crate::model::CreateApplicationRequest::application].
1727 ///
1728 /// # Example
1729 /// ```ignore,no_run
1730 /// # use google_cloud_appengine_v1::model::CreateApplicationRequest;
1731 /// use google_cloud_appengine_v1::model::Application;
1732 /// let x = CreateApplicationRequest::new().set_or_clear_application(Some(Application::default()/* use setters */));
1733 /// let x = CreateApplicationRequest::new().set_or_clear_application(None::<Application>);
1734 /// ```
1735 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
1736 where
1737 T: std::convert::Into<crate::model::Application>,
1738 {
1739 self.application = v.map(|x| x.into());
1740 self
1741 }
1742}
1743
1744impl wkt::message::Message for CreateApplicationRequest {
1745 fn typename() -> &'static str {
1746 "type.googleapis.com/google.appengine.v1.CreateApplicationRequest"
1747 }
1748}
1749
1750/// Request message for `Applications.UpdateApplication`.
1751#[derive(Clone, Default, PartialEq)]
1752#[non_exhaustive]
1753pub struct UpdateApplicationRequest {
1754 /// Name of the Application resource to update. Example: `apps/myapp`.
1755 pub name: std::string::String,
1756
1757 /// An Application containing the updated resource.
1758 pub application: std::option::Option<crate::model::Application>,
1759
1760 /// Required. Standard field mask for the set of fields to be updated.
1761 pub update_mask: std::option::Option<wkt::FieldMask>,
1762
1763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1764}
1765
1766impl UpdateApplicationRequest {
1767 pub fn new() -> Self {
1768 std::default::Default::default()
1769 }
1770
1771 /// Sets the value of [name][crate::model::UpdateApplicationRequest::name].
1772 ///
1773 /// # Example
1774 /// ```ignore,no_run
1775 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1776 /// let x = UpdateApplicationRequest::new().set_name("example");
1777 /// ```
1778 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1779 self.name = v.into();
1780 self
1781 }
1782
1783 /// Sets the value of [application][crate::model::UpdateApplicationRequest::application].
1784 ///
1785 /// # Example
1786 /// ```ignore,no_run
1787 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1788 /// use google_cloud_appengine_v1::model::Application;
1789 /// let x = UpdateApplicationRequest::new().set_application(Application::default()/* use setters */);
1790 /// ```
1791 pub fn set_application<T>(mut self, v: T) -> Self
1792 where
1793 T: std::convert::Into<crate::model::Application>,
1794 {
1795 self.application = std::option::Option::Some(v.into());
1796 self
1797 }
1798
1799 /// Sets or clears the value of [application][crate::model::UpdateApplicationRequest::application].
1800 ///
1801 /// # Example
1802 /// ```ignore,no_run
1803 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1804 /// use google_cloud_appengine_v1::model::Application;
1805 /// let x = UpdateApplicationRequest::new().set_or_clear_application(Some(Application::default()/* use setters */));
1806 /// let x = UpdateApplicationRequest::new().set_or_clear_application(None::<Application>);
1807 /// ```
1808 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
1809 where
1810 T: std::convert::Into<crate::model::Application>,
1811 {
1812 self.application = v.map(|x| x.into());
1813 self
1814 }
1815
1816 /// Sets the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
1817 ///
1818 /// # Example
1819 /// ```ignore,no_run
1820 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1821 /// use wkt::FieldMask;
1822 /// let x = UpdateApplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1823 /// ```
1824 pub fn set_update_mask<T>(mut self, v: T) -> Self
1825 where
1826 T: std::convert::Into<wkt::FieldMask>,
1827 {
1828 self.update_mask = std::option::Option::Some(v.into());
1829 self
1830 }
1831
1832 /// Sets or clears the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
1833 ///
1834 /// # Example
1835 /// ```ignore,no_run
1836 /// # use google_cloud_appengine_v1::model::UpdateApplicationRequest;
1837 /// use wkt::FieldMask;
1838 /// let x = UpdateApplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1839 /// let x = UpdateApplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1840 /// ```
1841 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1842 where
1843 T: std::convert::Into<wkt::FieldMask>,
1844 {
1845 self.update_mask = v.map(|x| x.into());
1846 self
1847 }
1848}
1849
1850impl wkt::message::Message for UpdateApplicationRequest {
1851 fn typename() -> &'static str {
1852 "type.googleapis.com/google.appengine.v1.UpdateApplicationRequest"
1853 }
1854}
1855
1856/// Request message for 'Applications.RepairApplication'.
1857#[derive(Clone, Default, PartialEq)]
1858#[non_exhaustive]
1859pub struct RepairApplicationRequest {
1860 /// Name of the application to repair. Example: `apps/myapp`
1861 pub name: std::string::String,
1862
1863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1864}
1865
1866impl RepairApplicationRequest {
1867 pub fn new() -> Self {
1868 std::default::Default::default()
1869 }
1870
1871 /// Sets the value of [name][crate::model::RepairApplicationRequest::name].
1872 ///
1873 /// # Example
1874 /// ```ignore,no_run
1875 /// # use google_cloud_appengine_v1::model::RepairApplicationRequest;
1876 /// let x = RepairApplicationRequest::new().set_name("example");
1877 /// ```
1878 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1879 self.name = v.into();
1880 self
1881 }
1882}
1883
1884impl wkt::message::Message for RepairApplicationRequest {
1885 fn typename() -> &'static str {
1886 "type.googleapis.com/google.appengine.v1.RepairApplicationRequest"
1887 }
1888}
1889
1890/// Request message for `Services.ListServices`.
1891#[derive(Clone, Default, PartialEq)]
1892#[non_exhaustive]
1893pub struct ListServicesRequest {
1894 /// Name of the parent Application resource. Example: `apps/myapp`.
1895 pub parent: std::string::String,
1896
1897 /// Maximum results to return per page.
1898 pub page_size: i32,
1899
1900 /// Continuation token for fetching the next page of results.
1901 pub page_token: std::string::String,
1902
1903 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1904}
1905
1906impl ListServicesRequest {
1907 pub fn new() -> Self {
1908 std::default::Default::default()
1909 }
1910
1911 /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
1912 ///
1913 /// # Example
1914 /// ```ignore,no_run
1915 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1916 /// let x = ListServicesRequest::new().set_parent("example");
1917 /// ```
1918 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1919 self.parent = v.into();
1920 self
1921 }
1922
1923 /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
1924 ///
1925 /// # Example
1926 /// ```ignore,no_run
1927 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1928 /// let x = ListServicesRequest::new().set_page_size(42);
1929 /// ```
1930 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1931 self.page_size = v.into();
1932 self
1933 }
1934
1935 /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
1936 ///
1937 /// # Example
1938 /// ```ignore,no_run
1939 /// # use google_cloud_appengine_v1::model::ListServicesRequest;
1940 /// let x = ListServicesRequest::new().set_page_token("example");
1941 /// ```
1942 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1943 self.page_token = v.into();
1944 self
1945 }
1946}
1947
1948impl wkt::message::Message for ListServicesRequest {
1949 fn typename() -> &'static str {
1950 "type.googleapis.com/google.appengine.v1.ListServicesRequest"
1951 }
1952}
1953
1954/// Response message for `Services.ListServices`.
1955#[derive(Clone, Default, PartialEq)]
1956#[non_exhaustive]
1957pub struct ListServicesResponse {
1958 /// The services belonging to the requested application.
1959 pub services: std::vec::Vec<crate::model::Service>,
1960
1961 /// Continuation token for fetching the next page of results.
1962 pub next_page_token: std::string::String,
1963
1964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1965}
1966
1967impl ListServicesResponse {
1968 pub fn new() -> Self {
1969 std::default::Default::default()
1970 }
1971
1972 /// Sets the value of [services][crate::model::ListServicesResponse::services].
1973 ///
1974 /// # Example
1975 /// ```ignore,no_run
1976 /// # use google_cloud_appengine_v1::model::ListServicesResponse;
1977 /// use google_cloud_appengine_v1::model::Service;
1978 /// let x = ListServicesResponse::new()
1979 /// .set_services([
1980 /// Service::default()/* use setters */,
1981 /// Service::default()/* use (different) setters */,
1982 /// ]);
1983 /// ```
1984 pub fn set_services<T, V>(mut self, v: T) -> Self
1985 where
1986 T: std::iter::IntoIterator<Item = V>,
1987 V: std::convert::Into<crate::model::Service>,
1988 {
1989 use std::iter::Iterator;
1990 self.services = v.into_iter().map(|i| i.into()).collect();
1991 self
1992 }
1993
1994 /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
1995 ///
1996 /// # Example
1997 /// ```ignore,no_run
1998 /// # use google_cloud_appengine_v1::model::ListServicesResponse;
1999 /// let x = ListServicesResponse::new().set_next_page_token("example");
2000 /// ```
2001 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2002 self.next_page_token = v.into();
2003 self
2004 }
2005}
2006
2007impl wkt::message::Message for ListServicesResponse {
2008 fn typename() -> &'static str {
2009 "type.googleapis.com/google.appengine.v1.ListServicesResponse"
2010 }
2011}
2012
2013#[doc(hidden)]
2014impl google_cloud_gax::paginator::internal::PageableResponse for ListServicesResponse {
2015 type PageItem = crate::model::Service;
2016
2017 fn items(self) -> std::vec::Vec<Self::PageItem> {
2018 self.services
2019 }
2020
2021 fn next_page_token(&self) -> std::string::String {
2022 use std::clone::Clone;
2023 self.next_page_token.clone()
2024 }
2025}
2026
2027/// Request message for `Services.GetService`.
2028#[derive(Clone, Default, PartialEq)]
2029#[non_exhaustive]
2030pub struct GetServiceRequest {
2031 /// Name of the resource requested. Example: `apps/myapp/services/default`.
2032 pub name: std::string::String,
2033
2034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2035}
2036
2037impl GetServiceRequest {
2038 pub fn new() -> Self {
2039 std::default::Default::default()
2040 }
2041
2042 /// Sets the value of [name][crate::model::GetServiceRequest::name].
2043 ///
2044 /// # Example
2045 /// ```ignore,no_run
2046 /// # use google_cloud_appengine_v1::model::GetServiceRequest;
2047 /// let x = GetServiceRequest::new().set_name("example");
2048 /// ```
2049 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2050 self.name = v.into();
2051 self
2052 }
2053}
2054
2055impl wkt::message::Message for GetServiceRequest {
2056 fn typename() -> &'static str {
2057 "type.googleapis.com/google.appengine.v1.GetServiceRequest"
2058 }
2059}
2060
2061/// Request message for `Services.UpdateService`.
2062#[derive(Clone, Default, PartialEq)]
2063#[non_exhaustive]
2064pub struct UpdateServiceRequest {
2065 /// Name of the resource to update. Example: `apps/myapp/services/default`.
2066 pub name: std::string::String,
2067
2068 /// A Service resource containing the updated service. Only fields set in the
2069 /// field mask will be updated.
2070 pub service: std::option::Option<crate::model::Service>,
2071
2072 /// Required. Standard field mask for the set of fields to be updated.
2073 pub update_mask: std::option::Option<wkt::FieldMask>,
2074
2075 /// Set to `true` to gradually shift traffic to one or more versions that you
2076 /// specify. By default, traffic is shifted immediately.
2077 /// For gradual traffic migration, the target versions
2078 /// must be located within instances that are configured for both
2079 /// [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType)
2080 /// and
2081 /// [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling).
2082 /// You must specify the
2083 /// [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy)
2084 /// field in the Service resource. Gradual traffic migration is not
2085 /// supported in the App Engine flexible environment. For examples, see
2086 /// [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
2087 pub migrate_traffic: bool,
2088
2089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2090}
2091
2092impl UpdateServiceRequest {
2093 pub fn new() -> Self {
2094 std::default::Default::default()
2095 }
2096
2097 /// Sets the value of [name][crate::model::UpdateServiceRequest::name].
2098 ///
2099 /// # Example
2100 /// ```ignore,no_run
2101 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2102 /// let x = UpdateServiceRequest::new().set_name("example");
2103 /// ```
2104 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2105 self.name = v.into();
2106 self
2107 }
2108
2109 /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
2110 ///
2111 /// # Example
2112 /// ```ignore,no_run
2113 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2114 /// use google_cloud_appengine_v1::model::Service;
2115 /// let x = UpdateServiceRequest::new().set_service(Service::default()/* use setters */);
2116 /// ```
2117 pub fn set_service<T>(mut self, v: T) -> Self
2118 where
2119 T: std::convert::Into<crate::model::Service>,
2120 {
2121 self.service = std::option::Option::Some(v.into());
2122 self
2123 }
2124
2125 /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
2126 ///
2127 /// # Example
2128 /// ```ignore,no_run
2129 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2130 /// use google_cloud_appengine_v1::model::Service;
2131 /// let x = UpdateServiceRequest::new().set_or_clear_service(Some(Service::default()/* use setters */));
2132 /// let x = UpdateServiceRequest::new().set_or_clear_service(None::<Service>);
2133 /// ```
2134 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
2135 where
2136 T: std::convert::Into<crate::model::Service>,
2137 {
2138 self.service = v.map(|x| x.into());
2139 self
2140 }
2141
2142 /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
2143 ///
2144 /// # Example
2145 /// ```ignore,no_run
2146 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2147 /// use wkt::FieldMask;
2148 /// let x = UpdateServiceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2149 /// ```
2150 pub fn set_update_mask<T>(mut self, v: T) -> Self
2151 where
2152 T: std::convert::Into<wkt::FieldMask>,
2153 {
2154 self.update_mask = std::option::Option::Some(v.into());
2155 self
2156 }
2157
2158 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
2159 ///
2160 /// # Example
2161 /// ```ignore,no_run
2162 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2163 /// use wkt::FieldMask;
2164 /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2165 /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2166 /// ```
2167 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2168 where
2169 T: std::convert::Into<wkt::FieldMask>,
2170 {
2171 self.update_mask = v.map(|x| x.into());
2172 self
2173 }
2174
2175 /// Sets the value of [migrate_traffic][crate::model::UpdateServiceRequest::migrate_traffic].
2176 ///
2177 /// # Example
2178 /// ```ignore,no_run
2179 /// # use google_cloud_appengine_v1::model::UpdateServiceRequest;
2180 /// let x = UpdateServiceRequest::new().set_migrate_traffic(true);
2181 /// ```
2182 pub fn set_migrate_traffic<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2183 self.migrate_traffic = v.into();
2184 self
2185 }
2186}
2187
2188impl wkt::message::Message for UpdateServiceRequest {
2189 fn typename() -> &'static str {
2190 "type.googleapis.com/google.appengine.v1.UpdateServiceRequest"
2191 }
2192}
2193
2194/// Request message for `Services.DeleteService`.
2195#[derive(Clone, Default, PartialEq)]
2196#[non_exhaustive]
2197pub struct DeleteServiceRequest {
2198 /// Name of the resource requested. Example: `apps/myapp/services/default`.
2199 pub name: std::string::String,
2200
2201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2202}
2203
2204impl DeleteServiceRequest {
2205 pub fn new() -> Self {
2206 std::default::Default::default()
2207 }
2208
2209 /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
2210 ///
2211 /// # Example
2212 /// ```ignore,no_run
2213 /// # use google_cloud_appengine_v1::model::DeleteServiceRequest;
2214 /// let x = DeleteServiceRequest::new().set_name("example");
2215 /// ```
2216 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2217 self.name = v.into();
2218 self
2219 }
2220}
2221
2222impl wkt::message::Message for DeleteServiceRequest {
2223 fn typename() -> &'static str {
2224 "type.googleapis.com/google.appengine.v1.DeleteServiceRequest"
2225 }
2226}
2227
2228/// Request message for `Versions.ListVersions`.
2229#[derive(Clone, Default, PartialEq)]
2230#[non_exhaustive]
2231pub struct ListVersionsRequest {
2232 /// Name of the parent Service resource. Example:
2233 /// `apps/myapp/services/default`.
2234 pub parent: std::string::String,
2235
2236 /// Controls the set of fields returned in the `List` response.
2237 pub view: crate::model::VersionView,
2238
2239 /// Maximum results to return per page.
2240 pub page_size: i32,
2241
2242 /// Continuation token for fetching the next page of results.
2243 pub page_token: std::string::String,
2244
2245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2246}
2247
2248impl ListVersionsRequest {
2249 pub fn new() -> Self {
2250 std::default::Default::default()
2251 }
2252
2253 /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
2254 ///
2255 /// # Example
2256 /// ```ignore,no_run
2257 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2258 /// let x = ListVersionsRequest::new().set_parent("example");
2259 /// ```
2260 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2261 self.parent = v.into();
2262 self
2263 }
2264
2265 /// Sets the value of [view][crate::model::ListVersionsRequest::view].
2266 ///
2267 /// # Example
2268 /// ```ignore,no_run
2269 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2270 /// use google_cloud_appengine_v1::model::VersionView;
2271 /// let x0 = ListVersionsRequest::new().set_view(VersionView::Full);
2272 /// ```
2273 pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
2274 self.view = v.into();
2275 self
2276 }
2277
2278 /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
2279 ///
2280 /// # Example
2281 /// ```ignore,no_run
2282 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2283 /// let x = ListVersionsRequest::new().set_page_size(42);
2284 /// ```
2285 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2286 self.page_size = v.into();
2287 self
2288 }
2289
2290 /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
2291 ///
2292 /// # Example
2293 /// ```ignore,no_run
2294 /// # use google_cloud_appengine_v1::model::ListVersionsRequest;
2295 /// let x = ListVersionsRequest::new().set_page_token("example");
2296 /// ```
2297 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2298 self.page_token = v.into();
2299 self
2300 }
2301}
2302
2303impl wkt::message::Message for ListVersionsRequest {
2304 fn typename() -> &'static str {
2305 "type.googleapis.com/google.appengine.v1.ListVersionsRequest"
2306 }
2307}
2308
2309/// Response message for `Versions.ListVersions`.
2310#[derive(Clone, Default, PartialEq)]
2311#[non_exhaustive]
2312pub struct ListVersionsResponse {
2313 /// The versions belonging to the requested service.
2314 pub versions: std::vec::Vec<crate::model::Version>,
2315
2316 /// Continuation token for fetching the next page of results.
2317 pub next_page_token: std::string::String,
2318
2319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2320}
2321
2322impl ListVersionsResponse {
2323 pub fn new() -> Self {
2324 std::default::Default::default()
2325 }
2326
2327 /// Sets the value of [versions][crate::model::ListVersionsResponse::versions].
2328 ///
2329 /// # Example
2330 /// ```ignore,no_run
2331 /// # use google_cloud_appengine_v1::model::ListVersionsResponse;
2332 /// use google_cloud_appengine_v1::model::Version;
2333 /// let x = ListVersionsResponse::new()
2334 /// .set_versions([
2335 /// Version::default()/* use setters */,
2336 /// Version::default()/* use (different) setters */,
2337 /// ]);
2338 /// ```
2339 pub fn set_versions<T, V>(mut self, v: T) -> Self
2340 where
2341 T: std::iter::IntoIterator<Item = V>,
2342 V: std::convert::Into<crate::model::Version>,
2343 {
2344 use std::iter::Iterator;
2345 self.versions = v.into_iter().map(|i| i.into()).collect();
2346 self
2347 }
2348
2349 /// Sets the value of [next_page_token][crate::model::ListVersionsResponse::next_page_token].
2350 ///
2351 /// # Example
2352 /// ```ignore,no_run
2353 /// # use google_cloud_appengine_v1::model::ListVersionsResponse;
2354 /// let x = ListVersionsResponse::new().set_next_page_token("example");
2355 /// ```
2356 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2357 self.next_page_token = v.into();
2358 self
2359 }
2360}
2361
2362impl wkt::message::Message for ListVersionsResponse {
2363 fn typename() -> &'static str {
2364 "type.googleapis.com/google.appengine.v1.ListVersionsResponse"
2365 }
2366}
2367
2368#[doc(hidden)]
2369impl google_cloud_gax::paginator::internal::PageableResponse for ListVersionsResponse {
2370 type PageItem = crate::model::Version;
2371
2372 fn items(self) -> std::vec::Vec<Self::PageItem> {
2373 self.versions
2374 }
2375
2376 fn next_page_token(&self) -> std::string::String {
2377 use std::clone::Clone;
2378 self.next_page_token.clone()
2379 }
2380}
2381
2382/// Request message for `Versions.GetVersion`.
2383#[derive(Clone, Default, PartialEq)]
2384#[non_exhaustive]
2385pub struct GetVersionRequest {
2386 /// Name of the resource requested. Example:
2387 /// `apps/myapp/services/default/versions/v1`.
2388 pub name: std::string::String,
2389
2390 /// Controls the set of fields returned in the `Get` response.
2391 pub view: crate::model::VersionView,
2392
2393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2394}
2395
2396impl GetVersionRequest {
2397 pub fn new() -> Self {
2398 std::default::Default::default()
2399 }
2400
2401 /// Sets the value of [name][crate::model::GetVersionRequest::name].
2402 ///
2403 /// # Example
2404 /// ```ignore,no_run
2405 /// # use google_cloud_appengine_v1::model::GetVersionRequest;
2406 /// let x = GetVersionRequest::new().set_name("example");
2407 /// ```
2408 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2409 self.name = v.into();
2410 self
2411 }
2412
2413 /// Sets the value of [view][crate::model::GetVersionRequest::view].
2414 ///
2415 /// # Example
2416 /// ```ignore,no_run
2417 /// # use google_cloud_appengine_v1::model::GetVersionRequest;
2418 /// use google_cloud_appengine_v1::model::VersionView;
2419 /// let x0 = GetVersionRequest::new().set_view(VersionView::Full);
2420 /// ```
2421 pub fn set_view<T: std::convert::Into<crate::model::VersionView>>(mut self, v: T) -> Self {
2422 self.view = v.into();
2423 self
2424 }
2425}
2426
2427impl wkt::message::Message for GetVersionRequest {
2428 fn typename() -> &'static str {
2429 "type.googleapis.com/google.appengine.v1.GetVersionRequest"
2430 }
2431}
2432
2433/// Request message for `Versions.CreateVersion`.
2434#[derive(Clone, Default, PartialEq)]
2435#[non_exhaustive]
2436pub struct CreateVersionRequest {
2437 /// Name of the parent resource to create this version under. Example:
2438 /// `apps/myapp/services/default`.
2439 pub parent: std::string::String,
2440
2441 /// Application deployment configuration.
2442 pub version: std::option::Option<crate::model::Version>,
2443
2444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2445}
2446
2447impl CreateVersionRequest {
2448 pub fn new() -> Self {
2449 std::default::Default::default()
2450 }
2451
2452 /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
2453 ///
2454 /// # Example
2455 /// ```ignore,no_run
2456 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2457 /// let x = CreateVersionRequest::new().set_parent("example");
2458 /// ```
2459 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2460 self.parent = v.into();
2461 self
2462 }
2463
2464 /// Sets the value of [version][crate::model::CreateVersionRequest::version].
2465 ///
2466 /// # Example
2467 /// ```ignore,no_run
2468 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2469 /// use google_cloud_appengine_v1::model::Version;
2470 /// let x = CreateVersionRequest::new().set_version(Version::default()/* use setters */);
2471 /// ```
2472 pub fn set_version<T>(mut self, v: T) -> Self
2473 where
2474 T: std::convert::Into<crate::model::Version>,
2475 {
2476 self.version = std::option::Option::Some(v.into());
2477 self
2478 }
2479
2480 /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
2481 ///
2482 /// # Example
2483 /// ```ignore,no_run
2484 /// # use google_cloud_appengine_v1::model::CreateVersionRequest;
2485 /// use google_cloud_appengine_v1::model::Version;
2486 /// let x = CreateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
2487 /// let x = CreateVersionRequest::new().set_or_clear_version(None::<Version>);
2488 /// ```
2489 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2490 where
2491 T: std::convert::Into<crate::model::Version>,
2492 {
2493 self.version = v.map(|x| x.into());
2494 self
2495 }
2496}
2497
2498impl wkt::message::Message for CreateVersionRequest {
2499 fn typename() -> &'static str {
2500 "type.googleapis.com/google.appengine.v1.CreateVersionRequest"
2501 }
2502}
2503
2504/// Request message for `Versions.UpdateVersion`.
2505#[derive(Clone, Default, PartialEq)]
2506#[non_exhaustive]
2507pub struct UpdateVersionRequest {
2508 /// Name of the resource to update. Example:
2509 /// `apps/myapp/services/default/versions/1`.
2510 pub name: std::string::String,
2511
2512 /// A Version containing the updated resource. Only fields set in the field
2513 /// mask will be updated.
2514 pub version: std::option::Option<crate::model::Version>,
2515
2516 /// Standard field mask for the set of fields to be updated.
2517 pub update_mask: std::option::Option<wkt::FieldMask>,
2518
2519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2520}
2521
2522impl UpdateVersionRequest {
2523 pub fn new() -> Self {
2524 std::default::Default::default()
2525 }
2526
2527 /// Sets the value of [name][crate::model::UpdateVersionRequest::name].
2528 ///
2529 /// # Example
2530 /// ```ignore,no_run
2531 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2532 /// let x = UpdateVersionRequest::new().set_name("example");
2533 /// ```
2534 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2535 self.name = v.into();
2536 self
2537 }
2538
2539 /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
2540 ///
2541 /// # Example
2542 /// ```ignore,no_run
2543 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2544 /// use google_cloud_appengine_v1::model::Version;
2545 /// let x = UpdateVersionRequest::new().set_version(Version::default()/* use setters */);
2546 /// ```
2547 pub fn set_version<T>(mut self, v: T) -> Self
2548 where
2549 T: std::convert::Into<crate::model::Version>,
2550 {
2551 self.version = std::option::Option::Some(v.into());
2552 self
2553 }
2554
2555 /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
2556 ///
2557 /// # Example
2558 /// ```ignore,no_run
2559 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2560 /// use google_cloud_appengine_v1::model::Version;
2561 /// let x = UpdateVersionRequest::new().set_or_clear_version(Some(Version::default()/* use setters */));
2562 /// let x = UpdateVersionRequest::new().set_or_clear_version(None::<Version>);
2563 /// ```
2564 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
2565 where
2566 T: std::convert::Into<crate::model::Version>,
2567 {
2568 self.version = v.map(|x| x.into());
2569 self
2570 }
2571
2572 /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
2573 ///
2574 /// # Example
2575 /// ```ignore,no_run
2576 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2577 /// use wkt::FieldMask;
2578 /// let x = UpdateVersionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2579 /// ```
2580 pub fn set_update_mask<T>(mut self, v: T) -> Self
2581 where
2582 T: std::convert::Into<wkt::FieldMask>,
2583 {
2584 self.update_mask = std::option::Option::Some(v.into());
2585 self
2586 }
2587
2588 /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
2589 ///
2590 /// # Example
2591 /// ```ignore,no_run
2592 /// # use google_cloud_appengine_v1::model::UpdateVersionRequest;
2593 /// use wkt::FieldMask;
2594 /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2595 /// let x = UpdateVersionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2596 /// ```
2597 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2598 where
2599 T: std::convert::Into<wkt::FieldMask>,
2600 {
2601 self.update_mask = v.map(|x| x.into());
2602 self
2603 }
2604}
2605
2606impl wkt::message::Message for UpdateVersionRequest {
2607 fn typename() -> &'static str {
2608 "type.googleapis.com/google.appengine.v1.UpdateVersionRequest"
2609 }
2610}
2611
2612/// Request message for `Versions.DeleteVersion`.
2613#[derive(Clone, Default, PartialEq)]
2614#[non_exhaustive]
2615pub struct DeleteVersionRequest {
2616 /// Name of the resource requested. Example:
2617 /// `apps/myapp/services/default/versions/v1`.
2618 pub name: std::string::String,
2619
2620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2621}
2622
2623impl DeleteVersionRequest {
2624 pub fn new() -> Self {
2625 std::default::Default::default()
2626 }
2627
2628 /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
2629 ///
2630 /// # Example
2631 /// ```ignore,no_run
2632 /// # use google_cloud_appengine_v1::model::DeleteVersionRequest;
2633 /// let x = DeleteVersionRequest::new().set_name("example");
2634 /// ```
2635 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2636 self.name = v.into();
2637 self
2638 }
2639}
2640
2641impl wkt::message::Message for DeleteVersionRequest {
2642 fn typename() -> &'static str {
2643 "type.googleapis.com/google.appengine.v1.DeleteVersionRequest"
2644 }
2645}
2646
2647/// Request message for `Instances.ListInstances`.
2648#[derive(Clone, Default, PartialEq)]
2649#[non_exhaustive]
2650pub struct ListInstancesRequest {
2651 /// Name of the parent Version resource. Example:
2652 /// `apps/myapp/services/default/versions/v1`.
2653 pub parent: std::string::String,
2654
2655 /// Maximum results to return per page.
2656 pub page_size: i32,
2657
2658 /// Continuation token for fetching the next page of results.
2659 pub page_token: std::string::String,
2660
2661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2662}
2663
2664impl ListInstancesRequest {
2665 pub fn new() -> Self {
2666 std::default::Default::default()
2667 }
2668
2669 /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
2670 ///
2671 /// # Example
2672 /// ```ignore,no_run
2673 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2674 /// let x = ListInstancesRequest::new().set_parent("example");
2675 /// ```
2676 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2677 self.parent = v.into();
2678 self
2679 }
2680
2681 /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
2682 ///
2683 /// # Example
2684 /// ```ignore,no_run
2685 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2686 /// let x = ListInstancesRequest::new().set_page_size(42);
2687 /// ```
2688 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2689 self.page_size = v.into();
2690 self
2691 }
2692
2693 /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
2694 ///
2695 /// # Example
2696 /// ```ignore,no_run
2697 /// # use google_cloud_appengine_v1::model::ListInstancesRequest;
2698 /// let x = ListInstancesRequest::new().set_page_token("example");
2699 /// ```
2700 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2701 self.page_token = v.into();
2702 self
2703 }
2704}
2705
2706impl wkt::message::Message for ListInstancesRequest {
2707 fn typename() -> &'static str {
2708 "type.googleapis.com/google.appengine.v1.ListInstancesRequest"
2709 }
2710}
2711
2712/// Response message for `Instances.ListInstances`.
2713#[derive(Clone, Default, PartialEq)]
2714#[non_exhaustive]
2715pub struct ListInstancesResponse {
2716 /// The instances belonging to the requested version.
2717 pub instances: std::vec::Vec<crate::model::Instance>,
2718
2719 /// Continuation token for fetching the next page of results.
2720 pub next_page_token: std::string::String,
2721
2722 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2723}
2724
2725impl ListInstancesResponse {
2726 pub fn new() -> Self {
2727 std::default::Default::default()
2728 }
2729
2730 /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
2731 ///
2732 /// # Example
2733 /// ```ignore,no_run
2734 /// # use google_cloud_appengine_v1::model::ListInstancesResponse;
2735 /// use google_cloud_appengine_v1::model::Instance;
2736 /// let x = ListInstancesResponse::new()
2737 /// .set_instances([
2738 /// Instance::default()/* use setters */,
2739 /// Instance::default()/* use (different) setters */,
2740 /// ]);
2741 /// ```
2742 pub fn set_instances<T, V>(mut self, v: T) -> Self
2743 where
2744 T: std::iter::IntoIterator<Item = V>,
2745 V: std::convert::Into<crate::model::Instance>,
2746 {
2747 use std::iter::Iterator;
2748 self.instances = v.into_iter().map(|i| i.into()).collect();
2749 self
2750 }
2751
2752 /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
2753 ///
2754 /// # Example
2755 /// ```ignore,no_run
2756 /// # use google_cloud_appengine_v1::model::ListInstancesResponse;
2757 /// let x = ListInstancesResponse::new().set_next_page_token("example");
2758 /// ```
2759 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2760 self.next_page_token = v.into();
2761 self
2762 }
2763}
2764
2765impl wkt::message::Message for ListInstancesResponse {
2766 fn typename() -> &'static str {
2767 "type.googleapis.com/google.appengine.v1.ListInstancesResponse"
2768 }
2769}
2770
2771#[doc(hidden)]
2772impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
2773 type PageItem = crate::model::Instance;
2774
2775 fn items(self) -> std::vec::Vec<Self::PageItem> {
2776 self.instances
2777 }
2778
2779 fn next_page_token(&self) -> std::string::String {
2780 use std::clone::Clone;
2781 self.next_page_token.clone()
2782 }
2783}
2784
2785/// Request message for `Instances.GetInstance`.
2786#[derive(Clone, Default, PartialEq)]
2787#[non_exhaustive]
2788pub struct GetInstanceRequest {
2789 /// Name of the resource requested. Example:
2790 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2791 pub name: std::string::String,
2792
2793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2794}
2795
2796impl GetInstanceRequest {
2797 pub fn new() -> Self {
2798 std::default::Default::default()
2799 }
2800
2801 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2802 ///
2803 /// # Example
2804 /// ```ignore,no_run
2805 /// # use google_cloud_appengine_v1::model::GetInstanceRequest;
2806 /// let x = GetInstanceRequest::new().set_name("example");
2807 /// ```
2808 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2809 self.name = v.into();
2810 self
2811 }
2812}
2813
2814impl wkt::message::Message for GetInstanceRequest {
2815 fn typename() -> &'static str {
2816 "type.googleapis.com/google.appengine.v1.GetInstanceRequest"
2817 }
2818}
2819
2820/// Request message for `Instances.DeleteInstance`.
2821#[derive(Clone, Default, PartialEq)]
2822#[non_exhaustive]
2823pub struct DeleteInstanceRequest {
2824 /// Name of the resource requested. Example:
2825 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2826 pub name: std::string::String,
2827
2828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2829}
2830
2831impl DeleteInstanceRequest {
2832 pub fn new() -> Self {
2833 std::default::Default::default()
2834 }
2835
2836 /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
2837 ///
2838 /// # Example
2839 /// ```ignore,no_run
2840 /// # use google_cloud_appengine_v1::model::DeleteInstanceRequest;
2841 /// let x = DeleteInstanceRequest::new().set_name("example");
2842 /// ```
2843 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2844 self.name = v.into();
2845 self
2846 }
2847}
2848
2849impl wkt::message::Message for DeleteInstanceRequest {
2850 fn typename() -> &'static str {
2851 "type.googleapis.com/google.appengine.v1.DeleteInstanceRequest"
2852 }
2853}
2854
2855/// Request message for `Instances.DebugInstance`.
2856#[derive(Clone, Default, PartialEq)]
2857#[non_exhaustive]
2858pub struct DebugInstanceRequest {
2859 /// Name of the resource requested. Example:
2860 /// `apps/myapp/services/default/versions/v1/instances/instance-1`.
2861 pub name: std::string::String,
2862
2863 /// Public SSH key to add to the instance. Examples:
2864 ///
2865 /// * `[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]`
2866 /// * `[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}`
2867 ///
2868 /// For more information, see
2869 /// [Adding and Removing SSH Keys](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys).
2870 pub ssh_key: std::string::String,
2871
2872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2873}
2874
2875impl DebugInstanceRequest {
2876 pub fn new() -> Self {
2877 std::default::Default::default()
2878 }
2879
2880 /// Sets the value of [name][crate::model::DebugInstanceRequest::name].
2881 ///
2882 /// # Example
2883 /// ```ignore,no_run
2884 /// # use google_cloud_appengine_v1::model::DebugInstanceRequest;
2885 /// let x = DebugInstanceRequest::new().set_name("example");
2886 /// ```
2887 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2888 self.name = v.into();
2889 self
2890 }
2891
2892 /// Sets the value of [ssh_key][crate::model::DebugInstanceRequest::ssh_key].
2893 ///
2894 /// # Example
2895 /// ```ignore,no_run
2896 /// # use google_cloud_appengine_v1::model::DebugInstanceRequest;
2897 /// let x = DebugInstanceRequest::new().set_ssh_key("example");
2898 /// ```
2899 pub fn set_ssh_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2900 self.ssh_key = v.into();
2901 self
2902 }
2903}
2904
2905impl wkt::message::Message for DebugInstanceRequest {
2906 fn typename() -> &'static str {
2907 "type.googleapis.com/google.appengine.v1.DebugInstanceRequest"
2908 }
2909}
2910
2911/// Request message for `Firewall.ListIngressRules`.
2912#[derive(Clone, Default, PartialEq)]
2913#[non_exhaustive]
2914pub struct ListIngressRulesRequest {
2915 /// Name of the Firewall collection to retrieve.
2916 /// Example: `apps/myapp/firewall/ingressRules`.
2917 pub parent: std::string::String,
2918
2919 /// Maximum results to return per page.
2920 pub page_size: i32,
2921
2922 /// Continuation token for fetching the next page of results.
2923 pub page_token: std::string::String,
2924
2925 /// A valid IP Address. If set, only rules matching this address will be
2926 /// returned. The first returned rule will be the rule that fires on requests
2927 /// from this IP.
2928 pub matching_address: std::string::String,
2929
2930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2931}
2932
2933impl ListIngressRulesRequest {
2934 pub fn new() -> Self {
2935 std::default::Default::default()
2936 }
2937
2938 /// Sets the value of [parent][crate::model::ListIngressRulesRequest::parent].
2939 ///
2940 /// # Example
2941 /// ```ignore,no_run
2942 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2943 /// let x = ListIngressRulesRequest::new().set_parent("example");
2944 /// ```
2945 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2946 self.parent = v.into();
2947 self
2948 }
2949
2950 /// Sets the value of [page_size][crate::model::ListIngressRulesRequest::page_size].
2951 ///
2952 /// # Example
2953 /// ```ignore,no_run
2954 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2955 /// let x = ListIngressRulesRequest::new().set_page_size(42);
2956 /// ```
2957 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2958 self.page_size = v.into();
2959 self
2960 }
2961
2962 /// Sets the value of [page_token][crate::model::ListIngressRulesRequest::page_token].
2963 ///
2964 /// # Example
2965 /// ```ignore,no_run
2966 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2967 /// let x = ListIngressRulesRequest::new().set_page_token("example");
2968 /// ```
2969 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2970 self.page_token = v.into();
2971 self
2972 }
2973
2974 /// Sets the value of [matching_address][crate::model::ListIngressRulesRequest::matching_address].
2975 ///
2976 /// # Example
2977 /// ```ignore,no_run
2978 /// # use google_cloud_appengine_v1::model::ListIngressRulesRequest;
2979 /// let x = ListIngressRulesRequest::new().set_matching_address("example");
2980 /// ```
2981 pub fn set_matching_address<T: std::convert::Into<std::string::String>>(
2982 mut self,
2983 v: T,
2984 ) -> Self {
2985 self.matching_address = v.into();
2986 self
2987 }
2988}
2989
2990impl wkt::message::Message for ListIngressRulesRequest {
2991 fn typename() -> &'static str {
2992 "type.googleapis.com/google.appengine.v1.ListIngressRulesRequest"
2993 }
2994}
2995
2996/// Response message for `Firewall.ListIngressRules`.
2997#[derive(Clone, Default, PartialEq)]
2998#[non_exhaustive]
2999pub struct ListIngressRulesResponse {
3000 /// The ingress FirewallRules for this application.
3001 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3002
3003 /// Continuation token for fetching the next page of results.
3004 pub next_page_token: std::string::String,
3005
3006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3007}
3008
3009impl ListIngressRulesResponse {
3010 pub fn new() -> Self {
3011 std::default::Default::default()
3012 }
3013
3014 /// Sets the value of [ingress_rules][crate::model::ListIngressRulesResponse::ingress_rules].
3015 ///
3016 /// # Example
3017 /// ```ignore,no_run
3018 /// # use google_cloud_appengine_v1::model::ListIngressRulesResponse;
3019 /// use google_cloud_appengine_v1::model::FirewallRule;
3020 /// let x = ListIngressRulesResponse::new()
3021 /// .set_ingress_rules([
3022 /// FirewallRule::default()/* use setters */,
3023 /// FirewallRule::default()/* use (different) setters */,
3024 /// ]);
3025 /// ```
3026 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3027 where
3028 T: std::iter::IntoIterator<Item = V>,
3029 V: std::convert::Into<crate::model::FirewallRule>,
3030 {
3031 use std::iter::Iterator;
3032 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3033 self
3034 }
3035
3036 /// Sets the value of [next_page_token][crate::model::ListIngressRulesResponse::next_page_token].
3037 ///
3038 /// # Example
3039 /// ```ignore,no_run
3040 /// # use google_cloud_appengine_v1::model::ListIngressRulesResponse;
3041 /// let x = ListIngressRulesResponse::new().set_next_page_token("example");
3042 /// ```
3043 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3044 self.next_page_token = v.into();
3045 self
3046 }
3047}
3048
3049impl wkt::message::Message for ListIngressRulesResponse {
3050 fn typename() -> &'static str {
3051 "type.googleapis.com/google.appengine.v1.ListIngressRulesResponse"
3052 }
3053}
3054
3055#[doc(hidden)]
3056impl google_cloud_gax::paginator::internal::PageableResponse for ListIngressRulesResponse {
3057 type PageItem = crate::model::FirewallRule;
3058
3059 fn items(self) -> std::vec::Vec<Self::PageItem> {
3060 self.ingress_rules
3061 }
3062
3063 fn next_page_token(&self) -> std::string::String {
3064 use std::clone::Clone;
3065 self.next_page_token.clone()
3066 }
3067}
3068
3069/// Request message for `Firewall.BatchUpdateIngressRules`.
3070#[derive(Clone, Default, PartialEq)]
3071#[non_exhaustive]
3072pub struct BatchUpdateIngressRulesRequest {
3073 /// Name of the Firewall collection to set.
3074 /// Example: `apps/myapp/firewall/ingressRules`.
3075 pub name: std::string::String,
3076
3077 /// A list of FirewallRules to replace the existing set.
3078 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3079
3080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3081}
3082
3083impl BatchUpdateIngressRulesRequest {
3084 pub fn new() -> Self {
3085 std::default::Default::default()
3086 }
3087
3088 /// Sets the value of [name][crate::model::BatchUpdateIngressRulesRequest::name].
3089 ///
3090 /// # Example
3091 /// ```ignore,no_run
3092 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesRequest;
3093 /// let x = BatchUpdateIngressRulesRequest::new().set_name("example");
3094 /// ```
3095 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3096 self.name = v.into();
3097 self
3098 }
3099
3100 /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesRequest::ingress_rules].
3101 ///
3102 /// # Example
3103 /// ```ignore,no_run
3104 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesRequest;
3105 /// use google_cloud_appengine_v1::model::FirewallRule;
3106 /// let x = BatchUpdateIngressRulesRequest::new()
3107 /// .set_ingress_rules([
3108 /// FirewallRule::default()/* use setters */,
3109 /// FirewallRule::default()/* use (different) setters */,
3110 /// ]);
3111 /// ```
3112 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3113 where
3114 T: std::iter::IntoIterator<Item = V>,
3115 V: std::convert::Into<crate::model::FirewallRule>,
3116 {
3117 use std::iter::Iterator;
3118 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3119 self
3120 }
3121}
3122
3123impl wkt::message::Message for BatchUpdateIngressRulesRequest {
3124 fn typename() -> &'static str {
3125 "type.googleapis.com/google.appengine.v1.BatchUpdateIngressRulesRequest"
3126 }
3127}
3128
3129/// Response message for `Firewall.UpdateAllIngressRules`.
3130#[derive(Clone, Default, PartialEq)]
3131#[non_exhaustive]
3132pub struct BatchUpdateIngressRulesResponse {
3133 /// The full list of ingress FirewallRules for this application.
3134 pub ingress_rules: std::vec::Vec<crate::model::FirewallRule>,
3135
3136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3137}
3138
3139impl BatchUpdateIngressRulesResponse {
3140 pub fn new() -> Self {
3141 std::default::Default::default()
3142 }
3143
3144 /// Sets the value of [ingress_rules][crate::model::BatchUpdateIngressRulesResponse::ingress_rules].
3145 ///
3146 /// # Example
3147 /// ```ignore,no_run
3148 /// # use google_cloud_appengine_v1::model::BatchUpdateIngressRulesResponse;
3149 /// use google_cloud_appengine_v1::model::FirewallRule;
3150 /// let x = BatchUpdateIngressRulesResponse::new()
3151 /// .set_ingress_rules([
3152 /// FirewallRule::default()/* use setters */,
3153 /// FirewallRule::default()/* use (different) setters */,
3154 /// ]);
3155 /// ```
3156 pub fn set_ingress_rules<T, V>(mut self, v: T) -> Self
3157 where
3158 T: std::iter::IntoIterator<Item = V>,
3159 V: std::convert::Into<crate::model::FirewallRule>,
3160 {
3161 use std::iter::Iterator;
3162 self.ingress_rules = v.into_iter().map(|i| i.into()).collect();
3163 self
3164 }
3165}
3166
3167impl wkt::message::Message for BatchUpdateIngressRulesResponse {
3168 fn typename() -> &'static str {
3169 "type.googleapis.com/google.appengine.v1.BatchUpdateIngressRulesResponse"
3170 }
3171}
3172
3173/// Request message for `Firewall.CreateIngressRule`.
3174#[derive(Clone, Default, PartialEq)]
3175#[non_exhaustive]
3176pub struct CreateIngressRuleRequest {
3177 /// Name of the parent Firewall collection in which to create a new rule.
3178 /// Example: `apps/myapp/firewall/ingressRules`.
3179 pub parent: std::string::String,
3180
3181 /// A FirewallRule containing the new resource.
3182 ///
3183 /// The user may optionally provide a position at which the new rule will be
3184 /// placed. The positions define a sequential list starting at 1. If a rule
3185 /// already exists at the given position, rules greater than the provided
3186 /// position will be moved forward by one.
3187 ///
3188 /// If no position is provided, the server will place the rule as the second to
3189 /// last rule in the sequence before the required default allow-all or deny-all
3190 /// rule.
3191 pub rule: std::option::Option<crate::model::FirewallRule>,
3192
3193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3194}
3195
3196impl CreateIngressRuleRequest {
3197 pub fn new() -> Self {
3198 std::default::Default::default()
3199 }
3200
3201 /// Sets the value of [parent][crate::model::CreateIngressRuleRequest::parent].
3202 ///
3203 /// # Example
3204 /// ```ignore,no_run
3205 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3206 /// let x = CreateIngressRuleRequest::new().set_parent("example");
3207 /// ```
3208 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3209 self.parent = v.into();
3210 self
3211 }
3212
3213 /// Sets the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3214 ///
3215 /// # Example
3216 /// ```ignore,no_run
3217 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3218 /// use google_cloud_appengine_v1::model::FirewallRule;
3219 /// let x = CreateIngressRuleRequest::new().set_rule(FirewallRule::default()/* use setters */);
3220 /// ```
3221 pub fn set_rule<T>(mut self, v: T) -> Self
3222 where
3223 T: std::convert::Into<crate::model::FirewallRule>,
3224 {
3225 self.rule = std::option::Option::Some(v.into());
3226 self
3227 }
3228
3229 /// Sets or clears the value of [rule][crate::model::CreateIngressRuleRequest::rule].
3230 ///
3231 /// # Example
3232 /// ```ignore,no_run
3233 /// # use google_cloud_appengine_v1::model::CreateIngressRuleRequest;
3234 /// use google_cloud_appengine_v1::model::FirewallRule;
3235 /// let x = CreateIngressRuleRequest::new().set_or_clear_rule(Some(FirewallRule::default()/* use setters */));
3236 /// let x = CreateIngressRuleRequest::new().set_or_clear_rule(None::<FirewallRule>);
3237 /// ```
3238 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3239 where
3240 T: std::convert::Into<crate::model::FirewallRule>,
3241 {
3242 self.rule = v.map(|x| x.into());
3243 self
3244 }
3245}
3246
3247impl wkt::message::Message for CreateIngressRuleRequest {
3248 fn typename() -> &'static str {
3249 "type.googleapis.com/google.appengine.v1.CreateIngressRuleRequest"
3250 }
3251}
3252
3253/// Request message for `Firewall.GetIngressRule`.
3254#[derive(Clone, Default, PartialEq)]
3255#[non_exhaustive]
3256pub struct GetIngressRuleRequest {
3257 /// Name of the Firewall resource to retrieve.
3258 /// Example: `apps/myapp/firewall/ingressRules/100`.
3259 pub name: std::string::String,
3260
3261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3262}
3263
3264impl GetIngressRuleRequest {
3265 pub fn new() -> Self {
3266 std::default::Default::default()
3267 }
3268
3269 /// Sets the value of [name][crate::model::GetIngressRuleRequest::name].
3270 ///
3271 /// # Example
3272 /// ```ignore,no_run
3273 /// # use google_cloud_appengine_v1::model::GetIngressRuleRequest;
3274 /// let x = GetIngressRuleRequest::new().set_name("example");
3275 /// ```
3276 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3277 self.name = v.into();
3278 self
3279 }
3280}
3281
3282impl wkt::message::Message for GetIngressRuleRequest {
3283 fn typename() -> &'static str {
3284 "type.googleapis.com/google.appengine.v1.GetIngressRuleRequest"
3285 }
3286}
3287
3288/// Request message for `Firewall.UpdateIngressRule`.
3289#[derive(Clone, Default, PartialEq)]
3290#[non_exhaustive]
3291pub struct UpdateIngressRuleRequest {
3292 /// Name of the Firewall resource to update.
3293 /// Example: `apps/myapp/firewall/ingressRules/100`.
3294 pub name: std::string::String,
3295
3296 /// A FirewallRule containing the updated resource
3297 pub rule: std::option::Option<crate::model::FirewallRule>,
3298
3299 /// Standard field mask for the set of fields to be updated.
3300 pub update_mask: std::option::Option<wkt::FieldMask>,
3301
3302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3303}
3304
3305impl UpdateIngressRuleRequest {
3306 pub fn new() -> Self {
3307 std::default::Default::default()
3308 }
3309
3310 /// Sets the value of [name][crate::model::UpdateIngressRuleRequest::name].
3311 ///
3312 /// # Example
3313 /// ```ignore,no_run
3314 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3315 /// let x = UpdateIngressRuleRequest::new().set_name("example");
3316 /// ```
3317 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3318 self.name = v.into();
3319 self
3320 }
3321
3322 /// Sets the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3323 ///
3324 /// # Example
3325 /// ```ignore,no_run
3326 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3327 /// use google_cloud_appengine_v1::model::FirewallRule;
3328 /// let x = UpdateIngressRuleRequest::new().set_rule(FirewallRule::default()/* use setters */);
3329 /// ```
3330 pub fn set_rule<T>(mut self, v: T) -> Self
3331 where
3332 T: std::convert::Into<crate::model::FirewallRule>,
3333 {
3334 self.rule = std::option::Option::Some(v.into());
3335 self
3336 }
3337
3338 /// Sets or clears the value of [rule][crate::model::UpdateIngressRuleRequest::rule].
3339 ///
3340 /// # Example
3341 /// ```ignore,no_run
3342 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3343 /// use google_cloud_appengine_v1::model::FirewallRule;
3344 /// let x = UpdateIngressRuleRequest::new().set_or_clear_rule(Some(FirewallRule::default()/* use setters */));
3345 /// let x = UpdateIngressRuleRequest::new().set_or_clear_rule(None::<FirewallRule>);
3346 /// ```
3347 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3348 where
3349 T: std::convert::Into<crate::model::FirewallRule>,
3350 {
3351 self.rule = v.map(|x| x.into());
3352 self
3353 }
3354
3355 /// Sets the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3356 ///
3357 /// # Example
3358 /// ```ignore,no_run
3359 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3360 /// use wkt::FieldMask;
3361 /// let x = UpdateIngressRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3362 /// ```
3363 pub fn set_update_mask<T>(mut self, v: T) -> Self
3364 where
3365 T: std::convert::Into<wkt::FieldMask>,
3366 {
3367 self.update_mask = std::option::Option::Some(v.into());
3368 self
3369 }
3370
3371 /// Sets or clears the value of [update_mask][crate::model::UpdateIngressRuleRequest::update_mask].
3372 ///
3373 /// # Example
3374 /// ```ignore,no_run
3375 /// # use google_cloud_appengine_v1::model::UpdateIngressRuleRequest;
3376 /// use wkt::FieldMask;
3377 /// let x = UpdateIngressRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3378 /// let x = UpdateIngressRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3379 /// ```
3380 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3381 where
3382 T: std::convert::Into<wkt::FieldMask>,
3383 {
3384 self.update_mask = v.map(|x| x.into());
3385 self
3386 }
3387}
3388
3389impl wkt::message::Message for UpdateIngressRuleRequest {
3390 fn typename() -> &'static str {
3391 "type.googleapis.com/google.appengine.v1.UpdateIngressRuleRequest"
3392 }
3393}
3394
3395/// Request message for `Firewall.DeleteIngressRule`.
3396#[derive(Clone, Default, PartialEq)]
3397#[non_exhaustive]
3398pub struct DeleteIngressRuleRequest {
3399 /// Name of the Firewall resource to delete.
3400 /// Example: `apps/myapp/firewall/ingressRules/100`.
3401 pub name: std::string::String,
3402
3403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3404}
3405
3406impl DeleteIngressRuleRequest {
3407 pub fn new() -> Self {
3408 std::default::Default::default()
3409 }
3410
3411 /// Sets the value of [name][crate::model::DeleteIngressRuleRequest::name].
3412 ///
3413 /// # Example
3414 /// ```ignore,no_run
3415 /// # use google_cloud_appengine_v1::model::DeleteIngressRuleRequest;
3416 /// let x = DeleteIngressRuleRequest::new().set_name("example");
3417 /// ```
3418 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3419 self.name = v.into();
3420 self
3421 }
3422}
3423
3424impl wkt::message::Message for DeleteIngressRuleRequest {
3425 fn typename() -> &'static str {
3426 "type.googleapis.com/google.appengine.v1.DeleteIngressRuleRequest"
3427 }
3428}
3429
3430/// Request message for `AuthorizedDomains.ListAuthorizedDomains`.
3431#[derive(Clone, Default, PartialEq)]
3432#[non_exhaustive]
3433pub struct ListAuthorizedDomainsRequest {
3434 /// Name of the parent Application resource. Example: `apps/myapp`.
3435 pub parent: std::string::String,
3436
3437 /// Maximum results to return per page.
3438 pub page_size: i32,
3439
3440 /// Continuation token for fetching the next page of results.
3441 pub page_token: std::string::String,
3442
3443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3444}
3445
3446impl ListAuthorizedDomainsRequest {
3447 pub fn new() -> Self {
3448 std::default::Default::default()
3449 }
3450
3451 /// Sets the value of [parent][crate::model::ListAuthorizedDomainsRequest::parent].
3452 ///
3453 /// # Example
3454 /// ```ignore,no_run
3455 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3456 /// let x = ListAuthorizedDomainsRequest::new().set_parent("example");
3457 /// ```
3458 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459 self.parent = v.into();
3460 self
3461 }
3462
3463 /// Sets the value of [page_size][crate::model::ListAuthorizedDomainsRequest::page_size].
3464 ///
3465 /// # Example
3466 /// ```ignore,no_run
3467 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3468 /// let x = ListAuthorizedDomainsRequest::new().set_page_size(42);
3469 /// ```
3470 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3471 self.page_size = v.into();
3472 self
3473 }
3474
3475 /// Sets the value of [page_token][crate::model::ListAuthorizedDomainsRequest::page_token].
3476 ///
3477 /// # Example
3478 /// ```ignore,no_run
3479 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsRequest;
3480 /// let x = ListAuthorizedDomainsRequest::new().set_page_token("example");
3481 /// ```
3482 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3483 self.page_token = v.into();
3484 self
3485 }
3486}
3487
3488impl wkt::message::Message for ListAuthorizedDomainsRequest {
3489 fn typename() -> &'static str {
3490 "type.googleapis.com/google.appengine.v1.ListAuthorizedDomainsRequest"
3491 }
3492}
3493
3494/// Response message for `AuthorizedDomains.ListAuthorizedDomains`.
3495#[derive(Clone, Default, PartialEq)]
3496#[non_exhaustive]
3497pub struct ListAuthorizedDomainsResponse {
3498 /// The authorized domains belonging to the user.
3499 pub domains: std::vec::Vec<crate::model::AuthorizedDomain>,
3500
3501 /// Continuation token for fetching the next page of results.
3502 pub next_page_token: std::string::String,
3503
3504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3505}
3506
3507impl ListAuthorizedDomainsResponse {
3508 pub fn new() -> Self {
3509 std::default::Default::default()
3510 }
3511
3512 /// Sets the value of [domains][crate::model::ListAuthorizedDomainsResponse::domains].
3513 ///
3514 /// # Example
3515 /// ```ignore,no_run
3516 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsResponse;
3517 /// use google_cloud_appengine_v1::model::AuthorizedDomain;
3518 /// let x = ListAuthorizedDomainsResponse::new()
3519 /// .set_domains([
3520 /// AuthorizedDomain::default()/* use setters */,
3521 /// AuthorizedDomain::default()/* use (different) setters */,
3522 /// ]);
3523 /// ```
3524 pub fn set_domains<T, V>(mut self, v: T) -> Self
3525 where
3526 T: std::iter::IntoIterator<Item = V>,
3527 V: std::convert::Into<crate::model::AuthorizedDomain>,
3528 {
3529 use std::iter::Iterator;
3530 self.domains = v.into_iter().map(|i| i.into()).collect();
3531 self
3532 }
3533
3534 /// Sets the value of [next_page_token][crate::model::ListAuthorizedDomainsResponse::next_page_token].
3535 ///
3536 /// # Example
3537 /// ```ignore,no_run
3538 /// # use google_cloud_appengine_v1::model::ListAuthorizedDomainsResponse;
3539 /// let x = ListAuthorizedDomainsResponse::new().set_next_page_token("example");
3540 /// ```
3541 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3542 self.next_page_token = v.into();
3543 self
3544 }
3545}
3546
3547impl wkt::message::Message for ListAuthorizedDomainsResponse {
3548 fn typename() -> &'static str {
3549 "type.googleapis.com/google.appengine.v1.ListAuthorizedDomainsResponse"
3550 }
3551}
3552
3553#[doc(hidden)]
3554impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizedDomainsResponse {
3555 type PageItem = crate::model::AuthorizedDomain;
3556
3557 fn items(self) -> std::vec::Vec<Self::PageItem> {
3558 self.domains
3559 }
3560
3561 fn next_page_token(&self) -> std::string::String {
3562 use std::clone::Clone;
3563 self.next_page_token.clone()
3564 }
3565}
3566
3567/// Request message for `AuthorizedCertificates.ListAuthorizedCertificates`.
3568#[derive(Clone, Default, PartialEq)]
3569#[non_exhaustive]
3570pub struct ListAuthorizedCertificatesRequest {
3571 /// Name of the parent `Application` resource. Example: `apps/myapp`.
3572 pub parent: std::string::String,
3573
3574 /// Controls the set of fields returned in the `LIST` response.
3575 pub view: crate::model::AuthorizedCertificateView,
3576
3577 /// Maximum results to return per page.
3578 pub page_size: i32,
3579
3580 /// Continuation token for fetching the next page of results.
3581 pub page_token: std::string::String,
3582
3583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3584}
3585
3586impl ListAuthorizedCertificatesRequest {
3587 pub fn new() -> Self {
3588 std::default::Default::default()
3589 }
3590
3591 /// Sets the value of [parent][crate::model::ListAuthorizedCertificatesRequest::parent].
3592 ///
3593 /// # Example
3594 /// ```ignore,no_run
3595 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3596 /// let x = ListAuthorizedCertificatesRequest::new().set_parent("example");
3597 /// ```
3598 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3599 self.parent = v.into();
3600 self
3601 }
3602
3603 /// Sets the value of [view][crate::model::ListAuthorizedCertificatesRequest::view].
3604 ///
3605 /// # Example
3606 /// ```ignore,no_run
3607 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3608 /// use google_cloud_appengine_v1::model::AuthorizedCertificateView;
3609 /// let x0 = ListAuthorizedCertificatesRequest::new().set_view(AuthorizedCertificateView::FullCertificate);
3610 /// ```
3611 pub fn set_view<T: std::convert::Into<crate::model::AuthorizedCertificateView>>(
3612 mut self,
3613 v: T,
3614 ) -> Self {
3615 self.view = v.into();
3616 self
3617 }
3618
3619 /// Sets the value of [page_size][crate::model::ListAuthorizedCertificatesRequest::page_size].
3620 ///
3621 /// # Example
3622 /// ```ignore,no_run
3623 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3624 /// let x = ListAuthorizedCertificatesRequest::new().set_page_size(42);
3625 /// ```
3626 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3627 self.page_size = v.into();
3628 self
3629 }
3630
3631 /// Sets the value of [page_token][crate::model::ListAuthorizedCertificatesRequest::page_token].
3632 ///
3633 /// # Example
3634 /// ```ignore,no_run
3635 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesRequest;
3636 /// let x = ListAuthorizedCertificatesRequest::new().set_page_token("example");
3637 /// ```
3638 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3639 self.page_token = v.into();
3640 self
3641 }
3642}
3643
3644impl wkt::message::Message for ListAuthorizedCertificatesRequest {
3645 fn typename() -> &'static str {
3646 "type.googleapis.com/google.appengine.v1.ListAuthorizedCertificatesRequest"
3647 }
3648}
3649
3650/// Response message for `AuthorizedCertificates.ListAuthorizedCertificates`.
3651#[derive(Clone, Default, PartialEq)]
3652#[non_exhaustive]
3653pub struct ListAuthorizedCertificatesResponse {
3654 /// The SSL certificates the user is authorized to administer.
3655 pub certificates: std::vec::Vec<crate::model::AuthorizedCertificate>,
3656
3657 /// Continuation token for fetching the next page of results.
3658 pub next_page_token: std::string::String,
3659
3660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3661}
3662
3663impl ListAuthorizedCertificatesResponse {
3664 pub fn new() -> Self {
3665 std::default::Default::default()
3666 }
3667
3668 /// Sets the value of [certificates][crate::model::ListAuthorizedCertificatesResponse::certificates].
3669 ///
3670 /// # Example
3671 /// ```ignore,no_run
3672 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesResponse;
3673 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3674 /// let x = ListAuthorizedCertificatesResponse::new()
3675 /// .set_certificates([
3676 /// AuthorizedCertificate::default()/* use setters */,
3677 /// AuthorizedCertificate::default()/* use (different) setters */,
3678 /// ]);
3679 /// ```
3680 pub fn set_certificates<T, V>(mut self, v: T) -> Self
3681 where
3682 T: std::iter::IntoIterator<Item = V>,
3683 V: std::convert::Into<crate::model::AuthorizedCertificate>,
3684 {
3685 use std::iter::Iterator;
3686 self.certificates = v.into_iter().map(|i| i.into()).collect();
3687 self
3688 }
3689
3690 /// Sets the value of [next_page_token][crate::model::ListAuthorizedCertificatesResponse::next_page_token].
3691 ///
3692 /// # Example
3693 /// ```ignore,no_run
3694 /// # use google_cloud_appengine_v1::model::ListAuthorizedCertificatesResponse;
3695 /// let x = ListAuthorizedCertificatesResponse::new().set_next_page_token("example");
3696 /// ```
3697 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3698 self.next_page_token = v.into();
3699 self
3700 }
3701}
3702
3703impl wkt::message::Message for ListAuthorizedCertificatesResponse {
3704 fn typename() -> &'static str {
3705 "type.googleapis.com/google.appengine.v1.ListAuthorizedCertificatesResponse"
3706 }
3707}
3708
3709#[doc(hidden)]
3710impl google_cloud_gax::paginator::internal::PageableResponse
3711 for ListAuthorizedCertificatesResponse
3712{
3713 type PageItem = crate::model::AuthorizedCertificate;
3714
3715 fn items(self) -> std::vec::Vec<Self::PageItem> {
3716 self.certificates
3717 }
3718
3719 fn next_page_token(&self) -> std::string::String {
3720 use std::clone::Clone;
3721 self.next_page_token.clone()
3722 }
3723}
3724
3725/// Request message for `AuthorizedCertificates.GetAuthorizedCertificate`.
3726#[derive(Clone, Default, PartialEq)]
3727#[non_exhaustive]
3728pub struct GetAuthorizedCertificateRequest {
3729 /// Name of the resource requested. Example:
3730 /// `apps/myapp/authorizedCertificates/12345`.
3731 pub name: std::string::String,
3732
3733 /// Controls the set of fields returned in the `GET` response.
3734 pub view: crate::model::AuthorizedCertificateView,
3735
3736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3737}
3738
3739impl GetAuthorizedCertificateRequest {
3740 pub fn new() -> Self {
3741 std::default::Default::default()
3742 }
3743
3744 /// Sets the value of [name][crate::model::GetAuthorizedCertificateRequest::name].
3745 ///
3746 /// # Example
3747 /// ```ignore,no_run
3748 /// # use google_cloud_appengine_v1::model::GetAuthorizedCertificateRequest;
3749 /// let x = GetAuthorizedCertificateRequest::new().set_name("example");
3750 /// ```
3751 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3752 self.name = v.into();
3753 self
3754 }
3755
3756 /// Sets the value of [view][crate::model::GetAuthorizedCertificateRequest::view].
3757 ///
3758 /// # Example
3759 /// ```ignore,no_run
3760 /// # use google_cloud_appengine_v1::model::GetAuthorizedCertificateRequest;
3761 /// use google_cloud_appengine_v1::model::AuthorizedCertificateView;
3762 /// let x0 = GetAuthorizedCertificateRequest::new().set_view(AuthorizedCertificateView::FullCertificate);
3763 /// ```
3764 pub fn set_view<T: std::convert::Into<crate::model::AuthorizedCertificateView>>(
3765 mut self,
3766 v: T,
3767 ) -> Self {
3768 self.view = v.into();
3769 self
3770 }
3771}
3772
3773impl wkt::message::Message for GetAuthorizedCertificateRequest {
3774 fn typename() -> &'static str {
3775 "type.googleapis.com/google.appengine.v1.GetAuthorizedCertificateRequest"
3776 }
3777}
3778
3779/// Request message for `AuthorizedCertificates.CreateAuthorizedCertificate`.
3780#[derive(Clone, Default, PartialEq)]
3781#[non_exhaustive]
3782pub struct CreateAuthorizedCertificateRequest {
3783 /// Name of the parent `Application` resource. Example: `apps/myapp`.
3784 pub parent: std::string::String,
3785
3786 /// SSL certificate data.
3787 pub certificate: std::option::Option<crate::model::AuthorizedCertificate>,
3788
3789 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3790}
3791
3792impl CreateAuthorizedCertificateRequest {
3793 pub fn new() -> Self {
3794 std::default::Default::default()
3795 }
3796
3797 /// Sets the value of [parent][crate::model::CreateAuthorizedCertificateRequest::parent].
3798 ///
3799 /// # Example
3800 /// ```ignore,no_run
3801 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3802 /// let x = CreateAuthorizedCertificateRequest::new().set_parent("example");
3803 /// ```
3804 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3805 self.parent = v.into();
3806 self
3807 }
3808
3809 /// Sets the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
3810 ///
3811 /// # Example
3812 /// ```ignore,no_run
3813 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3814 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3815 /// let x = CreateAuthorizedCertificateRequest::new().set_certificate(AuthorizedCertificate::default()/* use setters */);
3816 /// ```
3817 pub fn set_certificate<T>(mut self, v: T) -> Self
3818 where
3819 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3820 {
3821 self.certificate = std::option::Option::Some(v.into());
3822 self
3823 }
3824
3825 /// Sets or clears the value of [certificate][crate::model::CreateAuthorizedCertificateRequest::certificate].
3826 ///
3827 /// # Example
3828 /// ```ignore,no_run
3829 /// # use google_cloud_appengine_v1::model::CreateAuthorizedCertificateRequest;
3830 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3831 /// let x = CreateAuthorizedCertificateRequest::new().set_or_clear_certificate(Some(AuthorizedCertificate::default()/* use setters */));
3832 /// let x = CreateAuthorizedCertificateRequest::new().set_or_clear_certificate(None::<AuthorizedCertificate>);
3833 /// ```
3834 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
3835 where
3836 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3837 {
3838 self.certificate = v.map(|x| x.into());
3839 self
3840 }
3841}
3842
3843impl wkt::message::Message for CreateAuthorizedCertificateRequest {
3844 fn typename() -> &'static str {
3845 "type.googleapis.com/google.appengine.v1.CreateAuthorizedCertificateRequest"
3846 }
3847}
3848
3849/// Request message for `AuthorizedCertificates.UpdateAuthorizedCertificate`.
3850#[derive(Clone, Default, PartialEq)]
3851#[non_exhaustive]
3852pub struct UpdateAuthorizedCertificateRequest {
3853 /// Name of the resource to update. Example:
3854 /// `apps/myapp/authorizedCertificates/12345`.
3855 pub name: std::string::String,
3856
3857 /// An `AuthorizedCertificate` containing the updated resource. Only fields set
3858 /// in the field mask will be updated.
3859 pub certificate: std::option::Option<crate::model::AuthorizedCertificate>,
3860
3861 /// Standard field mask for the set of fields to be updated. Updates are only
3862 /// supported on the `certificate_raw_data` and `display_name` fields.
3863 pub update_mask: std::option::Option<wkt::FieldMask>,
3864
3865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3866}
3867
3868impl UpdateAuthorizedCertificateRequest {
3869 pub fn new() -> Self {
3870 std::default::Default::default()
3871 }
3872
3873 /// Sets the value of [name][crate::model::UpdateAuthorizedCertificateRequest::name].
3874 ///
3875 /// # Example
3876 /// ```ignore,no_run
3877 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3878 /// let x = UpdateAuthorizedCertificateRequest::new().set_name("example");
3879 /// ```
3880 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3881 self.name = v.into();
3882 self
3883 }
3884
3885 /// Sets the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
3886 ///
3887 /// # Example
3888 /// ```ignore,no_run
3889 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3890 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3891 /// let x = UpdateAuthorizedCertificateRequest::new().set_certificate(AuthorizedCertificate::default()/* use setters */);
3892 /// ```
3893 pub fn set_certificate<T>(mut self, v: T) -> Self
3894 where
3895 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3896 {
3897 self.certificate = std::option::Option::Some(v.into());
3898 self
3899 }
3900
3901 /// Sets or clears the value of [certificate][crate::model::UpdateAuthorizedCertificateRequest::certificate].
3902 ///
3903 /// # Example
3904 /// ```ignore,no_run
3905 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3906 /// use google_cloud_appengine_v1::model::AuthorizedCertificate;
3907 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_certificate(Some(AuthorizedCertificate::default()/* use setters */));
3908 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_certificate(None::<AuthorizedCertificate>);
3909 /// ```
3910 pub fn set_or_clear_certificate<T>(mut self, v: std::option::Option<T>) -> Self
3911 where
3912 T: std::convert::Into<crate::model::AuthorizedCertificate>,
3913 {
3914 self.certificate = v.map(|x| x.into());
3915 self
3916 }
3917
3918 /// Sets the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
3919 ///
3920 /// # Example
3921 /// ```ignore,no_run
3922 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3923 /// use wkt::FieldMask;
3924 /// let x = UpdateAuthorizedCertificateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3925 /// ```
3926 pub fn set_update_mask<T>(mut self, v: T) -> Self
3927 where
3928 T: std::convert::Into<wkt::FieldMask>,
3929 {
3930 self.update_mask = std::option::Option::Some(v.into());
3931 self
3932 }
3933
3934 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizedCertificateRequest::update_mask].
3935 ///
3936 /// # Example
3937 /// ```ignore,no_run
3938 /// # use google_cloud_appengine_v1::model::UpdateAuthorizedCertificateRequest;
3939 /// use wkt::FieldMask;
3940 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3941 /// let x = UpdateAuthorizedCertificateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3942 /// ```
3943 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3944 where
3945 T: std::convert::Into<wkt::FieldMask>,
3946 {
3947 self.update_mask = v.map(|x| x.into());
3948 self
3949 }
3950}
3951
3952impl wkt::message::Message for UpdateAuthorizedCertificateRequest {
3953 fn typename() -> &'static str {
3954 "type.googleapis.com/google.appengine.v1.UpdateAuthorizedCertificateRequest"
3955 }
3956}
3957
3958/// Request message for `AuthorizedCertificates.DeleteAuthorizedCertificate`.
3959#[derive(Clone, Default, PartialEq)]
3960#[non_exhaustive]
3961pub struct DeleteAuthorizedCertificateRequest {
3962 /// Name of the resource to delete. Example:
3963 /// `apps/myapp/authorizedCertificates/12345`.
3964 pub name: std::string::String,
3965
3966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3967}
3968
3969impl DeleteAuthorizedCertificateRequest {
3970 pub fn new() -> Self {
3971 std::default::Default::default()
3972 }
3973
3974 /// Sets the value of [name][crate::model::DeleteAuthorizedCertificateRequest::name].
3975 ///
3976 /// # Example
3977 /// ```ignore,no_run
3978 /// # use google_cloud_appengine_v1::model::DeleteAuthorizedCertificateRequest;
3979 /// let x = DeleteAuthorizedCertificateRequest::new().set_name("example");
3980 /// ```
3981 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3982 self.name = v.into();
3983 self
3984 }
3985}
3986
3987impl wkt::message::Message for DeleteAuthorizedCertificateRequest {
3988 fn typename() -> &'static str {
3989 "type.googleapis.com/google.appengine.v1.DeleteAuthorizedCertificateRequest"
3990 }
3991}
3992
3993/// Request message for `DomainMappings.ListDomainMappings`.
3994#[derive(Clone, Default, PartialEq)]
3995#[non_exhaustive]
3996pub struct ListDomainMappingsRequest {
3997 /// Name of the parent Application resource. Example: `apps/myapp`.
3998 pub parent: std::string::String,
3999
4000 /// Maximum results to return per page.
4001 pub page_size: i32,
4002
4003 /// Continuation token for fetching the next page of results.
4004 pub page_token: std::string::String,
4005
4006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4007}
4008
4009impl ListDomainMappingsRequest {
4010 pub fn new() -> Self {
4011 std::default::Default::default()
4012 }
4013
4014 /// Sets the value of [parent][crate::model::ListDomainMappingsRequest::parent].
4015 ///
4016 /// # Example
4017 /// ```ignore,no_run
4018 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4019 /// let x = ListDomainMappingsRequest::new().set_parent("example");
4020 /// ```
4021 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4022 self.parent = v.into();
4023 self
4024 }
4025
4026 /// Sets the value of [page_size][crate::model::ListDomainMappingsRequest::page_size].
4027 ///
4028 /// # Example
4029 /// ```ignore,no_run
4030 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4031 /// let x = ListDomainMappingsRequest::new().set_page_size(42);
4032 /// ```
4033 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4034 self.page_size = v.into();
4035 self
4036 }
4037
4038 /// Sets the value of [page_token][crate::model::ListDomainMappingsRequest::page_token].
4039 ///
4040 /// # Example
4041 /// ```ignore,no_run
4042 /// # use google_cloud_appengine_v1::model::ListDomainMappingsRequest;
4043 /// let x = ListDomainMappingsRequest::new().set_page_token("example");
4044 /// ```
4045 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4046 self.page_token = v.into();
4047 self
4048 }
4049}
4050
4051impl wkt::message::Message for ListDomainMappingsRequest {
4052 fn typename() -> &'static str {
4053 "type.googleapis.com/google.appengine.v1.ListDomainMappingsRequest"
4054 }
4055}
4056
4057/// Response message for `DomainMappings.ListDomainMappings`.
4058#[derive(Clone, Default, PartialEq)]
4059#[non_exhaustive]
4060pub struct ListDomainMappingsResponse {
4061 /// The domain mappings for the application.
4062 pub domain_mappings: std::vec::Vec<crate::model::DomainMapping>,
4063
4064 /// Continuation token for fetching the next page of results.
4065 pub next_page_token: std::string::String,
4066
4067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4068}
4069
4070impl ListDomainMappingsResponse {
4071 pub fn new() -> Self {
4072 std::default::Default::default()
4073 }
4074
4075 /// Sets the value of [domain_mappings][crate::model::ListDomainMappingsResponse::domain_mappings].
4076 ///
4077 /// # Example
4078 /// ```ignore,no_run
4079 /// # use google_cloud_appengine_v1::model::ListDomainMappingsResponse;
4080 /// use google_cloud_appengine_v1::model::DomainMapping;
4081 /// let x = ListDomainMappingsResponse::new()
4082 /// .set_domain_mappings([
4083 /// DomainMapping::default()/* use setters */,
4084 /// DomainMapping::default()/* use (different) setters */,
4085 /// ]);
4086 /// ```
4087 pub fn set_domain_mappings<T, V>(mut self, v: T) -> Self
4088 where
4089 T: std::iter::IntoIterator<Item = V>,
4090 V: std::convert::Into<crate::model::DomainMapping>,
4091 {
4092 use std::iter::Iterator;
4093 self.domain_mappings = v.into_iter().map(|i| i.into()).collect();
4094 self
4095 }
4096
4097 /// Sets the value of [next_page_token][crate::model::ListDomainMappingsResponse::next_page_token].
4098 ///
4099 /// # Example
4100 /// ```ignore,no_run
4101 /// # use google_cloud_appengine_v1::model::ListDomainMappingsResponse;
4102 /// let x = ListDomainMappingsResponse::new().set_next_page_token("example");
4103 /// ```
4104 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4105 self.next_page_token = v.into();
4106 self
4107 }
4108}
4109
4110impl wkt::message::Message for ListDomainMappingsResponse {
4111 fn typename() -> &'static str {
4112 "type.googleapis.com/google.appengine.v1.ListDomainMappingsResponse"
4113 }
4114}
4115
4116#[doc(hidden)]
4117impl google_cloud_gax::paginator::internal::PageableResponse for ListDomainMappingsResponse {
4118 type PageItem = crate::model::DomainMapping;
4119
4120 fn items(self) -> std::vec::Vec<Self::PageItem> {
4121 self.domain_mappings
4122 }
4123
4124 fn next_page_token(&self) -> std::string::String {
4125 use std::clone::Clone;
4126 self.next_page_token.clone()
4127 }
4128}
4129
4130/// Request message for `DomainMappings.GetDomainMapping`.
4131#[derive(Clone, Default, PartialEq)]
4132#[non_exhaustive]
4133pub struct GetDomainMappingRequest {
4134 /// Name of the resource requested. Example:
4135 /// `apps/myapp/domainMappings/example.com`.
4136 pub name: std::string::String,
4137
4138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4139}
4140
4141impl GetDomainMappingRequest {
4142 pub fn new() -> Self {
4143 std::default::Default::default()
4144 }
4145
4146 /// Sets the value of [name][crate::model::GetDomainMappingRequest::name].
4147 ///
4148 /// # Example
4149 /// ```ignore,no_run
4150 /// # use google_cloud_appengine_v1::model::GetDomainMappingRequest;
4151 /// let x = GetDomainMappingRequest::new().set_name("example");
4152 /// ```
4153 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4154 self.name = v.into();
4155 self
4156 }
4157}
4158
4159impl wkt::message::Message for GetDomainMappingRequest {
4160 fn typename() -> &'static str {
4161 "type.googleapis.com/google.appengine.v1.GetDomainMappingRequest"
4162 }
4163}
4164
4165/// Request message for `DomainMappings.CreateDomainMapping`.
4166#[derive(Clone, Default, PartialEq)]
4167#[non_exhaustive]
4168pub struct CreateDomainMappingRequest {
4169 /// Name of the parent Application resource. Example: `apps/myapp`.
4170 pub parent: std::string::String,
4171
4172 /// Domain mapping configuration.
4173 pub domain_mapping: std::option::Option<crate::model::DomainMapping>,
4174
4175 /// Whether the domain creation should override any existing mappings for this
4176 /// domain. By default, overrides are rejected.
4177 pub override_strategy: crate::model::DomainOverrideStrategy,
4178
4179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4180}
4181
4182impl CreateDomainMappingRequest {
4183 pub fn new() -> Self {
4184 std::default::Default::default()
4185 }
4186
4187 /// Sets the value of [parent][crate::model::CreateDomainMappingRequest::parent].
4188 ///
4189 /// # Example
4190 /// ```ignore,no_run
4191 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4192 /// let x = CreateDomainMappingRequest::new().set_parent("example");
4193 /// ```
4194 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4195 self.parent = v.into();
4196 self
4197 }
4198
4199 /// Sets the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4200 ///
4201 /// # Example
4202 /// ```ignore,no_run
4203 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4204 /// use google_cloud_appengine_v1::model::DomainMapping;
4205 /// let x = CreateDomainMappingRequest::new().set_domain_mapping(DomainMapping::default()/* use setters */);
4206 /// ```
4207 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4208 where
4209 T: std::convert::Into<crate::model::DomainMapping>,
4210 {
4211 self.domain_mapping = std::option::Option::Some(v.into());
4212 self
4213 }
4214
4215 /// Sets or clears the value of [domain_mapping][crate::model::CreateDomainMappingRequest::domain_mapping].
4216 ///
4217 /// # Example
4218 /// ```ignore,no_run
4219 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4220 /// use google_cloud_appengine_v1::model::DomainMapping;
4221 /// let x = CreateDomainMappingRequest::new().set_or_clear_domain_mapping(Some(DomainMapping::default()/* use setters */));
4222 /// let x = CreateDomainMappingRequest::new().set_or_clear_domain_mapping(None::<DomainMapping>);
4223 /// ```
4224 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4225 where
4226 T: std::convert::Into<crate::model::DomainMapping>,
4227 {
4228 self.domain_mapping = v.map(|x| x.into());
4229 self
4230 }
4231
4232 /// Sets the value of [override_strategy][crate::model::CreateDomainMappingRequest::override_strategy].
4233 ///
4234 /// # Example
4235 /// ```ignore,no_run
4236 /// # use google_cloud_appengine_v1::model::CreateDomainMappingRequest;
4237 /// use google_cloud_appengine_v1::model::DomainOverrideStrategy;
4238 /// let x0 = CreateDomainMappingRequest::new().set_override_strategy(DomainOverrideStrategy::Strict);
4239 /// let x1 = CreateDomainMappingRequest::new().set_override_strategy(DomainOverrideStrategy::Override);
4240 /// ```
4241 pub fn set_override_strategy<T: std::convert::Into<crate::model::DomainOverrideStrategy>>(
4242 mut self,
4243 v: T,
4244 ) -> Self {
4245 self.override_strategy = v.into();
4246 self
4247 }
4248}
4249
4250impl wkt::message::Message for CreateDomainMappingRequest {
4251 fn typename() -> &'static str {
4252 "type.googleapis.com/google.appengine.v1.CreateDomainMappingRequest"
4253 }
4254}
4255
4256/// Request message for `DomainMappings.UpdateDomainMapping`.
4257#[derive(Clone, Default, PartialEq)]
4258#[non_exhaustive]
4259pub struct UpdateDomainMappingRequest {
4260 /// Name of the resource to update. Example:
4261 /// `apps/myapp/domainMappings/example.com`.
4262 pub name: std::string::String,
4263
4264 /// A domain mapping containing the updated resource. Only fields set
4265 /// in the field mask will be updated.
4266 pub domain_mapping: std::option::Option<crate::model::DomainMapping>,
4267
4268 /// Required. Standard field mask for the set of fields to be updated.
4269 pub update_mask: std::option::Option<wkt::FieldMask>,
4270
4271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4272}
4273
4274impl UpdateDomainMappingRequest {
4275 pub fn new() -> Self {
4276 std::default::Default::default()
4277 }
4278
4279 /// Sets the value of [name][crate::model::UpdateDomainMappingRequest::name].
4280 ///
4281 /// # Example
4282 /// ```ignore,no_run
4283 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4284 /// let x = UpdateDomainMappingRequest::new().set_name("example");
4285 /// ```
4286 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4287 self.name = v.into();
4288 self
4289 }
4290
4291 /// Sets the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
4292 ///
4293 /// # Example
4294 /// ```ignore,no_run
4295 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4296 /// use google_cloud_appengine_v1::model::DomainMapping;
4297 /// let x = UpdateDomainMappingRequest::new().set_domain_mapping(DomainMapping::default()/* use setters */);
4298 /// ```
4299 pub fn set_domain_mapping<T>(mut self, v: T) -> Self
4300 where
4301 T: std::convert::Into<crate::model::DomainMapping>,
4302 {
4303 self.domain_mapping = std::option::Option::Some(v.into());
4304 self
4305 }
4306
4307 /// Sets or clears the value of [domain_mapping][crate::model::UpdateDomainMappingRequest::domain_mapping].
4308 ///
4309 /// # Example
4310 /// ```ignore,no_run
4311 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4312 /// use google_cloud_appengine_v1::model::DomainMapping;
4313 /// let x = UpdateDomainMappingRequest::new().set_or_clear_domain_mapping(Some(DomainMapping::default()/* use setters */));
4314 /// let x = UpdateDomainMappingRequest::new().set_or_clear_domain_mapping(None::<DomainMapping>);
4315 /// ```
4316 pub fn set_or_clear_domain_mapping<T>(mut self, v: std::option::Option<T>) -> Self
4317 where
4318 T: std::convert::Into<crate::model::DomainMapping>,
4319 {
4320 self.domain_mapping = v.map(|x| x.into());
4321 self
4322 }
4323
4324 /// Sets the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
4325 ///
4326 /// # Example
4327 /// ```ignore,no_run
4328 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4329 /// use wkt::FieldMask;
4330 /// let x = UpdateDomainMappingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4331 /// ```
4332 pub fn set_update_mask<T>(mut self, v: T) -> Self
4333 where
4334 T: std::convert::Into<wkt::FieldMask>,
4335 {
4336 self.update_mask = std::option::Option::Some(v.into());
4337 self
4338 }
4339
4340 /// Sets or clears the value of [update_mask][crate::model::UpdateDomainMappingRequest::update_mask].
4341 ///
4342 /// # Example
4343 /// ```ignore,no_run
4344 /// # use google_cloud_appengine_v1::model::UpdateDomainMappingRequest;
4345 /// use wkt::FieldMask;
4346 /// let x = UpdateDomainMappingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4347 /// let x = UpdateDomainMappingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4348 /// ```
4349 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4350 where
4351 T: std::convert::Into<wkt::FieldMask>,
4352 {
4353 self.update_mask = v.map(|x| x.into());
4354 self
4355 }
4356}
4357
4358impl wkt::message::Message for UpdateDomainMappingRequest {
4359 fn typename() -> &'static str {
4360 "type.googleapis.com/google.appengine.v1.UpdateDomainMappingRequest"
4361 }
4362}
4363
4364/// Request message for `DomainMappings.DeleteDomainMapping`.
4365#[derive(Clone, Default, PartialEq)]
4366#[non_exhaustive]
4367pub struct DeleteDomainMappingRequest {
4368 /// Name of the resource to delete. Example:
4369 /// `apps/myapp/domainMappings/example.com`.
4370 pub name: std::string::String,
4371
4372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4373}
4374
4375impl DeleteDomainMappingRequest {
4376 pub fn new() -> Self {
4377 std::default::Default::default()
4378 }
4379
4380 /// Sets the value of [name][crate::model::DeleteDomainMappingRequest::name].
4381 ///
4382 /// # Example
4383 /// ```ignore,no_run
4384 /// # use google_cloud_appengine_v1::model::DeleteDomainMappingRequest;
4385 /// let x = DeleteDomainMappingRequest::new().set_name("example");
4386 /// ```
4387 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4388 self.name = v.into();
4389 self
4390 }
4391}
4392
4393impl wkt::message::Message for DeleteDomainMappingRequest {
4394 fn typename() -> &'static str {
4395 "type.googleapis.com/google.appengine.v1.DeleteDomainMappingRequest"
4396 }
4397}
4398
4399/// An Application resource contains the top-level configuration of an App
4400/// Engine application.
4401#[derive(Clone, Default, PartialEq)]
4402#[non_exhaustive]
4403pub struct Application {
4404 /// Full path to the Application resource in the API.
4405 /// Example: `apps/myapp`.
4406 ///
4407 /// @OutputOnly
4408 pub name: std::string::String,
4409
4410 /// Identifier of the Application resource. This identifier is equivalent
4411 /// to the project ID of the Google Cloud Platform project where you want to
4412 /// deploy your application.
4413 /// Example: `myapp`.
4414 pub id: std::string::String,
4415
4416 /// HTTP path dispatch rules for requests to the application that do not
4417 /// explicitly target a service or version. Rules are order-dependent.
4418 /// Up to 20 dispatch rules can be supported.
4419 pub dispatch_rules: std::vec::Vec<crate::model::UrlDispatchRule>,
4420
4421 /// Google Apps authentication domain that controls which users can access
4422 /// this application.
4423 ///
4424 /// Defaults to open access for any Google Account.
4425 pub auth_domain: std::string::String,
4426
4427 /// Location from which this application runs. Application instances
4428 /// run out of the data centers in the specified location, which is also where
4429 /// all of the application's end user content is stored.
4430 ///
4431 /// Defaults to `us-central`.
4432 ///
4433 /// View the list of
4434 /// [supported locations](https://cloud.google.com/appengine/docs/locations).
4435 pub location_id: std::string::String,
4436
4437 /// Google Cloud Storage bucket that can be used for storing files
4438 /// associated with this application. This bucket is associated with the
4439 /// application and can be used by the gcloud deployment commands.
4440 ///
4441 /// @OutputOnly
4442 pub code_bucket: std::string::String,
4443
4444 /// Cookie expiration policy for this application.
4445 pub default_cookie_expiration: std::option::Option<wkt::Duration>,
4446
4447 /// Serving status of this application.
4448 pub serving_status: crate::model::application::ServingStatus,
4449
4450 /// Hostname used to reach this application, as resolved by App Engine.
4451 ///
4452 /// @OutputOnly
4453 pub default_hostname: std::string::String,
4454
4455 /// Google Cloud Storage bucket that can be used by this application to store
4456 /// content.
4457 ///
4458 /// @OutputOnly
4459 pub default_bucket: std::string::String,
4460
4461 /// The service account associated with the application.
4462 /// This is the app-level default identity. If no identity provided during
4463 /// create version, Admin API will fallback to this one.
4464 pub service_account: std::string::String,
4465
4466 pub iap: std::option::Option<crate::model::application::IdentityAwareProxy>,
4467
4468 /// The Google Container Registry domain used for storing managed build docker
4469 /// images for this application.
4470 pub gcr_domain: std::string::String,
4471
4472 /// The type of the Cloud Firestore or Cloud Datastore database associated with
4473 /// this application.
4474 pub database_type: crate::model::application::DatabaseType,
4475
4476 /// The feature specific settings to be used in the application.
4477 pub feature_settings: std::option::Option<crate::model::application::FeatureSettings>,
4478
4479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4480}
4481
4482impl Application {
4483 pub fn new() -> Self {
4484 std::default::Default::default()
4485 }
4486
4487 /// Sets the value of [name][crate::model::Application::name].
4488 ///
4489 /// # Example
4490 /// ```ignore,no_run
4491 /// # use google_cloud_appengine_v1::model::Application;
4492 /// let x = Application::new().set_name("example");
4493 /// ```
4494 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4495 self.name = v.into();
4496 self
4497 }
4498
4499 /// Sets the value of [id][crate::model::Application::id].
4500 ///
4501 /// # Example
4502 /// ```ignore,no_run
4503 /// # use google_cloud_appengine_v1::model::Application;
4504 /// let x = Application::new().set_id("example");
4505 /// ```
4506 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4507 self.id = v.into();
4508 self
4509 }
4510
4511 /// Sets the value of [dispatch_rules][crate::model::Application::dispatch_rules].
4512 ///
4513 /// # Example
4514 /// ```ignore,no_run
4515 /// # use google_cloud_appengine_v1::model::Application;
4516 /// use google_cloud_appengine_v1::model::UrlDispatchRule;
4517 /// let x = Application::new()
4518 /// .set_dispatch_rules([
4519 /// UrlDispatchRule::default()/* use setters */,
4520 /// UrlDispatchRule::default()/* use (different) setters */,
4521 /// ]);
4522 /// ```
4523 pub fn set_dispatch_rules<T, V>(mut self, v: T) -> Self
4524 where
4525 T: std::iter::IntoIterator<Item = V>,
4526 V: std::convert::Into<crate::model::UrlDispatchRule>,
4527 {
4528 use std::iter::Iterator;
4529 self.dispatch_rules = v.into_iter().map(|i| i.into()).collect();
4530 self
4531 }
4532
4533 /// Sets the value of [auth_domain][crate::model::Application::auth_domain].
4534 ///
4535 /// # Example
4536 /// ```ignore,no_run
4537 /// # use google_cloud_appengine_v1::model::Application;
4538 /// let x = Application::new().set_auth_domain("example");
4539 /// ```
4540 pub fn set_auth_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4541 self.auth_domain = v.into();
4542 self
4543 }
4544
4545 /// Sets the value of [location_id][crate::model::Application::location_id].
4546 ///
4547 /// # Example
4548 /// ```ignore,no_run
4549 /// # use google_cloud_appengine_v1::model::Application;
4550 /// let x = Application::new().set_location_id("example");
4551 /// ```
4552 pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4553 self.location_id = v.into();
4554 self
4555 }
4556
4557 /// Sets the value of [code_bucket][crate::model::Application::code_bucket].
4558 ///
4559 /// # Example
4560 /// ```ignore,no_run
4561 /// # use google_cloud_appengine_v1::model::Application;
4562 /// let x = Application::new().set_code_bucket("example");
4563 /// ```
4564 pub fn set_code_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4565 self.code_bucket = v.into();
4566 self
4567 }
4568
4569 /// Sets the value of [default_cookie_expiration][crate::model::Application::default_cookie_expiration].
4570 ///
4571 /// # Example
4572 /// ```ignore,no_run
4573 /// # use google_cloud_appengine_v1::model::Application;
4574 /// use wkt::Duration;
4575 /// let x = Application::new().set_default_cookie_expiration(Duration::default()/* use setters */);
4576 /// ```
4577 pub fn set_default_cookie_expiration<T>(mut self, v: T) -> Self
4578 where
4579 T: std::convert::Into<wkt::Duration>,
4580 {
4581 self.default_cookie_expiration = std::option::Option::Some(v.into());
4582 self
4583 }
4584
4585 /// Sets or clears the value of [default_cookie_expiration][crate::model::Application::default_cookie_expiration].
4586 ///
4587 /// # Example
4588 /// ```ignore,no_run
4589 /// # use google_cloud_appengine_v1::model::Application;
4590 /// use wkt::Duration;
4591 /// let x = Application::new().set_or_clear_default_cookie_expiration(Some(Duration::default()/* use setters */));
4592 /// let x = Application::new().set_or_clear_default_cookie_expiration(None::<Duration>);
4593 /// ```
4594 pub fn set_or_clear_default_cookie_expiration<T>(mut self, v: std::option::Option<T>) -> Self
4595 where
4596 T: std::convert::Into<wkt::Duration>,
4597 {
4598 self.default_cookie_expiration = v.map(|x| x.into());
4599 self
4600 }
4601
4602 /// Sets the value of [serving_status][crate::model::Application::serving_status].
4603 ///
4604 /// # Example
4605 /// ```ignore,no_run
4606 /// # use google_cloud_appengine_v1::model::Application;
4607 /// use google_cloud_appengine_v1::model::application::ServingStatus;
4608 /// let x0 = Application::new().set_serving_status(ServingStatus::Serving);
4609 /// let x1 = Application::new().set_serving_status(ServingStatus::UserDisabled);
4610 /// let x2 = Application::new().set_serving_status(ServingStatus::SystemDisabled);
4611 /// ```
4612 pub fn set_serving_status<T: std::convert::Into<crate::model::application::ServingStatus>>(
4613 mut self,
4614 v: T,
4615 ) -> Self {
4616 self.serving_status = v.into();
4617 self
4618 }
4619
4620 /// Sets the value of [default_hostname][crate::model::Application::default_hostname].
4621 ///
4622 /// # Example
4623 /// ```ignore,no_run
4624 /// # use google_cloud_appengine_v1::model::Application;
4625 /// let x = Application::new().set_default_hostname("example");
4626 /// ```
4627 pub fn set_default_hostname<T: std::convert::Into<std::string::String>>(
4628 mut self,
4629 v: T,
4630 ) -> Self {
4631 self.default_hostname = v.into();
4632 self
4633 }
4634
4635 /// Sets the value of [default_bucket][crate::model::Application::default_bucket].
4636 ///
4637 /// # Example
4638 /// ```ignore,no_run
4639 /// # use google_cloud_appengine_v1::model::Application;
4640 /// let x = Application::new().set_default_bucket("example");
4641 /// ```
4642 pub fn set_default_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4643 self.default_bucket = v.into();
4644 self
4645 }
4646
4647 /// Sets the value of [service_account][crate::model::Application::service_account].
4648 ///
4649 /// # Example
4650 /// ```ignore,no_run
4651 /// # use google_cloud_appengine_v1::model::Application;
4652 /// let x = Application::new().set_service_account("example");
4653 /// ```
4654 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4655 self.service_account = v.into();
4656 self
4657 }
4658
4659 /// Sets the value of [iap][crate::model::Application::iap].
4660 ///
4661 /// # Example
4662 /// ```ignore,no_run
4663 /// # use google_cloud_appengine_v1::model::Application;
4664 /// use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4665 /// let x = Application::new().set_iap(IdentityAwareProxy::default()/* use setters */);
4666 /// ```
4667 pub fn set_iap<T>(mut self, v: T) -> Self
4668 where
4669 T: std::convert::Into<crate::model::application::IdentityAwareProxy>,
4670 {
4671 self.iap = std::option::Option::Some(v.into());
4672 self
4673 }
4674
4675 /// Sets or clears the value of [iap][crate::model::Application::iap].
4676 ///
4677 /// # Example
4678 /// ```ignore,no_run
4679 /// # use google_cloud_appengine_v1::model::Application;
4680 /// use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4681 /// let x = Application::new().set_or_clear_iap(Some(IdentityAwareProxy::default()/* use setters */));
4682 /// let x = Application::new().set_or_clear_iap(None::<IdentityAwareProxy>);
4683 /// ```
4684 pub fn set_or_clear_iap<T>(mut self, v: std::option::Option<T>) -> Self
4685 where
4686 T: std::convert::Into<crate::model::application::IdentityAwareProxy>,
4687 {
4688 self.iap = v.map(|x| x.into());
4689 self
4690 }
4691
4692 /// Sets the value of [gcr_domain][crate::model::Application::gcr_domain].
4693 ///
4694 /// # Example
4695 /// ```ignore,no_run
4696 /// # use google_cloud_appengine_v1::model::Application;
4697 /// let x = Application::new().set_gcr_domain("example");
4698 /// ```
4699 pub fn set_gcr_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4700 self.gcr_domain = v.into();
4701 self
4702 }
4703
4704 /// Sets the value of [database_type][crate::model::Application::database_type].
4705 ///
4706 /// # Example
4707 /// ```ignore,no_run
4708 /// # use google_cloud_appengine_v1::model::Application;
4709 /// use google_cloud_appengine_v1::model::application::DatabaseType;
4710 /// let x0 = Application::new().set_database_type(DatabaseType::CloudDatastore);
4711 /// let x1 = Application::new().set_database_type(DatabaseType::CloudFirestore);
4712 /// let x2 = Application::new().set_database_type(DatabaseType::CloudDatastoreCompatibility);
4713 /// ```
4714 pub fn set_database_type<T: std::convert::Into<crate::model::application::DatabaseType>>(
4715 mut self,
4716 v: T,
4717 ) -> Self {
4718 self.database_type = v.into();
4719 self
4720 }
4721
4722 /// Sets the value of [feature_settings][crate::model::Application::feature_settings].
4723 ///
4724 /// # Example
4725 /// ```ignore,no_run
4726 /// # use google_cloud_appengine_v1::model::Application;
4727 /// use google_cloud_appengine_v1::model::application::FeatureSettings;
4728 /// let x = Application::new().set_feature_settings(FeatureSettings::default()/* use setters */);
4729 /// ```
4730 pub fn set_feature_settings<T>(mut self, v: T) -> Self
4731 where
4732 T: std::convert::Into<crate::model::application::FeatureSettings>,
4733 {
4734 self.feature_settings = std::option::Option::Some(v.into());
4735 self
4736 }
4737
4738 /// Sets or clears the value of [feature_settings][crate::model::Application::feature_settings].
4739 ///
4740 /// # Example
4741 /// ```ignore,no_run
4742 /// # use google_cloud_appengine_v1::model::Application;
4743 /// use google_cloud_appengine_v1::model::application::FeatureSettings;
4744 /// let x = Application::new().set_or_clear_feature_settings(Some(FeatureSettings::default()/* use setters */));
4745 /// let x = Application::new().set_or_clear_feature_settings(None::<FeatureSettings>);
4746 /// ```
4747 pub fn set_or_clear_feature_settings<T>(mut self, v: std::option::Option<T>) -> Self
4748 where
4749 T: std::convert::Into<crate::model::application::FeatureSettings>,
4750 {
4751 self.feature_settings = v.map(|x| x.into());
4752 self
4753 }
4754}
4755
4756impl wkt::message::Message for Application {
4757 fn typename() -> &'static str {
4758 "type.googleapis.com/google.appengine.v1.Application"
4759 }
4760}
4761
4762/// Defines additional types related to [Application].
4763pub mod application {
4764 #[allow(unused_imports)]
4765 use super::*;
4766
4767 /// Identity-Aware Proxy
4768 #[derive(Clone, Default, PartialEq)]
4769 #[non_exhaustive]
4770 pub struct IdentityAwareProxy {
4771 /// Whether the serving infrastructure will authenticate and
4772 /// authorize all incoming requests.
4773 ///
4774 /// If true, the `oauth2_client_id` and `oauth2_client_secret`
4775 /// fields must be non-empty.
4776 pub enabled: bool,
4777
4778 /// OAuth2 client ID to use for the authentication flow.
4779 pub oauth2_client_id: std::string::String,
4780
4781 /// OAuth2 client secret to use for the authentication flow.
4782 ///
4783 /// For security reasons, this value cannot be retrieved via the API.
4784 /// Instead, the SHA-256 hash of the value is returned in the
4785 /// `oauth2_client_secret_sha256` field.
4786 ///
4787 /// @InputOnly
4788 pub oauth2_client_secret: std::string::String,
4789
4790 /// Hex-encoded SHA-256 hash of the client secret.
4791 ///
4792 /// @OutputOnly
4793 pub oauth2_client_secret_sha256: std::string::String,
4794
4795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4796 }
4797
4798 impl IdentityAwareProxy {
4799 pub fn new() -> Self {
4800 std::default::Default::default()
4801 }
4802
4803 /// Sets the value of [enabled][crate::model::application::IdentityAwareProxy::enabled].
4804 ///
4805 /// # Example
4806 /// ```ignore,no_run
4807 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4808 /// let x = IdentityAwareProxy::new().set_enabled(true);
4809 /// ```
4810 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4811 self.enabled = v.into();
4812 self
4813 }
4814
4815 /// Sets the value of [oauth2_client_id][crate::model::application::IdentityAwareProxy::oauth2_client_id].
4816 ///
4817 /// # Example
4818 /// ```ignore,no_run
4819 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4820 /// let x = IdentityAwareProxy::new().set_oauth2_client_id("example");
4821 /// ```
4822 pub fn set_oauth2_client_id<T: std::convert::Into<std::string::String>>(
4823 mut self,
4824 v: T,
4825 ) -> Self {
4826 self.oauth2_client_id = v.into();
4827 self
4828 }
4829
4830 /// Sets the value of [oauth2_client_secret][crate::model::application::IdentityAwareProxy::oauth2_client_secret].
4831 ///
4832 /// # Example
4833 /// ```ignore,no_run
4834 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4835 /// let x = IdentityAwareProxy::new().set_oauth2_client_secret("example");
4836 /// ```
4837 pub fn set_oauth2_client_secret<T: std::convert::Into<std::string::String>>(
4838 mut self,
4839 v: T,
4840 ) -> Self {
4841 self.oauth2_client_secret = v.into();
4842 self
4843 }
4844
4845 /// Sets the value of [oauth2_client_secret_sha256][crate::model::application::IdentityAwareProxy::oauth2_client_secret_sha256].
4846 ///
4847 /// # Example
4848 /// ```ignore,no_run
4849 /// # use google_cloud_appengine_v1::model::application::IdentityAwareProxy;
4850 /// let x = IdentityAwareProxy::new().set_oauth2_client_secret_sha256("example");
4851 /// ```
4852 pub fn set_oauth2_client_secret_sha256<T: std::convert::Into<std::string::String>>(
4853 mut self,
4854 v: T,
4855 ) -> Self {
4856 self.oauth2_client_secret_sha256 = v.into();
4857 self
4858 }
4859 }
4860
4861 impl wkt::message::Message for IdentityAwareProxy {
4862 fn typename() -> &'static str {
4863 "type.googleapis.com/google.appengine.v1.Application.IdentityAwareProxy"
4864 }
4865 }
4866
4867 /// The feature specific settings to be used in the application. These define
4868 /// behaviors that are user configurable.
4869 #[derive(Clone, Default, PartialEq)]
4870 #[non_exhaustive]
4871 pub struct FeatureSettings {
4872 /// Boolean value indicating if split health checks should be used instead
4873 /// of the legacy health checks. At an app.yaml level, this means defaulting
4874 /// to 'readiness_check' and 'liveness_check' values instead of
4875 /// 'health_check' ones. Once the legacy 'health_check' behavior is
4876 /// deprecated, and this value is always true, this setting can
4877 /// be removed.
4878 pub split_health_checks: bool,
4879
4880 /// If true, use [Container-Optimized OS](https://cloud.google.com/container-optimized-os/)
4881 /// base image for VMs, rather than a base Debian image.
4882 pub use_container_optimized_os: bool,
4883
4884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4885 }
4886
4887 impl FeatureSettings {
4888 pub fn new() -> Self {
4889 std::default::Default::default()
4890 }
4891
4892 /// Sets the value of [split_health_checks][crate::model::application::FeatureSettings::split_health_checks].
4893 ///
4894 /// # Example
4895 /// ```ignore,no_run
4896 /// # use google_cloud_appengine_v1::model::application::FeatureSettings;
4897 /// let x = FeatureSettings::new().set_split_health_checks(true);
4898 /// ```
4899 pub fn set_split_health_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4900 self.split_health_checks = v.into();
4901 self
4902 }
4903
4904 /// Sets the value of [use_container_optimized_os][crate::model::application::FeatureSettings::use_container_optimized_os].
4905 ///
4906 /// # Example
4907 /// ```ignore,no_run
4908 /// # use google_cloud_appengine_v1::model::application::FeatureSettings;
4909 /// let x = FeatureSettings::new().set_use_container_optimized_os(true);
4910 /// ```
4911 pub fn set_use_container_optimized_os<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4912 self.use_container_optimized_os = v.into();
4913 self
4914 }
4915 }
4916
4917 impl wkt::message::Message for FeatureSettings {
4918 fn typename() -> &'static str {
4919 "type.googleapis.com/google.appengine.v1.Application.FeatureSettings"
4920 }
4921 }
4922
4923 ///
4924 /// # Working with unknown values
4925 ///
4926 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4927 /// additional enum variants at any time. Adding new variants is not considered
4928 /// a breaking change. Applications should write their code in anticipation of:
4929 ///
4930 /// - New values appearing in future releases of the client library, **and**
4931 /// - New values received dynamically, without application changes.
4932 ///
4933 /// Please consult the [Working with enums] section in the user guide for some
4934 /// guidelines.
4935 ///
4936 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4937 #[derive(Clone, Debug, PartialEq)]
4938 #[non_exhaustive]
4939 pub enum ServingStatus {
4940 /// Serving status is unspecified.
4941 Unspecified,
4942 /// Application is serving.
4943 Serving,
4944 /// Application has been disabled by the user.
4945 UserDisabled,
4946 /// Application has been disabled by the system.
4947 SystemDisabled,
4948 /// If set, the enum was initialized with an unknown value.
4949 ///
4950 /// Applications can examine the value using [ServingStatus::value] or
4951 /// [ServingStatus::name].
4952 UnknownValue(serving_status::UnknownValue),
4953 }
4954
4955 #[doc(hidden)]
4956 pub mod serving_status {
4957 #[allow(unused_imports)]
4958 use super::*;
4959 #[derive(Clone, Debug, PartialEq)]
4960 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4961 }
4962
4963 impl ServingStatus {
4964 /// Gets the enum value.
4965 ///
4966 /// Returns `None` if the enum contains an unknown value deserialized from
4967 /// the string representation of enums.
4968 pub fn value(&self) -> std::option::Option<i32> {
4969 match self {
4970 Self::Unspecified => std::option::Option::Some(0),
4971 Self::Serving => std::option::Option::Some(1),
4972 Self::UserDisabled => std::option::Option::Some(2),
4973 Self::SystemDisabled => std::option::Option::Some(3),
4974 Self::UnknownValue(u) => u.0.value(),
4975 }
4976 }
4977
4978 /// Gets the enum value as a string.
4979 ///
4980 /// Returns `None` if the enum contains an unknown value deserialized from
4981 /// the integer representation of enums.
4982 pub fn name(&self) -> std::option::Option<&str> {
4983 match self {
4984 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
4985 Self::Serving => std::option::Option::Some("SERVING"),
4986 Self::UserDisabled => std::option::Option::Some("USER_DISABLED"),
4987 Self::SystemDisabled => std::option::Option::Some("SYSTEM_DISABLED"),
4988 Self::UnknownValue(u) => u.0.name(),
4989 }
4990 }
4991 }
4992
4993 impl std::default::Default for ServingStatus {
4994 fn default() -> Self {
4995 use std::convert::From;
4996 Self::from(0)
4997 }
4998 }
4999
5000 impl std::fmt::Display for ServingStatus {
5001 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5002 wkt::internal::display_enum(f, self.name(), self.value())
5003 }
5004 }
5005
5006 impl std::convert::From<i32> for ServingStatus {
5007 fn from(value: i32) -> Self {
5008 match value {
5009 0 => Self::Unspecified,
5010 1 => Self::Serving,
5011 2 => Self::UserDisabled,
5012 3 => Self::SystemDisabled,
5013 _ => Self::UnknownValue(serving_status::UnknownValue(
5014 wkt::internal::UnknownEnumValue::Integer(value),
5015 )),
5016 }
5017 }
5018 }
5019
5020 impl std::convert::From<&str> for ServingStatus {
5021 fn from(value: &str) -> Self {
5022 use std::string::ToString;
5023 match value {
5024 "UNSPECIFIED" => Self::Unspecified,
5025 "SERVING" => Self::Serving,
5026 "USER_DISABLED" => Self::UserDisabled,
5027 "SYSTEM_DISABLED" => Self::SystemDisabled,
5028 _ => Self::UnknownValue(serving_status::UnknownValue(
5029 wkt::internal::UnknownEnumValue::String(value.to_string()),
5030 )),
5031 }
5032 }
5033 }
5034
5035 impl serde::ser::Serialize for ServingStatus {
5036 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5037 where
5038 S: serde::Serializer,
5039 {
5040 match self {
5041 Self::Unspecified => serializer.serialize_i32(0),
5042 Self::Serving => serializer.serialize_i32(1),
5043 Self::UserDisabled => serializer.serialize_i32(2),
5044 Self::SystemDisabled => serializer.serialize_i32(3),
5045 Self::UnknownValue(u) => u.0.serialize(serializer),
5046 }
5047 }
5048 }
5049
5050 impl<'de> serde::de::Deserialize<'de> for ServingStatus {
5051 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5052 where
5053 D: serde::Deserializer<'de>,
5054 {
5055 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServingStatus>::new(
5056 ".google.appengine.v1.Application.ServingStatus",
5057 ))
5058 }
5059 }
5060
5061 ///
5062 /// # Working with unknown values
5063 ///
5064 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5065 /// additional enum variants at any time. Adding new variants is not considered
5066 /// a breaking change. Applications should write their code in anticipation of:
5067 ///
5068 /// - New values appearing in future releases of the client library, **and**
5069 /// - New values received dynamically, without application changes.
5070 ///
5071 /// Please consult the [Working with enums] section in the user guide for some
5072 /// guidelines.
5073 ///
5074 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5075 #[derive(Clone, Debug, PartialEq)]
5076 #[non_exhaustive]
5077 pub enum DatabaseType {
5078 /// Database type is unspecified.
5079 Unspecified,
5080 /// Cloud Datastore
5081 CloudDatastore,
5082 /// Cloud Firestore Native
5083 CloudFirestore,
5084 /// Cloud Firestore in Datastore Mode
5085 CloudDatastoreCompatibility,
5086 /// If set, the enum was initialized with an unknown value.
5087 ///
5088 /// Applications can examine the value using [DatabaseType::value] or
5089 /// [DatabaseType::name].
5090 UnknownValue(database_type::UnknownValue),
5091 }
5092
5093 #[doc(hidden)]
5094 pub mod database_type {
5095 #[allow(unused_imports)]
5096 use super::*;
5097 #[derive(Clone, Debug, PartialEq)]
5098 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5099 }
5100
5101 impl DatabaseType {
5102 /// Gets the enum value.
5103 ///
5104 /// Returns `None` if the enum contains an unknown value deserialized from
5105 /// the string representation of enums.
5106 pub fn value(&self) -> std::option::Option<i32> {
5107 match self {
5108 Self::Unspecified => std::option::Option::Some(0),
5109 Self::CloudDatastore => std::option::Option::Some(1),
5110 Self::CloudFirestore => std::option::Option::Some(2),
5111 Self::CloudDatastoreCompatibility => std::option::Option::Some(3),
5112 Self::UnknownValue(u) => u.0.value(),
5113 }
5114 }
5115
5116 /// Gets the enum value as a string.
5117 ///
5118 /// Returns `None` if the enum contains an unknown value deserialized from
5119 /// the integer representation of enums.
5120 pub fn name(&self) -> std::option::Option<&str> {
5121 match self {
5122 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
5123 Self::CloudDatastore => std::option::Option::Some("CLOUD_DATASTORE"),
5124 Self::CloudFirestore => std::option::Option::Some("CLOUD_FIRESTORE"),
5125 Self::CloudDatastoreCompatibility => {
5126 std::option::Option::Some("CLOUD_DATASTORE_COMPATIBILITY")
5127 }
5128 Self::UnknownValue(u) => u.0.name(),
5129 }
5130 }
5131 }
5132
5133 impl std::default::Default for DatabaseType {
5134 fn default() -> Self {
5135 use std::convert::From;
5136 Self::from(0)
5137 }
5138 }
5139
5140 impl std::fmt::Display for DatabaseType {
5141 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5142 wkt::internal::display_enum(f, self.name(), self.value())
5143 }
5144 }
5145
5146 impl std::convert::From<i32> for DatabaseType {
5147 fn from(value: i32) -> Self {
5148 match value {
5149 0 => Self::Unspecified,
5150 1 => Self::CloudDatastore,
5151 2 => Self::CloudFirestore,
5152 3 => Self::CloudDatastoreCompatibility,
5153 _ => Self::UnknownValue(database_type::UnknownValue(
5154 wkt::internal::UnknownEnumValue::Integer(value),
5155 )),
5156 }
5157 }
5158 }
5159
5160 impl std::convert::From<&str> for DatabaseType {
5161 fn from(value: &str) -> Self {
5162 use std::string::ToString;
5163 match value {
5164 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
5165 "CLOUD_DATASTORE" => Self::CloudDatastore,
5166 "CLOUD_FIRESTORE" => Self::CloudFirestore,
5167 "CLOUD_DATASTORE_COMPATIBILITY" => Self::CloudDatastoreCompatibility,
5168 _ => Self::UnknownValue(database_type::UnknownValue(
5169 wkt::internal::UnknownEnumValue::String(value.to_string()),
5170 )),
5171 }
5172 }
5173 }
5174
5175 impl serde::ser::Serialize for DatabaseType {
5176 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5177 where
5178 S: serde::Serializer,
5179 {
5180 match self {
5181 Self::Unspecified => serializer.serialize_i32(0),
5182 Self::CloudDatastore => serializer.serialize_i32(1),
5183 Self::CloudFirestore => serializer.serialize_i32(2),
5184 Self::CloudDatastoreCompatibility => serializer.serialize_i32(3),
5185 Self::UnknownValue(u) => u.0.serialize(serializer),
5186 }
5187 }
5188 }
5189
5190 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
5191 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5192 where
5193 D: serde::Deserializer<'de>,
5194 {
5195 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
5196 ".google.appengine.v1.Application.DatabaseType",
5197 ))
5198 }
5199 }
5200}
5201
5202/// Rules to match an HTTP request and dispatch that request to a service.
5203#[derive(Clone, Default, PartialEq)]
5204#[non_exhaustive]
5205pub struct UrlDispatchRule {
5206 /// Domain name to match against. The wildcard "`*`" is supported if
5207 /// specified before a period: "`*.`".
5208 ///
5209 /// Defaults to matching all domains: "`*`".
5210 pub domain: std::string::String,
5211
5212 /// Pathname within the host. Must start with a "`/`". A
5213 /// single "`*`" can be included at the end of the path.
5214 ///
5215 /// The sum of the lengths of the domain and path may not
5216 /// exceed 100 characters.
5217 pub path: std::string::String,
5218
5219 /// Resource ID of a service in this application that should
5220 /// serve the matched request. The service must already
5221 /// exist. Example: `default`.
5222 pub service: std::string::String,
5223
5224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5225}
5226
5227impl UrlDispatchRule {
5228 pub fn new() -> Self {
5229 std::default::Default::default()
5230 }
5231
5232 /// Sets the value of [domain][crate::model::UrlDispatchRule::domain].
5233 ///
5234 /// # Example
5235 /// ```ignore,no_run
5236 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5237 /// let x = UrlDispatchRule::new().set_domain("example");
5238 /// ```
5239 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5240 self.domain = v.into();
5241 self
5242 }
5243
5244 /// Sets the value of [path][crate::model::UrlDispatchRule::path].
5245 ///
5246 /// # Example
5247 /// ```ignore,no_run
5248 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5249 /// let x = UrlDispatchRule::new().set_path("example");
5250 /// ```
5251 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5252 self.path = v.into();
5253 self
5254 }
5255
5256 /// Sets the value of [service][crate::model::UrlDispatchRule::service].
5257 ///
5258 /// # Example
5259 /// ```ignore,no_run
5260 /// # use google_cloud_appengine_v1::model::UrlDispatchRule;
5261 /// let x = UrlDispatchRule::new().set_service("example");
5262 /// ```
5263 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5264 self.service = v.into();
5265 self
5266 }
5267}
5268
5269impl wkt::message::Message for UrlDispatchRule {
5270 fn typename() -> &'static str {
5271 "type.googleapis.com/google.appengine.v1.UrlDispatchRule"
5272 }
5273}
5274
5275/// App Engine admin service audit log.
5276#[derive(Clone, Default, PartialEq)]
5277#[non_exhaustive]
5278pub struct AuditData {
5279 /// Detailed information about methods that require it. Does not include
5280 /// simple Get, List or Delete methods because all significant information
5281 /// (resource name, number of returned elements for List operations) is already
5282 /// included in parent audit log message.
5283 pub method: std::option::Option<crate::model::audit_data::Method>,
5284
5285 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5286}
5287
5288impl AuditData {
5289 pub fn new() -> Self {
5290 std::default::Default::default()
5291 }
5292
5293 /// Sets the value of [method][crate::model::AuditData::method].
5294 ///
5295 /// Note that all the setters affecting `method` are mutually
5296 /// exclusive.
5297 ///
5298 /// # Example
5299 /// ```ignore,no_run
5300 /// # use google_cloud_appengine_v1::model::AuditData;
5301 /// use google_cloud_appengine_v1::model::UpdateServiceMethod;
5302 /// let x = AuditData::new().set_method(Some(
5303 /// google_cloud_appengine_v1::model::audit_data::Method::UpdateService(UpdateServiceMethod::default().into())));
5304 /// ```
5305 pub fn set_method<
5306 T: std::convert::Into<std::option::Option<crate::model::audit_data::Method>>,
5307 >(
5308 mut self,
5309 v: T,
5310 ) -> Self {
5311 self.method = v.into();
5312 self
5313 }
5314
5315 /// The value of [method][crate::model::AuditData::method]
5316 /// if it holds a `UpdateService`, `None` if the field is not set or
5317 /// holds a different branch.
5318 pub fn update_service(
5319 &self,
5320 ) -> std::option::Option<&std::boxed::Box<crate::model::UpdateServiceMethod>> {
5321 #[allow(unreachable_patterns)]
5322 self.method.as_ref().and_then(|v| match v {
5323 crate::model::audit_data::Method::UpdateService(v) => std::option::Option::Some(v),
5324 _ => std::option::Option::None,
5325 })
5326 }
5327
5328 /// Sets the value of [method][crate::model::AuditData::method]
5329 /// to hold a `UpdateService`.
5330 ///
5331 /// Note that all the setters affecting `method` are
5332 /// mutually exclusive.
5333 ///
5334 /// # Example
5335 /// ```ignore,no_run
5336 /// # use google_cloud_appengine_v1::model::AuditData;
5337 /// use google_cloud_appengine_v1::model::UpdateServiceMethod;
5338 /// let x = AuditData::new().set_update_service(UpdateServiceMethod::default()/* use setters */);
5339 /// assert!(x.update_service().is_some());
5340 /// assert!(x.create_version().is_none());
5341 /// ```
5342 pub fn set_update_service<
5343 T: std::convert::Into<std::boxed::Box<crate::model::UpdateServiceMethod>>,
5344 >(
5345 mut self,
5346 v: T,
5347 ) -> Self {
5348 self.method =
5349 std::option::Option::Some(crate::model::audit_data::Method::UpdateService(v.into()));
5350 self
5351 }
5352
5353 /// The value of [method][crate::model::AuditData::method]
5354 /// if it holds a `CreateVersion`, `None` if the field is not set or
5355 /// holds a different branch.
5356 pub fn create_version(
5357 &self,
5358 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateVersionMethod>> {
5359 #[allow(unreachable_patterns)]
5360 self.method.as_ref().and_then(|v| match v {
5361 crate::model::audit_data::Method::CreateVersion(v) => std::option::Option::Some(v),
5362 _ => std::option::Option::None,
5363 })
5364 }
5365
5366 /// Sets the value of [method][crate::model::AuditData::method]
5367 /// to hold a `CreateVersion`.
5368 ///
5369 /// Note that all the setters affecting `method` are
5370 /// mutually exclusive.
5371 ///
5372 /// # Example
5373 /// ```ignore,no_run
5374 /// # use google_cloud_appengine_v1::model::AuditData;
5375 /// use google_cloud_appengine_v1::model::CreateVersionMethod;
5376 /// let x = AuditData::new().set_create_version(CreateVersionMethod::default()/* use setters */);
5377 /// assert!(x.create_version().is_some());
5378 /// assert!(x.update_service().is_none());
5379 /// ```
5380 pub fn set_create_version<
5381 T: std::convert::Into<std::boxed::Box<crate::model::CreateVersionMethod>>,
5382 >(
5383 mut self,
5384 v: T,
5385 ) -> Self {
5386 self.method =
5387 std::option::Option::Some(crate::model::audit_data::Method::CreateVersion(v.into()));
5388 self
5389 }
5390}
5391
5392impl wkt::message::Message for AuditData {
5393 fn typename() -> &'static str {
5394 "type.googleapis.com/google.appengine.v1.AuditData"
5395 }
5396}
5397
5398/// Defines additional types related to [AuditData].
5399pub mod audit_data {
5400 #[allow(unused_imports)]
5401 use super::*;
5402
5403 /// Detailed information about methods that require it. Does not include
5404 /// simple Get, List or Delete methods because all significant information
5405 /// (resource name, number of returned elements for List operations) is already
5406 /// included in parent audit log message.
5407 #[derive(Clone, Debug, PartialEq)]
5408 #[non_exhaustive]
5409 pub enum Method {
5410 /// Detailed information about UpdateService call.
5411 UpdateService(std::boxed::Box<crate::model::UpdateServiceMethod>),
5412 /// Detailed information about CreateVersion call.
5413 CreateVersion(std::boxed::Box<crate::model::CreateVersionMethod>),
5414 }
5415}
5416
5417/// Detailed information about UpdateService call.
5418#[derive(Clone, Default, PartialEq)]
5419#[non_exhaustive]
5420pub struct UpdateServiceMethod {
5421 /// Update service request.
5422 pub request: std::option::Option<crate::model::UpdateServiceRequest>,
5423
5424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5425}
5426
5427impl UpdateServiceMethod {
5428 pub fn new() -> Self {
5429 std::default::Default::default()
5430 }
5431
5432 /// Sets the value of [request][crate::model::UpdateServiceMethod::request].
5433 ///
5434 /// # Example
5435 /// ```ignore,no_run
5436 /// # use google_cloud_appengine_v1::model::UpdateServiceMethod;
5437 /// use google_cloud_appengine_v1::model::UpdateServiceRequest;
5438 /// let x = UpdateServiceMethod::new().set_request(UpdateServiceRequest::default()/* use setters */);
5439 /// ```
5440 pub fn set_request<T>(mut self, v: T) -> Self
5441 where
5442 T: std::convert::Into<crate::model::UpdateServiceRequest>,
5443 {
5444 self.request = std::option::Option::Some(v.into());
5445 self
5446 }
5447
5448 /// Sets or clears the value of [request][crate::model::UpdateServiceMethod::request].
5449 ///
5450 /// # Example
5451 /// ```ignore,no_run
5452 /// # use google_cloud_appengine_v1::model::UpdateServiceMethod;
5453 /// use google_cloud_appengine_v1::model::UpdateServiceRequest;
5454 /// let x = UpdateServiceMethod::new().set_or_clear_request(Some(UpdateServiceRequest::default()/* use setters */));
5455 /// let x = UpdateServiceMethod::new().set_or_clear_request(None::<UpdateServiceRequest>);
5456 /// ```
5457 pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5458 where
5459 T: std::convert::Into<crate::model::UpdateServiceRequest>,
5460 {
5461 self.request = v.map(|x| x.into());
5462 self
5463 }
5464}
5465
5466impl wkt::message::Message for UpdateServiceMethod {
5467 fn typename() -> &'static str {
5468 "type.googleapis.com/google.appengine.v1.UpdateServiceMethod"
5469 }
5470}
5471
5472/// Detailed information about CreateVersion call.
5473#[derive(Clone, Default, PartialEq)]
5474#[non_exhaustive]
5475pub struct CreateVersionMethod {
5476 /// Create version request.
5477 pub request: std::option::Option<crate::model::CreateVersionRequest>,
5478
5479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5480}
5481
5482impl CreateVersionMethod {
5483 pub fn new() -> Self {
5484 std::default::Default::default()
5485 }
5486
5487 /// Sets the value of [request][crate::model::CreateVersionMethod::request].
5488 ///
5489 /// # Example
5490 /// ```ignore,no_run
5491 /// # use google_cloud_appengine_v1::model::CreateVersionMethod;
5492 /// use google_cloud_appengine_v1::model::CreateVersionRequest;
5493 /// let x = CreateVersionMethod::new().set_request(CreateVersionRequest::default()/* use setters */);
5494 /// ```
5495 pub fn set_request<T>(mut self, v: T) -> Self
5496 where
5497 T: std::convert::Into<crate::model::CreateVersionRequest>,
5498 {
5499 self.request = std::option::Option::Some(v.into());
5500 self
5501 }
5502
5503 /// Sets or clears the value of [request][crate::model::CreateVersionMethod::request].
5504 ///
5505 /// # Example
5506 /// ```ignore,no_run
5507 /// # use google_cloud_appengine_v1::model::CreateVersionMethod;
5508 /// use google_cloud_appengine_v1::model::CreateVersionRequest;
5509 /// let x = CreateVersionMethod::new().set_or_clear_request(Some(CreateVersionRequest::default()/* use setters */));
5510 /// let x = CreateVersionMethod::new().set_or_clear_request(None::<CreateVersionRequest>);
5511 /// ```
5512 pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5513 where
5514 T: std::convert::Into<crate::model::CreateVersionRequest>,
5515 {
5516 self.request = v.map(|x| x.into());
5517 self
5518 }
5519}
5520
5521impl wkt::message::Message for CreateVersionMethod {
5522 fn typename() -> &'static str {
5523 "type.googleapis.com/google.appengine.v1.CreateVersionMethod"
5524 }
5525}
5526
5527/// An SSL certificate that a user has been authorized to administer. A user
5528/// is authorized to administer any certificate that applies to one of their
5529/// authorized domains.
5530#[derive(Clone, Default, PartialEq)]
5531#[non_exhaustive]
5532pub struct AuthorizedCertificate {
5533 /// Full path to the `AuthorizedCertificate` resource in the API. Example:
5534 /// `apps/myapp/authorizedCertificates/12345`.
5535 ///
5536 /// @OutputOnly
5537 pub name: std::string::String,
5538
5539 /// Relative name of the certificate. This is a unique value autogenerated
5540 /// on `AuthorizedCertificate` resource creation. Example: `12345`.
5541 ///
5542 /// @OutputOnly
5543 pub id: std::string::String,
5544
5545 /// The user-specified display name of the certificate. This is not
5546 /// guaranteed to be unique. Example: `My Certificate`.
5547 pub display_name: std::string::String,
5548
5549 /// Topmost applicable domains of this certificate. This certificate
5550 /// applies to these domains and their subdomains. Example: `example.com`.
5551 ///
5552 /// @OutputOnly
5553 pub domain_names: std::vec::Vec<std::string::String>,
5554
5555 /// The time when this certificate expires. To update the renewal time on this
5556 /// certificate, upload an SSL certificate with a different expiration time
5557 /// using [`AuthorizedCertificates.UpdateAuthorizedCertificate`]().
5558 ///
5559 /// @OutputOnly
5560 pub expire_time: std::option::Option<wkt::Timestamp>,
5561
5562 /// The SSL certificate serving the `AuthorizedCertificate` resource. This
5563 /// must be obtained independently from a certificate authority.
5564 pub certificate_raw_data: std::option::Option<crate::model::CertificateRawData>,
5565
5566 /// Only applicable if this certificate is managed by App Engine. Managed
5567 /// certificates are tied to the lifecycle of a `DomainMapping` and cannot be
5568 /// updated or deleted via the `AuthorizedCertificates` API. If this
5569 /// certificate is manually administered by the user, this field will be empty.
5570 ///
5571 /// @OutputOnly
5572 pub managed_certificate: std::option::Option<crate::model::ManagedCertificate>,
5573
5574 /// The full paths to user visible Domain Mapping resources that have this
5575 /// certificate mapped. Example: `apps/myapp/domainMappings/example.com`.
5576 ///
5577 /// This may not represent the full list of mapped domain mappings if the user
5578 /// does not have `VIEWER` permissions on all of the applications that have
5579 /// this certificate mapped. See `domain_mappings_count` for a complete count.
5580 ///
5581 /// Only returned by `GET` or `LIST` requests when specifically requested by
5582 /// the `view=FULL_CERTIFICATE` option.
5583 ///
5584 /// @OutputOnly
5585 pub visible_domain_mappings: std::vec::Vec<std::string::String>,
5586
5587 /// Aggregate count of the domain mappings with this certificate mapped. This
5588 /// count includes domain mappings on applications for which the user does not
5589 /// have `VIEWER` permissions.
5590 ///
5591 /// Only returned by `GET` or `LIST` requests when specifically requested by
5592 /// the `view=FULL_CERTIFICATE` option.
5593 ///
5594 /// @OutputOnly
5595 pub domain_mappings_count: i32,
5596
5597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5598}
5599
5600impl AuthorizedCertificate {
5601 pub fn new() -> Self {
5602 std::default::Default::default()
5603 }
5604
5605 /// Sets the value of [name][crate::model::AuthorizedCertificate::name].
5606 ///
5607 /// # Example
5608 /// ```ignore,no_run
5609 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5610 /// let x = AuthorizedCertificate::new().set_name("example");
5611 /// ```
5612 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5613 self.name = v.into();
5614 self
5615 }
5616
5617 /// Sets the value of [id][crate::model::AuthorizedCertificate::id].
5618 ///
5619 /// # Example
5620 /// ```ignore,no_run
5621 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5622 /// let x = AuthorizedCertificate::new().set_id("example");
5623 /// ```
5624 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5625 self.id = v.into();
5626 self
5627 }
5628
5629 /// Sets the value of [display_name][crate::model::AuthorizedCertificate::display_name].
5630 ///
5631 /// # Example
5632 /// ```ignore,no_run
5633 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5634 /// let x = AuthorizedCertificate::new().set_display_name("example");
5635 /// ```
5636 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5637 self.display_name = v.into();
5638 self
5639 }
5640
5641 /// Sets the value of [domain_names][crate::model::AuthorizedCertificate::domain_names].
5642 ///
5643 /// # Example
5644 /// ```ignore,no_run
5645 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5646 /// let x = AuthorizedCertificate::new().set_domain_names(["a", "b", "c"]);
5647 /// ```
5648 pub fn set_domain_names<T, V>(mut self, v: T) -> Self
5649 where
5650 T: std::iter::IntoIterator<Item = V>,
5651 V: std::convert::Into<std::string::String>,
5652 {
5653 use std::iter::Iterator;
5654 self.domain_names = v.into_iter().map(|i| i.into()).collect();
5655 self
5656 }
5657
5658 /// Sets the value of [expire_time][crate::model::AuthorizedCertificate::expire_time].
5659 ///
5660 /// # Example
5661 /// ```ignore,no_run
5662 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5663 /// use wkt::Timestamp;
5664 /// let x = AuthorizedCertificate::new().set_expire_time(Timestamp::default()/* use setters */);
5665 /// ```
5666 pub fn set_expire_time<T>(mut self, v: T) -> Self
5667 where
5668 T: std::convert::Into<wkt::Timestamp>,
5669 {
5670 self.expire_time = std::option::Option::Some(v.into());
5671 self
5672 }
5673
5674 /// Sets or clears the value of [expire_time][crate::model::AuthorizedCertificate::expire_time].
5675 ///
5676 /// # Example
5677 /// ```ignore,no_run
5678 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5679 /// use wkt::Timestamp;
5680 /// let x = AuthorizedCertificate::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
5681 /// let x = AuthorizedCertificate::new().set_or_clear_expire_time(None::<Timestamp>);
5682 /// ```
5683 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
5684 where
5685 T: std::convert::Into<wkt::Timestamp>,
5686 {
5687 self.expire_time = v.map(|x| x.into());
5688 self
5689 }
5690
5691 /// Sets the value of [certificate_raw_data][crate::model::AuthorizedCertificate::certificate_raw_data].
5692 ///
5693 /// # Example
5694 /// ```ignore,no_run
5695 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5696 /// use google_cloud_appengine_v1::model::CertificateRawData;
5697 /// let x = AuthorizedCertificate::new().set_certificate_raw_data(CertificateRawData::default()/* use setters */);
5698 /// ```
5699 pub fn set_certificate_raw_data<T>(mut self, v: T) -> Self
5700 where
5701 T: std::convert::Into<crate::model::CertificateRawData>,
5702 {
5703 self.certificate_raw_data = std::option::Option::Some(v.into());
5704 self
5705 }
5706
5707 /// Sets or clears the value of [certificate_raw_data][crate::model::AuthorizedCertificate::certificate_raw_data].
5708 ///
5709 /// # Example
5710 /// ```ignore,no_run
5711 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5712 /// use google_cloud_appengine_v1::model::CertificateRawData;
5713 /// let x = AuthorizedCertificate::new().set_or_clear_certificate_raw_data(Some(CertificateRawData::default()/* use setters */));
5714 /// let x = AuthorizedCertificate::new().set_or_clear_certificate_raw_data(None::<CertificateRawData>);
5715 /// ```
5716 pub fn set_or_clear_certificate_raw_data<T>(mut self, v: std::option::Option<T>) -> Self
5717 where
5718 T: std::convert::Into<crate::model::CertificateRawData>,
5719 {
5720 self.certificate_raw_data = v.map(|x| x.into());
5721 self
5722 }
5723
5724 /// Sets the value of [managed_certificate][crate::model::AuthorizedCertificate::managed_certificate].
5725 ///
5726 /// # Example
5727 /// ```ignore,no_run
5728 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5729 /// use google_cloud_appengine_v1::model::ManagedCertificate;
5730 /// let x = AuthorizedCertificate::new().set_managed_certificate(ManagedCertificate::default()/* use setters */);
5731 /// ```
5732 pub fn set_managed_certificate<T>(mut self, v: T) -> Self
5733 where
5734 T: std::convert::Into<crate::model::ManagedCertificate>,
5735 {
5736 self.managed_certificate = std::option::Option::Some(v.into());
5737 self
5738 }
5739
5740 /// Sets or clears the value of [managed_certificate][crate::model::AuthorizedCertificate::managed_certificate].
5741 ///
5742 /// # Example
5743 /// ```ignore,no_run
5744 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5745 /// use google_cloud_appengine_v1::model::ManagedCertificate;
5746 /// let x = AuthorizedCertificate::new().set_or_clear_managed_certificate(Some(ManagedCertificate::default()/* use setters */));
5747 /// let x = AuthorizedCertificate::new().set_or_clear_managed_certificate(None::<ManagedCertificate>);
5748 /// ```
5749 pub fn set_or_clear_managed_certificate<T>(mut self, v: std::option::Option<T>) -> Self
5750 where
5751 T: std::convert::Into<crate::model::ManagedCertificate>,
5752 {
5753 self.managed_certificate = v.map(|x| x.into());
5754 self
5755 }
5756
5757 /// Sets the value of [visible_domain_mappings][crate::model::AuthorizedCertificate::visible_domain_mappings].
5758 ///
5759 /// # Example
5760 /// ```ignore,no_run
5761 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5762 /// let x = AuthorizedCertificate::new().set_visible_domain_mappings(["a", "b", "c"]);
5763 /// ```
5764 pub fn set_visible_domain_mappings<T, V>(mut self, v: T) -> Self
5765 where
5766 T: std::iter::IntoIterator<Item = V>,
5767 V: std::convert::Into<std::string::String>,
5768 {
5769 use std::iter::Iterator;
5770 self.visible_domain_mappings = v.into_iter().map(|i| i.into()).collect();
5771 self
5772 }
5773
5774 /// Sets the value of [domain_mappings_count][crate::model::AuthorizedCertificate::domain_mappings_count].
5775 ///
5776 /// # Example
5777 /// ```ignore,no_run
5778 /// # use google_cloud_appengine_v1::model::AuthorizedCertificate;
5779 /// let x = AuthorizedCertificate::new().set_domain_mappings_count(42);
5780 /// ```
5781 pub fn set_domain_mappings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5782 self.domain_mappings_count = v.into();
5783 self
5784 }
5785}
5786
5787impl wkt::message::Message for AuthorizedCertificate {
5788 fn typename() -> &'static str {
5789 "type.googleapis.com/google.appengine.v1.AuthorizedCertificate"
5790 }
5791}
5792
5793/// An SSL certificate obtained from a certificate authority.
5794#[derive(Clone, Default, PartialEq)]
5795#[non_exhaustive]
5796pub struct CertificateRawData {
5797 /// PEM encoded x.509 public key certificate. This field is set once on
5798 /// certificate creation. Must include the header and footer. Example:
5799 pub public_certificate: std::string::String,
5800
5801 /// Unencrypted PEM encoded RSA private key. This field is set once on
5802 /// certificate creation and then encrypted. The key size must be 2048
5803 /// bits or fewer. Must include the header and footer. Example:
5804 ///
5805 /// @InputOnly
5806 pub private_key: std::string::String,
5807
5808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5809}
5810
5811impl CertificateRawData {
5812 pub fn new() -> Self {
5813 std::default::Default::default()
5814 }
5815
5816 /// Sets the value of [public_certificate][crate::model::CertificateRawData::public_certificate].
5817 ///
5818 /// # Example
5819 /// ```ignore,no_run
5820 /// # use google_cloud_appengine_v1::model::CertificateRawData;
5821 /// let x = CertificateRawData::new().set_public_certificate("example");
5822 /// ```
5823 pub fn set_public_certificate<T: std::convert::Into<std::string::String>>(
5824 mut self,
5825 v: T,
5826 ) -> Self {
5827 self.public_certificate = v.into();
5828 self
5829 }
5830
5831 /// Sets the value of [private_key][crate::model::CertificateRawData::private_key].
5832 ///
5833 /// # Example
5834 /// ```ignore,no_run
5835 /// # use google_cloud_appengine_v1::model::CertificateRawData;
5836 /// let x = CertificateRawData::new().set_private_key("example");
5837 /// ```
5838 pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5839 self.private_key = v.into();
5840 self
5841 }
5842}
5843
5844impl wkt::message::Message for CertificateRawData {
5845 fn typename() -> &'static str {
5846 "type.googleapis.com/google.appengine.v1.CertificateRawData"
5847 }
5848}
5849
5850/// A certificate managed by App Engine.
5851#[derive(Clone, Default, PartialEq)]
5852#[non_exhaustive]
5853pub struct ManagedCertificate {
5854 /// Time at which the certificate was last renewed. The renewal process is
5855 /// fully managed. Certificate renewal will automatically occur before the
5856 /// certificate expires. Renewal errors can be tracked via `ManagementStatus`.
5857 ///
5858 /// @OutputOnly
5859 pub last_renewal_time: std::option::Option<wkt::Timestamp>,
5860
5861 /// Status of certificate management. Refers to the most recent certificate
5862 /// acquisition or renewal attempt.
5863 ///
5864 /// @OutputOnly
5865 pub status: crate::model::ManagementStatus,
5866
5867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5868}
5869
5870impl ManagedCertificate {
5871 pub fn new() -> Self {
5872 std::default::Default::default()
5873 }
5874
5875 /// Sets the value of [last_renewal_time][crate::model::ManagedCertificate::last_renewal_time].
5876 ///
5877 /// # Example
5878 /// ```ignore,no_run
5879 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5880 /// use wkt::Timestamp;
5881 /// let x = ManagedCertificate::new().set_last_renewal_time(Timestamp::default()/* use setters */);
5882 /// ```
5883 pub fn set_last_renewal_time<T>(mut self, v: T) -> Self
5884 where
5885 T: std::convert::Into<wkt::Timestamp>,
5886 {
5887 self.last_renewal_time = std::option::Option::Some(v.into());
5888 self
5889 }
5890
5891 /// Sets or clears the value of [last_renewal_time][crate::model::ManagedCertificate::last_renewal_time].
5892 ///
5893 /// # Example
5894 /// ```ignore,no_run
5895 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5896 /// use wkt::Timestamp;
5897 /// let x = ManagedCertificate::new().set_or_clear_last_renewal_time(Some(Timestamp::default()/* use setters */));
5898 /// let x = ManagedCertificate::new().set_or_clear_last_renewal_time(None::<Timestamp>);
5899 /// ```
5900 pub fn set_or_clear_last_renewal_time<T>(mut self, v: std::option::Option<T>) -> Self
5901 where
5902 T: std::convert::Into<wkt::Timestamp>,
5903 {
5904 self.last_renewal_time = v.map(|x| x.into());
5905 self
5906 }
5907
5908 /// Sets the value of [status][crate::model::ManagedCertificate::status].
5909 ///
5910 /// # Example
5911 /// ```ignore,no_run
5912 /// # use google_cloud_appengine_v1::model::ManagedCertificate;
5913 /// use google_cloud_appengine_v1::model::ManagementStatus;
5914 /// let x0 = ManagedCertificate::new().set_status(ManagementStatus::Ok);
5915 /// let x1 = ManagedCertificate::new().set_status(ManagementStatus::Pending);
5916 /// let x2 = ManagedCertificate::new().set_status(ManagementStatus::FailedRetryingNotVisible);
5917 /// ```
5918 pub fn set_status<T: std::convert::Into<crate::model::ManagementStatus>>(
5919 mut self,
5920 v: T,
5921 ) -> Self {
5922 self.status = v.into();
5923 self
5924 }
5925}
5926
5927impl wkt::message::Message for ManagedCertificate {
5928 fn typename() -> &'static str {
5929 "type.googleapis.com/google.appengine.v1.ManagedCertificate"
5930 }
5931}
5932
5933/// Code and application artifacts used to deploy a version to App Engine.
5934#[derive(Clone, Default, PartialEq)]
5935#[non_exhaustive]
5936pub struct Deployment {
5937 /// Manifest of the files stored in Google Cloud Storage that are included
5938 /// as part of this version. All files must be readable using the
5939 /// credentials supplied with this call.
5940 pub files: std::collections::HashMap<std::string::String, crate::model::FileInfo>,
5941
5942 /// The Docker image for the container that runs the version.
5943 /// Only applicable for instances running in the App Engine flexible environment.
5944 pub container: std::option::Option<crate::model::ContainerInfo>,
5945
5946 /// The zip file for this deployment, if this is a zip deployment.
5947 pub zip: std::option::Option<crate::model::ZipInfo>,
5948
5949 /// Options for any Google Cloud Build builds created as a part of this
5950 /// deployment.
5951 ///
5952 /// These options will only be used if a new build is created, such as when
5953 /// deploying to the App Engine flexible environment using files or zip.
5954 pub cloud_build_options: std::option::Option<crate::model::CloudBuildOptions>,
5955
5956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5957}
5958
5959impl Deployment {
5960 pub fn new() -> Self {
5961 std::default::Default::default()
5962 }
5963
5964 /// Sets the value of [files][crate::model::Deployment::files].
5965 ///
5966 /// # Example
5967 /// ```ignore,no_run
5968 /// # use google_cloud_appengine_v1::model::Deployment;
5969 /// use google_cloud_appengine_v1::model::FileInfo;
5970 /// let x = Deployment::new().set_files([
5971 /// ("key0", FileInfo::default()/* use setters */),
5972 /// ("key1", FileInfo::default()/* use (different) setters */),
5973 /// ]);
5974 /// ```
5975 pub fn set_files<T, K, V>(mut self, v: T) -> Self
5976 where
5977 T: std::iter::IntoIterator<Item = (K, V)>,
5978 K: std::convert::Into<std::string::String>,
5979 V: std::convert::Into<crate::model::FileInfo>,
5980 {
5981 use std::iter::Iterator;
5982 self.files = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5983 self
5984 }
5985
5986 /// Sets the value of [container][crate::model::Deployment::container].
5987 ///
5988 /// # Example
5989 /// ```ignore,no_run
5990 /// # use google_cloud_appengine_v1::model::Deployment;
5991 /// use google_cloud_appengine_v1::model::ContainerInfo;
5992 /// let x = Deployment::new().set_container(ContainerInfo::default()/* use setters */);
5993 /// ```
5994 pub fn set_container<T>(mut self, v: T) -> Self
5995 where
5996 T: std::convert::Into<crate::model::ContainerInfo>,
5997 {
5998 self.container = std::option::Option::Some(v.into());
5999 self
6000 }
6001
6002 /// Sets or clears the value of [container][crate::model::Deployment::container].
6003 ///
6004 /// # Example
6005 /// ```ignore,no_run
6006 /// # use google_cloud_appengine_v1::model::Deployment;
6007 /// use google_cloud_appengine_v1::model::ContainerInfo;
6008 /// let x = Deployment::new().set_or_clear_container(Some(ContainerInfo::default()/* use setters */));
6009 /// let x = Deployment::new().set_or_clear_container(None::<ContainerInfo>);
6010 /// ```
6011 pub fn set_or_clear_container<T>(mut self, v: std::option::Option<T>) -> Self
6012 where
6013 T: std::convert::Into<crate::model::ContainerInfo>,
6014 {
6015 self.container = v.map(|x| x.into());
6016 self
6017 }
6018
6019 /// Sets the value of [zip][crate::model::Deployment::zip].
6020 ///
6021 /// # Example
6022 /// ```ignore,no_run
6023 /// # use google_cloud_appengine_v1::model::Deployment;
6024 /// use google_cloud_appengine_v1::model::ZipInfo;
6025 /// let x = Deployment::new().set_zip(ZipInfo::default()/* use setters */);
6026 /// ```
6027 pub fn set_zip<T>(mut self, v: T) -> Self
6028 where
6029 T: std::convert::Into<crate::model::ZipInfo>,
6030 {
6031 self.zip = std::option::Option::Some(v.into());
6032 self
6033 }
6034
6035 /// Sets or clears the value of [zip][crate::model::Deployment::zip].
6036 ///
6037 /// # Example
6038 /// ```ignore,no_run
6039 /// # use google_cloud_appengine_v1::model::Deployment;
6040 /// use google_cloud_appengine_v1::model::ZipInfo;
6041 /// let x = Deployment::new().set_or_clear_zip(Some(ZipInfo::default()/* use setters */));
6042 /// let x = Deployment::new().set_or_clear_zip(None::<ZipInfo>);
6043 /// ```
6044 pub fn set_or_clear_zip<T>(mut self, v: std::option::Option<T>) -> Self
6045 where
6046 T: std::convert::Into<crate::model::ZipInfo>,
6047 {
6048 self.zip = v.map(|x| x.into());
6049 self
6050 }
6051
6052 /// Sets the value of [cloud_build_options][crate::model::Deployment::cloud_build_options].
6053 ///
6054 /// # Example
6055 /// ```ignore,no_run
6056 /// # use google_cloud_appengine_v1::model::Deployment;
6057 /// use google_cloud_appengine_v1::model::CloudBuildOptions;
6058 /// let x = Deployment::new().set_cloud_build_options(CloudBuildOptions::default()/* use setters */);
6059 /// ```
6060 pub fn set_cloud_build_options<T>(mut self, v: T) -> Self
6061 where
6062 T: std::convert::Into<crate::model::CloudBuildOptions>,
6063 {
6064 self.cloud_build_options = std::option::Option::Some(v.into());
6065 self
6066 }
6067
6068 /// Sets or clears the value of [cloud_build_options][crate::model::Deployment::cloud_build_options].
6069 ///
6070 /// # Example
6071 /// ```ignore,no_run
6072 /// # use google_cloud_appengine_v1::model::Deployment;
6073 /// use google_cloud_appengine_v1::model::CloudBuildOptions;
6074 /// let x = Deployment::new().set_or_clear_cloud_build_options(Some(CloudBuildOptions::default()/* use setters */));
6075 /// let x = Deployment::new().set_or_clear_cloud_build_options(None::<CloudBuildOptions>);
6076 /// ```
6077 pub fn set_or_clear_cloud_build_options<T>(mut self, v: std::option::Option<T>) -> Self
6078 where
6079 T: std::convert::Into<crate::model::CloudBuildOptions>,
6080 {
6081 self.cloud_build_options = v.map(|x| x.into());
6082 self
6083 }
6084}
6085
6086impl wkt::message::Message for Deployment {
6087 fn typename() -> &'static str {
6088 "type.googleapis.com/google.appengine.v1.Deployment"
6089 }
6090}
6091
6092/// Single source file that is part of the version to be deployed. Each source
6093/// file that is deployed must be specified separately.
6094#[derive(Clone, Default, PartialEq)]
6095#[non_exhaustive]
6096pub struct FileInfo {
6097 /// URL source to use to fetch this file. Must be a URL to a resource in
6098 /// Google Cloud Storage in the form
6099 /// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
6100 pub source_url: std::string::String,
6101
6102 /// The SHA1 hash of the file, in hex.
6103 pub sha1_sum: std::string::String,
6104
6105 /// The MIME type of the file.
6106 ///
6107 /// Defaults to the value from Google Cloud Storage.
6108 pub mime_type: std::string::String,
6109
6110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6111}
6112
6113impl FileInfo {
6114 pub fn new() -> Self {
6115 std::default::Default::default()
6116 }
6117
6118 /// Sets the value of [source_url][crate::model::FileInfo::source_url].
6119 ///
6120 /// # Example
6121 /// ```ignore,no_run
6122 /// # use google_cloud_appengine_v1::model::FileInfo;
6123 /// let x = FileInfo::new().set_source_url("example");
6124 /// ```
6125 pub fn set_source_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6126 self.source_url = v.into();
6127 self
6128 }
6129
6130 /// Sets the value of [sha1_sum][crate::model::FileInfo::sha1_sum].
6131 ///
6132 /// # Example
6133 /// ```ignore,no_run
6134 /// # use google_cloud_appengine_v1::model::FileInfo;
6135 /// let x = FileInfo::new().set_sha1_sum("example");
6136 /// ```
6137 pub fn set_sha1_sum<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6138 self.sha1_sum = v.into();
6139 self
6140 }
6141
6142 /// Sets the value of [mime_type][crate::model::FileInfo::mime_type].
6143 ///
6144 /// # Example
6145 /// ```ignore,no_run
6146 /// # use google_cloud_appengine_v1::model::FileInfo;
6147 /// let x = FileInfo::new().set_mime_type("example");
6148 /// ```
6149 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6150 self.mime_type = v.into();
6151 self
6152 }
6153}
6154
6155impl wkt::message::Message for FileInfo {
6156 fn typename() -> &'static str {
6157 "type.googleapis.com/google.appengine.v1.FileInfo"
6158 }
6159}
6160
6161/// Docker image that is used to create a container and start a VM instance for
6162/// the version that you deploy. Only applicable for instances running in the App
6163/// Engine flexible environment.
6164#[derive(Clone, Default, PartialEq)]
6165#[non_exhaustive]
6166pub struct ContainerInfo {
6167 /// URI to the hosted container image in Google Container Registry. The URI
6168 /// must be fully qualified and include a tag or digest.
6169 /// Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest"
6170 pub image: std::string::String,
6171
6172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6173}
6174
6175impl ContainerInfo {
6176 pub fn new() -> Self {
6177 std::default::Default::default()
6178 }
6179
6180 /// Sets the value of [image][crate::model::ContainerInfo::image].
6181 ///
6182 /// # Example
6183 /// ```ignore,no_run
6184 /// # use google_cloud_appengine_v1::model::ContainerInfo;
6185 /// let x = ContainerInfo::new().set_image("example");
6186 /// ```
6187 pub fn set_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6188 self.image = v.into();
6189 self
6190 }
6191}
6192
6193impl wkt::message::Message for ContainerInfo {
6194 fn typename() -> &'static str {
6195 "type.googleapis.com/google.appengine.v1.ContainerInfo"
6196 }
6197}
6198
6199/// Options for the build operations performed as a part of the version
6200/// deployment. Only applicable for App Engine flexible environment when creating
6201/// a version using source code directly.
6202#[derive(Clone, Default, PartialEq)]
6203#[non_exhaustive]
6204pub struct CloudBuildOptions {
6205 /// Path to the yaml file used in deployment, used to determine runtime
6206 /// configuration details.
6207 ///
6208 /// Required for flexible environment builds.
6209 ///
6210 /// See <https://cloud.google.com/appengine/docs/standard/python/config/appref>
6211 /// for more details.
6212 pub app_yaml_path: std::string::String,
6213
6214 /// The Cloud Build timeout used as part of any dependent builds performed by
6215 /// version creation. Defaults to 10 minutes.
6216 pub cloud_build_timeout: std::option::Option<wkt::Duration>,
6217
6218 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6219}
6220
6221impl CloudBuildOptions {
6222 pub fn new() -> Self {
6223 std::default::Default::default()
6224 }
6225
6226 /// Sets the value of [app_yaml_path][crate::model::CloudBuildOptions::app_yaml_path].
6227 ///
6228 /// # Example
6229 /// ```ignore,no_run
6230 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6231 /// let x = CloudBuildOptions::new().set_app_yaml_path("example");
6232 /// ```
6233 pub fn set_app_yaml_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6234 self.app_yaml_path = v.into();
6235 self
6236 }
6237
6238 /// Sets the value of [cloud_build_timeout][crate::model::CloudBuildOptions::cloud_build_timeout].
6239 ///
6240 /// # Example
6241 /// ```ignore,no_run
6242 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6243 /// use wkt::Duration;
6244 /// let x = CloudBuildOptions::new().set_cloud_build_timeout(Duration::default()/* use setters */);
6245 /// ```
6246 pub fn set_cloud_build_timeout<T>(mut self, v: T) -> Self
6247 where
6248 T: std::convert::Into<wkt::Duration>,
6249 {
6250 self.cloud_build_timeout = std::option::Option::Some(v.into());
6251 self
6252 }
6253
6254 /// Sets or clears the value of [cloud_build_timeout][crate::model::CloudBuildOptions::cloud_build_timeout].
6255 ///
6256 /// # Example
6257 /// ```ignore,no_run
6258 /// # use google_cloud_appengine_v1::model::CloudBuildOptions;
6259 /// use wkt::Duration;
6260 /// let x = CloudBuildOptions::new().set_or_clear_cloud_build_timeout(Some(Duration::default()/* use setters */));
6261 /// let x = CloudBuildOptions::new().set_or_clear_cloud_build_timeout(None::<Duration>);
6262 /// ```
6263 pub fn set_or_clear_cloud_build_timeout<T>(mut self, v: std::option::Option<T>) -> Self
6264 where
6265 T: std::convert::Into<wkt::Duration>,
6266 {
6267 self.cloud_build_timeout = v.map(|x| x.into());
6268 self
6269 }
6270}
6271
6272impl wkt::message::Message for CloudBuildOptions {
6273 fn typename() -> &'static str {
6274 "type.googleapis.com/google.appengine.v1.CloudBuildOptions"
6275 }
6276}
6277
6278/// The zip file information for a zip deployment.
6279#[derive(Clone, Default, PartialEq)]
6280#[non_exhaustive]
6281pub struct ZipInfo {
6282 /// URL of the zip file to deploy from. Must be a URL to a resource in
6283 /// Google Cloud Storage in the form
6284 /// 'http(s)://storage.googleapis.com/\<bucket\>/\<object\>'.
6285 pub source_url: std::string::String,
6286
6287 /// An estimate of the number of files in a zip for a zip deployment.
6288 /// If set, must be greater than or equal to the actual number of files.
6289 /// Used for optimizing performance; if not provided, deployment may be slow.
6290 pub files_count: i32,
6291
6292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6293}
6294
6295impl ZipInfo {
6296 pub fn new() -> Self {
6297 std::default::Default::default()
6298 }
6299
6300 /// Sets the value of [source_url][crate::model::ZipInfo::source_url].
6301 ///
6302 /// # Example
6303 /// ```ignore,no_run
6304 /// # use google_cloud_appengine_v1::model::ZipInfo;
6305 /// let x = ZipInfo::new().set_source_url("example");
6306 /// ```
6307 pub fn set_source_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6308 self.source_url = v.into();
6309 self
6310 }
6311
6312 /// Sets the value of [files_count][crate::model::ZipInfo::files_count].
6313 ///
6314 /// # Example
6315 /// ```ignore,no_run
6316 /// # use google_cloud_appengine_v1::model::ZipInfo;
6317 /// let x = ZipInfo::new().set_files_count(42);
6318 /// ```
6319 pub fn set_files_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6320 self.files_count = v.into();
6321 self
6322 }
6323}
6324
6325impl wkt::message::Message for ZipInfo {
6326 fn typename() -> &'static str {
6327 "type.googleapis.com/google.appengine.v1.ZipInfo"
6328 }
6329}
6330
6331/// A domain that a user has been authorized to administer. To authorize use
6332/// of a domain, verify ownership via
6333/// [Search Console](https://search.google.com/search-console/welcome).
6334#[derive(Clone, Default, PartialEq)]
6335#[non_exhaustive]
6336pub struct AuthorizedDomain {
6337 /// Full path to the `AuthorizedDomain` resource in the API. Example:
6338 /// `apps/myapp/authorizedDomains/example.com`.
6339 ///
6340 /// @OutputOnly
6341 pub name: std::string::String,
6342
6343 /// Fully qualified domain name of the domain authorized for use. Example:
6344 /// `example.com`.
6345 pub id: std::string::String,
6346
6347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6348}
6349
6350impl AuthorizedDomain {
6351 pub fn new() -> Self {
6352 std::default::Default::default()
6353 }
6354
6355 /// Sets the value of [name][crate::model::AuthorizedDomain::name].
6356 ///
6357 /// # Example
6358 /// ```ignore,no_run
6359 /// # use google_cloud_appengine_v1::model::AuthorizedDomain;
6360 /// let x = AuthorizedDomain::new().set_name("example");
6361 /// ```
6362 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6363 self.name = v.into();
6364 self
6365 }
6366
6367 /// Sets the value of [id][crate::model::AuthorizedDomain::id].
6368 ///
6369 /// # Example
6370 /// ```ignore,no_run
6371 /// # use google_cloud_appengine_v1::model::AuthorizedDomain;
6372 /// let x = AuthorizedDomain::new().set_id("example");
6373 /// ```
6374 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6375 self.id = v.into();
6376 self
6377 }
6378}
6379
6380impl wkt::message::Message for AuthorizedDomain {
6381 fn typename() -> &'static str {
6382 "type.googleapis.com/google.appengine.v1.AuthorizedDomain"
6383 }
6384}
6385
6386/// A domain serving an App Engine application.
6387#[derive(Clone, Default, PartialEq)]
6388#[non_exhaustive]
6389pub struct DomainMapping {
6390 /// Full path to the `DomainMapping` resource in the API. Example:
6391 /// `apps/myapp/domainMapping/example.com`.
6392 ///
6393 /// @OutputOnly
6394 pub name: std::string::String,
6395
6396 /// Relative name of the domain serving the application. Example:
6397 /// `example.com`.
6398 pub id: std::string::String,
6399
6400 /// SSL configuration for this domain. If unconfigured, this domain will not
6401 /// serve with SSL.
6402 pub ssl_settings: std::option::Option<crate::model::SslSettings>,
6403
6404 /// The resource records required to configure this domain mapping. These
6405 /// records must be added to the domain's DNS configuration in order to
6406 /// serve the application via this domain mapping.
6407 ///
6408 /// @OutputOnly
6409 pub resource_records: std::vec::Vec<crate::model::ResourceRecord>,
6410
6411 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6412}
6413
6414impl DomainMapping {
6415 pub fn new() -> Self {
6416 std::default::Default::default()
6417 }
6418
6419 /// Sets the value of [name][crate::model::DomainMapping::name].
6420 ///
6421 /// # Example
6422 /// ```ignore,no_run
6423 /// # use google_cloud_appengine_v1::model::DomainMapping;
6424 /// let x = DomainMapping::new().set_name("example");
6425 /// ```
6426 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6427 self.name = v.into();
6428 self
6429 }
6430
6431 /// Sets the value of [id][crate::model::DomainMapping::id].
6432 ///
6433 /// # Example
6434 /// ```ignore,no_run
6435 /// # use google_cloud_appengine_v1::model::DomainMapping;
6436 /// let x = DomainMapping::new().set_id("example");
6437 /// ```
6438 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6439 self.id = v.into();
6440 self
6441 }
6442
6443 /// Sets the value of [ssl_settings][crate::model::DomainMapping::ssl_settings].
6444 ///
6445 /// # Example
6446 /// ```ignore,no_run
6447 /// # use google_cloud_appengine_v1::model::DomainMapping;
6448 /// use google_cloud_appengine_v1::model::SslSettings;
6449 /// let x = DomainMapping::new().set_ssl_settings(SslSettings::default()/* use setters */);
6450 /// ```
6451 pub fn set_ssl_settings<T>(mut self, v: T) -> Self
6452 where
6453 T: std::convert::Into<crate::model::SslSettings>,
6454 {
6455 self.ssl_settings = std::option::Option::Some(v.into());
6456 self
6457 }
6458
6459 /// Sets or clears the value of [ssl_settings][crate::model::DomainMapping::ssl_settings].
6460 ///
6461 /// # Example
6462 /// ```ignore,no_run
6463 /// # use google_cloud_appengine_v1::model::DomainMapping;
6464 /// use google_cloud_appengine_v1::model::SslSettings;
6465 /// let x = DomainMapping::new().set_or_clear_ssl_settings(Some(SslSettings::default()/* use setters */));
6466 /// let x = DomainMapping::new().set_or_clear_ssl_settings(None::<SslSettings>);
6467 /// ```
6468 pub fn set_or_clear_ssl_settings<T>(mut self, v: std::option::Option<T>) -> Self
6469 where
6470 T: std::convert::Into<crate::model::SslSettings>,
6471 {
6472 self.ssl_settings = v.map(|x| x.into());
6473 self
6474 }
6475
6476 /// Sets the value of [resource_records][crate::model::DomainMapping::resource_records].
6477 ///
6478 /// # Example
6479 /// ```ignore,no_run
6480 /// # use google_cloud_appengine_v1::model::DomainMapping;
6481 /// use google_cloud_appengine_v1::model::ResourceRecord;
6482 /// let x = DomainMapping::new()
6483 /// .set_resource_records([
6484 /// ResourceRecord::default()/* use setters */,
6485 /// ResourceRecord::default()/* use (different) setters */,
6486 /// ]);
6487 /// ```
6488 pub fn set_resource_records<T, V>(mut self, v: T) -> Self
6489 where
6490 T: std::iter::IntoIterator<Item = V>,
6491 V: std::convert::Into<crate::model::ResourceRecord>,
6492 {
6493 use std::iter::Iterator;
6494 self.resource_records = v.into_iter().map(|i| i.into()).collect();
6495 self
6496 }
6497}
6498
6499impl wkt::message::Message for DomainMapping {
6500 fn typename() -> &'static str {
6501 "type.googleapis.com/google.appengine.v1.DomainMapping"
6502 }
6503}
6504
6505/// SSL configuration for a `DomainMapping` resource.
6506#[derive(Clone, Default, PartialEq)]
6507#[non_exhaustive]
6508pub struct SslSettings {
6509 /// ID of the `AuthorizedCertificate` resource configuring SSL for the
6510 /// application. Clearing this field will remove SSL support.
6511 ///
6512 /// By default, a managed certificate is automatically created for every
6513 /// domain mapping. To omit SSL support or to configure SSL manually, specify
6514 /// `SslManagementType.MANUAL` on a `CREATE` or `UPDATE` request. You must
6515 /// be authorized to administer the `AuthorizedCertificate` resource to
6516 /// manually map it to a `DomainMapping` resource.
6517 /// Example: `12345`.
6518 pub certificate_id: std::string::String,
6519
6520 /// SSL management type for this domain. If `AUTOMATIC`, a managed certificate
6521 /// is automatically provisioned. If `MANUAL`, `certificate_id` must be
6522 /// manually specified in order to configure SSL for this domain.
6523 pub ssl_management_type: crate::model::ssl_settings::SslManagementType,
6524
6525 /// ID of the managed `AuthorizedCertificate` resource currently being
6526 /// provisioned, if applicable. Until the new managed certificate has been
6527 /// successfully provisioned, the previous SSL state will be preserved. Once
6528 /// the provisioning process completes, the `certificate_id` field will reflect
6529 /// the new managed certificate and this field will be left empty. To remove
6530 /// SSL support while there is still a pending managed certificate, clear the
6531 /// `certificate_id` field with an `UpdateDomainMappingRequest`.
6532 ///
6533 /// @OutputOnly
6534 pub pending_managed_certificate_id: std::string::String,
6535
6536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6537}
6538
6539impl SslSettings {
6540 pub fn new() -> Self {
6541 std::default::Default::default()
6542 }
6543
6544 /// Sets the value of [certificate_id][crate::model::SslSettings::certificate_id].
6545 ///
6546 /// # Example
6547 /// ```ignore,no_run
6548 /// # use google_cloud_appengine_v1::model::SslSettings;
6549 /// let x = SslSettings::new().set_certificate_id("example");
6550 /// ```
6551 pub fn set_certificate_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6552 self.certificate_id = v.into();
6553 self
6554 }
6555
6556 /// Sets the value of [ssl_management_type][crate::model::SslSettings::ssl_management_type].
6557 ///
6558 /// # Example
6559 /// ```ignore,no_run
6560 /// # use google_cloud_appengine_v1::model::SslSettings;
6561 /// use google_cloud_appengine_v1::model::ssl_settings::SslManagementType;
6562 /// let x0 = SslSettings::new().set_ssl_management_type(SslManagementType::Automatic);
6563 /// let x1 = SslSettings::new().set_ssl_management_type(SslManagementType::Manual);
6564 /// ```
6565 pub fn set_ssl_management_type<
6566 T: std::convert::Into<crate::model::ssl_settings::SslManagementType>,
6567 >(
6568 mut self,
6569 v: T,
6570 ) -> Self {
6571 self.ssl_management_type = v.into();
6572 self
6573 }
6574
6575 /// Sets the value of [pending_managed_certificate_id][crate::model::SslSettings::pending_managed_certificate_id].
6576 ///
6577 /// # Example
6578 /// ```ignore,no_run
6579 /// # use google_cloud_appengine_v1::model::SslSettings;
6580 /// let x = SslSettings::new().set_pending_managed_certificate_id("example");
6581 /// ```
6582 pub fn set_pending_managed_certificate_id<T: std::convert::Into<std::string::String>>(
6583 mut self,
6584 v: T,
6585 ) -> Self {
6586 self.pending_managed_certificate_id = v.into();
6587 self
6588 }
6589}
6590
6591impl wkt::message::Message for SslSettings {
6592 fn typename() -> &'static str {
6593 "type.googleapis.com/google.appengine.v1.SslSettings"
6594 }
6595}
6596
6597/// Defines additional types related to [SslSettings].
6598pub mod ssl_settings {
6599 #[allow(unused_imports)]
6600 use super::*;
6601
6602 /// The SSL management type for this domain.
6603 ///
6604 /// # Working with unknown values
6605 ///
6606 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6607 /// additional enum variants at any time. Adding new variants is not considered
6608 /// a breaking change. Applications should write their code in anticipation of:
6609 ///
6610 /// - New values appearing in future releases of the client library, **and**
6611 /// - New values received dynamically, without application changes.
6612 ///
6613 /// Please consult the [Working with enums] section in the user guide for some
6614 /// guidelines.
6615 ///
6616 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6617 #[derive(Clone, Debug, PartialEq)]
6618 #[non_exhaustive]
6619 pub enum SslManagementType {
6620 /// Defaults to `AUTOMATIC`.
6621 Unspecified,
6622 /// SSL support for this domain is configured automatically. The mapped SSL
6623 /// certificate will be automatically renewed.
6624 Automatic,
6625 /// SSL support for this domain is configured manually by the user. Either
6626 /// the domain has no SSL support or a user-obtained SSL certificate has been
6627 /// explictly mapped to this domain.
6628 Manual,
6629 /// If set, the enum was initialized with an unknown value.
6630 ///
6631 /// Applications can examine the value using [SslManagementType::value] or
6632 /// [SslManagementType::name].
6633 UnknownValue(ssl_management_type::UnknownValue),
6634 }
6635
6636 #[doc(hidden)]
6637 pub mod ssl_management_type {
6638 #[allow(unused_imports)]
6639 use super::*;
6640 #[derive(Clone, Debug, PartialEq)]
6641 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6642 }
6643
6644 impl SslManagementType {
6645 /// Gets the enum value.
6646 ///
6647 /// Returns `None` if the enum contains an unknown value deserialized from
6648 /// the string representation of enums.
6649 pub fn value(&self) -> std::option::Option<i32> {
6650 match self {
6651 Self::Unspecified => std::option::Option::Some(0),
6652 Self::Automatic => std::option::Option::Some(1),
6653 Self::Manual => std::option::Option::Some(2),
6654 Self::UnknownValue(u) => u.0.value(),
6655 }
6656 }
6657
6658 /// Gets the enum value as a string.
6659 ///
6660 /// Returns `None` if the enum contains an unknown value deserialized from
6661 /// the integer representation of enums.
6662 pub fn name(&self) -> std::option::Option<&str> {
6663 match self {
6664 Self::Unspecified => std::option::Option::Some("SSL_MANAGEMENT_TYPE_UNSPECIFIED"),
6665 Self::Automatic => std::option::Option::Some("AUTOMATIC"),
6666 Self::Manual => std::option::Option::Some("MANUAL"),
6667 Self::UnknownValue(u) => u.0.name(),
6668 }
6669 }
6670 }
6671
6672 impl std::default::Default for SslManagementType {
6673 fn default() -> Self {
6674 use std::convert::From;
6675 Self::from(0)
6676 }
6677 }
6678
6679 impl std::fmt::Display for SslManagementType {
6680 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6681 wkt::internal::display_enum(f, self.name(), self.value())
6682 }
6683 }
6684
6685 impl std::convert::From<i32> for SslManagementType {
6686 fn from(value: i32) -> Self {
6687 match value {
6688 0 => Self::Unspecified,
6689 1 => Self::Automatic,
6690 2 => Self::Manual,
6691 _ => Self::UnknownValue(ssl_management_type::UnknownValue(
6692 wkt::internal::UnknownEnumValue::Integer(value),
6693 )),
6694 }
6695 }
6696 }
6697
6698 impl std::convert::From<&str> for SslManagementType {
6699 fn from(value: &str) -> Self {
6700 use std::string::ToString;
6701 match value {
6702 "SSL_MANAGEMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
6703 "AUTOMATIC" => Self::Automatic,
6704 "MANUAL" => Self::Manual,
6705 _ => Self::UnknownValue(ssl_management_type::UnknownValue(
6706 wkt::internal::UnknownEnumValue::String(value.to_string()),
6707 )),
6708 }
6709 }
6710 }
6711
6712 impl serde::ser::Serialize for SslManagementType {
6713 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6714 where
6715 S: serde::Serializer,
6716 {
6717 match self {
6718 Self::Unspecified => serializer.serialize_i32(0),
6719 Self::Automatic => serializer.serialize_i32(1),
6720 Self::Manual => serializer.serialize_i32(2),
6721 Self::UnknownValue(u) => u.0.serialize(serializer),
6722 }
6723 }
6724 }
6725
6726 impl<'de> serde::de::Deserialize<'de> for SslManagementType {
6727 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6728 where
6729 D: serde::Deserializer<'de>,
6730 {
6731 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslManagementType>::new(
6732 ".google.appengine.v1.SslSettings.SslManagementType",
6733 ))
6734 }
6735 }
6736}
6737
6738/// A DNS resource record.
6739#[derive(Clone, Default, PartialEq)]
6740#[non_exhaustive]
6741pub struct ResourceRecord {
6742 /// Relative name of the object affected by this record. Only applicable for
6743 /// `CNAME` records. Example: 'www'.
6744 pub name: std::string::String,
6745
6746 /// Data for this record. Values vary by record type, as defined in RFC 1035
6747 /// (section 5) and RFC 1034 (section 3.6.1).
6748 pub rrdata: std::string::String,
6749
6750 /// Resource record type. Example: `AAAA`.
6751 pub r#type: crate::model::resource_record::RecordType,
6752
6753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6754}
6755
6756impl ResourceRecord {
6757 pub fn new() -> Self {
6758 std::default::Default::default()
6759 }
6760
6761 /// Sets the value of [name][crate::model::ResourceRecord::name].
6762 ///
6763 /// # Example
6764 /// ```ignore,no_run
6765 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6766 /// let x = ResourceRecord::new().set_name("example");
6767 /// ```
6768 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6769 self.name = v.into();
6770 self
6771 }
6772
6773 /// Sets the value of [rrdata][crate::model::ResourceRecord::rrdata].
6774 ///
6775 /// # Example
6776 /// ```ignore,no_run
6777 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6778 /// let x = ResourceRecord::new().set_rrdata("example");
6779 /// ```
6780 pub fn set_rrdata<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6781 self.rrdata = v.into();
6782 self
6783 }
6784
6785 /// Sets the value of [r#type][crate::model::ResourceRecord::type].
6786 ///
6787 /// # Example
6788 /// ```ignore,no_run
6789 /// # use google_cloud_appengine_v1::model::ResourceRecord;
6790 /// use google_cloud_appengine_v1::model::resource_record::RecordType;
6791 /// let x0 = ResourceRecord::new().set_type(RecordType::A);
6792 /// let x1 = ResourceRecord::new().set_type(RecordType::Aaaa);
6793 /// let x2 = ResourceRecord::new().set_type(RecordType::Cname);
6794 /// ```
6795 pub fn set_type<T: std::convert::Into<crate::model::resource_record::RecordType>>(
6796 mut self,
6797 v: T,
6798 ) -> Self {
6799 self.r#type = v.into();
6800 self
6801 }
6802}
6803
6804impl wkt::message::Message for ResourceRecord {
6805 fn typename() -> &'static str {
6806 "type.googleapis.com/google.appengine.v1.ResourceRecord"
6807 }
6808}
6809
6810/// Defines additional types related to [ResourceRecord].
6811pub mod resource_record {
6812 #[allow(unused_imports)]
6813 use super::*;
6814
6815 /// A resource record type.
6816 ///
6817 /// # Working with unknown values
6818 ///
6819 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6820 /// additional enum variants at any time. Adding new variants is not considered
6821 /// a breaking change. Applications should write their code in anticipation of:
6822 ///
6823 /// - New values appearing in future releases of the client library, **and**
6824 /// - New values received dynamically, without application changes.
6825 ///
6826 /// Please consult the [Working with enums] section in the user guide for some
6827 /// guidelines.
6828 ///
6829 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6830 #[derive(Clone, Debug, PartialEq)]
6831 #[non_exhaustive]
6832 pub enum RecordType {
6833 /// An unknown resource record.
6834 Unspecified,
6835 /// An A resource record. Data is an IPv4 address.
6836 A,
6837 /// An AAAA resource record. Data is an IPv6 address.
6838 Aaaa,
6839 /// A CNAME resource record. Data is a domain name to be aliased.
6840 Cname,
6841 /// If set, the enum was initialized with an unknown value.
6842 ///
6843 /// Applications can examine the value using [RecordType::value] or
6844 /// [RecordType::name].
6845 UnknownValue(record_type::UnknownValue),
6846 }
6847
6848 #[doc(hidden)]
6849 pub mod record_type {
6850 #[allow(unused_imports)]
6851 use super::*;
6852 #[derive(Clone, Debug, PartialEq)]
6853 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6854 }
6855
6856 impl RecordType {
6857 /// Gets the enum value.
6858 ///
6859 /// Returns `None` if the enum contains an unknown value deserialized from
6860 /// the string representation of enums.
6861 pub fn value(&self) -> std::option::Option<i32> {
6862 match self {
6863 Self::Unspecified => std::option::Option::Some(0),
6864 Self::A => std::option::Option::Some(1),
6865 Self::Aaaa => std::option::Option::Some(2),
6866 Self::Cname => std::option::Option::Some(3),
6867 Self::UnknownValue(u) => u.0.value(),
6868 }
6869 }
6870
6871 /// Gets the enum value as a string.
6872 ///
6873 /// Returns `None` if the enum contains an unknown value deserialized from
6874 /// the integer representation of enums.
6875 pub fn name(&self) -> std::option::Option<&str> {
6876 match self {
6877 Self::Unspecified => std::option::Option::Some("RECORD_TYPE_UNSPECIFIED"),
6878 Self::A => std::option::Option::Some("A"),
6879 Self::Aaaa => std::option::Option::Some("AAAA"),
6880 Self::Cname => std::option::Option::Some("CNAME"),
6881 Self::UnknownValue(u) => u.0.name(),
6882 }
6883 }
6884 }
6885
6886 impl std::default::Default for RecordType {
6887 fn default() -> Self {
6888 use std::convert::From;
6889 Self::from(0)
6890 }
6891 }
6892
6893 impl std::fmt::Display for RecordType {
6894 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6895 wkt::internal::display_enum(f, self.name(), self.value())
6896 }
6897 }
6898
6899 impl std::convert::From<i32> for RecordType {
6900 fn from(value: i32) -> Self {
6901 match value {
6902 0 => Self::Unspecified,
6903 1 => Self::A,
6904 2 => Self::Aaaa,
6905 3 => Self::Cname,
6906 _ => Self::UnknownValue(record_type::UnknownValue(
6907 wkt::internal::UnknownEnumValue::Integer(value),
6908 )),
6909 }
6910 }
6911 }
6912
6913 impl std::convert::From<&str> for RecordType {
6914 fn from(value: &str) -> Self {
6915 use std::string::ToString;
6916 match value {
6917 "RECORD_TYPE_UNSPECIFIED" => Self::Unspecified,
6918 "A" => Self::A,
6919 "AAAA" => Self::Aaaa,
6920 "CNAME" => Self::Cname,
6921 _ => Self::UnknownValue(record_type::UnknownValue(
6922 wkt::internal::UnknownEnumValue::String(value.to_string()),
6923 )),
6924 }
6925 }
6926 }
6927
6928 impl serde::ser::Serialize for RecordType {
6929 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6930 where
6931 S: serde::Serializer,
6932 {
6933 match self {
6934 Self::Unspecified => serializer.serialize_i32(0),
6935 Self::A => serializer.serialize_i32(1),
6936 Self::Aaaa => serializer.serialize_i32(2),
6937 Self::Cname => serializer.serialize_i32(3),
6938 Self::UnknownValue(u) => u.0.serialize(serializer),
6939 }
6940 }
6941 }
6942
6943 impl<'de> serde::de::Deserialize<'de> for RecordType {
6944 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6945 where
6946 D: serde::Deserializer<'de>,
6947 {
6948 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordType>::new(
6949 ".google.appengine.v1.ResourceRecord.RecordType",
6950 ))
6951 }
6952 }
6953}
6954
6955/// A single firewall rule that is evaluated against incoming traffic
6956/// and provides an action to take on matched requests.
6957#[derive(Clone, Default, PartialEq)]
6958#[non_exhaustive]
6959pub struct FirewallRule {
6960 /// A positive integer between [1, Int32.MaxValue-1] that defines the order of
6961 /// rule evaluation. Rules with the lowest priority are evaluated first.
6962 ///
6963 /// A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic
6964 /// when no previous rule matches. Only the action of this rule can be modified
6965 /// by the user.
6966 pub priority: i32,
6967
6968 /// The action to take on matched requests.
6969 pub action: crate::model::firewall_rule::Action,
6970
6971 /// IP address or range, defined using CIDR notation, of requests that this
6972 /// rule applies to. You can use the wildcard character "*" to match all IPs
6973 /// equivalent to "0/0" and "::/0" together.
6974 /// Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32`
6975 /// or `2001:0db8:0000:0042:0000:8a2e:0370:7334`.
6976 pub source_range: std::string::String,
6977
6978 /// An optional string description of this rule.
6979 /// This field has a maximum length of 100 characters.
6980 pub description: std::string::String,
6981
6982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6983}
6984
6985impl FirewallRule {
6986 pub fn new() -> Self {
6987 std::default::Default::default()
6988 }
6989
6990 /// Sets the value of [priority][crate::model::FirewallRule::priority].
6991 ///
6992 /// # Example
6993 /// ```ignore,no_run
6994 /// # use google_cloud_appengine_v1::model::FirewallRule;
6995 /// let x = FirewallRule::new().set_priority(42);
6996 /// ```
6997 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6998 self.priority = v.into();
6999 self
7000 }
7001
7002 /// Sets the value of [action][crate::model::FirewallRule::action].
7003 ///
7004 /// # Example
7005 /// ```ignore,no_run
7006 /// # use google_cloud_appengine_v1::model::FirewallRule;
7007 /// use google_cloud_appengine_v1::model::firewall_rule::Action;
7008 /// let x0 = FirewallRule::new().set_action(Action::Allow);
7009 /// let x1 = FirewallRule::new().set_action(Action::Deny);
7010 /// ```
7011 pub fn set_action<T: std::convert::Into<crate::model::firewall_rule::Action>>(
7012 mut self,
7013 v: T,
7014 ) -> Self {
7015 self.action = v.into();
7016 self
7017 }
7018
7019 /// Sets the value of [source_range][crate::model::FirewallRule::source_range].
7020 ///
7021 /// # Example
7022 /// ```ignore,no_run
7023 /// # use google_cloud_appengine_v1::model::FirewallRule;
7024 /// let x = FirewallRule::new().set_source_range("example");
7025 /// ```
7026 pub fn set_source_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7027 self.source_range = v.into();
7028 self
7029 }
7030
7031 /// Sets the value of [description][crate::model::FirewallRule::description].
7032 ///
7033 /// # Example
7034 /// ```ignore,no_run
7035 /// # use google_cloud_appengine_v1::model::FirewallRule;
7036 /// let x = FirewallRule::new().set_description("example");
7037 /// ```
7038 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7039 self.description = v.into();
7040 self
7041 }
7042}
7043
7044impl wkt::message::Message for FirewallRule {
7045 fn typename() -> &'static str {
7046 "type.googleapis.com/google.appengine.v1.FirewallRule"
7047 }
7048}
7049
7050/// Defines additional types related to [FirewallRule].
7051pub mod firewall_rule {
7052 #[allow(unused_imports)]
7053 use super::*;
7054
7055 /// Available actions to take on matching requests.
7056 ///
7057 /// # Working with unknown values
7058 ///
7059 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7060 /// additional enum variants at any time. Adding new variants is not considered
7061 /// a breaking change. Applications should write their code in anticipation of:
7062 ///
7063 /// - New values appearing in future releases of the client library, **and**
7064 /// - New values received dynamically, without application changes.
7065 ///
7066 /// Please consult the [Working with enums] section in the user guide for some
7067 /// guidelines.
7068 ///
7069 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7070 #[derive(Clone, Debug, PartialEq)]
7071 #[non_exhaustive]
7072 pub enum Action {
7073 UnspecifiedAction,
7074 /// Matching requests are allowed.
7075 Allow,
7076 /// Matching requests are denied.
7077 Deny,
7078 /// If set, the enum was initialized with an unknown value.
7079 ///
7080 /// Applications can examine the value using [Action::value] or
7081 /// [Action::name].
7082 UnknownValue(action::UnknownValue),
7083 }
7084
7085 #[doc(hidden)]
7086 pub mod action {
7087 #[allow(unused_imports)]
7088 use super::*;
7089 #[derive(Clone, Debug, PartialEq)]
7090 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7091 }
7092
7093 impl Action {
7094 /// Gets the enum value.
7095 ///
7096 /// Returns `None` if the enum contains an unknown value deserialized from
7097 /// the string representation of enums.
7098 pub fn value(&self) -> std::option::Option<i32> {
7099 match self {
7100 Self::UnspecifiedAction => std::option::Option::Some(0),
7101 Self::Allow => std::option::Option::Some(1),
7102 Self::Deny => std::option::Option::Some(2),
7103 Self::UnknownValue(u) => u.0.value(),
7104 }
7105 }
7106
7107 /// Gets the enum value as a string.
7108 ///
7109 /// Returns `None` if the enum contains an unknown value deserialized from
7110 /// the integer representation of enums.
7111 pub fn name(&self) -> std::option::Option<&str> {
7112 match self {
7113 Self::UnspecifiedAction => std::option::Option::Some("UNSPECIFIED_ACTION"),
7114 Self::Allow => std::option::Option::Some("ALLOW"),
7115 Self::Deny => std::option::Option::Some("DENY"),
7116 Self::UnknownValue(u) => u.0.name(),
7117 }
7118 }
7119 }
7120
7121 impl std::default::Default for Action {
7122 fn default() -> Self {
7123 use std::convert::From;
7124 Self::from(0)
7125 }
7126 }
7127
7128 impl std::fmt::Display for Action {
7129 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7130 wkt::internal::display_enum(f, self.name(), self.value())
7131 }
7132 }
7133
7134 impl std::convert::From<i32> for Action {
7135 fn from(value: i32) -> Self {
7136 match value {
7137 0 => Self::UnspecifiedAction,
7138 1 => Self::Allow,
7139 2 => Self::Deny,
7140 _ => Self::UnknownValue(action::UnknownValue(
7141 wkt::internal::UnknownEnumValue::Integer(value),
7142 )),
7143 }
7144 }
7145 }
7146
7147 impl std::convert::From<&str> for Action {
7148 fn from(value: &str) -> Self {
7149 use std::string::ToString;
7150 match value {
7151 "UNSPECIFIED_ACTION" => Self::UnspecifiedAction,
7152 "ALLOW" => Self::Allow,
7153 "DENY" => Self::Deny,
7154 _ => Self::UnknownValue(action::UnknownValue(
7155 wkt::internal::UnknownEnumValue::String(value.to_string()),
7156 )),
7157 }
7158 }
7159 }
7160
7161 impl serde::ser::Serialize for Action {
7162 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7163 where
7164 S: serde::Serializer,
7165 {
7166 match self {
7167 Self::UnspecifiedAction => serializer.serialize_i32(0),
7168 Self::Allow => serializer.serialize_i32(1),
7169 Self::Deny => serializer.serialize_i32(2),
7170 Self::UnknownValue(u) => u.0.serialize(serializer),
7171 }
7172 }
7173 }
7174
7175 impl<'de> serde::de::Deserialize<'de> for Action {
7176 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7177 where
7178 D: serde::Deserializer<'de>,
7179 {
7180 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
7181 ".google.appengine.v1.FirewallRule.Action",
7182 ))
7183 }
7184 }
7185}
7186
7187/// An Instance resource is the computing unit that App Engine uses to
7188/// automatically scale an application.
7189#[derive(Clone, Default, PartialEq)]
7190#[non_exhaustive]
7191pub struct Instance {
7192 /// Output only. Full path to the Instance resource in the API.
7193 /// Example: `apps/myapp/services/default/versions/v1/instances/instance-1`.
7194 pub name: std::string::String,
7195
7196 /// Output only. Relative name of the instance within the version.
7197 /// Example: `instance-1`.
7198 pub id: std::string::String,
7199
7200 /// Output only. App Engine release this instance is running on.
7201 pub app_engine_release: std::string::String,
7202
7203 /// Output only. Availability of the instance.
7204 pub availability: crate::model::instance::Availability,
7205
7206 /// Output only. Name of the virtual machine where this instance lives. Only applicable
7207 /// for instances in App Engine flexible environment.
7208 pub vm_name: std::string::String,
7209
7210 /// Output only. Zone where the virtual machine is located. Only applicable for instances
7211 /// in App Engine flexible environment.
7212 pub vm_zone_name: std::string::String,
7213
7214 /// Output only. Virtual machine ID of this instance. Only applicable for instances in
7215 /// App Engine flexible environment.
7216 pub vm_id: std::string::String,
7217
7218 /// Output only. Time that this instance was started.
7219 ///
7220 /// @OutputOnly
7221 pub start_time: std::option::Option<wkt::Timestamp>,
7222
7223 /// Output only. Number of requests since this instance was started.
7224 pub requests: i32,
7225
7226 /// Output only. Number of errors since this instance was started.
7227 pub errors: i32,
7228
7229 /// Output only. Average queries per second (QPS) over the last minute.
7230 pub qps: f32,
7231
7232 /// Output only. Average latency (ms) over the last minute.
7233 pub average_latency: i32,
7234
7235 /// Output only. Total memory in use (bytes).
7236 pub memory_usage: i64,
7237
7238 /// Output only. Status of the virtual machine where this instance lives. Only applicable
7239 /// for instances in App Engine flexible environment.
7240 pub vm_status: std::string::String,
7241
7242 /// Output only. Whether this instance is in debug mode. Only applicable for instances in
7243 /// App Engine flexible environment.
7244 pub vm_debug_enabled: bool,
7245
7246 /// Output only. The IP address of this instance. Only applicable for instances in App
7247 /// Engine flexible environment.
7248 pub vm_ip: std::string::String,
7249
7250 /// Output only. The liveness health check of this instance. Only applicable for instances
7251 /// in App Engine flexible environment.
7252 pub vm_liveness: crate::model::instance::liveness::LivenessState,
7253
7254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7255}
7256
7257impl Instance {
7258 pub fn new() -> Self {
7259 std::default::Default::default()
7260 }
7261
7262 /// Sets the value of [name][crate::model::Instance::name].
7263 ///
7264 /// # Example
7265 /// ```ignore,no_run
7266 /// # use google_cloud_appengine_v1::model::Instance;
7267 /// let x = Instance::new().set_name("example");
7268 /// ```
7269 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7270 self.name = v.into();
7271 self
7272 }
7273
7274 /// Sets the value of [id][crate::model::Instance::id].
7275 ///
7276 /// # Example
7277 /// ```ignore,no_run
7278 /// # use google_cloud_appengine_v1::model::Instance;
7279 /// let x = Instance::new().set_id("example");
7280 /// ```
7281 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7282 self.id = v.into();
7283 self
7284 }
7285
7286 /// Sets the value of [app_engine_release][crate::model::Instance::app_engine_release].
7287 ///
7288 /// # Example
7289 /// ```ignore,no_run
7290 /// # use google_cloud_appengine_v1::model::Instance;
7291 /// let x = Instance::new().set_app_engine_release("example");
7292 /// ```
7293 pub fn set_app_engine_release<T: std::convert::Into<std::string::String>>(
7294 mut self,
7295 v: T,
7296 ) -> Self {
7297 self.app_engine_release = v.into();
7298 self
7299 }
7300
7301 /// Sets the value of [availability][crate::model::Instance::availability].
7302 ///
7303 /// # Example
7304 /// ```ignore,no_run
7305 /// # use google_cloud_appengine_v1::model::Instance;
7306 /// use google_cloud_appengine_v1::model::instance::Availability;
7307 /// let x0 = Instance::new().set_availability(Availability::Resident);
7308 /// let x1 = Instance::new().set_availability(Availability::Dynamic);
7309 /// ```
7310 pub fn set_availability<T: std::convert::Into<crate::model::instance::Availability>>(
7311 mut self,
7312 v: T,
7313 ) -> Self {
7314 self.availability = v.into();
7315 self
7316 }
7317
7318 /// Sets the value of [vm_name][crate::model::Instance::vm_name].
7319 ///
7320 /// # Example
7321 /// ```ignore,no_run
7322 /// # use google_cloud_appengine_v1::model::Instance;
7323 /// let x = Instance::new().set_vm_name("example");
7324 /// ```
7325 pub fn set_vm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7326 self.vm_name = v.into();
7327 self
7328 }
7329
7330 /// Sets the value of [vm_zone_name][crate::model::Instance::vm_zone_name].
7331 ///
7332 /// # Example
7333 /// ```ignore,no_run
7334 /// # use google_cloud_appengine_v1::model::Instance;
7335 /// let x = Instance::new().set_vm_zone_name("example");
7336 /// ```
7337 pub fn set_vm_zone_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7338 self.vm_zone_name = v.into();
7339 self
7340 }
7341
7342 /// Sets the value of [vm_id][crate::model::Instance::vm_id].
7343 ///
7344 /// # Example
7345 /// ```ignore,no_run
7346 /// # use google_cloud_appengine_v1::model::Instance;
7347 /// let x = Instance::new().set_vm_id("example");
7348 /// ```
7349 pub fn set_vm_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7350 self.vm_id = v.into();
7351 self
7352 }
7353
7354 /// Sets the value of [start_time][crate::model::Instance::start_time].
7355 ///
7356 /// # Example
7357 /// ```ignore,no_run
7358 /// # use google_cloud_appengine_v1::model::Instance;
7359 /// use wkt::Timestamp;
7360 /// let x = Instance::new().set_start_time(Timestamp::default()/* use setters */);
7361 /// ```
7362 pub fn set_start_time<T>(mut self, v: T) -> Self
7363 where
7364 T: std::convert::Into<wkt::Timestamp>,
7365 {
7366 self.start_time = std::option::Option::Some(v.into());
7367 self
7368 }
7369
7370 /// Sets or clears the value of [start_time][crate::model::Instance::start_time].
7371 ///
7372 /// # Example
7373 /// ```ignore,no_run
7374 /// # use google_cloud_appengine_v1::model::Instance;
7375 /// use wkt::Timestamp;
7376 /// let x = Instance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7377 /// let x = Instance::new().set_or_clear_start_time(None::<Timestamp>);
7378 /// ```
7379 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7380 where
7381 T: std::convert::Into<wkt::Timestamp>,
7382 {
7383 self.start_time = v.map(|x| x.into());
7384 self
7385 }
7386
7387 /// Sets the value of [requests][crate::model::Instance::requests].
7388 ///
7389 /// # Example
7390 /// ```ignore,no_run
7391 /// # use google_cloud_appengine_v1::model::Instance;
7392 /// let x = Instance::new().set_requests(42);
7393 /// ```
7394 pub fn set_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7395 self.requests = v.into();
7396 self
7397 }
7398
7399 /// Sets the value of [errors][crate::model::Instance::errors].
7400 ///
7401 /// # Example
7402 /// ```ignore,no_run
7403 /// # use google_cloud_appengine_v1::model::Instance;
7404 /// let x = Instance::new().set_errors(42);
7405 /// ```
7406 pub fn set_errors<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7407 self.errors = v.into();
7408 self
7409 }
7410
7411 /// Sets the value of [qps][crate::model::Instance::qps].
7412 ///
7413 /// # Example
7414 /// ```ignore,no_run
7415 /// # use google_cloud_appengine_v1::model::Instance;
7416 /// let x = Instance::new().set_qps(42.0);
7417 /// ```
7418 pub fn set_qps<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
7419 self.qps = v.into();
7420 self
7421 }
7422
7423 /// Sets the value of [average_latency][crate::model::Instance::average_latency].
7424 ///
7425 /// # Example
7426 /// ```ignore,no_run
7427 /// # use google_cloud_appengine_v1::model::Instance;
7428 /// let x = Instance::new().set_average_latency(42);
7429 /// ```
7430 pub fn set_average_latency<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7431 self.average_latency = v.into();
7432 self
7433 }
7434
7435 /// Sets the value of [memory_usage][crate::model::Instance::memory_usage].
7436 ///
7437 /// # Example
7438 /// ```ignore,no_run
7439 /// # use google_cloud_appengine_v1::model::Instance;
7440 /// let x = Instance::new().set_memory_usage(42);
7441 /// ```
7442 pub fn set_memory_usage<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7443 self.memory_usage = v.into();
7444 self
7445 }
7446
7447 /// Sets the value of [vm_status][crate::model::Instance::vm_status].
7448 ///
7449 /// # Example
7450 /// ```ignore,no_run
7451 /// # use google_cloud_appengine_v1::model::Instance;
7452 /// let x = Instance::new().set_vm_status("example");
7453 /// ```
7454 pub fn set_vm_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7455 self.vm_status = v.into();
7456 self
7457 }
7458
7459 /// Sets the value of [vm_debug_enabled][crate::model::Instance::vm_debug_enabled].
7460 ///
7461 /// # Example
7462 /// ```ignore,no_run
7463 /// # use google_cloud_appengine_v1::model::Instance;
7464 /// let x = Instance::new().set_vm_debug_enabled(true);
7465 /// ```
7466 pub fn set_vm_debug_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7467 self.vm_debug_enabled = v.into();
7468 self
7469 }
7470
7471 /// Sets the value of [vm_ip][crate::model::Instance::vm_ip].
7472 ///
7473 /// # Example
7474 /// ```ignore,no_run
7475 /// # use google_cloud_appengine_v1::model::Instance;
7476 /// let x = Instance::new().set_vm_ip("example");
7477 /// ```
7478 pub fn set_vm_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7479 self.vm_ip = v.into();
7480 self
7481 }
7482
7483 /// Sets the value of [vm_liveness][crate::model::Instance::vm_liveness].
7484 ///
7485 /// # Example
7486 /// ```ignore,no_run
7487 /// # use google_cloud_appengine_v1::model::Instance;
7488 /// use google_cloud_appengine_v1::model::instance::liveness::LivenessState;
7489 /// let x0 = Instance::new().set_vm_liveness(LivenessState::Unknown);
7490 /// let x1 = Instance::new().set_vm_liveness(LivenessState::Healthy);
7491 /// let x2 = Instance::new().set_vm_liveness(LivenessState::Unhealthy);
7492 /// ```
7493 pub fn set_vm_liveness<
7494 T: std::convert::Into<crate::model::instance::liveness::LivenessState>,
7495 >(
7496 mut self,
7497 v: T,
7498 ) -> Self {
7499 self.vm_liveness = v.into();
7500 self
7501 }
7502}
7503
7504impl wkt::message::Message for Instance {
7505 fn typename() -> &'static str {
7506 "type.googleapis.com/google.appengine.v1.Instance"
7507 }
7508}
7509
7510/// Defines additional types related to [Instance].
7511pub mod instance {
7512 #[allow(unused_imports)]
7513 use super::*;
7514
7515 /// Wrapper for LivenessState enum.
7516 #[derive(Clone, Default, PartialEq)]
7517 #[non_exhaustive]
7518 pub struct Liveness {
7519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7520 }
7521
7522 impl Liveness {
7523 pub fn new() -> Self {
7524 std::default::Default::default()
7525 }
7526 }
7527
7528 impl wkt::message::Message for Liveness {
7529 fn typename() -> &'static str {
7530 "type.googleapis.com/google.appengine.v1.Instance.Liveness"
7531 }
7532 }
7533
7534 /// Defines additional types related to [Liveness].
7535 pub mod liveness {
7536 #[allow(unused_imports)]
7537 use super::*;
7538
7539 /// Liveness health check status for Flex instances.
7540 ///
7541 /// # Working with unknown values
7542 ///
7543 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7544 /// additional enum variants at any time. Adding new variants is not considered
7545 /// a breaking change. Applications should write their code in anticipation of:
7546 ///
7547 /// - New values appearing in future releases of the client library, **and**
7548 /// - New values received dynamically, without application changes.
7549 ///
7550 /// Please consult the [Working with enums] section in the user guide for some
7551 /// guidelines.
7552 ///
7553 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7554 #[derive(Clone, Debug, PartialEq)]
7555 #[non_exhaustive]
7556 pub enum LivenessState {
7557 /// There is no liveness health check for the instance. Only applicable for
7558 /// instances in App Engine standard environment.
7559 Unspecified,
7560 /// The health checking system is aware of the instance but its health is
7561 /// not known at the moment.
7562 Unknown,
7563 /// The instance is reachable i.e. a connection to the application health
7564 /// checking endpoint can be established, and conforms to the requirements
7565 /// defined by the health check.
7566 Healthy,
7567 /// The instance is reachable, but does not conform to the requirements
7568 /// defined by the health check.
7569 Unhealthy,
7570 /// The instance is being drained. The existing connections to the instance
7571 /// have time to complete, but the new ones are being refused.
7572 Draining,
7573 /// The instance is unreachable i.e. a connection to the application health
7574 /// checking endpoint cannot be established, or the server does not respond
7575 /// within the specified timeout.
7576 Timeout,
7577 /// If set, the enum was initialized with an unknown value.
7578 ///
7579 /// Applications can examine the value using [LivenessState::value] or
7580 /// [LivenessState::name].
7581 UnknownValue(liveness_state::UnknownValue),
7582 }
7583
7584 #[doc(hidden)]
7585 pub mod liveness_state {
7586 #[allow(unused_imports)]
7587 use super::*;
7588 #[derive(Clone, Debug, PartialEq)]
7589 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7590 }
7591
7592 impl LivenessState {
7593 /// Gets the enum value.
7594 ///
7595 /// Returns `None` if the enum contains an unknown value deserialized from
7596 /// the string representation of enums.
7597 pub fn value(&self) -> std::option::Option<i32> {
7598 match self {
7599 Self::Unspecified => std::option::Option::Some(0),
7600 Self::Unknown => std::option::Option::Some(1),
7601 Self::Healthy => std::option::Option::Some(2),
7602 Self::Unhealthy => std::option::Option::Some(3),
7603 Self::Draining => std::option::Option::Some(4),
7604 Self::Timeout => std::option::Option::Some(5),
7605 Self::UnknownValue(u) => u.0.value(),
7606 }
7607 }
7608
7609 /// Gets the enum value as a string.
7610 ///
7611 /// Returns `None` if the enum contains an unknown value deserialized from
7612 /// the integer representation of enums.
7613 pub fn name(&self) -> std::option::Option<&str> {
7614 match self {
7615 Self::Unspecified => std::option::Option::Some("LIVENESS_STATE_UNSPECIFIED"),
7616 Self::Unknown => std::option::Option::Some("UNKNOWN"),
7617 Self::Healthy => std::option::Option::Some("HEALTHY"),
7618 Self::Unhealthy => std::option::Option::Some("UNHEALTHY"),
7619 Self::Draining => std::option::Option::Some("DRAINING"),
7620 Self::Timeout => std::option::Option::Some("TIMEOUT"),
7621 Self::UnknownValue(u) => u.0.name(),
7622 }
7623 }
7624 }
7625
7626 impl std::default::Default for LivenessState {
7627 fn default() -> Self {
7628 use std::convert::From;
7629 Self::from(0)
7630 }
7631 }
7632
7633 impl std::fmt::Display for LivenessState {
7634 fn fmt(
7635 &self,
7636 f: &mut std::fmt::Formatter<'_>,
7637 ) -> std::result::Result<(), std::fmt::Error> {
7638 wkt::internal::display_enum(f, self.name(), self.value())
7639 }
7640 }
7641
7642 impl std::convert::From<i32> for LivenessState {
7643 fn from(value: i32) -> Self {
7644 match value {
7645 0 => Self::Unspecified,
7646 1 => Self::Unknown,
7647 2 => Self::Healthy,
7648 3 => Self::Unhealthy,
7649 4 => Self::Draining,
7650 5 => Self::Timeout,
7651 _ => Self::UnknownValue(liveness_state::UnknownValue(
7652 wkt::internal::UnknownEnumValue::Integer(value),
7653 )),
7654 }
7655 }
7656 }
7657
7658 impl std::convert::From<&str> for LivenessState {
7659 fn from(value: &str) -> Self {
7660 use std::string::ToString;
7661 match value {
7662 "LIVENESS_STATE_UNSPECIFIED" => Self::Unspecified,
7663 "UNKNOWN" => Self::Unknown,
7664 "HEALTHY" => Self::Healthy,
7665 "UNHEALTHY" => Self::Unhealthy,
7666 "DRAINING" => Self::Draining,
7667 "TIMEOUT" => Self::Timeout,
7668 _ => Self::UnknownValue(liveness_state::UnknownValue(
7669 wkt::internal::UnknownEnumValue::String(value.to_string()),
7670 )),
7671 }
7672 }
7673 }
7674
7675 impl serde::ser::Serialize for LivenessState {
7676 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7677 where
7678 S: serde::Serializer,
7679 {
7680 match self {
7681 Self::Unspecified => serializer.serialize_i32(0),
7682 Self::Unknown => serializer.serialize_i32(1),
7683 Self::Healthy => serializer.serialize_i32(2),
7684 Self::Unhealthy => serializer.serialize_i32(3),
7685 Self::Draining => serializer.serialize_i32(4),
7686 Self::Timeout => serializer.serialize_i32(5),
7687 Self::UnknownValue(u) => u.0.serialize(serializer),
7688 }
7689 }
7690 }
7691
7692 impl<'de> serde::de::Deserialize<'de> for LivenessState {
7693 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7694 where
7695 D: serde::Deserializer<'de>,
7696 {
7697 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LivenessState>::new(
7698 ".google.appengine.v1.Instance.Liveness.LivenessState",
7699 ))
7700 }
7701 }
7702 }
7703
7704 /// Availability of the instance.
7705 ///
7706 /// # Working with unknown values
7707 ///
7708 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7709 /// additional enum variants at any time. Adding new variants is not considered
7710 /// a breaking change. Applications should write their code in anticipation of:
7711 ///
7712 /// - New values appearing in future releases of the client library, **and**
7713 /// - New values received dynamically, without application changes.
7714 ///
7715 /// Please consult the [Working with enums] section in the user guide for some
7716 /// guidelines.
7717 ///
7718 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7719 #[derive(Clone, Debug, PartialEq)]
7720 #[non_exhaustive]
7721 pub enum Availability {
7722 Unspecified,
7723 Resident,
7724 Dynamic,
7725 /// If set, the enum was initialized with an unknown value.
7726 ///
7727 /// Applications can examine the value using [Availability::value] or
7728 /// [Availability::name].
7729 UnknownValue(availability::UnknownValue),
7730 }
7731
7732 #[doc(hidden)]
7733 pub mod availability {
7734 #[allow(unused_imports)]
7735 use super::*;
7736 #[derive(Clone, Debug, PartialEq)]
7737 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7738 }
7739
7740 impl Availability {
7741 /// Gets the enum value.
7742 ///
7743 /// Returns `None` if the enum contains an unknown value deserialized from
7744 /// the string representation of enums.
7745 pub fn value(&self) -> std::option::Option<i32> {
7746 match self {
7747 Self::Unspecified => std::option::Option::Some(0),
7748 Self::Resident => std::option::Option::Some(1),
7749 Self::Dynamic => std::option::Option::Some(2),
7750 Self::UnknownValue(u) => u.0.value(),
7751 }
7752 }
7753
7754 /// Gets the enum value as a string.
7755 ///
7756 /// Returns `None` if the enum contains an unknown value deserialized from
7757 /// the integer representation of enums.
7758 pub fn name(&self) -> std::option::Option<&str> {
7759 match self {
7760 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
7761 Self::Resident => std::option::Option::Some("RESIDENT"),
7762 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
7763 Self::UnknownValue(u) => u.0.name(),
7764 }
7765 }
7766 }
7767
7768 impl std::default::Default for Availability {
7769 fn default() -> Self {
7770 use std::convert::From;
7771 Self::from(0)
7772 }
7773 }
7774
7775 impl std::fmt::Display for Availability {
7776 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7777 wkt::internal::display_enum(f, self.name(), self.value())
7778 }
7779 }
7780
7781 impl std::convert::From<i32> for Availability {
7782 fn from(value: i32) -> Self {
7783 match value {
7784 0 => Self::Unspecified,
7785 1 => Self::Resident,
7786 2 => Self::Dynamic,
7787 _ => Self::UnknownValue(availability::UnknownValue(
7788 wkt::internal::UnknownEnumValue::Integer(value),
7789 )),
7790 }
7791 }
7792 }
7793
7794 impl std::convert::From<&str> for Availability {
7795 fn from(value: &str) -> Self {
7796 use std::string::ToString;
7797 match value {
7798 "UNSPECIFIED" => Self::Unspecified,
7799 "RESIDENT" => Self::Resident,
7800 "DYNAMIC" => Self::Dynamic,
7801 _ => Self::UnknownValue(availability::UnknownValue(
7802 wkt::internal::UnknownEnumValue::String(value.to_string()),
7803 )),
7804 }
7805 }
7806 }
7807
7808 impl serde::ser::Serialize for Availability {
7809 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7810 where
7811 S: serde::Serializer,
7812 {
7813 match self {
7814 Self::Unspecified => serializer.serialize_i32(0),
7815 Self::Resident => serializer.serialize_i32(1),
7816 Self::Dynamic => serializer.serialize_i32(2),
7817 Self::UnknownValue(u) => u.0.serialize(serializer),
7818 }
7819 }
7820 }
7821
7822 impl<'de> serde::de::Deserialize<'de> for Availability {
7823 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7824 where
7825 D: serde::Deserializer<'de>,
7826 {
7827 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Availability>::new(
7828 ".google.appengine.v1.Instance.Availability",
7829 ))
7830 }
7831 }
7832}
7833
7834/// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location].
7835#[derive(Clone, Default, PartialEq)]
7836#[non_exhaustive]
7837pub struct LocationMetadata {
7838 /// App Engine standard environment is available in the given location.
7839 ///
7840 /// @OutputOnly
7841 pub standard_environment_available: bool,
7842
7843 /// App Engine flexible environment is available in the given location.
7844 ///
7845 /// @OutputOnly
7846 pub flexible_environment_available: bool,
7847
7848 /// Output only. [Search API](https://cloud.google.com/appengine/docs/standard/python/search)
7849 /// is available in the given location.
7850 pub search_api_available: bool,
7851
7852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7853}
7854
7855impl LocationMetadata {
7856 pub fn new() -> Self {
7857 std::default::Default::default()
7858 }
7859
7860 /// Sets the value of [standard_environment_available][crate::model::LocationMetadata::standard_environment_available].
7861 ///
7862 /// # Example
7863 /// ```ignore,no_run
7864 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7865 /// let x = LocationMetadata::new().set_standard_environment_available(true);
7866 /// ```
7867 pub fn set_standard_environment_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7868 self.standard_environment_available = v.into();
7869 self
7870 }
7871
7872 /// Sets the value of [flexible_environment_available][crate::model::LocationMetadata::flexible_environment_available].
7873 ///
7874 /// # Example
7875 /// ```ignore,no_run
7876 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7877 /// let x = LocationMetadata::new().set_flexible_environment_available(true);
7878 /// ```
7879 pub fn set_flexible_environment_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7880 self.flexible_environment_available = v.into();
7881 self
7882 }
7883
7884 /// Sets the value of [search_api_available][crate::model::LocationMetadata::search_api_available].
7885 ///
7886 /// # Example
7887 /// ```ignore,no_run
7888 /// # use google_cloud_appengine_v1::model::LocationMetadata;
7889 /// let x = LocationMetadata::new().set_search_api_available(true);
7890 /// ```
7891 pub fn set_search_api_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7892 self.search_api_available = v.into();
7893 self
7894 }
7895}
7896
7897impl wkt::message::Message for LocationMetadata {
7898 fn typename() -> &'static str {
7899 "type.googleapis.com/google.appengine.v1.LocationMetadata"
7900 }
7901}
7902
7903/// A NetworkSettings resource is a container for ingress settings for a version
7904/// or service.
7905#[derive(Clone, Default, PartialEq)]
7906#[non_exhaustive]
7907pub struct NetworkSettings {
7908 /// The ingress settings for version or service.
7909 pub ingress_traffic_allowed: crate::model::network_settings::IngressTrafficAllowed,
7910
7911 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7912}
7913
7914impl NetworkSettings {
7915 pub fn new() -> Self {
7916 std::default::Default::default()
7917 }
7918
7919 /// Sets the value of [ingress_traffic_allowed][crate::model::NetworkSettings::ingress_traffic_allowed].
7920 ///
7921 /// # Example
7922 /// ```ignore,no_run
7923 /// # use google_cloud_appengine_v1::model::NetworkSettings;
7924 /// use google_cloud_appengine_v1::model::network_settings::IngressTrafficAllowed;
7925 /// let x0 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::All);
7926 /// let x1 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::InternalOnly);
7927 /// let x2 = NetworkSettings::new().set_ingress_traffic_allowed(IngressTrafficAllowed::InternalAndLb);
7928 /// ```
7929 pub fn set_ingress_traffic_allowed<
7930 T: std::convert::Into<crate::model::network_settings::IngressTrafficAllowed>,
7931 >(
7932 mut self,
7933 v: T,
7934 ) -> Self {
7935 self.ingress_traffic_allowed = v.into();
7936 self
7937 }
7938}
7939
7940impl wkt::message::Message for NetworkSettings {
7941 fn typename() -> &'static str {
7942 "type.googleapis.com/google.appengine.v1.NetworkSettings"
7943 }
7944}
7945
7946/// Defines additional types related to [NetworkSettings].
7947pub mod network_settings {
7948 #[allow(unused_imports)]
7949 use super::*;
7950
7951 /// If unspecified, INGRESS_TRAFFIC_ALLOWED_ALL will be used.
7952 ///
7953 /// # Working with unknown values
7954 ///
7955 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7956 /// additional enum variants at any time. Adding new variants is not considered
7957 /// a breaking change. Applications should write their code in anticipation of:
7958 ///
7959 /// - New values appearing in future releases of the client library, **and**
7960 /// - New values received dynamically, without application changes.
7961 ///
7962 /// Please consult the [Working with enums] section in the user guide for some
7963 /// guidelines.
7964 ///
7965 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7966 #[derive(Clone, Debug, PartialEq)]
7967 #[non_exhaustive]
7968 pub enum IngressTrafficAllowed {
7969 /// Unspecified
7970 Unspecified,
7971 /// Allow HTTP traffic from public and private sources.
7972 All,
7973 /// Allow HTTP traffic from only private VPC sources.
7974 InternalOnly,
7975 /// Allow HTTP traffic from private VPC sources and through load balancers.
7976 InternalAndLb,
7977 /// If set, the enum was initialized with an unknown value.
7978 ///
7979 /// Applications can examine the value using [IngressTrafficAllowed::value] or
7980 /// [IngressTrafficAllowed::name].
7981 UnknownValue(ingress_traffic_allowed::UnknownValue),
7982 }
7983
7984 #[doc(hidden)]
7985 pub mod ingress_traffic_allowed {
7986 #[allow(unused_imports)]
7987 use super::*;
7988 #[derive(Clone, Debug, PartialEq)]
7989 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7990 }
7991
7992 impl IngressTrafficAllowed {
7993 /// Gets the enum value.
7994 ///
7995 /// Returns `None` if the enum contains an unknown value deserialized from
7996 /// the string representation of enums.
7997 pub fn value(&self) -> std::option::Option<i32> {
7998 match self {
7999 Self::Unspecified => std::option::Option::Some(0),
8000 Self::All => std::option::Option::Some(1),
8001 Self::InternalOnly => std::option::Option::Some(2),
8002 Self::InternalAndLb => std::option::Option::Some(3),
8003 Self::UnknownValue(u) => u.0.value(),
8004 }
8005 }
8006
8007 /// Gets the enum value as a string.
8008 ///
8009 /// Returns `None` if the enum contains an unknown value deserialized from
8010 /// the integer representation of enums.
8011 pub fn name(&self) -> std::option::Option<&str> {
8012 match self {
8013 Self::Unspecified => {
8014 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED")
8015 }
8016 Self::All => std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_ALL"),
8017 Self::InternalOnly => {
8018 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY")
8019 }
8020 Self::InternalAndLb => {
8021 std::option::Option::Some("INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB")
8022 }
8023 Self::UnknownValue(u) => u.0.name(),
8024 }
8025 }
8026 }
8027
8028 impl std::default::Default for IngressTrafficAllowed {
8029 fn default() -> Self {
8030 use std::convert::From;
8031 Self::from(0)
8032 }
8033 }
8034
8035 impl std::fmt::Display for IngressTrafficAllowed {
8036 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8037 wkt::internal::display_enum(f, self.name(), self.value())
8038 }
8039 }
8040
8041 impl std::convert::From<i32> for IngressTrafficAllowed {
8042 fn from(value: i32) -> Self {
8043 match value {
8044 0 => Self::Unspecified,
8045 1 => Self::All,
8046 2 => Self::InternalOnly,
8047 3 => Self::InternalAndLb,
8048 _ => Self::UnknownValue(ingress_traffic_allowed::UnknownValue(
8049 wkt::internal::UnknownEnumValue::Integer(value),
8050 )),
8051 }
8052 }
8053 }
8054
8055 impl std::convert::From<&str> for IngressTrafficAllowed {
8056 fn from(value: &str) -> Self {
8057 use std::string::ToString;
8058 match value {
8059 "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED" => Self::Unspecified,
8060 "INGRESS_TRAFFIC_ALLOWED_ALL" => Self::All,
8061 "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY" => Self::InternalOnly,
8062 "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB" => Self::InternalAndLb,
8063 _ => Self::UnknownValue(ingress_traffic_allowed::UnknownValue(
8064 wkt::internal::UnknownEnumValue::String(value.to_string()),
8065 )),
8066 }
8067 }
8068 }
8069
8070 impl serde::ser::Serialize for IngressTrafficAllowed {
8071 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8072 where
8073 S: serde::Serializer,
8074 {
8075 match self {
8076 Self::Unspecified => serializer.serialize_i32(0),
8077 Self::All => serializer.serialize_i32(1),
8078 Self::InternalOnly => serializer.serialize_i32(2),
8079 Self::InternalAndLb => serializer.serialize_i32(3),
8080 Self::UnknownValue(u) => u.0.serialize(serializer),
8081 }
8082 }
8083 }
8084
8085 impl<'de> serde::de::Deserialize<'de> for IngressTrafficAllowed {
8086 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8087 where
8088 D: serde::Deserializer<'de>,
8089 {
8090 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngressTrafficAllowed>::new(
8091 ".google.appengine.v1.NetworkSettings.IngressTrafficAllowed",
8092 ))
8093 }
8094 }
8095}
8096
8097/// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation].
8098///
8099/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8100#[derive(Clone, Default, PartialEq)]
8101#[non_exhaustive]
8102pub struct OperationMetadataV1 {
8103 /// API method that initiated this operation. Example:
8104 /// `google.appengine.v1.Versions.CreateVersion`.
8105 ///
8106 /// @OutputOnly
8107 pub method: std::string::String,
8108
8109 /// Time that this operation was created.
8110 ///
8111 /// @OutputOnly
8112 pub insert_time: std::option::Option<wkt::Timestamp>,
8113
8114 /// Time that this operation completed.
8115 ///
8116 /// @OutputOnly
8117 pub end_time: std::option::Option<wkt::Timestamp>,
8118
8119 /// User who requested this operation.
8120 ///
8121 /// @OutputOnly
8122 pub user: std::string::String,
8123
8124 /// Name of the resource that this operation is acting on. Example:
8125 /// `apps/myapp/services/default`.
8126 ///
8127 /// @OutputOnly
8128 pub target: std::string::String,
8129
8130 /// Ephemeral message that may change every time the operation is polled.
8131 /// @OutputOnly
8132 pub ephemeral_message: std::string::String,
8133
8134 /// Durable messages that persist on every operation poll.
8135 /// @OutputOnly
8136 pub warning: std::vec::Vec<std::string::String>,
8137
8138 /// Metadata specific to the type of operation in progress.
8139 /// @OutputOnly
8140 pub method_metadata: std::option::Option<crate::model::operation_metadata_v_1::MethodMetadata>,
8141
8142 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8143}
8144
8145impl OperationMetadataV1 {
8146 pub fn new() -> Self {
8147 std::default::Default::default()
8148 }
8149
8150 /// Sets the value of [method][crate::model::OperationMetadataV1::method].
8151 ///
8152 /// # Example
8153 /// ```ignore,no_run
8154 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8155 /// let x = OperationMetadataV1::new().set_method("example");
8156 /// ```
8157 pub fn set_method<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8158 self.method = v.into();
8159 self
8160 }
8161
8162 /// Sets the value of [insert_time][crate::model::OperationMetadataV1::insert_time].
8163 ///
8164 /// # Example
8165 /// ```ignore,no_run
8166 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8167 /// use wkt::Timestamp;
8168 /// let x = OperationMetadataV1::new().set_insert_time(Timestamp::default()/* use setters */);
8169 /// ```
8170 pub fn set_insert_time<T>(mut self, v: T) -> Self
8171 where
8172 T: std::convert::Into<wkt::Timestamp>,
8173 {
8174 self.insert_time = std::option::Option::Some(v.into());
8175 self
8176 }
8177
8178 /// Sets or clears the value of [insert_time][crate::model::OperationMetadataV1::insert_time].
8179 ///
8180 /// # Example
8181 /// ```ignore,no_run
8182 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8183 /// use wkt::Timestamp;
8184 /// let x = OperationMetadataV1::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
8185 /// let x = OperationMetadataV1::new().set_or_clear_insert_time(None::<Timestamp>);
8186 /// ```
8187 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
8188 where
8189 T: std::convert::Into<wkt::Timestamp>,
8190 {
8191 self.insert_time = v.map(|x| x.into());
8192 self
8193 }
8194
8195 /// Sets the value of [end_time][crate::model::OperationMetadataV1::end_time].
8196 ///
8197 /// # Example
8198 /// ```ignore,no_run
8199 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8200 /// use wkt::Timestamp;
8201 /// let x = OperationMetadataV1::new().set_end_time(Timestamp::default()/* use setters */);
8202 /// ```
8203 pub fn set_end_time<T>(mut self, v: T) -> Self
8204 where
8205 T: std::convert::Into<wkt::Timestamp>,
8206 {
8207 self.end_time = std::option::Option::Some(v.into());
8208 self
8209 }
8210
8211 /// Sets or clears the value of [end_time][crate::model::OperationMetadataV1::end_time].
8212 ///
8213 /// # Example
8214 /// ```ignore,no_run
8215 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8216 /// use wkt::Timestamp;
8217 /// let x = OperationMetadataV1::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8218 /// let x = OperationMetadataV1::new().set_or_clear_end_time(None::<Timestamp>);
8219 /// ```
8220 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8221 where
8222 T: std::convert::Into<wkt::Timestamp>,
8223 {
8224 self.end_time = v.map(|x| x.into());
8225 self
8226 }
8227
8228 /// Sets the value of [user][crate::model::OperationMetadataV1::user].
8229 ///
8230 /// # Example
8231 /// ```ignore,no_run
8232 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8233 /// let x = OperationMetadataV1::new().set_user("example");
8234 /// ```
8235 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8236 self.user = v.into();
8237 self
8238 }
8239
8240 /// Sets the value of [target][crate::model::OperationMetadataV1::target].
8241 ///
8242 /// # Example
8243 /// ```ignore,no_run
8244 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8245 /// let x = OperationMetadataV1::new().set_target("example");
8246 /// ```
8247 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8248 self.target = v.into();
8249 self
8250 }
8251
8252 /// Sets the value of [ephemeral_message][crate::model::OperationMetadataV1::ephemeral_message].
8253 ///
8254 /// # Example
8255 /// ```ignore,no_run
8256 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8257 /// let x = OperationMetadataV1::new().set_ephemeral_message("example");
8258 /// ```
8259 pub fn set_ephemeral_message<T: std::convert::Into<std::string::String>>(
8260 mut self,
8261 v: T,
8262 ) -> Self {
8263 self.ephemeral_message = v.into();
8264 self
8265 }
8266
8267 /// Sets the value of [warning][crate::model::OperationMetadataV1::warning].
8268 ///
8269 /// # Example
8270 /// ```ignore,no_run
8271 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8272 /// let x = OperationMetadataV1::new().set_warning(["a", "b", "c"]);
8273 /// ```
8274 pub fn set_warning<T, V>(mut self, v: T) -> Self
8275 where
8276 T: std::iter::IntoIterator<Item = V>,
8277 V: std::convert::Into<std::string::String>,
8278 {
8279 use std::iter::Iterator;
8280 self.warning = v.into_iter().map(|i| i.into()).collect();
8281 self
8282 }
8283
8284 /// Sets the value of [method_metadata][crate::model::OperationMetadataV1::method_metadata].
8285 ///
8286 /// Note that all the setters affecting `method_metadata` are mutually
8287 /// exclusive.
8288 ///
8289 /// # Example
8290 /// ```ignore,no_run
8291 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8292 /// use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8293 /// let x = OperationMetadataV1::new().set_method_metadata(Some(
8294 /// google_cloud_appengine_v1::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(CreateVersionMetadataV1::default().into())));
8295 /// ```
8296 pub fn set_method_metadata<
8297 T: std::convert::Into<
8298 std::option::Option<crate::model::operation_metadata_v_1::MethodMetadata>,
8299 >,
8300 >(
8301 mut self,
8302 v: T,
8303 ) -> Self {
8304 self.method_metadata = v.into();
8305 self
8306 }
8307
8308 /// The value of [method_metadata][crate::model::OperationMetadataV1::method_metadata]
8309 /// if it holds a `CreateVersionMetadata`, `None` if the field is not set or
8310 /// holds a different branch.
8311 pub fn create_version_metadata(
8312 &self,
8313 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateVersionMetadataV1>> {
8314 #[allow(unreachable_patterns)]
8315 self.method_metadata.as_ref().and_then(|v| match v {
8316 crate::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(v) => {
8317 std::option::Option::Some(v)
8318 }
8319 _ => std::option::Option::None,
8320 })
8321 }
8322
8323 /// Sets the value of [method_metadata][crate::model::OperationMetadataV1::method_metadata]
8324 /// to hold a `CreateVersionMetadata`.
8325 ///
8326 /// Note that all the setters affecting `method_metadata` are
8327 /// mutually exclusive.
8328 ///
8329 /// # Example
8330 /// ```ignore,no_run
8331 /// # use google_cloud_appengine_v1::model::OperationMetadataV1;
8332 /// use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8333 /// let x = OperationMetadataV1::new().set_create_version_metadata(CreateVersionMetadataV1::default()/* use setters */);
8334 /// assert!(x.create_version_metadata().is_some());
8335 /// ```
8336 pub fn set_create_version_metadata<
8337 T: std::convert::Into<std::boxed::Box<crate::model::CreateVersionMetadataV1>>,
8338 >(
8339 mut self,
8340 v: T,
8341 ) -> Self {
8342 self.method_metadata = std::option::Option::Some(
8343 crate::model::operation_metadata_v_1::MethodMetadata::CreateVersionMetadata(v.into()),
8344 );
8345 self
8346 }
8347}
8348
8349impl wkt::message::Message for OperationMetadataV1 {
8350 fn typename() -> &'static str {
8351 "type.googleapis.com/google.appengine.v1.OperationMetadataV1"
8352 }
8353}
8354
8355/// Defines additional types related to [OperationMetadataV1].
8356pub mod operation_metadata_v_1 {
8357 #[allow(unused_imports)]
8358 use super::*;
8359
8360 /// Metadata specific to the type of operation in progress.
8361 /// @OutputOnly
8362 #[derive(Clone, Debug, PartialEq)]
8363 #[non_exhaustive]
8364 pub enum MethodMetadata {
8365 CreateVersionMetadata(std::boxed::Box<crate::model::CreateVersionMetadataV1>),
8366 }
8367}
8368
8369/// Metadata for the given [google.longrunning.Operation][google.longrunning.Operation] during a
8370/// [google.appengine.v1.CreateVersionRequest][google.appengine.v1.CreateVersionRequest].
8371///
8372/// [google.appengine.v1.CreateVersionRequest]: crate::model::CreateVersionRequest
8373/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8374#[derive(Clone, Default, PartialEq)]
8375#[non_exhaustive]
8376pub struct CreateVersionMetadataV1 {
8377 /// The Cloud Build ID if one was created as part of the version create.
8378 /// @OutputOnly
8379 pub cloud_build_id: std::string::String,
8380
8381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8382}
8383
8384impl CreateVersionMetadataV1 {
8385 pub fn new() -> Self {
8386 std::default::Default::default()
8387 }
8388
8389 /// Sets the value of [cloud_build_id][crate::model::CreateVersionMetadataV1::cloud_build_id].
8390 ///
8391 /// # Example
8392 /// ```ignore,no_run
8393 /// # use google_cloud_appengine_v1::model::CreateVersionMetadataV1;
8394 /// let x = CreateVersionMetadataV1::new().set_cloud_build_id("example");
8395 /// ```
8396 pub fn set_cloud_build_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8397 self.cloud_build_id = v.into();
8398 self
8399 }
8400}
8401
8402impl wkt::message::Message for CreateVersionMetadataV1 {
8403 fn typename() -> &'static str {
8404 "type.googleapis.com/google.appengine.v1.CreateVersionMetadataV1"
8405 }
8406}
8407
8408/// A Service resource is a logical component of an application that can share
8409/// state and communicate in a secure fashion with other services.
8410/// For example, an application that handles customer requests might
8411/// include separate services to handle tasks such as backend data
8412/// analysis or API requests from mobile devices. Each service has a
8413/// collection of versions that define a specific set of code used to
8414/// implement the functionality of that service.
8415#[derive(Clone, Default, PartialEq)]
8416#[non_exhaustive]
8417pub struct Service {
8418 /// Full path to the Service resource in the API.
8419 /// Example: `apps/myapp/services/default`.
8420 ///
8421 /// @OutputOnly
8422 pub name: std::string::String,
8423
8424 /// Relative name of the service within the application.
8425 /// Example: `default`.
8426 ///
8427 /// @OutputOnly
8428 pub id: std::string::String,
8429
8430 /// Mapping that defines fractional HTTP traffic diversion to
8431 /// different versions within the service.
8432 pub split: std::option::Option<crate::model::TrafficSplit>,
8433
8434 /// A set of labels to apply to this service. Labels are key/value pairs that
8435 /// describe the service and all resources that belong to it (e.g.,
8436 /// versions). The labels can be used to search and group resources, and are
8437 /// propagated to the usage and billing reports, enabling fine-grain analysis
8438 /// of costs. An example of using labels is to tag resources belonging to
8439 /// different environments (e.g., "env=prod", "env=qa").
8440 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8441
8442 /// Ingress settings for this service. Will apply to all versions.
8443 pub network_settings: std::option::Option<crate::model::NetworkSettings>,
8444
8445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8446}
8447
8448impl Service {
8449 pub fn new() -> Self {
8450 std::default::Default::default()
8451 }
8452
8453 /// Sets the value of [name][crate::model::Service::name].
8454 ///
8455 /// # Example
8456 /// ```ignore,no_run
8457 /// # use google_cloud_appengine_v1::model::Service;
8458 /// let x = Service::new().set_name("example");
8459 /// ```
8460 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8461 self.name = v.into();
8462 self
8463 }
8464
8465 /// Sets the value of [id][crate::model::Service::id].
8466 ///
8467 /// # Example
8468 /// ```ignore,no_run
8469 /// # use google_cloud_appengine_v1::model::Service;
8470 /// let x = Service::new().set_id("example");
8471 /// ```
8472 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8473 self.id = v.into();
8474 self
8475 }
8476
8477 /// Sets the value of [split][crate::model::Service::split].
8478 ///
8479 /// # Example
8480 /// ```ignore,no_run
8481 /// # use google_cloud_appengine_v1::model::Service;
8482 /// use google_cloud_appengine_v1::model::TrafficSplit;
8483 /// let x = Service::new().set_split(TrafficSplit::default()/* use setters */);
8484 /// ```
8485 pub fn set_split<T>(mut self, v: T) -> Self
8486 where
8487 T: std::convert::Into<crate::model::TrafficSplit>,
8488 {
8489 self.split = std::option::Option::Some(v.into());
8490 self
8491 }
8492
8493 /// Sets or clears the value of [split][crate::model::Service::split].
8494 ///
8495 /// # Example
8496 /// ```ignore,no_run
8497 /// # use google_cloud_appengine_v1::model::Service;
8498 /// use google_cloud_appengine_v1::model::TrafficSplit;
8499 /// let x = Service::new().set_or_clear_split(Some(TrafficSplit::default()/* use setters */));
8500 /// let x = Service::new().set_or_clear_split(None::<TrafficSplit>);
8501 /// ```
8502 pub fn set_or_clear_split<T>(mut self, v: std::option::Option<T>) -> Self
8503 where
8504 T: std::convert::Into<crate::model::TrafficSplit>,
8505 {
8506 self.split = v.map(|x| x.into());
8507 self
8508 }
8509
8510 /// Sets the value of [labels][crate::model::Service::labels].
8511 ///
8512 /// # Example
8513 /// ```ignore,no_run
8514 /// # use google_cloud_appengine_v1::model::Service;
8515 /// let x = Service::new().set_labels([
8516 /// ("key0", "abc"),
8517 /// ("key1", "xyz"),
8518 /// ]);
8519 /// ```
8520 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8521 where
8522 T: std::iter::IntoIterator<Item = (K, V)>,
8523 K: std::convert::Into<std::string::String>,
8524 V: std::convert::Into<std::string::String>,
8525 {
8526 use std::iter::Iterator;
8527 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8528 self
8529 }
8530
8531 /// Sets the value of [network_settings][crate::model::Service::network_settings].
8532 ///
8533 /// # Example
8534 /// ```ignore,no_run
8535 /// # use google_cloud_appengine_v1::model::Service;
8536 /// use google_cloud_appengine_v1::model::NetworkSettings;
8537 /// let x = Service::new().set_network_settings(NetworkSettings::default()/* use setters */);
8538 /// ```
8539 pub fn set_network_settings<T>(mut self, v: T) -> Self
8540 where
8541 T: std::convert::Into<crate::model::NetworkSettings>,
8542 {
8543 self.network_settings = std::option::Option::Some(v.into());
8544 self
8545 }
8546
8547 /// Sets or clears the value of [network_settings][crate::model::Service::network_settings].
8548 ///
8549 /// # Example
8550 /// ```ignore,no_run
8551 /// # use google_cloud_appengine_v1::model::Service;
8552 /// use google_cloud_appengine_v1::model::NetworkSettings;
8553 /// let x = Service::new().set_or_clear_network_settings(Some(NetworkSettings::default()/* use setters */));
8554 /// let x = Service::new().set_or_clear_network_settings(None::<NetworkSettings>);
8555 /// ```
8556 pub fn set_or_clear_network_settings<T>(mut self, v: std::option::Option<T>) -> Self
8557 where
8558 T: std::convert::Into<crate::model::NetworkSettings>,
8559 {
8560 self.network_settings = v.map(|x| x.into());
8561 self
8562 }
8563}
8564
8565impl wkt::message::Message for Service {
8566 fn typename() -> &'static str {
8567 "type.googleapis.com/google.appengine.v1.Service"
8568 }
8569}
8570
8571/// Traffic routing configuration for versions within a single service. Traffic
8572/// splits define how traffic directed to the service is assigned to versions.
8573#[derive(Clone, Default, PartialEq)]
8574#[non_exhaustive]
8575pub struct TrafficSplit {
8576 /// Mechanism used to determine which version a request is sent to.
8577 /// The traffic selection algorithm will
8578 /// be stable for either type until allocations are changed.
8579 pub shard_by: crate::model::traffic_split::ShardBy,
8580
8581 /// Mapping from version IDs within the service to fractional
8582 /// (0.000, 1] allocations of traffic for that version. Each version can
8583 /// be specified only once, but some versions in the service may not
8584 /// have any traffic allocation. Services that have traffic allocated
8585 /// cannot be deleted until either the service is deleted or
8586 /// their traffic allocation is removed. Allocations must sum to 1.
8587 /// Up to two decimal place precision is supported for IP-based splits and
8588 /// up to three decimal places is supported for cookie-based splits.
8589 pub allocations: std::collections::HashMap<std::string::String, f64>,
8590
8591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8592}
8593
8594impl TrafficSplit {
8595 pub fn new() -> Self {
8596 std::default::Default::default()
8597 }
8598
8599 /// Sets the value of [shard_by][crate::model::TrafficSplit::shard_by].
8600 ///
8601 /// # Example
8602 /// ```ignore,no_run
8603 /// # use google_cloud_appengine_v1::model::TrafficSplit;
8604 /// use google_cloud_appengine_v1::model::traffic_split::ShardBy;
8605 /// let x0 = TrafficSplit::new().set_shard_by(ShardBy::Cookie);
8606 /// let x1 = TrafficSplit::new().set_shard_by(ShardBy::Ip);
8607 /// let x2 = TrafficSplit::new().set_shard_by(ShardBy::Random);
8608 /// ```
8609 pub fn set_shard_by<T: std::convert::Into<crate::model::traffic_split::ShardBy>>(
8610 mut self,
8611 v: T,
8612 ) -> Self {
8613 self.shard_by = v.into();
8614 self
8615 }
8616
8617 /// Sets the value of [allocations][crate::model::TrafficSplit::allocations].
8618 ///
8619 /// # Example
8620 /// ```ignore,no_run
8621 /// # use google_cloud_appengine_v1::model::TrafficSplit;
8622 /// let x = TrafficSplit::new().set_allocations([
8623 /// ("key0", 123.5),
8624 /// ("key1", 456.5),
8625 /// ]);
8626 /// ```
8627 pub fn set_allocations<T, K, V>(mut self, v: T) -> Self
8628 where
8629 T: std::iter::IntoIterator<Item = (K, V)>,
8630 K: std::convert::Into<std::string::String>,
8631 V: std::convert::Into<f64>,
8632 {
8633 use std::iter::Iterator;
8634 self.allocations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8635 self
8636 }
8637}
8638
8639impl wkt::message::Message for TrafficSplit {
8640 fn typename() -> &'static str {
8641 "type.googleapis.com/google.appengine.v1.TrafficSplit"
8642 }
8643}
8644
8645/// Defines additional types related to [TrafficSplit].
8646pub mod traffic_split {
8647 #[allow(unused_imports)]
8648 use super::*;
8649
8650 /// Available sharding mechanisms.
8651 ///
8652 /// # Working with unknown values
8653 ///
8654 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8655 /// additional enum variants at any time. Adding new variants is not considered
8656 /// a breaking change. Applications should write their code in anticipation of:
8657 ///
8658 /// - New values appearing in future releases of the client library, **and**
8659 /// - New values received dynamically, without application changes.
8660 ///
8661 /// Please consult the [Working with enums] section in the user guide for some
8662 /// guidelines.
8663 ///
8664 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8665 #[derive(Clone, Debug, PartialEq)]
8666 #[non_exhaustive]
8667 pub enum ShardBy {
8668 /// Diversion method unspecified.
8669 Unspecified,
8670 /// Diversion based on a specially named cookie, "GOOGAPPUID." The cookie
8671 /// must be set by the application itself or no diversion will occur.
8672 Cookie,
8673 /// Diversion based on applying the modulus operation to a fingerprint
8674 /// of the IP address.
8675 Ip,
8676 /// Diversion based on weighted random assignment. An incoming request is
8677 /// randomly routed to a version in the traffic split, with probability
8678 /// proportional to the version's traffic share.
8679 Random,
8680 /// If set, the enum was initialized with an unknown value.
8681 ///
8682 /// Applications can examine the value using [ShardBy::value] or
8683 /// [ShardBy::name].
8684 UnknownValue(shard_by::UnknownValue),
8685 }
8686
8687 #[doc(hidden)]
8688 pub mod shard_by {
8689 #[allow(unused_imports)]
8690 use super::*;
8691 #[derive(Clone, Debug, PartialEq)]
8692 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8693 }
8694
8695 impl ShardBy {
8696 /// Gets the enum value.
8697 ///
8698 /// Returns `None` if the enum contains an unknown value deserialized from
8699 /// the string representation of enums.
8700 pub fn value(&self) -> std::option::Option<i32> {
8701 match self {
8702 Self::Unspecified => std::option::Option::Some(0),
8703 Self::Cookie => std::option::Option::Some(1),
8704 Self::Ip => std::option::Option::Some(2),
8705 Self::Random => std::option::Option::Some(3),
8706 Self::UnknownValue(u) => u.0.value(),
8707 }
8708 }
8709
8710 /// Gets the enum value as a string.
8711 ///
8712 /// Returns `None` if the enum contains an unknown value deserialized from
8713 /// the integer representation of enums.
8714 pub fn name(&self) -> std::option::Option<&str> {
8715 match self {
8716 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
8717 Self::Cookie => std::option::Option::Some("COOKIE"),
8718 Self::Ip => std::option::Option::Some("IP"),
8719 Self::Random => std::option::Option::Some("RANDOM"),
8720 Self::UnknownValue(u) => u.0.name(),
8721 }
8722 }
8723 }
8724
8725 impl std::default::Default for ShardBy {
8726 fn default() -> Self {
8727 use std::convert::From;
8728 Self::from(0)
8729 }
8730 }
8731
8732 impl std::fmt::Display for ShardBy {
8733 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8734 wkt::internal::display_enum(f, self.name(), self.value())
8735 }
8736 }
8737
8738 impl std::convert::From<i32> for ShardBy {
8739 fn from(value: i32) -> Self {
8740 match value {
8741 0 => Self::Unspecified,
8742 1 => Self::Cookie,
8743 2 => Self::Ip,
8744 3 => Self::Random,
8745 _ => Self::UnknownValue(shard_by::UnknownValue(
8746 wkt::internal::UnknownEnumValue::Integer(value),
8747 )),
8748 }
8749 }
8750 }
8751
8752 impl std::convert::From<&str> for ShardBy {
8753 fn from(value: &str) -> Self {
8754 use std::string::ToString;
8755 match value {
8756 "UNSPECIFIED" => Self::Unspecified,
8757 "COOKIE" => Self::Cookie,
8758 "IP" => Self::Ip,
8759 "RANDOM" => Self::Random,
8760 _ => Self::UnknownValue(shard_by::UnknownValue(
8761 wkt::internal::UnknownEnumValue::String(value.to_string()),
8762 )),
8763 }
8764 }
8765 }
8766
8767 impl serde::ser::Serialize for ShardBy {
8768 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8769 where
8770 S: serde::Serializer,
8771 {
8772 match self {
8773 Self::Unspecified => serializer.serialize_i32(0),
8774 Self::Cookie => serializer.serialize_i32(1),
8775 Self::Ip => serializer.serialize_i32(2),
8776 Self::Random => serializer.serialize_i32(3),
8777 Self::UnknownValue(u) => u.0.serialize(serializer),
8778 }
8779 }
8780 }
8781
8782 impl<'de> serde::de::Deserialize<'de> for ShardBy {
8783 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8784 where
8785 D: serde::Deserializer<'de>,
8786 {
8787 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ShardBy>::new(
8788 ".google.appengine.v1.TrafficSplit.ShardBy",
8789 ))
8790 }
8791 }
8792}
8793
8794/// A Version resource is a specific set of source code and configuration files
8795/// that are deployed into a service.
8796#[derive(Clone, Default, PartialEq)]
8797#[non_exhaustive]
8798pub struct Version {
8799 /// Full path to the Version resource in the API. Example:
8800 /// `apps/myapp/services/default/versions/v1`.
8801 ///
8802 /// @OutputOnly
8803 pub name: std::string::String,
8804
8805 /// Relative name of the version within the service. Example: `v1`.
8806 /// Version names can contain only lowercase letters, numbers, or hyphens.
8807 /// Reserved names: "default", "latest", and any name with the prefix "ah-".
8808 pub id: std::string::String,
8809
8810 /// Before an application can receive email or XMPP messages, the application
8811 /// must be configured to enable the service.
8812 pub inbound_services: std::vec::Vec<crate::model::InboundServiceType>,
8813
8814 /// Instance class that is used to run this version. Valid values are:
8815 ///
8816 /// * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G`
8817 /// * ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
8818 ///
8819 /// Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
8820 /// BasicScaling.
8821 pub instance_class: std::string::String,
8822
8823 /// Extra network settings.
8824 /// Only applicable in the App Engine flexible environment.
8825 pub network: std::option::Option<crate::model::Network>,
8826
8827 /// The Google Compute Engine zones that are supported by this version in the
8828 /// App Engine flexible environment. Deprecated.
8829 pub zones: std::vec::Vec<std::string::String>,
8830
8831 /// Machine resources for this version.
8832 /// Only applicable in the App Engine flexible environment.
8833 pub resources: std::option::Option<crate::model::Resources>,
8834
8835 /// Desired runtime. Example: `python27`.
8836 pub runtime: std::string::String,
8837
8838 /// The channel of the runtime to use. Only available for some
8839 /// runtimes. Defaults to the `default` channel.
8840 pub runtime_channel: std::string::String,
8841
8842 /// Whether multiple requests can be dispatched to this version at once.
8843 pub threadsafe: bool,
8844
8845 /// Whether to deploy this version in a container on a virtual machine.
8846 pub vm: bool,
8847
8848 /// Allows App Engine second generation runtimes to access the legacy bundled
8849 /// services.
8850 pub app_engine_apis: bool,
8851
8852 /// Metadata settings that are supplied to this version to enable
8853 /// beta runtime features.
8854 pub beta_settings: std::collections::HashMap<std::string::String, std::string::String>,
8855
8856 /// App Engine execution environment for this version.
8857 ///
8858 /// Defaults to `standard`.
8859 pub env: std::string::String,
8860
8861 /// Current serving status of this version. Only the versions with a
8862 /// `SERVING` status create instances and can be billed.
8863 ///
8864 /// `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to `SERVING`.
8865 pub serving_status: crate::model::ServingStatus,
8866
8867 /// Email address of the user who created this version.
8868 ///
8869 /// @OutputOnly
8870 pub created_by: std::string::String,
8871
8872 /// Time that this version was created.
8873 ///
8874 /// @OutputOnly
8875 pub create_time: std::option::Option<wkt::Timestamp>,
8876
8877 /// Total size in bytes of all the files that are included in this version
8878 /// and currently hosted on the App Engine disk.
8879 ///
8880 /// @OutputOnly
8881 pub disk_usage_bytes: i64,
8882
8883 /// The version of the API in the given runtime environment. Please see the
8884 /// app.yaml reference for valid values at
8885 /// <https://cloud.google.com/appengine/docs/standard/>\<language\>/config/appref
8886 pub runtime_api_version: std::string::String,
8887
8888 /// The path or name of the app's main executable.
8889 pub runtime_main_executable_path: std::string::String,
8890
8891 /// The identity that the deployed version will run as.
8892 /// Admin API will use the App Engine Appspot service account as default if
8893 /// this field is neither provided in app.yaml file nor through CLI flag.
8894 pub service_account: std::string::String,
8895
8896 /// An ordered list of URL-matching patterns that should be applied to incoming
8897 /// requests. The first matching URL handles the request and other request
8898 /// handlers are not attempted.
8899 ///
8900 /// Only returned in `GET` requests if `view=FULL` is set.
8901 pub handlers: std::vec::Vec<crate::model::UrlMap>,
8902
8903 /// Custom static error pages. Limited to 10KB per page.
8904 ///
8905 /// Only returned in `GET` requests if `view=FULL` is set.
8906 pub error_handlers: std::vec::Vec<crate::model::ErrorHandler>,
8907
8908 /// Configuration for third-party Python runtime libraries that are required
8909 /// by the application.
8910 ///
8911 /// Only returned in `GET` requests if `view=FULL` is set.
8912 pub libraries: std::vec::Vec<crate::model::Library>,
8913
8914 /// Serving configuration for
8915 /// [Google Cloud Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
8916 ///
8917 /// Only returned in `GET` requests if `view=FULL` is set.
8918 pub api_config: std::option::Option<crate::model::ApiConfigHandler>,
8919
8920 /// Environment variables available to the application.
8921 ///
8922 /// Only returned in `GET` requests if `view=FULL` is set.
8923 pub env_variables: std::collections::HashMap<std::string::String, std::string::String>,
8924
8925 /// Environment variables available to the build environment.
8926 ///
8927 /// Only returned in `GET` requests if `view=FULL` is set.
8928 pub build_env_variables: std::collections::HashMap<std::string::String, std::string::String>,
8929
8930 /// Duration that static files should be cached by web proxies and browsers.
8931 /// Only applicable if the corresponding
8932 /// [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StaticFilesHandler)
8933 /// does not specify its own expiration time.
8934 ///
8935 /// Only returned in `GET` requests if `view=FULL` is set.
8936 pub default_expiration: std::option::Option<wkt::Duration>,
8937
8938 /// Configures health checking for instances. Unhealthy instances are
8939 /// stopped and replaced with new instances.
8940 /// Only applicable in the App Engine flexible environment.
8941 ///
8942 /// Only returned in `GET` requests if `view=FULL` is set.
8943 pub health_check: std::option::Option<crate::model::HealthCheck>,
8944
8945 /// Configures readiness health checking for instances.
8946 /// Unhealthy instances are not put into the backend traffic rotation.
8947 ///
8948 /// Only returned in `GET` requests if `view=FULL` is set.
8949 pub readiness_check: std::option::Option<crate::model::ReadinessCheck>,
8950
8951 /// Configures liveness health checking for instances.
8952 /// Unhealthy instances are stopped and replaced with new instances
8953 ///
8954 /// Only returned in `GET` requests if `view=FULL` is set.
8955 pub liveness_check: std::option::Option<crate::model::LivenessCheck>,
8956
8957 /// Files that match this pattern will not be built into this version.
8958 /// Only applicable for Go runtimes.
8959 ///
8960 /// Only returned in `GET` requests if `view=FULL` is set.
8961 pub nobuild_files_regex: std::string::String,
8962
8963 /// Code and application artifacts that make up this version.
8964 ///
8965 /// Only returned in `GET` requests if `view=FULL` is set.
8966 pub deployment: std::option::Option<crate::model::Deployment>,
8967
8968 /// Serving URL for this version. Example:
8969 /// `https://myversion-dot-myservice-dot-myapp.appspot.com`
8970 ///
8971 /// @OutputOnly
8972 pub version_url: std::string::String,
8973
8974 /// Cloud Endpoints configuration.
8975 ///
8976 /// If endpoints_api_service is set, the Cloud Endpoints Extensible Service
8977 /// Proxy will be provided to serve the API implemented by the app.
8978 pub endpoints_api_service: std::option::Option<crate::model::EndpointsApiService>,
8979
8980 /// The entrypoint for the application.
8981 pub entrypoint: std::option::Option<crate::model::Entrypoint>,
8982
8983 /// Enables VPC connectivity for standard apps.
8984 pub vpc_access_connector: std::option::Option<crate::model::VpcAccessConnector>,
8985
8986 /// Controls how instances are created, scaled, and reaped.
8987 ///
8988 /// Defaults to `AutomaticScaling`.
8989 pub scaling: std::option::Option<crate::model::version::Scaling>,
8990
8991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8992}
8993
8994impl Version {
8995 pub fn new() -> Self {
8996 std::default::Default::default()
8997 }
8998
8999 /// Sets the value of [name][crate::model::Version::name].
9000 ///
9001 /// # Example
9002 /// ```ignore,no_run
9003 /// # use google_cloud_appengine_v1::model::Version;
9004 /// let x = Version::new().set_name("example");
9005 /// ```
9006 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9007 self.name = v.into();
9008 self
9009 }
9010
9011 /// Sets the value of [id][crate::model::Version::id].
9012 ///
9013 /// # Example
9014 /// ```ignore,no_run
9015 /// # use google_cloud_appengine_v1::model::Version;
9016 /// let x = Version::new().set_id("example");
9017 /// ```
9018 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9019 self.id = v.into();
9020 self
9021 }
9022
9023 /// Sets the value of [inbound_services][crate::model::Version::inbound_services].
9024 ///
9025 /// # Example
9026 /// ```ignore,no_run
9027 /// # use google_cloud_appengine_v1::model::Version;
9028 /// use google_cloud_appengine_v1::model::InboundServiceType;
9029 /// let x = Version::new().set_inbound_services([
9030 /// InboundServiceType::InboundServiceMail,
9031 /// InboundServiceType::InboundServiceMailBounce,
9032 /// InboundServiceType::InboundServiceXmppError,
9033 /// ]);
9034 /// ```
9035 pub fn set_inbound_services<T, V>(mut self, v: T) -> Self
9036 where
9037 T: std::iter::IntoIterator<Item = V>,
9038 V: std::convert::Into<crate::model::InboundServiceType>,
9039 {
9040 use std::iter::Iterator;
9041 self.inbound_services = v.into_iter().map(|i| i.into()).collect();
9042 self
9043 }
9044
9045 /// Sets the value of [instance_class][crate::model::Version::instance_class].
9046 ///
9047 /// # Example
9048 /// ```ignore,no_run
9049 /// # use google_cloud_appengine_v1::model::Version;
9050 /// let x = Version::new().set_instance_class("example");
9051 /// ```
9052 pub fn set_instance_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9053 self.instance_class = v.into();
9054 self
9055 }
9056
9057 /// Sets the value of [network][crate::model::Version::network].
9058 ///
9059 /// # Example
9060 /// ```ignore,no_run
9061 /// # use google_cloud_appengine_v1::model::Version;
9062 /// use google_cloud_appengine_v1::model::Network;
9063 /// let x = Version::new().set_network(Network::default()/* use setters */);
9064 /// ```
9065 pub fn set_network<T>(mut self, v: T) -> Self
9066 where
9067 T: std::convert::Into<crate::model::Network>,
9068 {
9069 self.network = std::option::Option::Some(v.into());
9070 self
9071 }
9072
9073 /// Sets or clears the value of [network][crate::model::Version::network].
9074 ///
9075 /// # Example
9076 /// ```ignore,no_run
9077 /// # use google_cloud_appengine_v1::model::Version;
9078 /// use google_cloud_appengine_v1::model::Network;
9079 /// let x = Version::new().set_or_clear_network(Some(Network::default()/* use setters */));
9080 /// let x = Version::new().set_or_clear_network(None::<Network>);
9081 /// ```
9082 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
9083 where
9084 T: std::convert::Into<crate::model::Network>,
9085 {
9086 self.network = v.map(|x| x.into());
9087 self
9088 }
9089
9090 /// Sets the value of [zones][crate::model::Version::zones].
9091 ///
9092 /// # Example
9093 /// ```ignore,no_run
9094 /// # use google_cloud_appengine_v1::model::Version;
9095 /// let x = Version::new().set_zones(["a", "b", "c"]);
9096 /// ```
9097 pub fn set_zones<T, V>(mut self, v: T) -> Self
9098 where
9099 T: std::iter::IntoIterator<Item = V>,
9100 V: std::convert::Into<std::string::String>,
9101 {
9102 use std::iter::Iterator;
9103 self.zones = v.into_iter().map(|i| i.into()).collect();
9104 self
9105 }
9106
9107 /// Sets the value of [resources][crate::model::Version::resources].
9108 ///
9109 /// # Example
9110 /// ```ignore,no_run
9111 /// # use google_cloud_appengine_v1::model::Version;
9112 /// use google_cloud_appengine_v1::model::Resources;
9113 /// let x = Version::new().set_resources(Resources::default()/* use setters */);
9114 /// ```
9115 pub fn set_resources<T>(mut self, v: T) -> Self
9116 where
9117 T: std::convert::Into<crate::model::Resources>,
9118 {
9119 self.resources = std::option::Option::Some(v.into());
9120 self
9121 }
9122
9123 /// Sets or clears the value of [resources][crate::model::Version::resources].
9124 ///
9125 /// # Example
9126 /// ```ignore,no_run
9127 /// # use google_cloud_appengine_v1::model::Version;
9128 /// use google_cloud_appengine_v1::model::Resources;
9129 /// let x = Version::new().set_or_clear_resources(Some(Resources::default()/* use setters */));
9130 /// let x = Version::new().set_or_clear_resources(None::<Resources>);
9131 /// ```
9132 pub fn set_or_clear_resources<T>(mut self, v: std::option::Option<T>) -> Self
9133 where
9134 T: std::convert::Into<crate::model::Resources>,
9135 {
9136 self.resources = v.map(|x| x.into());
9137 self
9138 }
9139
9140 /// Sets the value of [runtime][crate::model::Version::runtime].
9141 ///
9142 /// # Example
9143 /// ```ignore,no_run
9144 /// # use google_cloud_appengine_v1::model::Version;
9145 /// let x = Version::new().set_runtime("example");
9146 /// ```
9147 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9148 self.runtime = v.into();
9149 self
9150 }
9151
9152 /// Sets the value of [runtime_channel][crate::model::Version::runtime_channel].
9153 ///
9154 /// # Example
9155 /// ```ignore,no_run
9156 /// # use google_cloud_appengine_v1::model::Version;
9157 /// let x = Version::new().set_runtime_channel("example");
9158 /// ```
9159 pub fn set_runtime_channel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9160 self.runtime_channel = v.into();
9161 self
9162 }
9163
9164 /// Sets the value of [threadsafe][crate::model::Version::threadsafe].
9165 ///
9166 /// # Example
9167 /// ```ignore,no_run
9168 /// # use google_cloud_appengine_v1::model::Version;
9169 /// let x = Version::new().set_threadsafe(true);
9170 /// ```
9171 pub fn set_threadsafe<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9172 self.threadsafe = v.into();
9173 self
9174 }
9175
9176 /// Sets the value of [vm][crate::model::Version::vm].
9177 ///
9178 /// # Example
9179 /// ```ignore,no_run
9180 /// # use google_cloud_appengine_v1::model::Version;
9181 /// let x = Version::new().set_vm(true);
9182 /// ```
9183 pub fn set_vm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9184 self.vm = v.into();
9185 self
9186 }
9187
9188 /// Sets the value of [app_engine_apis][crate::model::Version::app_engine_apis].
9189 ///
9190 /// # Example
9191 /// ```ignore,no_run
9192 /// # use google_cloud_appengine_v1::model::Version;
9193 /// let x = Version::new().set_app_engine_apis(true);
9194 /// ```
9195 pub fn set_app_engine_apis<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9196 self.app_engine_apis = v.into();
9197 self
9198 }
9199
9200 /// Sets the value of [beta_settings][crate::model::Version::beta_settings].
9201 ///
9202 /// # Example
9203 /// ```ignore,no_run
9204 /// # use google_cloud_appengine_v1::model::Version;
9205 /// let x = Version::new().set_beta_settings([
9206 /// ("key0", "abc"),
9207 /// ("key1", "xyz"),
9208 /// ]);
9209 /// ```
9210 pub fn set_beta_settings<T, K, V>(mut self, v: T) -> Self
9211 where
9212 T: std::iter::IntoIterator<Item = (K, V)>,
9213 K: std::convert::Into<std::string::String>,
9214 V: std::convert::Into<std::string::String>,
9215 {
9216 use std::iter::Iterator;
9217 self.beta_settings = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9218 self
9219 }
9220
9221 /// Sets the value of [env][crate::model::Version::env].
9222 ///
9223 /// # Example
9224 /// ```ignore,no_run
9225 /// # use google_cloud_appengine_v1::model::Version;
9226 /// let x = Version::new().set_env("example");
9227 /// ```
9228 pub fn set_env<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9229 self.env = v.into();
9230 self
9231 }
9232
9233 /// Sets the value of [serving_status][crate::model::Version::serving_status].
9234 ///
9235 /// # Example
9236 /// ```ignore,no_run
9237 /// # use google_cloud_appengine_v1::model::Version;
9238 /// use google_cloud_appengine_v1::model::ServingStatus;
9239 /// let x0 = Version::new().set_serving_status(ServingStatus::Serving);
9240 /// let x1 = Version::new().set_serving_status(ServingStatus::Stopped);
9241 /// ```
9242 pub fn set_serving_status<T: std::convert::Into<crate::model::ServingStatus>>(
9243 mut self,
9244 v: T,
9245 ) -> Self {
9246 self.serving_status = v.into();
9247 self
9248 }
9249
9250 /// Sets the value of [created_by][crate::model::Version::created_by].
9251 ///
9252 /// # Example
9253 /// ```ignore,no_run
9254 /// # use google_cloud_appengine_v1::model::Version;
9255 /// let x = Version::new().set_created_by("example");
9256 /// ```
9257 pub fn set_created_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9258 self.created_by = v.into();
9259 self
9260 }
9261
9262 /// Sets the value of [create_time][crate::model::Version::create_time].
9263 ///
9264 /// # Example
9265 /// ```ignore,no_run
9266 /// # use google_cloud_appengine_v1::model::Version;
9267 /// use wkt::Timestamp;
9268 /// let x = Version::new().set_create_time(Timestamp::default()/* use setters */);
9269 /// ```
9270 pub fn set_create_time<T>(mut self, v: T) -> Self
9271 where
9272 T: std::convert::Into<wkt::Timestamp>,
9273 {
9274 self.create_time = std::option::Option::Some(v.into());
9275 self
9276 }
9277
9278 /// Sets or clears the value of [create_time][crate::model::Version::create_time].
9279 ///
9280 /// # Example
9281 /// ```ignore,no_run
9282 /// # use google_cloud_appengine_v1::model::Version;
9283 /// use wkt::Timestamp;
9284 /// let x = Version::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9285 /// let x = Version::new().set_or_clear_create_time(None::<Timestamp>);
9286 /// ```
9287 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9288 where
9289 T: std::convert::Into<wkt::Timestamp>,
9290 {
9291 self.create_time = v.map(|x| x.into());
9292 self
9293 }
9294
9295 /// Sets the value of [disk_usage_bytes][crate::model::Version::disk_usage_bytes].
9296 ///
9297 /// # Example
9298 /// ```ignore,no_run
9299 /// # use google_cloud_appengine_v1::model::Version;
9300 /// let x = Version::new().set_disk_usage_bytes(42);
9301 /// ```
9302 pub fn set_disk_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9303 self.disk_usage_bytes = v.into();
9304 self
9305 }
9306
9307 /// Sets the value of [runtime_api_version][crate::model::Version::runtime_api_version].
9308 ///
9309 /// # Example
9310 /// ```ignore,no_run
9311 /// # use google_cloud_appengine_v1::model::Version;
9312 /// let x = Version::new().set_runtime_api_version("example");
9313 /// ```
9314 pub fn set_runtime_api_version<T: std::convert::Into<std::string::String>>(
9315 mut self,
9316 v: T,
9317 ) -> Self {
9318 self.runtime_api_version = v.into();
9319 self
9320 }
9321
9322 /// Sets the value of [runtime_main_executable_path][crate::model::Version::runtime_main_executable_path].
9323 ///
9324 /// # Example
9325 /// ```ignore,no_run
9326 /// # use google_cloud_appengine_v1::model::Version;
9327 /// let x = Version::new().set_runtime_main_executable_path("example");
9328 /// ```
9329 pub fn set_runtime_main_executable_path<T: std::convert::Into<std::string::String>>(
9330 mut self,
9331 v: T,
9332 ) -> Self {
9333 self.runtime_main_executable_path = v.into();
9334 self
9335 }
9336
9337 /// Sets the value of [service_account][crate::model::Version::service_account].
9338 ///
9339 /// # Example
9340 /// ```ignore,no_run
9341 /// # use google_cloud_appengine_v1::model::Version;
9342 /// let x = Version::new().set_service_account("example");
9343 /// ```
9344 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9345 self.service_account = v.into();
9346 self
9347 }
9348
9349 /// Sets the value of [handlers][crate::model::Version::handlers].
9350 ///
9351 /// # Example
9352 /// ```ignore,no_run
9353 /// # use google_cloud_appengine_v1::model::Version;
9354 /// use google_cloud_appengine_v1::model::UrlMap;
9355 /// let x = Version::new()
9356 /// .set_handlers([
9357 /// UrlMap::default()/* use setters */,
9358 /// UrlMap::default()/* use (different) setters */,
9359 /// ]);
9360 /// ```
9361 pub fn set_handlers<T, V>(mut self, v: T) -> Self
9362 where
9363 T: std::iter::IntoIterator<Item = V>,
9364 V: std::convert::Into<crate::model::UrlMap>,
9365 {
9366 use std::iter::Iterator;
9367 self.handlers = v.into_iter().map(|i| i.into()).collect();
9368 self
9369 }
9370
9371 /// Sets the value of [error_handlers][crate::model::Version::error_handlers].
9372 ///
9373 /// # Example
9374 /// ```ignore,no_run
9375 /// # use google_cloud_appengine_v1::model::Version;
9376 /// use google_cloud_appengine_v1::model::ErrorHandler;
9377 /// let x = Version::new()
9378 /// .set_error_handlers([
9379 /// ErrorHandler::default()/* use setters */,
9380 /// ErrorHandler::default()/* use (different) setters */,
9381 /// ]);
9382 /// ```
9383 pub fn set_error_handlers<T, V>(mut self, v: T) -> Self
9384 where
9385 T: std::iter::IntoIterator<Item = V>,
9386 V: std::convert::Into<crate::model::ErrorHandler>,
9387 {
9388 use std::iter::Iterator;
9389 self.error_handlers = v.into_iter().map(|i| i.into()).collect();
9390 self
9391 }
9392
9393 /// Sets the value of [libraries][crate::model::Version::libraries].
9394 ///
9395 /// # Example
9396 /// ```ignore,no_run
9397 /// # use google_cloud_appengine_v1::model::Version;
9398 /// use google_cloud_appengine_v1::model::Library;
9399 /// let x = Version::new()
9400 /// .set_libraries([
9401 /// Library::default()/* use setters */,
9402 /// Library::default()/* use (different) setters */,
9403 /// ]);
9404 /// ```
9405 pub fn set_libraries<T, V>(mut self, v: T) -> Self
9406 where
9407 T: std::iter::IntoIterator<Item = V>,
9408 V: std::convert::Into<crate::model::Library>,
9409 {
9410 use std::iter::Iterator;
9411 self.libraries = v.into_iter().map(|i| i.into()).collect();
9412 self
9413 }
9414
9415 /// Sets the value of [api_config][crate::model::Version::api_config].
9416 ///
9417 /// # Example
9418 /// ```ignore,no_run
9419 /// # use google_cloud_appengine_v1::model::Version;
9420 /// use google_cloud_appengine_v1::model::ApiConfigHandler;
9421 /// let x = Version::new().set_api_config(ApiConfigHandler::default()/* use setters */);
9422 /// ```
9423 pub fn set_api_config<T>(mut self, v: T) -> Self
9424 where
9425 T: std::convert::Into<crate::model::ApiConfigHandler>,
9426 {
9427 self.api_config = std::option::Option::Some(v.into());
9428 self
9429 }
9430
9431 /// Sets or clears the value of [api_config][crate::model::Version::api_config].
9432 ///
9433 /// # Example
9434 /// ```ignore,no_run
9435 /// # use google_cloud_appengine_v1::model::Version;
9436 /// use google_cloud_appengine_v1::model::ApiConfigHandler;
9437 /// let x = Version::new().set_or_clear_api_config(Some(ApiConfigHandler::default()/* use setters */));
9438 /// let x = Version::new().set_or_clear_api_config(None::<ApiConfigHandler>);
9439 /// ```
9440 pub fn set_or_clear_api_config<T>(mut self, v: std::option::Option<T>) -> Self
9441 where
9442 T: std::convert::Into<crate::model::ApiConfigHandler>,
9443 {
9444 self.api_config = v.map(|x| x.into());
9445 self
9446 }
9447
9448 /// Sets the value of [env_variables][crate::model::Version::env_variables].
9449 ///
9450 /// # Example
9451 /// ```ignore,no_run
9452 /// # use google_cloud_appengine_v1::model::Version;
9453 /// let x = Version::new().set_env_variables([
9454 /// ("key0", "abc"),
9455 /// ("key1", "xyz"),
9456 /// ]);
9457 /// ```
9458 pub fn set_env_variables<T, K, V>(mut self, v: T) -> Self
9459 where
9460 T: std::iter::IntoIterator<Item = (K, V)>,
9461 K: std::convert::Into<std::string::String>,
9462 V: std::convert::Into<std::string::String>,
9463 {
9464 use std::iter::Iterator;
9465 self.env_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9466 self
9467 }
9468
9469 /// Sets the value of [build_env_variables][crate::model::Version::build_env_variables].
9470 ///
9471 /// # Example
9472 /// ```ignore,no_run
9473 /// # use google_cloud_appengine_v1::model::Version;
9474 /// let x = Version::new().set_build_env_variables([
9475 /// ("key0", "abc"),
9476 /// ("key1", "xyz"),
9477 /// ]);
9478 /// ```
9479 pub fn set_build_env_variables<T, K, V>(mut self, v: T) -> Self
9480 where
9481 T: std::iter::IntoIterator<Item = (K, V)>,
9482 K: std::convert::Into<std::string::String>,
9483 V: std::convert::Into<std::string::String>,
9484 {
9485 use std::iter::Iterator;
9486 self.build_env_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9487 self
9488 }
9489
9490 /// Sets the value of [default_expiration][crate::model::Version::default_expiration].
9491 ///
9492 /// # Example
9493 /// ```ignore,no_run
9494 /// # use google_cloud_appengine_v1::model::Version;
9495 /// use wkt::Duration;
9496 /// let x = Version::new().set_default_expiration(Duration::default()/* use setters */);
9497 /// ```
9498 pub fn set_default_expiration<T>(mut self, v: T) -> Self
9499 where
9500 T: std::convert::Into<wkt::Duration>,
9501 {
9502 self.default_expiration = std::option::Option::Some(v.into());
9503 self
9504 }
9505
9506 /// Sets or clears the value of [default_expiration][crate::model::Version::default_expiration].
9507 ///
9508 /// # Example
9509 /// ```ignore,no_run
9510 /// # use google_cloud_appengine_v1::model::Version;
9511 /// use wkt::Duration;
9512 /// let x = Version::new().set_or_clear_default_expiration(Some(Duration::default()/* use setters */));
9513 /// let x = Version::new().set_or_clear_default_expiration(None::<Duration>);
9514 /// ```
9515 pub fn set_or_clear_default_expiration<T>(mut self, v: std::option::Option<T>) -> Self
9516 where
9517 T: std::convert::Into<wkt::Duration>,
9518 {
9519 self.default_expiration = v.map(|x| x.into());
9520 self
9521 }
9522
9523 /// Sets the value of [health_check][crate::model::Version::health_check].
9524 ///
9525 /// # Example
9526 /// ```ignore,no_run
9527 /// # use google_cloud_appengine_v1::model::Version;
9528 /// use google_cloud_appengine_v1::model::HealthCheck;
9529 /// let x = Version::new().set_health_check(HealthCheck::default()/* use setters */);
9530 /// ```
9531 pub fn set_health_check<T>(mut self, v: T) -> Self
9532 where
9533 T: std::convert::Into<crate::model::HealthCheck>,
9534 {
9535 self.health_check = std::option::Option::Some(v.into());
9536 self
9537 }
9538
9539 /// Sets or clears the value of [health_check][crate::model::Version::health_check].
9540 ///
9541 /// # Example
9542 /// ```ignore,no_run
9543 /// # use google_cloud_appengine_v1::model::Version;
9544 /// use google_cloud_appengine_v1::model::HealthCheck;
9545 /// let x = Version::new().set_or_clear_health_check(Some(HealthCheck::default()/* use setters */));
9546 /// let x = Version::new().set_or_clear_health_check(None::<HealthCheck>);
9547 /// ```
9548 pub fn set_or_clear_health_check<T>(mut self, v: std::option::Option<T>) -> Self
9549 where
9550 T: std::convert::Into<crate::model::HealthCheck>,
9551 {
9552 self.health_check = v.map(|x| x.into());
9553 self
9554 }
9555
9556 /// Sets the value of [readiness_check][crate::model::Version::readiness_check].
9557 ///
9558 /// # Example
9559 /// ```ignore,no_run
9560 /// # use google_cloud_appengine_v1::model::Version;
9561 /// use google_cloud_appengine_v1::model::ReadinessCheck;
9562 /// let x = Version::new().set_readiness_check(ReadinessCheck::default()/* use setters */);
9563 /// ```
9564 pub fn set_readiness_check<T>(mut self, v: T) -> Self
9565 where
9566 T: std::convert::Into<crate::model::ReadinessCheck>,
9567 {
9568 self.readiness_check = std::option::Option::Some(v.into());
9569 self
9570 }
9571
9572 /// Sets or clears the value of [readiness_check][crate::model::Version::readiness_check].
9573 ///
9574 /// # Example
9575 /// ```ignore,no_run
9576 /// # use google_cloud_appengine_v1::model::Version;
9577 /// use google_cloud_appengine_v1::model::ReadinessCheck;
9578 /// let x = Version::new().set_or_clear_readiness_check(Some(ReadinessCheck::default()/* use setters */));
9579 /// let x = Version::new().set_or_clear_readiness_check(None::<ReadinessCheck>);
9580 /// ```
9581 pub fn set_or_clear_readiness_check<T>(mut self, v: std::option::Option<T>) -> Self
9582 where
9583 T: std::convert::Into<crate::model::ReadinessCheck>,
9584 {
9585 self.readiness_check = v.map(|x| x.into());
9586 self
9587 }
9588
9589 /// Sets the value of [liveness_check][crate::model::Version::liveness_check].
9590 ///
9591 /// # Example
9592 /// ```ignore,no_run
9593 /// # use google_cloud_appengine_v1::model::Version;
9594 /// use google_cloud_appengine_v1::model::LivenessCheck;
9595 /// let x = Version::new().set_liveness_check(LivenessCheck::default()/* use setters */);
9596 /// ```
9597 pub fn set_liveness_check<T>(mut self, v: T) -> Self
9598 where
9599 T: std::convert::Into<crate::model::LivenessCheck>,
9600 {
9601 self.liveness_check = std::option::Option::Some(v.into());
9602 self
9603 }
9604
9605 /// Sets or clears the value of [liveness_check][crate::model::Version::liveness_check].
9606 ///
9607 /// # Example
9608 /// ```ignore,no_run
9609 /// # use google_cloud_appengine_v1::model::Version;
9610 /// use google_cloud_appengine_v1::model::LivenessCheck;
9611 /// let x = Version::new().set_or_clear_liveness_check(Some(LivenessCheck::default()/* use setters */));
9612 /// let x = Version::new().set_or_clear_liveness_check(None::<LivenessCheck>);
9613 /// ```
9614 pub fn set_or_clear_liveness_check<T>(mut self, v: std::option::Option<T>) -> Self
9615 where
9616 T: std::convert::Into<crate::model::LivenessCheck>,
9617 {
9618 self.liveness_check = v.map(|x| x.into());
9619 self
9620 }
9621
9622 /// Sets the value of [nobuild_files_regex][crate::model::Version::nobuild_files_regex].
9623 ///
9624 /// # Example
9625 /// ```ignore,no_run
9626 /// # use google_cloud_appengine_v1::model::Version;
9627 /// let x = Version::new().set_nobuild_files_regex("example");
9628 /// ```
9629 pub fn set_nobuild_files_regex<T: std::convert::Into<std::string::String>>(
9630 mut self,
9631 v: T,
9632 ) -> Self {
9633 self.nobuild_files_regex = v.into();
9634 self
9635 }
9636
9637 /// Sets the value of [deployment][crate::model::Version::deployment].
9638 ///
9639 /// # Example
9640 /// ```ignore,no_run
9641 /// # use google_cloud_appengine_v1::model::Version;
9642 /// use google_cloud_appengine_v1::model::Deployment;
9643 /// let x = Version::new().set_deployment(Deployment::default()/* use setters */);
9644 /// ```
9645 pub fn set_deployment<T>(mut self, v: T) -> Self
9646 where
9647 T: std::convert::Into<crate::model::Deployment>,
9648 {
9649 self.deployment = std::option::Option::Some(v.into());
9650 self
9651 }
9652
9653 /// Sets or clears the value of [deployment][crate::model::Version::deployment].
9654 ///
9655 /// # Example
9656 /// ```ignore,no_run
9657 /// # use google_cloud_appengine_v1::model::Version;
9658 /// use google_cloud_appengine_v1::model::Deployment;
9659 /// let x = Version::new().set_or_clear_deployment(Some(Deployment::default()/* use setters */));
9660 /// let x = Version::new().set_or_clear_deployment(None::<Deployment>);
9661 /// ```
9662 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
9663 where
9664 T: std::convert::Into<crate::model::Deployment>,
9665 {
9666 self.deployment = v.map(|x| x.into());
9667 self
9668 }
9669
9670 /// Sets the value of [version_url][crate::model::Version::version_url].
9671 ///
9672 /// # Example
9673 /// ```ignore,no_run
9674 /// # use google_cloud_appengine_v1::model::Version;
9675 /// let x = Version::new().set_version_url("example");
9676 /// ```
9677 pub fn set_version_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9678 self.version_url = v.into();
9679 self
9680 }
9681
9682 /// Sets the value of [endpoints_api_service][crate::model::Version::endpoints_api_service].
9683 ///
9684 /// # Example
9685 /// ```ignore,no_run
9686 /// # use google_cloud_appengine_v1::model::Version;
9687 /// use google_cloud_appengine_v1::model::EndpointsApiService;
9688 /// let x = Version::new().set_endpoints_api_service(EndpointsApiService::default()/* use setters */);
9689 /// ```
9690 pub fn set_endpoints_api_service<T>(mut self, v: T) -> Self
9691 where
9692 T: std::convert::Into<crate::model::EndpointsApiService>,
9693 {
9694 self.endpoints_api_service = std::option::Option::Some(v.into());
9695 self
9696 }
9697
9698 /// Sets or clears the value of [endpoints_api_service][crate::model::Version::endpoints_api_service].
9699 ///
9700 /// # Example
9701 /// ```ignore,no_run
9702 /// # use google_cloud_appengine_v1::model::Version;
9703 /// use google_cloud_appengine_v1::model::EndpointsApiService;
9704 /// let x = Version::new().set_or_clear_endpoints_api_service(Some(EndpointsApiService::default()/* use setters */));
9705 /// let x = Version::new().set_or_clear_endpoints_api_service(None::<EndpointsApiService>);
9706 /// ```
9707 pub fn set_or_clear_endpoints_api_service<T>(mut self, v: std::option::Option<T>) -> Self
9708 where
9709 T: std::convert::Into<crate::model::EndpointsApiService>,
9710 {
9711 self.endpoints_api_service = v.map(|x| x.into());
9712 self
9713 }
9714
9715 /// Sets the value of [entrypoint][crate::model::Version::entrypoint].
9716 ///
9717 /// # Example
9718 /// ```ignore,no_run
9719 /// # use google_cloud_appengine_v1::model::Version;
9720 /// use google_cloud_appengine_v1::model::Entrypoint;
9721 /// let x = Version::new().set_entrypoint(Entrypoint::default()/* use setters */);
9722 /// ```
9723 pub fn set_entrypoint<T>(mut self, v: T) -> Self
9724 where
9725 T: std::convert::Into<crate::model::Entrypoint>,
9726 {
9727 self.entrypoint = std::option::Option::Some(v.into());
9728 self
9729 }
9730
9731 /// Sets or clears the value of [entrypoint][crate::model::Version::entrypoint].
9732 ///
9733 /// # Example
9734 /// ```ignore,no_run
9735 /// # use google_cloud_appengine_v1::model::Version;
9736 /// use google_cloud_appengine_v1::model::Entrypoint;
9737 /// let x = Version::new().set_or_clear_entrypoint(Some(Entrypoint::default()/* use setters */));
9738 /// let x = Version::new().set_or_clear_entrypoint(None::<Entrypoint>);
9739 /// ```
9740 pub fn set_or_clear_entrypoint<T>(mut self, v: std::option::Option<T>) -> Self
9741 where
9742 T: std::convert::Into<crate::model::Entrypoint>,
9743 {
9744 self.entrypoint = v.map(|x| x.into());
9745 self
9746 }
9747
9748 /// Sets the value of [vpc_access_connector][crate::model::Version::vpc_access_connector].
9749 ///
9750 /// # Example
9751 /// ```ignore,no_run
9752 /// # use google_cloud_appengine_v1::model::Version;
9753 /// use google_cloud_appengine_v1::model::VpcAccessConnector;
9754 /// let x = Version::new().set_vpc_access_connector(VpcAccessConnector::default()/* use setters */);
9755 /// ```
9756 pub fn set_vpc_access_connector<T>(mut self, v: T) -> Self
9757 where
9758 T: std::convert::Into<crate::model::VpcAccessConnector>,
9759 {
9760 self.vpc_access_connector = std::option::Option::Some(v.into());
9761 self
9762 }
9763
9764 /// Sets or clears the value of [vpc_access_connector][crate::model::Version::vpc_access_connector].
9765 ///
9766 /// # Example
9767 /// ```ignore,no_run
9768 /// # use google_cloud_appengine_v1::model::Version;
9769 /// use google_cloud_appengine_v1::model::VpcAccessConnector;
9770 /// let x = Version::new().set_or_clear_vpc_access_connector(Some(VpcAccessConnector::default()/* use setters */));
9771 /// let x = Version::new().set_or_clear_vpc_access_connector(None::<VpcAccessConnector>);
9772 /// ```
9773 pub fn set_or_clear_vpc_access_connector<T>(mut self, v: std::option::Option<T>) -> Self
9774 where
9775 T: std::convert::Into<crate::model::VpcAccessConnector>,
9776 {
9777 self.vpc_access_connector = v.map(|x| x.into());
9778 self
9779 }
9780
9781 /// Sets the value of [scaling][crate::model::Version::scaling].
9782 ///
9783 /// Note that all the setters affecting `scaling` are mutually
9784 /// exclusive.
9785 ///
9786 /// # Example
9787 /// ```ignore,no_run
9788 /// # use google_cloud_appengine_v1::model::Version;
9789 /// use google_cloud_appengine_v1::model::AutomaticScaling;
9790 /// let x = Version::new().set_scaling(Some(
9791 /// google_cloud_appengine_v1::model::version::Scaling::AutomaticScaling(AutomaticScaling::default().into())));
9792 /// ```
9793 pub fn set_scaling<
9794 T: std::convert::Into<std::option::Option<crate::model::version::Scaling>>,
9795 >(
9796 mut self,
9797 v: T,
9798 ) -> Self {
9799 self.scaling = v.into();
9800 self
9801 }
9802
9803 /// The value of [scaling][crate::model::Version::scaling]
9804 /// if it holds a `AutomaticScaling`, `None` if the field is not set or
9805 /// holds a different branch.
9806 pub fn automatic_scaling(
9807 &self,
9808 ) -> std::option::Option<&std::boxed::Box<crate::model::AutomaticScaling>> {
9809 #[allow(unreachable_patterns)]
9810 self.scaling.as_ref().and_then(|v| match v {
9811 crate::model::version::Scaling::AutomaticScaling(v) => std::option::Option::Some(v),
9812 _ => std::option::Option::None,
9813 })
9814 }
9815
9816 /// Sets the value of [scaling][crate::model::Version::scaling]
9817 /// to hold a `AutomaticScaling`.
9818 ///
9819 /// Note that all the setters affecting `scaling` are
9820 /// mutually exclusive.
9821 ///
9822 /// # Example
9823 /// ```ignore,no_run
9824 /// # use google_cloud_appengine_v1::model::Version;
9825 /// use google_cloud_appengine_v1::model::AutomaticScaling;
9826 /// let x = Version::new().set_automatic_scaling(AutomaticScaling::default()/* use setters */);
9827 /// assert!(x.automatic_scaling().is_some());
9828 /// assert!(x.basic_scaling().is_none());
9829 /// assert!(x.manual_scaling().is_none());
9830 /// ```
9831 pub fn set_automatic_scaling<
9832 T: std::convert::Into<std::boxed::Box<crate::model::AutomaticScaling>>,
9833 >(
9834 mut self,
9835 v: T,
9836 ) -> Self {
9837 self.scaling =
9838 std::option::Option::Some(crate::model::version::Scaling::AutomaticScaling(v.into()));
9839 self
9840 }
9841
9842 /// The value of [scaling][crate::model::Version::scaling]
9843 /// if it holds a `BasicScaling`, `None` if the field is not set or
9844 /// holds a different branch.
9845 pub fn basic_scaling(
9846 &self,
9847 ) -> std::option::Option<&std::boxed::Box<crate::model::BasicScaling>> {
9848 #[allow(unreachable_patterns)]
9849 self.scaling.as_ref().and_then(|v| match v {
9850 crate::model::version::Scaling::BasicScaling(v) => std::option::Option::Some(v),
9851 _ => std::option::Option::None,
9852 })
9853 }
9854
9855 /// Sets the value of [scaling][crate::model::Version::scaling]
9856 /// to hold a `BasicScaling`.
9857 ///
9858 /// Note that all the setters affecting `scaling` are
9859 /// mutually exclusive.
9860 ///
9861 /// # Example
9862 /// ```ignore,no_run
9863 /// # use google_cloud_appengine_v1::model::Version;
9864 /// use google_cloud_appengine_v1::model::BasicScaling;
9865 /// let x = Version::new().set_basic_scaling(BasicScaling::default()/* use setters */);
9866 /// assert!(x.basic_scaling().is_some());
9867 /// assert!(x.automatic_scaling().is_none());
9868 /// assert!(x.manual_scaling().is_none());
9869 /// ```
9870 pub fn set_basic_scaling<T: std::convert::Into<std::boxed::Box<crate::model::BasicScaling>>>(
9871 mut self,
9872 v: T,
9873 ) -> Self {
9874 self.scaling =
9875 std::option::Option::Some(crate::model::version::Scaling::BasicScaling(v.into()));
9876 self
9877 }
9878
9879 /// The value of [scaling][crate::model::Version::scaling]
9880 /// if it holds a `ManualScaling`, `None` if the field is not set or
9881 /// holds a different branch.
9882 pub fn manual_scaling(
9883 &self,
9884 ) -> std::option::Option<&std::boxed::Box<crate::model::ManualScaling>> {
9885 #[allow(unreachable_patterns)]
9886 self.scaling.as_ref().and_then(|v| match v {
9887 crate::model::version::Scaling::ManualScaling(v) => std::option::Option::Some(v),
9888 _ => std::option::Option::None,
9889 })
9890 }
9891
9892 /// Sets the value of [scaling][crate::model::Version::scaling]
9893 /// to hold a `ManualScaling`.
9894 ///
9895 /// Note that all the setters affecting `scaling` are
9896 /// mutually exclusive.
9897 ///
9898 /// # Example
9899 /// ```ignore,no_run
9900 /// # use google_cloud_appengine_v1::model::Version;
9901 /// use google_cloud_appengine_v1::model::ManualScaling;
9902 /// let x = Version::new().set_manual_scaling(ManualScaling::default()/* use setters */);
9903 /// assert!(x.manual_scaling().is_some());
9904 /// assert!(x.automatic_scaling().is_none());
9905 /// assert!(x.basic_scaling().is_none());
9906 /// ```
9907 pub fn set_manual_scaling<
9908 T: std::convert::Into<std::boxed::Box<crate::model::ManualScaling>>,
9909 >(
9910 mut self,
9911 v: T,
9912 ) -> Self {
9913 self.scaling =
9914 std::option::Option::Some(crate::model::version::Scaling::ManualScaling(v.into()));
9915 self
9916 }
9917}
9918
9919impl wkt::message::Message for Version {
9920 fn typename() -> &'static str {
9921 "type.googleapis.com/google.appengine.v1.Version"
9922 }
9923}
9924
9925/// Defines additional types related to [Version].
9926pub mod version {
9927 #[allow(unused_imports)]
9928 use super::*;
9929
9930 /// Controls how instances are created, scaled, and reaped.
9931 ///
9932 /// Defaults to `AutomaticScaling`.
9933 #[derive(Clone, Debug, PartialEq)]
9934 #[non_exhaustive]
9935 pub enum Scaling {
9936 /// Automatic scaling is based on request rate, response latencies, and other
9937 /// application metrics. Instances are dynamically created and destroyed as
9938 /// needed in order to handle traffic.
9939 AutomaticScaling(std::boxed::Box<crate::model::AutomaticScaling>),
9940 /// A service with basic scaling will create an instance when the application
9941 /// receives a request. The instance will be turned down when the app becomes
9942 /// idle. Basic scaling is ideal for work that is intermittent or driven by
9943 /// user activity.
9944 BasicScaling(std::boxed::Box<crate::model::BasicScaling>),
9945 /// A service with manual scaling runs continuously, allowing you to perform
9946 /// complex initialization and rely on the state of its memory over time.
9947 /// Manually scaled versions are sometimes referred to as "backends".
9948 ManualScaling(std::boxed::Box<crate::model::ManualScaling>),
9949 }
9950}
9951
9952/// [Cloud Endpoints](https://cloud.google.com/endpoints) configuration.
9953/// The Endpoints API Service provides tooling for serving Open API and gRPC
9954/// endpoints via an NGINX proxy. Only valid for App Engine Flexible environment
9955/// deployments.
9956///
9957/// The fields here refer to the name and configuration ID of a "service"
9958/// resource in the [Service Management API](https://cloud.google.com/service-management/overview).
9959#[derive(Clone, Default, PartialEq)]
9960#[non_exhaustive]
9961pub struct EndpointsApiService {
9962 /// Endpoints service name which is the name of the "service" resource in the
9963 /// Service Management API. For example "myapi.endpoints.myproject.cloud.goog"
9964 pub name: std::string::String,
9965
9966 /// Endpoints service configuration ID as specified by the Service Management
9967 /// API. For example "2016-09-19r1".
9968 ///
9969 /// By default, the rollout strategy for Endpoints is `RolloutStrategy.FIXED`.
9970 /// This means that Endpoints starts up with a particular configuration ID.
9971 /// When a new configuration is rolled out, Endpoints must be given the new
9972 /// configuration ID. The `config_id` field is used to give the configuration
9973 /// ID and is required in this case.
9974 ///
9975 /// Endpoints also has a rollout strategy called `RolloutStrategy.MANAGED`.
9976 /// When using this, Endpoints fetches the latest configuration and does not
9977 /// need the configuration ID. In this case, `config_id` must be omitted.
9978 pub config_id: std::string::String,
9979
9980 /// Endpoints rollout strategy. If `FIXED`, `config_id` must be specified. If
9981 /// `MANAGED`, `config_id` must be omitted.
9982 pub rollout_strategy: crate::model::endpoints_api_service::RolloutStrategy,
9983
9984 /// Enable or disable trace sampling. By default, this is set to false for
9985 /// enabled.
9986 pub disable_trace_sampling: bool,
9987
9988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9989}
9990
9991impl EndpointsApiService {
9992 pub fn new() -> Self {
9993 std::default::Default::default()
9994 }
9995
9996 /// Sets the value of [name][crate::model::EndpointsApiService::name].
9997 ///
9998 /// # Example
9999 /// ```ignore,no_run
10000 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10001 /// let x = EndpointsApiService::new().set_name("example");
10002 /// ```
10003 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10004 self.name = v.into();
10005 self
10006 }
10007
10008 /// Sets the value of [config_id][crate::model::EndpointsApiService::config_id].
10009 ///
10010 /// # Example
10011 /// ```ignore,no_run
10012 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10013 /// let x = EndpointsApiService::new().set_config_id("example");
10014 /// ```
10015 pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10016 self.config_id = v.into();
10017 self
10018 }
10019
10020 /// Sets the value of [rollout_strategy][crate::model::EndpointsApiService::rollout_strategy].
10021 ///
10022 /// # Example
10023 /// ```ignore,no_run
10024 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10025 /// use google_cloud_appengine_v1::model::endpoints_api_service::RolloutStrategy;
10026 /// let x0 = EndpointsApiService::new().set_rollout_strategy(RolloutStrategy::Fixed);
10027 /// let x1 = EndpointsApiService::new().set_rollout_strategy(RolloutStrategy::Managed);
10028 /// ```
10029 pub fn set_rollout_strategy<
10030 T: std::convert::Into<crate::model::endpoints_api_service::RolloutStrategy>,
10031 >(
10032 mut self,
10033 v: T,
10034 ) -> Self {
10035 self.rollout_strategy = v.into();
10036 self
10037 }
10038
10039 /// Sets the value of [disable_trace_sampling][crate::model::EndpointsApiService::disable_trace_sampling].
10040 ///
10041 /// # Example
10042 /// ```ignore,no_run
10043 /// # use google_cloud_appengine_v1::model::EndpointsApiService;
10044 /// let x = EndpointsApiService::new().set_disable_trace_sampling(true);
10045 /// ```
10046 pub fn set_disable_trace_sampling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10047 self.disable_trace_sampling = v.into();
10048 self
10049 }
10050}
10051
10052impl wkt::message::Message for EndpointsApiService {
10053 fn typename() -> &'static str {
10054 "type.googleapis.com/google.appengine.v1.EndpointsApiService"
10055 }
10056}
10057
10058/// Defines additional types related to [EndpointsApiService].
10059pub mod endpoints_api_service {
10060 #[allow(unused_imports)]
10061 use super::*;
10062
10063 /// Available rollout strategies.
10064 ///
10065 /// # Working with unknown values
10066 ///
10067 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10068 /// additional enum variants at any time. Adding new variants is not considered
10069 /// a breaking change. Applications should write their code in anticipation of:
10070 ///
10071 /// - New values appearing in future releases of the client library, **and**
10072 /// - New values received dynamically, without application changes.
10073 ///
10074 /// Please consult the [Working with enums] section in the user guide for some
10075 /// guidelines.
10076 ///
10077 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10078 #[derive(Clone, Debug, PartialEq)]
10079 #[non_exhaustive]
10080 pub enum RolloutStrategy {
10081 /// Not specified. Defaults to `FIXED`.
10082 UnspecifiedRolloutStrategy,
10083 /// Endpoints service configuration ID will be fixed to the configuration ID
10084 /// specified by `config_id`.
10085 Fixed,
10086 /// Endpoints service configuration ID will be updated with each rollout.
10087 Managed,
10088 /// If set, the enum was initialized with an unknown value.
10089 ///
10090 /// Applications can examine the value using [RolloutStrategy::value] or
10091 /// [RolloutStrategy::name].
10092 UnknownValue(rollout_strategy::UnknownValue),
10093 }
10094
10095 #[doc(hidden)]
10096 pub mod rollout_strategy {
10097 #[allow(unused_imports)]
10098 use super::*;
10099 #[derive(Clone, Debug, PartialEq)]
10100 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10101 }
10102
10103 impl RolloutStrategy {
10104 /// Gets the enum value.
10105 ///
10106 /// Returns `None` if the enum contains an unknown value deserialized from
10107 /// the string representation of enums.
10108 pub fn value(&self) -> std::option::Option<i32> {
10109 match self {
10110 Self::UnspecifiedRolloutStrategy => std::option::Option::Some(0),
10111 Self::Fixed => std::option::Option::Some(1),
10112 Self::Managed => std::option::Option::Some(2),
10113 Self::UnknownValue(u) => u.0.value(),
10114 }
10115 }
10116
10117 /// Gets the enum value as a string.
10118 ///
10119 /// Returns `None` if the enum contains an unknown value deserialized from
10120 /// the integer representation of enums.
10121 pub fn name(&self) -> std::option::Option<&str> {
10122 match self {
10123 Self::UnspecifiedRolloutStrategy => {
10124 std::option::Option::Some("UNSPECIFIED_ROLLOUT_STRATEGY")
10125 }
10126 Self::Fixed => std::option::Option::Some("FIXED"),
10127 Self::Managed => std::option::Option::Some("MANAGED"),
10128 Self::UnknownValue(u) => u.0.name(),
10129 }
10130 }
10131 }
10132
10133 impl std::default::Default for RolloutStrategy {
10134 fn default() -> Self {
10135 use std::convert::From;
10136 Self::from(0)
10137 }
10138 }
10139
10140 impl std::fmt::Display for RolloutStrategy {
10141 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10142 wkt::internal::display_enum(f, self.name(), self.value())
10143 }
10144 }
10145
10146 impl std::convert::From<i32> for RolloutStrategy {
10147 fn from(value: i32) -> Self {
10148 match value {
10149 0 => Self::UnspecifiedRolloutStrategy,
10150 1 => Self::Fixed,
10151 2 => Self::Managed,
10152 _ => Self::UnknownValue(rollout_strategy::UnknownValue(
10153 wkt::internal::UnknownEnumValue::Integer(value),
10154 )),
10155 }
10156 }
10157 }
10158
10159 impl std::convert::From<&str> for RolloutStrategy {
10160 fn from(value: &str) -> Self {
10161 use std::string::ToString;
10162 match value {
10163 "UNSPECIFIED_ROLLOUT_STRATEGY" => Self::UnspecifiedRolloutStrategy,
10164 "FIXED" => Self::Fixed,
10165 "MANAGED" => Self::Managed,
10166 _ => Self::UnknownValue(rollout_strategy::UnknownValue(
10167 wkt::internal::UnknownEnumValue::String(value.to_string()),
10168 )),
10169 }
10170 }
10171 }
10172
10173 impl serde::ser::Serialize for RolloutStrategy {
10174 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10175 where
10176 S: serde::Serializer,
10177 {
10178 match self {
10179 Self::UnspecifiedRolloutStrategy => serializer.serialize_i32(0),
10180 Self::Fixed => serializer.serialize_i32(1),
10181 Self::Managed => serializer.serialize_i32(2),
10182 Self::UnknownValue(u) => u.0.serialize(serializer),
10183 }
10184 }
10185 }
10186
10187 impl<'de> serde::de::Deserialize<'de> for RolloutStrategy {
10188 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10189 where
10190 D: serde::Deserializer<'de>,
10191 {
10192 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RolloutStrategy>::new(
10193 ".google.appengine.v1.EndpointsApiService.RolloutStrategy",
10194 ))
10195 }
10196 }
10197}
10198
10199/// Automatic scaling is based on request rate, response latencies, and other
10200/// application metrics.
10201#[derive(Clone, Default, PartialEq)]
10202#[non_exhaustive]
10203pub struct AutomaticScaling {
10204 /// The time period that the
10205 /// [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
10206 /// should wait before it starts collecting information from a new instance.
10207 /// This prevents the autoscaler from collecting information when the instance
10208 /// is initializing, during which the collected usage would not be reliable.
10209 /// Only applicable in the App Engine flexible environment.
10210 pub cool_down_period: std::option::Option<wkt::Duration>,
10211
10212 /// Target scaling by CPU usage.
10213 pub cpu_utilization: std::option::Option<crate::model::CpuUtilization>,
10214
10215 /// Number of concurrent requests an automatic scaling instance can accept
10216 /// before the scheduler spawns a new instance.
10217 ///
10218 /// Defaults to a runtime-specific value.
10219 pub max_concurrent_requests: i32,
10220
10221 /// Maximum number of idle instances that should be maintained for this
10222 /// version.
10223 pub max_idle_instances: i32,
10224
10225 /// Maximum number of instances that should be started to handle requests for
10226 /// this version.
10227 pub max_total_instances: i32,
10228
10229 /// Maximum amount of time that a request should wait in the pending queue
10230 /// before starting a new instance to handle it.
10231 pub max_pending_latency: std::option::Option<wkt::Duration>,
10232
10233 /// Minimum number of idle instances that should be maintained for
10234 /// this version. Only applicable for the default version of a service.
10235 pub min_idle_instances: i32,
10236
10237 /// Minimum number of running instances that should be maintained for this
10238 /// version.
10239 pub min_total_instances: i32,
10240
10241 /// Minimum amount of time a request should wait in the pending queue before
10242 /// starting a new instance to handle it.
10243 pub min_pending_latency: std::option::Option<wkt::Duration>,
10244
10245 /// Target scaling by request utilization.
10246 pub request_utilization: std::option::Option<crate::model::RequestUtilization>,
10247
10248 /// Target scaling by disk usage.
10249 pub disk_utilization: std::option::Option<crate::model::DiskUtilization>,
10250
10251 /// Target scaling by network usage.
10252 pub network_utilization: std::option::Option<crate::model::NetworkUtilization>,
10253
10254 /// Scheduler settings for standard environment.
10255 pub standard_scheduler_settings: std::option::Option<crate::model::StandardSchedulerSettings>,
10256
10257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10258}
10259
10260impl AutomaticScaling {
10261 pub fn new() -> Self {
10262 std::default::Default::default()
10263 }
10264
10265 /// Sets the value of [cool_down_period][crate::model::AutomaticScaling::cool_down_period].
10266 ///
10267 /// # Example
10268 /// ```ignore,no_run
10269 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10270 /// use wkt::Duration;
10271 /// let x = AutomaticScaling::new().set_cool_down_period(Duration::default()/* use setters */);
10272 /// ```
10273 pub fn set_cool_down_period<T>(mut self, v: T) -> Self
10274 where
10275 T: std::convert::Into<wkt::Duration>,
10276 {
10277 self.cool_down_period = std::option::Option::Some(v.into());
10278 self
10279 }
10280
10281 /// Sets or clears the value of [cool_down_period][crate::model::AutomaticScaling::cool_down_period].
10282 ///
10283 /// # Example
10284 /// ```ignore,no_run
10285 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10286 /// use wkt::Duration;
10287 /// let x = AutomaticScaling::new().set_or_clear_cool_down_period(Some(Duration::default()/* use setters */));
10288 /// let x = AutomaticScaling::new().set_or_clear_cool_down_period(None::<Duration>);
10289 /// ```
10290 pub fn set_or_clear_cool_down_period<T>(mut self, v: std::option::Option<T>) -> Self
10291 where
10292 T: std::convert::Into<wkt::Duration>,
10293 {
10294 self.cool_down_period = v.map(|x| x.into());
10295 self
10296 }
10297
10298 /// Sets the value of [cpu_utilization][crate::model::AutomaticScaling::cpu_utilization].
10299 ///
10300 /// # Example
10301 /// ```ignore,no_run
10302 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10303 /// use google_cloud_appengine_v1::model::CpuUtilization;
10304 /// let x = AutomaticScaling::new().set_cpu_utilization(CpuUtilization::default()/* use setters */);
10305 /// ```
10306 pub fn set_cpu_utilization<T>(mut self, v: T) -> Self
10307 where
10308 T: std::convert::Into<crate::model::CpuUtilization>,
10309 {
10310 self.cpu_utilization = std::option::Option::Some(v.into());
10311 self
10312 }
10313
10314 /// Sets or clears the value of [cpu_utilization][crate::model::AutomaticScaling::cpu_utilization].
10315 ///
10316 /// # Example
10317 /// ```ignore,no_run
10318 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10319 /// use google_cloud_appengine_v1::model::CpuUtilization;
10320 /// let x = AutomaticScaling::new().set_or_clear_cpu_utilization(Some(CpuUtilization::default()/* use setters */));
10321 /// let x = AutomaticScaling::new().set_or_clear_cpu_utilization(None::<CpuUtilization>);
10322 /// ```
10323 pub fn set_or_clear_cpu_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10324 where
10325 T: std::convert::Into<crate::model::CpuUtilization>,
10326 {
10327 self.cpu_utilization = v.map(|x| x.into());
10328 self
10329 }
10330
10331 /// Sets the value of [max_concurrent_requests][crate::model::AutomaticScaling::max_concurrent_requests].
10332 ///
10333 /// # Example
10334 /// ```ignore,no_run
10335 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10336 /// let x = AutomaticScaling::new().set_max_concurrent_requests(42);
10337 /// ```
10338 pub fn set_max_concurrent_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10339 self.max_concurrent_requests = v.into();
10340 self
10341 }
10342
10343 /// Sets the value of [max_idle_instances][crate::model::AutomaticScaling::max_idle_instances].
10344 ///
10345 /// # Example
10346 /// ```ignore,no_run
10347 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10348 /// let x = AutomaticScaling::new().set_max_idle_instances(42);
10349 /// ```
10350 pub fn set_max_idle_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10351 self.max_idle_instances = v.into();
10352 self
10353 }
10354
10355 /// Sets the value of [max_total_instances][crate::model::AutomaticScaling::max_total_instances].
10356 ///
10357 /// # Example
10358 /// ```ignore,no_run
10359 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10360 /// let x = AutomaticScaling::new().set_max_total_instances(42);
10361 /// ```
10362 pub fn set_max_total_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10363 self.max_total_instances = v.into();
10364 self
10365 }
10366
10367 /// Sets the value of [max_pending_latency][crate::model::AutomaticScaling::max_pending_latency].
10368 ///
10369 /// # Example
10370 /// ```ignore,no_run
10371 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10372 /// use wkt::Duration;
10373 /// let x = AutomaticScaling::new().set_max_pending_latency(Duration::default()/* use setters */);
10374 /// ```
10375 pub fn set_max_pending_latency<T>(mut self, v: T) -> Self
10376 where
10377 T: std::convert::Into<wkt::Duration>,
10378 {
10379 self.max_pending_latency = std::option::Option::Some(v.into());
10380 self
10381 }
10382
10383 /// Sets or clears the value of [max_pending_latency][crate::model::AutomaticScaling::max_pending_latency].
10384 ///
10385 /// # Example
10386 /// ```ignore,no_run
10387 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10388 /// use wkt::Duration;
10389 /// let x = AutomaticScaling::new().set_or_clear_max_pending_latency(Some(Duration::default()/* use setters */));
10390 /// let x = AutomaticScaling::new().set_or_clear_max_pending_latency(None::<Duration>);
10391 /// ```
10392 pub fn set_or_clear_max_pending_latency<T>(mut self, v: std::option::Option<T>) -> Self
10393 where
10394 T: std::convert::Into<wkt::Duration>,
10395 {
10396 self.max_pending_latency = v.map(|x| x.into());
10397 self
10398 }
10399
10400 /// Sets the value of [min_idle_instances][crate::model::AutomaticScaling::min_idle_instances].
10401 ///
10402 /// # Example
10403 /// ```ignore,no_run
10404 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10405 /// let x = AutomaticScaling::new().set_min_idle_instances(42);
10406 /// ```
10407 pub fn set_min_idle_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10408 self.min_idle_instances = v.into();
10409 self
10410 }
10411
10412 /// Sets the value of [min_total_instances][crate::model::AutomaticScaling::min_total_instances].
10413 ///
10414 /// # Example
10415 /// ```ignore,no_run
10416 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10417 /// let x = AutomaticScaling::new().set_min_total_instances(42);
10418 /// ```
10419 pub fn set_min_total_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10420 self.min_total_instances = v.into();
10421 self
10422 }
10423
10424 /// Sets the value of [min_pending_latency][crate::model::AutomaticScaling::min_pending_latency].
10425 ///
10426 /// # Example
10427 /// ```ignore,no_run
10428 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10429 /// use wkt::Duration;
10430 /// let x = AutomaticScaling::new().set_min_pending_latency(Duration::default()/* use setters */);
10431 /// ```
10432 pub fn set_min_pending_latency<T>(mut self, v: T) -> Self
10433 where
10434 T: std::convert::Into<wkt::Duration>,
10435 {
10436 self.min_pending_latency = std::option::Option::Some(v.into());
10437 self
10438 }
10439
10440 /// Sets or clears the value of [min_pending_latency][crate::model::AutomaticScaling::min_pending_latency].
10441 ///
10442 /// # Example
10443 /// ```ignore,no_run
10444 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10445 /// use wkt::Duration;
10446 /// let x = AutomaticScaling::new().set_or_clear_min_pending_latency(Some(Duration::default()/* use setters */));
10447 /// let x = AutomaticScaling::new().set_or_clear_min_pending_latency(None::<Duration>);
10448 /// ```
10449 pub fn set_or_clear_min_pending_latency<T>(mut self, v: std::option::Option<T>) -> Self
10450 where
10451 T: std::convert::Into<wkt::Duration>,
10452 {
10453 self.min_pending_latency = v.map(|x| x.into());
10454 self
10455 }
10456
10457 /// Sets the value of [request_utilization][crate::model::AutomaticScaling::request_utilization].
10458 ///
10459 /// # Example
10460 /// ```ignore,no_run
10461 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10462 /// use google_cloud_appengine_v1::model::RequestUtilization;
10463 /// let x = AutomaticScaling::new().set_request_utilization(RequestUtilization::default()/* use setters */);
10464 /// ```
10465 pub fn set_request_utilization<T>(mut self, v: T) -> Self
10466 where
10467 T: std::convert::Into<crate::model::RequestUtilization>,
10468 {
10469 self.request_utilization = std::option::Option::Some(v.into());
10470 self
10471 }
10472
10473 /// Sets or clears the value of [request_utilization][crate::model::AutomaticScaling::request_utilization].
10474 ///
10475 /// # Example
10476 /// ```ignore,no_run
10477 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10478 /// use google_cloud_appengine_v1::model::RequestUtilization;
10479 /// let x = AutomaticScaling::new().set_or_clear_request_utilization(Some(RequestUtilization::default()/* use setters */));
10480 /// let x = AutomaticScaling::new().set_or_clear_request_utilization(None::<RequestUtilization>);
10481 /// ```
10482 pub fn set_or_clear_request_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10483 where
10484 T: std::convert::Into<crate::model::RequestUtilization>,
10485 {
10486 self.request_utilization = v.map(|x| x.into());
10487 self
10488 }
10489
10490 /// Sets the value of [disk_utilization][crate::model::AutomaticScaling::disk_utilization].
10491 ///
10492 /// # Example
10493 /// ```ignore,no_run
10494 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10495 /// use google_cloud_appengine_v1::model::DiskUtilization;
10496 /// let x = AutomaticScaling::new().set_disk_utilization(DiskUtilization::default()/* use setters */);
10497 /// ```
10498 pub fn set_disk_utilization<T>(mut self, v: T) -> Self
10499 where
10500 T: std::convert::Into<crate::model::DiskUtilization>,
10501 {
10502 self.disk_utilization = std::option::Option::Some(v.into());
10503 self
10504 }
10505
10506 /// Sets or clears the value of [disk_utilization][crate::model::AutomaticScaling::disk_utilization].
10507 ///
10508 /// # Example
10509 /// ```ignore,no_run
10510 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10511 /// use google_cloud_appengine_v1::model::DiskUtilization;
10512 /// let x = AutomaticScaling::new().set_or_clear_disk_utilization(Some(DiskUtilization::default()/* use setters */));
10513 /// let x = AutomaticScaling::new().set_or_clear_disk_utilization(None::<DiskUtilization>);
10514 /// ```
10515 pub fn set_or_clear_disk_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10516 where
10517 T: std::convert::Into<crate::model::DiskUtilization>,
10518 {
10519 self.disk_utilization = v.map(|x| x.into());
10520 self
10521 }
10522
10523 /// Sets the value of [network_utilization][crate::model::AutomaticScaling::network_utilization].
10524 ///
10525 /// # Example
10526 /// ```ignore,no_run
10527 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10528 /// use google_cloud_appengine_v1::model::NetworkUtilization;
10529 /// let x = AutomaticScaling::new().set_network_utilization(NetworkUtilization::default()/* use setters */);
10530 /// ```
10531 pub fn set_network_utilization<T>(mut self, v: T) -> Self
10532 where
10533 T: std::convert::Into<crate::model::NetworkUtilization>,
10534 {
10535 self.network_utilization = std::option::Option::Some(v.into());
10536 self
10537 }
10538
10539 /// Sets or clears the value of [network_utilization][crate::model::AutomaticScaling::network_utilization].
10540 ///
10541 /// # Example
10542 /// ```ignore,no_run
10543 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10544 /// use google_cloud_appengine_v1::model::NetworkUtilization;
10545 /// let x = AutomaticScaling::new().set_or_clear_network_utilization(Some(NetworkUtilization::default()/* use setters */));
10546 /// let x = AutomaticScaling::new().set_or_clear_network_utilization(None::<NetworkUtilization>);
10547 /// ```
10548 pub fn set_or_clear_network_utilization<T>(mut self, v: std::option::Option<T>) -> Self
10549 where
10550 T: std::convert::Into<crate::model::NetworkUtilization>,
10551 {
10552 self.network_utilization = v.map(|x| x.into());
10553 self
10554 }
10555
10556 /// Sets the value of [standard_scheduler_settings][crate::model::AutomaticScaling::standard_scheduler_settings].
10557 ///
10558 /// # Example
10559 /// ```ignore,no_run
10560 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10561 /// use google_cloud_appengine_v1::model::StandardSchedulerSettings;
10562 /// let x = AutomaticScaling::new().set_standard_scheduler_settings(StandardSchedulerSettings::default()/* use setters */);
10563 /// ```
10564 pub fn set_standard_scheduler_settings<T>(mut self, v: T) -> Self
10565 where
10566 T: std::convert::Into<crate::model::StandardSchedulerSettings>,
10567 {
10568 self.standard_scheduler_settings = std::option::Option::Some(v.into());
10569 self
10570 }
10571
10572 /// Sets or clears the value of [standard_scheduler_settings][crate::model::AutomaticScaling::standard_scheduler_settings].
10573 ///
10574 /// # Example
10575 /// ```ignore,no_run
10576 /// # use google_cloud_appengine_v1::model::AutomaticScaling;
10577 /// use google_cloud_appengine_v1::model::StandardSchedulerSettings;
10578 /// let x = AutomaticScaling::new().set_or_clear_standard_scheduler_settings(Some(StandardSchedulerSettings::default()/* use setters */));
10579 /// let x = AutomaticScaling::new().set_or_clear_standard_scheduler_settings(None::<StandardSchedulerSettings>);
10580 /// ```
10581 pub fn set_or_clear_standard_scheduler_settings<T>(mut self, v: std::option::Option<T>) -> Self
10582 where
10583 T: std::convert::Into<crate::model::StandardSchedulerSettings>,
10584 {
10585 self.standard_scheduler_settings = v.map(|x| x.into());
10586 self
10587 }
10588}
10589
10590impl wkt::message::Message for AutomaticScaling {
10591 fn typename() -> &'static str {
10592 "type.googleapis.com/google.appengine.v1.AutomaticScaling"
10593 }
10594}
10595
10596/// A service with basic scaling will create an instance when the application
10597/// receives a request. The instance will be turned down when the app becomes
10598/// idle. Basic scaling is ideal for work that is intermittent or driven by
10599/// user activity.
10600#[derive(Clone, Default, PartialEq)]
10601#[non_exhaustive]
10602pub struct BasicScaling {
10603 /// Duration of time after the last request that an instance must wait before
10604 /// the instance is shut down.
10605 pub idle_timeout: std::option::Option<wkt::Duration>,
10606
10607 /// Maximum number of instances to create for this version.
10608 pub max_instances: i32,
10609
10610 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10611}
10612
10613impl BasicScaling {
10614 pub fn new() -> Self {
10615 std::default::Default::default()
10616 }
10617
10618 /// Sets the value of [idle_timeout][crate::model::BasicScaling::idle_timeout].
10619 ///
10620 /// # Example
10621 /// ```ignore,no_run
10622 /// # use google_cloud_appengine_v1::model::BasicScaling;
10623 /// use wkt::Duration;
10624 /// let x = BasicScaling::new().set_idle_timeout(Duration::default()/* use setters */);
10625 /// ```
10626 pub fn set_idle_timeout<T>(mut self, v: T) -> Self
10627 where
10628 T: std::convert::Into<wkt::Duration>,
10629 {
10630 self.idle_timeout = std::option::Option::Some(v.into());
10631 self
10632 }
10633
10634 /// Sets or clears the value of [idle_timeout][crate::model::BasicScaling::idle_timeout].
10635 ///
10636 /// # Example
10637 /// ```ignore,no_run
10638 /// # use google_cloud_appengine_v1::model::BasicScaling;
10639 /// use wkt::Duration;
10640 /// let x = BasicScaling::new().set_or_clear_idle_timeout(Some(Duration::default()/* use setters */));
10641 /// let x = BasicScaling::new().set_or_clear_idle_timeout(None::<Duration>);
10642 /// ```
10643 pub fn set_or_clear_idle_timeout<T>(mut self, v: std::option::Option<T>) -> Self
10644 where
10645 T: std::convert::Into<wkt::Duration>,
10646 {
10647 self.idle_timeout = v.map(|x| x.into());
10648 self
10649 }
10650
10651 /// Sets the value of [max_instances][crate::model::BasicScaling::max_instances].
10652 ///
10653 /// # Example
10654 /// ```ignore,no_run
10655 /// # use google_cloud_appengine_v1::model::BasicScaling;
10656 /// let x = BasicScaling::new().set_max_instances(42);
10657 /// ```
10658 pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10659 self.max_instances = v.into();
10660 self
10661 }
10662}
10663
10664impl wkt::message::Message for BasicScaling {
10665 fn typename() -> &'static str {
10666 "type.googleapis.com/google.appengine.v1.BasicScaling"
10667 }
10668}
10669
10670/// A service with manual scaling runs continuously, allowing you to perform
10671/// complex initialization and rely on the state of its memory over time.
10672#[derive(Clone, Default, PartialEq)]
10673#[non_exhaustive]
10674pub struct ManualScaling {
10675 /// Number of instances to assign to the service at the start. This number
10676 /// can later be altered by using the
10677 /// [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions)
10678 /// `set_num_instances()` function.
10679 pub instances: i32,
10680
10681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10682}
10683
10684impl ManualScaling {
10685 pub fn new() -> Self {
10686 std::default::Default::default()
10687 }
10688
10689 /// Sets the value of [instances][crate::model::ManualScaling::instances].
10690 ///
10691 /// # Example
10692 /// ```ignore,no_run
10693 /// # use google_cloud_appengine_v1::model::ManualScaling;
10694 /// let x = ManualScaling::new().set_instances(42);
10695 /// ```
10696 pub fn set_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10697 self.instances = v.into();
10698 self
10699 }
10700}
10701
10702impl wkt::message::Message for ManualScaling {
10703 fn typename() -> &'static str {
10704 "type.googleapis.com/google.appengine.v1.ManualScaling"
10705 }
10706}
10707
10708/// Target scaling by CPU usage.
10709#[derive(Clone, Default, PartialEq)]
10710#[non_exhaustive]
10711pub struct CpuUtilization {
10712 /// Period of time over which CPU utilization is calculated.
10713 pub aggregation_window_length: std::option::Option<wkt::Duration>,
10714
10715 /// Target CPU utilization ratio to maintain when scaling. Must be between 0
10716 /// and 1.
10717 pub target_utilization: f64,
10718
10719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10720}
10721
10722impl CpuUtilization {
10723 pub fn new() -> Self {
10724 std::default::Default::default()
10725 }
10726
10727 /// Sets the value of [aggregation_window_length][crate::model::CpuUtilization::aggregation_window_length].
10728 ///
10729 /// # Example
10730 /// ```ignore,no_run
10731 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10732 /// use wkt::Duration;
10733 /// let x = CpuUtilization::new().set_aggregation_window_length(Duration::default()/* use setters */);
10734 /// ```
10735 pub fn set_aggregation_window_length<T>(mut self, v: T) -> Self
10736 where
10737 T: std::convert::Into<wkt::Duration>,
10738 {
10739 self.aggregation_window_length = std::option::Option::Some(v.into());
10740 self
10741 }
10742
10743 /// Sets or clears the value of [aggregation_window_length][crate::model::CpuUtilization::aggregation_window_length].
10744 ///
10745 /// # Example
10746 /// ```ignore,no_run
10747 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10748 /// use wkt::Duration;
10749 /// let x = CpuUtilization::new().set_or_clear_aggregation_window_length(Some(Duration::default()/* use setters */));
10750 /// let x = CpuUtilization::new().set_or_clear_aggregation_window_length(None::<Duration>);
10751 /// ```
10752 pub fn set_or_clear_aggregation_window_length<T>(mut self, v: std::option::Option<T>) -> Self
10753 where
10754 T: std::convert::Into<wkt::Duration>,
10755 {
10756 self.aggregation_window_length = v.map(|x| x.into());
10757 self
10758 }
10759
10760 /// Sets the value of [target_utilization][crate::model::CpuUtilization::target_utilization].
10761 ///
10762 /// # Example
10763 /// ```ignore,no_run
10764 /// # use google_cloud_appengine_v1::model::CpuUtilization;
10765 /// let x = CpuUtilization::new().set_target_utilization(42.0);
10766 /// ```
10767 pub fn set_target_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10768 self.target_utilization = v.into();
10769 self
10770 }
10771}
10772
10773impl wkt::message::Message for CpuUtilization {
10774 fn typename() -> &'static str {
10775 "type.googleapis.com/google.appengine.v1.CpuUtilization"
10776 }
10777}
10778
10779/// Target scaling by request utilization.
10780/// Only applicable in the App Engine flexible environment.
10781#[derive(Clone, Default, PartialEq)]
10782#[non_exhaustive]
10783pub struct RequestUtilization {
10784 /// Target requests per second.
10785 pub target_request_count_per_second: i32,
10786
10787 /// Target number of concurrent requests.
10788 pub target_concurrent_requests: i32,
10789
10790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10791}
10792
10793impl RequestUtilization {
10794 pub fn new() -> Self {
10795 std::default::Default::default()
10796 }
10797
10798 /// Sets the value of [target_request_count_per_second][crate::model::RequestUtilization::target_request_count_per_second].
10799 ///
10800 /// # Example
10801 /// ```ignore,no_run
10802 /// # use google_cloud_appengine_v1::model::RequestUtilization;
10803 /// let x = RequestUtilization::new().set_target_request_count_per_second(42);
10804 /// ```
10805 pub fn set_target_request_count_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10806 self.target_request_count_per_second = v.into();
10807 self
10808 }
10809
10810 /// Sets the value of [target_concurrent_requests][crate::model::RequestUtilization::target_concurrent_requests].
10811 ///
10812 /// # Example
10813 /// ```ignore,no_run
10814 /// # use google_cloud_appengine_v1::model::RequestUtilization;
10815 /// let x = RequestUtilization::new().set_target_concurrent_requests(42);
10816 /// ```
10817 pub fn set_target_concurrent_requests<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10818 self.target_concurrent_requests = v.into();
10819 self
10820 }
10821}
10822
10823impl wkt::message::Message for RequestUtilization {
10824 fn typename() -> &'static str {
10825 "type.googleapis.com/google.appengine.v1.RequestUtilization"
10826 }
10827}
10828
10829/// Target scaling by disk usage.
10830/// Only applicable in the App Engine flexible environment.
10831#[derive(Clone, Default, PartialEq)]
10832#[non_exhaustive]
10833pub struct DiskUtilization {
10834 /// Target bytes written per second.
10835 pub target_write_bytes_per_second: i32,
10836
10837 /// Target ops written per second.
10838 pub target_write_ops_per_second: i32,
10839
10840 /// Target bytes read per second.
10841 pub target_read_bytes_per_second: i32,
10842
10843 /// Target ops read per seconds.
10844 pub target_read_ops_per_second: i32,
10845
10846 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10847}
10848
10849impl DiskUtilization {
10850 pub fn new() -> Self {
10851 std::default::Default::default()
10852 }
10853
10854 /// Sets the value of [target_write_bytes_per_second][crate::model::DiskUtilization::target_write_bytes_per_second].
10855 ///
10856 /// # Example
10857 /// ```ignore,no_run
10858 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10859 /// let x = DiskUtilization::new().set_target_write_bytes_per_second(42);
10860 /// ```
10861 pub fn set_target_write_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10862 self.target_write_bytes_per_second = v.into();
10863 self
10864 }
10865
10866 /// Sets the value of [target_write_ops_per_second][crate::model::DiskUtilization::target_write_ops_per_second].
10867 ///
10868 /// # Example
10869 /// ```ignore,no_run
10870 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10871 /// let x = DiskUtilization::new().set_target_write_ops_per_second(42);
10872 /// ```
10873 pub fn set_target_write_ops_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10874 self.target_write_ops_per_second = v.into();
10875 self
10876 }
10877
10878 /// Sets the value of [target_read_bytes_per_second][crate::model::DiskUtilization::target_read_bytes_per_second].
10879 ///
10880 /// # Example
10881 /// ```ignore,no_run
10882 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10883 /// let x = DiskUtilization::new().set_target_read_bytes_per_second(42);
10884 /// ```
10885 pub fn set_target_read_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10886 self.target_read_bytes_per_second = v.into();
10887 self
10888 }
10889
10890 /// Sets the value of [target_read_ops_per_second][crate::model::DiskUtilization::target_read_ops_per_second].
10891 ///
10892 /// # Example
10893 /// ```ignore,no_run
10894 /// # use google_cloud_appengine_v1::model::DiskUtilization;
10895 /// let x = DiskUtilization::new().set_target_read_ops_per_second(42);
10896 /// ```
10897 pub fn set_target_read_ops_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10898 self.target_read_ops_per_second = v.into();
10899 self
10900 }
10901}
10902
10903impl wkt::message::Message for DiskUtilization {
10904 fn typename() -> &'static str {
10905 "type.googleapis.com/google.appengine.v1.DiskUtilization"
10906 }
10907}
10908
10909/// Target scaling by network usage.
10910/// Only applicable in the App Engine flexible environment.
10911#[derive(Clone, Default, PartialEq)]
10912#[non_exhaustive]
10913pub struct NetworkUtilization {
10914 /// Target bytes sent per second.
10915 pub target_sent_bytes_per_second: i32,
10916
10917 /// Target packets sent per second.
10918 pub target_sent_packets_per_second: i32,
10919
10920 /// Target bytes received per second.
10921 pub target_received_bytes_per_second: i32,
10922
10923 /// Target packets received per second.
10924 pub target_received_packets_per_second: i32,
10925
10926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10927}
10928
10929impl NetworkUtilization {
10930 pub fn new() -> Self {
10931 std::default::Default::default()
10932 }
10933
10934 /// Sets the value of [target_sent_bytes_per_second][crate::model::NetworkUtilization::target_sent_bytes_per_second].
10935 ///
10936 /// # Example
10937 /// ```ignore,no_run
10938 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
10939 /// let x = NetworkUtilization::new().set_target_sent_bytes_per_second(42);
10940 /// ```
10941 pub fn set_target_sent_bytes_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10942 self.target_sent_bytes_per_second = v.into();
10943 self
10944 }
10945
10946 /// Sets the value of [target_sent_packets_per_second][crate::model::NetworkUtilization::target_sent_packets_per_second].
10947 ///
10948 /// # Example
10949 /// ```ignore,no_run
10950 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
10951 /// let x = NetworkUtilization::new().set_target_sent_packets_per_second(42);
10952 /// ```
10953 pub fn set_target_sent_packets_per_second<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10954 self.target_sent_packets_per_second = v.into();
10955 self
10956 }
10957
10958 /// Sets the value of [target_received_bytes_per_second][crate::model::NetworkUtilization::target_received_bytes_per_second].
10959 ///
10960 /// # Example
10961 /// ```ignore,no_run
10962 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
10963 /// let x = NetworkUtilization::new().set_target_received_bytes_per_second(42);
10964 /// ```
10965 pub fn set_target_received_bytes_per_second<T: std::convert::Into<i32>>(
10966 mut self,
10967 v: T,
10968 ) -> Self {
10969 self.target_received_bytes_per_second = v.into();
10970 self
10971 }
10972
10973 /// Sets the value of [target_received_packets_per_second][crate::model::NetworkUtilization::target_received_packets_per_second].
10974 ///
10975 /// # Example
10976 /// ```ignore,no_run
10977 /// # use google_cloud_appengine_v1::model::NetworkUtilization;
10978 /// let x = NetworkUtilization::new().set_target_received_packets_per_second(42);
10979 /// ```
10980 pub fn set_target_received_packets_per_second<T: std::convert::Into<i32>>(
10981 mut self,
10982 v: T,
10983 ) -> Self {
10984 self.target_received_packets_per_second = v.into();
10985 self
10986 }
10987}
10988
10989impl wkt::message::Message for NetworkUtilization {
10990 fn typename() -> &'static str {
10991 "type.googleapis.com/google.appengine.v1.NetworkUtilization"
10992 }
10993}
10994
10995/// Scheduler settings for standard environment.
10996#[derive(Clone, Default, PartialEq)]
10997#[non_exhaustive]
10998pub struct StandardSchedulerSettings {
10999 /// Target CPU utilization ratio to maintain when scaling.
11000 pub target_cpu_utilization: f64,
11001
11002 /// Target throughput utilization ratio to maintain when scaling
11003 pub target_throughput_utilization: f64,
11004
11005 /// Minimum number of instances to run for this version. Set to zero to disable
11006 /// `min_instances` configuration.
11007 pub min_instances: i32,
11008
11009 /// Maximum number of instances to run for this version. Set to zero to disable
11010 /// `max_instances` configuration.
11011 pub max_instances: i32,
11012
11013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11014}
11015
11016impl StandardSchedulerSettings {
11017 pub fn new() -> Self {
11018 std::default::Default::default()
11019 }
11020
11021 /// Sets the value of [target_cpu_utilization][crate::model::StandardSchedulerSettings::target_cpu_utilization].
11022 ///
11023 /// # Example
11024 /// ```ignore,no_run
11025 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11026 /// let x = StandardSchedulerSettings::new().set_target_cpu_utilization(42.0);
11027 /// ```
11028 pub fn set_target_cpu_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11029 self.target_cpu_utilization = v.into();
11030 self
11031 }
11032
11033 /// Sets the value of [target_throughput_utilization][crate::model::StandardSchedulerSettings::target_throughput_utilization].
11034 ///
11035 /// # Example
11036 /// ```ignore,no_run
11037 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11038 /// let x = StandardSchedulerSettings::new().set_target_throughput_utilization(42.0);
11039 /// ```
11040 pub fn set_target_throughput_utilization<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11041 self.target_throughput_utilization = v.into();
11042 self
11043 }
11044
11045 /// Sets the value of [min_instances][crate::model::StandardSchedulerSettings::min_instances].
11046 ///
11047 /// # Example
11048 /// ```ignore,no_run
11049 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11050 /// let x = StandardSchedulerSettings::new().set_min_instances(42);
11051 /// ```
11052 pub fn set_min_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11053 self.min_instances = v.into();
11054 self
11055 }
11056
11057 /// Sets the value of [max_instances][crate::model::StandardSchedulerSettings::max_instances].
11058 ///
11059 /// # Example
11060 /// ```ignore,no_run
11061 /// # use google_cloud_appengine_v1::model::StandardSchedulerSettings;
11062 /// let x = StandardSchedulerSettings::new().set_max_instances(42);
11063 /// ```
11064 pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11065 self.max_instances = v.into();
11066 self
11067 }
11068}
11069
11070impl wkt::message::Message for StandardSchedulerSettings {
11071 fn typename() -> &'static str {
11072 "type.googleapis.com/google.appengine.v1.StandardSchedulerSettings"
11073 }
11074}
11075
11076/// Extra network settings.
11077/// Only applicable in the App Engine flexible environment.
11078#[derive(Clone, Default, PartialEq)]
11079#[non_exhaustive]
11080pub struct Network {
11081 /// List of ports, or port pairs, to forward from the virtual machine to the
11082 /// application container.
11083 /// Only applicable in the App Engine flexible environment.
11084 pub forwarded_ports: std::vec::Vec<std::string::String>,
11085
11086 /// Tag to apply to the instance during creation.
11087 /// Only applicable in the App Engine flexible environment.
11088 pub instance_tag: std::string::String,
11089
11090 /// Google Compute Engine network where the virtual machines are created.
11091 /// Specify the short name, not the resource path.
11092 ///
11093 /// Defaults to `default`.
11094 pub name: std::string::String,
11095
11096 /// Google Cloud Platform sub-network where the virtual machines are created.
11097 /// Specify the short name, not the resource path.
11098 ///
11099 /// If a subnetwork name is specified, a network name will also be required
11100 /// unless it is for the default network.
11101 ///
11102 /// * If the network that the instance is being created in is a Legacy network,
11103 /// then the IP address is allocated from the IPv4Range.
11104 /// * If the network that the instance is being created in is an auto Subnet
11105 /// Mode Network, then only network name should be specified (not the
11106 /// subnetwork_name) and the IP address is created from the IPCidrRange of the
11107 /// subnetwork that exists in that zone for that network.
11108 /// * If the network that the instance is being created in is a custom Subnet
11109 /// Mode Network, then the subnetwork_name must be specified and the
11110 /// IP address is created from the IPCidrRange of the subnetwork.
11111 ///
11112 /// If specified, the subnetwork must exist in the same region as the
11113 /// App Engine flexible environment application.
11114 pub subnetwork_name: std::string::String,
11115
11116 /// Enable session affinity.
11117 /// Only applicable in the App Engine flexible environment.
11118 pub session_affinity: bool,
11119
11120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11121}
11122
11123impl Network {
11124 pub fn new() -> Self {
11125 std::default::Default::default()
11126 }
11127
11128 /// Sets the value of [forwarded_ports][crate::model::Network::forwarded_ports].
11129 ///
11130 /// # Example
11131 /// ```ignore,no_run
11132 /// # use google_cloud_appengine_v1::model::Network;
11133 /// let x = Network::new().set_forwarded_ports(["a", "b", "c"]);
11134 /// ```
11135 pub fn set_forwarded_ports<T, V>(mut self, v: T) -> Self
11136 where
11137 T: std::iter::IntoIterator<Item = V>,
11138 V: std::convert::Into<std::string::String>,
11139 {
11140 use std::iter::Iterator;
11141 self.forwarded_ports = v.into_iter().map(|i| i.into()).collect();
11142 self
11143 }
11144
11145 /// Sets the value of [instance_tag][crate::model::Network::instance_tag].
11146 ///
11147 /// # Example
11148 /// ```ignore,no_run
11149 /// # use google_cloud_appengine_v1::model::Network;
11150 /// let x = Network::new().set_instance_tag("example");
11151 /// ```
11152 pub fn set_instance_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11153 self.instance_tag = v.into();
11154 self
11155 }
11156
11157 /// Sets the value of [name][crate::model::Network::name].
11158 ///
11159 /// # Example
11160 /// ```ignore,no_run
11161 /// # use google_cloud_appengine_v1::model::Network;
11162 /// let x = Network::new().set_name("example");
11163 /// ```
11164 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11165 self.name = v.into();
11166 self
11167 }
11168
11169 /// Sets the value of [subnetwork_name][crate::model::Network::subnetwork_name].
11170 ///
11171 /// # Example
11172 /// ```ignore,no_run
11173 /// # use google_cloud_appengine_v1::model::Network;
11174 /// let x = Network::new().set_subnetwork_name("example");
11175 /// ```
11176 pub fn set_subnetwork_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11177 self.subnetwork_name = v.into();
11178 self
11179 }
11180
11181 /// Sets the value of [session_affinity][crate::model::Network::session_affinity].
11182 ///
11183 /// # Example
11184 /// ```ignore,no_run
11185 /// # use google_cloud_appengine_v1::model::Network;
11186 /// let x = Network::new().set_session_affinity(true);
11187 /// ```
11188 pub fn set_session_affinity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11189 self.session_affinity = v.into();
11190 self
11191 }
11192}
11193
11194impl wkt::message::Message for Network {
11195 fn typename() -> &'static str {
11196 "type.googleapis.com/google.appengine.v1.Network"
11197 }
11198}
11199
11200/// Volumes mounted within the app container.
11201/// Only applicable in the App Engine flexible environment.
11202#[derive(Clone, Default, PartialEq)]
11203#[non_exhaustive]
11204pub struct Volume {
11205 /// Unique name for the volume.
11206 pub name: std::string::String,
11207
11208 /// Underlying volume type, e.g. 'tmpfs'.
11209 pub volume_type: std::string::String,
11210
11211 /// Volume size in gigabytes.
11212 pub size_gb: f64,
11213
11214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11215}
11216
11217impl Volume {
11218 pub fn new() -> Self {
11219 std::default::Default::default()
11220 }
11221
11222 /// Sets the value of [name][crate::model::Volume::name].
11223 ///
11224 /// # Example
11225 /// ```ignore,no_run
11226 /// # use google_cloud_appengine_v1::model::Volume;
11227 /// let x = Volume::new().set_name("example");
11228 /// ```
11229 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11230 self.name = v.into();
11231 self
11232 }
11233
11234 /// Sets the value of [volume_type][crate::model::Volume::volume_type].
11235 ///
11236 /// # Example
11237 /// ```ignore,no_run
11238 /// # use google_cloud_appengine_v1::model::Volume;
11239 /// let x = Volume::new().set_volume_type("example");
11240 /// ```
11241 pub fn set_volume_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11242 self.volume_type = v.into();
11243 self
11244 }
11245
11246 /// Sets the value of [size_gb][crate::model::Volume::size_gb].
11247 ///
11248 /// # Example
11249 /// ```ignore,no_run
11250 /// # use google_cloud_appengine_v1::model::Volume;
11251 /// let x = Volume::new().set_size_gb(42.0);
11252 /// ```
11253 pub fn set_size_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11254 self.size_gb = v.into();
11255 self
11256 }
11257}
11258
11259impl wkt::message::Message for Volume {
11260 fn typename() -> &'static str {
11261 "type.googleapis.com/google.appengine.v1.Volume"
11262 }
11263}
11264
11265/// Machine resources for a version.
11266#[derive(Clone, Default, PartialEq)]
11267#[non_exhaustive]
11268pub struct Resources {
11269 /// Number of CPU cores needed.
11270 pub cpu: f64,
11271
11272 /// Disk size (GB) needed.
11273 pub disk_gb: f64,
11274
11275 /// Memory (GB) needed.
11276 pub memory_gb: f64,
11277
11278 /// User specified volumes.
11279 pub volumes: std::vec::Vec<crate::model::Volume>,
11280
11281 /// The name of the encryption key that is stored in Google Cloud KMS.
11282 /// Only should be used by Cloud Composer to encrypt the vm disk
11283 pub kms_key_reference: std::string::String,
11284
11285 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11286}
11287
11288impl Resources {
11289 pub fn new() -> Self {
11290 std::default::Default::default()
11291 }
11292
11293 /// Sets the value of [cpu][crate::model::Resources::cpu].
11294 ///
11295 /// # Example
11296 /// ```ignore,no_run
11297 /// # use google_cloud_appengine_v1::model::Resources;
11298 /// let x = Resources::new().set_cpu(42.0);
11299 /// ```
11300 pub fn set_cpu<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11301 self.cpu = v.into();
11302 self
11303 }
11304
11305 /// Sets the value of [disk_gb][crate::model::Resources::disk_gb].
11306 ///
11307 /// # Example
11308 /// ```ignore,no_run
11309 /// # use google_cloud_appengine_v1::model::Resources;
11310 /// let x = Resources::new().set_disk_gb(42.0);
11311 /// ```
11312 pub fn set_disk_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11313 self.disk_gb = v.into();
11314 self
11315 }
11316
11317 /// Sets the value of [memory_gb][crate::model::Resources::memory_gb].
11318 ///
11319 /// # Example
11320 /// ```ignore,no_run
11321 /// # use google_cloud_appengine_v1::model::Resources;
11322 /// let x = Resources::new().set_memory_gb(42.0);
11323 /// ```
11324 pub fn set_memory_gb<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11325 self.memory_gb = v.into();
11326 self
11327 }
11328
11329 /// Sets the value of [volumes][crate::model::Resources::volumes].
11330 ///
11331 /// # Example
11332 /// ```ignore,no_run
11333 /// # use google_cloud_appengine_v1::model::Resources;
11334 /// use google_cloud_appengine_v1::model::Volume;
11335 /// let x = Resources::new()
11336 /// .set_volumes([
11337 /// Volume::default()/* use setters */,
11338 /// Volume::default()/* use (different) setters */,
11339 /// ]);
11340 /// ```
11341 pub fn set_volumes<T, V>(mut self, v: T) -> Self
11342 where
11343 T: std::iter::IntoIterator<Item = V>,
11344 V: std::convert::Into<crate::model::Volume>,
11345 {
11346 use std::iter::Iterator;
11347 self.volumes = v.into_iter().map(|i| i.into()).collect();
11348 self
11349 }
11350
11351 /// Sets the value of [kms_key_reference][crate::model::Resources::kms_key_reference].
11352 ///
11353 /// # Example
11354 /// ```ignore,no_run
11355 /// # use google_cloud_appengine_v1::model::Resources;
11356 /// let x = Resources::new().set_kms_key_reference("example");
11357 /// ```
11358 pub fn set_kms_key_reference<T: std::convert::Into<std::string::String>>(
11359 mut self,
11360 v: T,
11361 ) -> Self {
11362 self.kms_key_reference = v.into();
11363 self
11364 }
11365}
11366
11367impl wkt::message::Message for Resources {
11368 fn typename() -> &'static str {
11369 "type.googleapis.com/google.appengine.v1.Resources"
11370 }
11371}
11372
11373/// VPC access connector specification.
11374#[derive(Clone, Default, PartialEq)]
11375#[non_exhaustive]
11376pub struct VpcAccessConnector {
11377 /// Full Serverless VPC Access Connector name e.g.
11378 /// /projects/my-project/locations/us-central1/connectors/c1.
11379 pub name: std::string::String,
11380
11381 /// The egress setting for the connector, controlling what traffic is diverted
11382 /// through it.
11383 pub egress_setting: crate::model::vpc_access_connector::EgressSetting,
11384
11385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11386}
11387
11388impl VpcAccessConnector {
11389 pub fn new() -> Self {
11390 std::default::Default::default()
11391 }
11392
11393 /// Sets the value of [name][crate::model::VpcAccessConnector::name].
11394 ///
11395 /// # Example
11396 /// ```ignore,no_run
11397 /// # use google_cloud_appengine_v1::model::VpcAccessConnector;
11398 /// let x = VpcAccessConnector::new().set_name("example");
11399 /// ```
11400 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11401 self.name = v.into();
11402 self
11403 }
11404
11405 /// Sets the value of [egress_setting][crate::model::VpcAccessConnector::egress_setting].
11406 ///
11407 /// # Example
11408 /// ```ignore,no_run
11409 /// # use google_cloud_appengine_v1::model::VpcAccessConnector;
11410 /// use google_cloud_appengine_v1::model::vpc_access_connector::EgressSetting;
11411 /// let x0 = VpcAccessConnector::new().set_egress_setting(EgressSetting::AllTraffic);
11412 /// let x1 = VpcAccessConnector::new().set_egress_setting(EgressSetting::PrivateIpRanges);
11413 /// ```
11414 pub fn set_egress_setting<
11415 T: std::convert::Into<crate::model::vpc_access_connector::EgressSetting>,
11416 >(
11417 mut self,
11418 v: T,
11419 ) -> Self {
11420 self.egress_setting = v.into();
11421 self
11422 }
11423}
11424
11425impl wkt::message::Message for VpcAccessConnector {
11426 fn typename() -> &'static str {
11427 "type.googleapis.com/google.appengine.v1.VpcAccessConnector"
11428 }
11429}
11430
11431/// Defines additional types related to [VpcAccessConnector].
11432pub mod vpc_access_connector {
11433 #[allow(unused_imports)]
11434 use super::*;
11435
11436 /// Available egress settings.
11437 ///
11438 /// This controls what traffic is diverted through the VPC Access Connector
11439 /// resource. By default PRIVATE_IP_RANGES will be used.
11440 ///
11441 /// # Working with unknown values
11442 ///
11443 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11444 /// additional enum variants at any time. Adding new variants is not considered
11445 /// a breaking change. Applications should write their code in anticipation of:
11446 ///
11447 /// - New values appearing in future releases of the client library, **and**
11448 /// - New values received dynamically, without application changes.
11449 ///
11450 /// Please consult the [Working with enums] section in the user guide for some
11451 /// guidelines.
11452 ///
11453 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11454 #[derive(Clone, Debug, PartialEq)]
11455 #[non_exhaustive]
11456 pub enum EgressSetting {
11457 Unspecified,
11458 /// Force the use of VPC Access for all egress traffic from the function.
11459 AllTraffic,
11460 /// Use the VPC Access Connector for private IP space from RFC1918.
11461 PrivateIpRanges,
11462 /// If set, the enum was initialized with an unknown value.
11463 ///
11464 /// Applications can examine the value using [EgressSetting::value] or
11465 /// [EgressSetting::name].
11466 UnknownValue(egress_setting::UnknownValue),
11467 }
11468
11469 #[doc(hidden)]
11470 pub mod egress_setting {
11471 #[allow(unused_imports)]
11472 use super::*;
11473 #[derive(Clone, Debug, PartialEq)]
11474 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11475 }
11476
11477 impl EgressSetting {
11478 /// Gets the enum value.
11479 ///
11480 /// Returns `None` if the enum contains an unknown value deserialized from
11481 /// the string representation of enums.
11482 pub fn value(&self) -> std::option::Option<i32> {
11483 match self {
11484 Self::Unspecified => std::option::Option::Some(0),
11485 Self::AllTraffic => std::option::Option::Some(1),
11486 Self::PrivateIpRanges => std::option::Option::Some(2),
11487 Self::UnknownValue(u) => u.0.value(),
11488 }
11489 }
11490
11491 /// Gets the enum value as a string.
11492 ///
11493 /// Returns `None` if the enum contains an unknown value deserialized from
11494 /// the integer representation of enums.
11495 pub fn name(&self) -> std::option::Option<&str> {
11496 match self {
11497 Self::Unspecified => std::option::Option::Some("EGRESS_SETTING_UNSPECIFIED"),
11498 Self::AllTraffic => std::option::Option::Some("ALL_TRAFFIC"),
11499 Self::PrivateIpRanges => std::option::Option::Some("PRIVATE_IP_RANGES"),
11500 Self::UnknownValue(u) => u.0.name(),
11501 }
11502 }
11503 }
11504
11505 impl std::default::Default for EgressSetting {
11506 fn default() -> Self {
11507 use std::convert::From;
11508 Self::from(0)
11509 }
11510 }
11511
11512 impl std::fmt::Display for EgressSetting {
11513 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11514 wkt::internal::display_enum(f, self.name(), self.value())
11515 }
11516 }
11517
11518 impl std::convert::From<i32> for EgressSetting {
11519 fn from(value: i32) -> Self {
11520 match value {
11521 0 => Self::Unspecified,
11522 1 => Self::AllTraffic,
11523 2 => Self::PrivateIpRanges,
11524 _ => Self::UnknownValue(egress_setting::UnknownValue(
11525 wkt::internal::UnknownEnumValue::Integer(value),
11526 )),
11527 }
11528 }
11529 }
11530
11531 impl std::convert::From<&str> for EgressSetting {
11532 fn from(value: &str) -> Self {
11533 use std::string::ToString;
11534 match value {
11535 "EGRESS_SETTING_UNSPECIFIED" => Self::Unspecified,
11536 "ALL_TRAFFIC" => Self::AllTraffic,
11537 "PRIVATE_IP_RANGES" => Self::PrivateIpRanges,
11538 _ => Self::UnknownValue(egress_setting::UnknownValue(
11539 wkt::internal::UnknownEnumValue::String(value.to_string()),
11540 )),
11541 }
11542 }
11543 }
11544
11545 impl serde::ser::Serialize for EgressSetting {
11546 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11547 where
11548 S: serde::Serializer,
11549 {
11550 match self {
11551 Self::Unspecified => serializer.serialize_i32(0),
11552 Self::AllTraffic => serializer.serialize_i32(1),
11553 Self::PrivateIpRanges => serializer.serialize_i32(2),
11554 Self::UnknownValue(u) => u.0.serialize(serializer),
11555 }
11556 }
11557 }
11558
11559 impl<'de> serde::de::Deserialize<'de> for EgressSetting {
11560 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11561 where
11562 D: serde::Deserializer<'de>,
11563 {
11564 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EgressSetting>::new(
11565 ".google.appengine.v1.VpcAccessConnector.EgressSetting",
11566 ))
11567 }
11568 }
11569}
11570
11571/// The entrypoint for the application.
11572#[derive(Clone, Default, PartialEq)]
11573#[non_exhaustive]
11574pub struct Entrypoint {
11575 /// The command to run.
11576 pub command: std::option::Option<crate::model::entrypoint::Command>,
11577
11578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11579}
11580
11581impl Entrypoint {
11582 pub fn new() -> Self {
11583 std::default::Default::default()
11584 }
11585
11586 /// Sets the value of [command][crate::model::Entrypoint::command].
11587 ///
11588 /// Note that all the setters affecting `command` are mutually
11589 /// exclusive.
11590 ///
11591 /// # Example
11592 /// ```ignore,no_run
11593 /// # use google_cloud_appengine_v1::model::Entrypoint;
11594 /// use google_cloud_appengine_v1::model::entrypoint::Command;
11595 /// let x = Entrypoint::new().set_command(Some(Command::Shell("example".to_string())));
11596 /// ```
11597 pub fn set_command<
11598 T: std::convert::Into<std::option::Option<crate::model::entrypoint::Command>>,
11599 >(
11600 mut self,
11601 v: T,
11602 ) -> Self {
11603 self.command = v.into();
11604 self
11605 }
11606
11607 /// The value of [command][crate::model::Entrypoint::command]
11608 /// if it holds a `Shell`, `None` if the field is not set or
11609 /// holds a different branch.
11610 pub fn shell(&self) -> std::option::Option<&std::string::String> {
11611 #[allow(unreachable_patterns)]
11612 self.command.as_ref().and_then(|v| match v {
11613 crate::model::entrypoint::Command::Shell(v) => std::option::Option::Some(v),
11614 _ => std::option::Option::None,
11615 })
11616 }
11617
11618 /// Sets the value of [command][crate::model::Entrypoint::command]
11619 /// to hold a `Shell`.
11620 ///
11621 /// Note that all the setters affecting `command` are
11622 /// mutually exclusive.
11623 ///
11624 /// # Example
11625 /// ```ignore,no_run
11626 /// # use google_cloud_appengine_v1::model::Entrypoint;
11627 /// let x = Entrypoint::new().set_shell("example");
11628 /// assert!(x.shell().is_some());
11629 /// ```
11630 pub fn set_shell<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11631 self.command =
11632 std::option::Option::Some(crate::model::entrypoint::Command::Shell(v.into()));
11633 self
11634 }
11635}
11636
11637impl wkt::message::Message for Entrypoint {
11638 fn typename() -> &'static str {
11639 "type.googleapis.com/google.appengine.v1.Entrypoint"
11640 }
11641}
11642
11643/// Defines additional types related to [Entrypoint].
11644pub mod entrypoint {
11645 #[allow(unused_imports)]
11646 use super::*;
11647
11648 /// The command to run.
11649 #[derive(Clone, Debug, PartialEq)]
11650 #[non_exhaustive]
11651 pub enum Command {
11652 /// The format should be a shell command that can be fed to `bash -c`.
11653 Shell(std::string::String),
11654 }
11655}
11656
11657/// Actions to take when the user is not logged in.
11658///
11659/// # Working with unknown values
11660///
11661/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11662/// additional enum variants at any time. Adding new variants is not considered
11663/// a breaking change. Applications should write their code in anticipation of:
11664///
11665/// - New values appearing in future releases of the client library, **and**
11666/// - New values received dynamically, without application changes.
11667///
11668/// Please consult the [Working with enums] section in the user guide for some
11669/// guidelines.
11670///
11671/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11672#[derive(Clone, Debug, PartialEq)]
11673#[non_exhaustive]
11674pub enum AuthFailAction {
11675 /// Not specified. `AUTH_FAIL_ACTION_REDIRECT` is assumed.
11676 Unspecified,
11677 /// Redirects user to "accounts.google.com". The user is redirected back to the
11678 /// application URL after signing in or creating an account.
11679 Redirect,
11680 /// Rejects request with a `401` HTTP status code and an error
11681 /// message.
11682 Unauthorized,
11683 /// If set, the enum was initialized with an unknown value.
11684 ///
11685 /// Applications can examine the value using [AuthFailAction::value] or
11686 /// [AuthFailAction::name].
11687 UnknownValue(auth_fail_action::UnknownValue),
11688}
11689
11690#[doc(hidden)]
11691pub mod auth_fail_action {
11692 #[allow(unused_imports)]
11693 use super::*;
11694 #[derive(Clone, Debug, PartialEq)]
11695 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11696}
11697
11698impl AuthFailAction {
11699 /// Gets the enum value.
11700 ///
11701 /// Returns `None` if the enum contains an unknown value deserialized from
11702 /// the string representation of enums.
11703 pub fn value(&self) -> std::option::Option<i32> {
11704 match self {
11705 Self::Unspecified => std::option::Option::Some(0),
11706 Self::Redirect => std::option::Option::Some(1),
11707 Self::Unauthorized => std::option::Option::Some(2),
11708 Self::UnknownValue(u) => u.0.value(),
11709 }
11710 }
11711
11712 /// Gets the enum value as a string.
11713 ///
11714 /// Returns `None` if the enum contains an unknown value deserialized from
11715 /// the integer representation of enums.
11716 pub fn name(&self) -> std::option::Option<&str> {
11717 match self {
11718 Self::Unspecified => std::option::Option::Some("AUTH_FAIL_ACTION_UNSPECIFIED"),
11719 Self::Redirect => std::option::Option::Some("AUTH_FAIL_ACTION_REDIRECT"),
11720 Self::Unauthorized => std::option::Option::Some("AUTH_FAIL_ACTION_UNAUTHORIZED"),
11721 Self::UnknownValue(u) => u.0.name(),
11722 }
11723 }
11724}
11725
11726impl std::default::Default for AuthFailAction {
11727 fn default() -> Self {
11728 use std::convert::From;
11729 Self::from(0)
11730 }
11731}
11732
11733impl std::fmt::Display for AuthFailAction {
11734 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11735 wkt::internal::display_enum(f, self.name(), self.value())
11736 }
11737}
11738
11739impl std::convert::From<i32> for AuthFailAction {
11740 fn from(value: i32) -> Self {
11741 match value {
11742 0 => Self::Unspecified,
11743 1 => Self::Redirect,
11744 2 => Self::Unauthorized,
11745 _ => Self::UnknownValue(auth_fail_action::UnknownValue(
11746 wkt::internal::UnknownEnumValue::Integer(value),
11747 )),
11748 }
11749 }
11750}
11751
11752impl std::convert::From<&str> for AuthFailAction {
11753 fn from(value: &str) -> Self {
11754 use std::string::ToString;
11755 match value {
11756 "AUTH_FAIL_ACTION_UNSPECIFIED" => Self::Unspecified,
11757 "AUTH_FAIL_ACTION_REDIRECT" => Self::Redirect,
11758 "AUTH_FAIL_ACTION_UNAUTHORIZED" => Self::Unauthorized,
11759 _ => Self::UnknownValue(auth_fail_action::UnknownValue(
11760 wkt::internal::UnknownEnumValue::String(value.to_string()),
11761 )),
11762 }
11763 }
11764}
11765
11766impl serde::ser::Serialize for AuthFailAction {
11767 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11768 where
11769 S: serde::Serializer,
11770 {
11771 match self {
11772 Self::Unspecified => serializer.serialize_i32(0),
11773 Self::Redirect => serializer.serialize_i32(1),
11774 Self::Unauthorized => serializer.serialize_i32(2),
11775 Self::UnknownValue(u) => u.0.serialize(serializer),
11776 }
11777 }
11778}
11779
11780impl<'de> serde::de::Deserialize<'de> for AuthFailAction {
11781 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11782 where
11783 D: serde::Deserializer<'de>,
11784 {
11785 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthFailAction>::new(
11786 ".google.appengine.v1.AuthFailAction",
11787 ))
11788 }
11789}
11790
11791/// Methods to restrict access to a URL based on login status.
11792///
11793/// # Working with unknown values
11794///
11795/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11796/// additional enum variants at any time. Adding new variants is not considered
11797/// a breaking change. Applications should write their code in anticipation of:
11798///
11799/// - New values appearing in future releases of the client library, **and**
11800/// - New values received dynamically, without application changes.
11801///
11802/// Please consult the [Working with enums] section in the user guide for some
11803/// guidelines.
11804///
11805/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11806#[derive(Clone, Debug, PartialEq)]
11807#[non_exhaustive]
11808pub enum LoginRequirement {
11809 /// Not specified. `LOGIN_OPTIONAL` is assumed.
11810 LoginUnspecified,
11811 /// Does not require that the user is signed in.
11812 LoginOptional,
11813 /// If the user is not signed in, the `auth_fail_action` is taken.
11814 /// In addition, if the user is not an administrator for the
11815 /// application, they are given an error message regardless of
11816 /// `auth_fail_action`. If the user is an administrator, the handler
11817 /// proceeds.
11818 LoginAdmin,
11819 /// If the user has signed in, the handler proceeds normally. Otherwise, the
11820 /// auth_fail_action is taken.
11821 LoginRequired,
11822 /// If set, the enum was initialized with an unknown value.
11823 ///
11824 /// Applications can examine the value using [LoginRequirement::value] or
11825 /// [LoginRequirement::name].
11826 UnknownValue(login_requirement::UnknownValue),
11827}
11828
11829#[doc(hidden)]
11830pub mod login_requirement {
11831 #[allow(unused_imports)]
11832 use super::*;
11833 #[derive(Clone, Debug, PartialEq)]
11834 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11835}
11836
11837impl LoginRequirement {
11838 /// Gets the enum value.
11839 ///
11840 /// Returns `None` if the enum contains an unknown value deserialized from
11841 /// the string representation of enums.
11842 pub fn value(&self) -> std::option::Option<i32> {
11843 match self {
11844 Self::LoginUnspecified => std::option::Option::Some(0),
11845 Self::LoginOptional => std::option::Option::Some(1),
11846 Self::LoginAdmin => std::option::Option::Some(2),
11847 Self::LoginRequired => std::option::Option::Some(3),
11848 Self::UnknownValue(u) => u.0.value(),
11849 }
11850 }
11851
11852 /// Gets the enum value as a string.
11853 ///
11854 /// Returns `None` if the enum contains an unknown value deserialized from
11855 /// the integer representation of enums.
11856 pub fn name(&self) -> std::option::Option<&str> {
11857 match self {
11858 Self::LoginUnspecified => std::option::Option::Some("LOGIN_UNSPECIFIED"),
11859 Self::LoginOptional => std::option::Option::Some("LOGIN_OPTIONAL"),
11860 Self::LoginAdmin => std::option::Option::Some("LOGIN_ADMIN"),
11861 Self::LoginRequired => std::option::Option::Some("LOGIN_REQUIRED"),
11862 Self::UnknownValue(u) => u.0.name(),
11863 }
11864 }
11865}
11866
11867impl std::default::Default for LoginRequirement {
11868 fn default() -> Self {
11869 use std::convert::From;
11870 Self::from(0)
11871 }
11872}
11873
11874impl std::fmt::Display for LoginRequirement {
11875 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11876 wkt::internal::display_enum(f, self.name(), self.value())
11877 }
11878}
11879
11880impl std::convert::From<i32> for LoginRequirement {
11881 fn from(value: i32) -> Self {
11882 match value {
11883 0 => Self::LoginUnspecified,
11884 1 => Self::LoginOptional,
11885 2 => Self::LoginAdmin,
11886 3 => Self::LoginRequired,
11887 _ => Self::UnknownValue(login_requirement::UnknownValue(
11888 wkt::internal::UnknownEnumValue::Integer(value),
11889 )),
11890 }
11891 }
11892}
11893
11894impl std::convert::From<&str> for LoginRequirement {
11895 fn from(value: &str) -> Self {
11896 use std::string::ToString;
11897 match value {
11898 "LOGIN_UNSPECIFIED" => Self::LoginUnspecified,
11899 "LOGIN_OPTIONAL" => Self::LoginOptional,
11900 "LOGIN_ADMIN" => Self::LoginAdmin,
11901 "LOGIN_REQUIRED" => Self::LoginRequired,
11902 _ => Self::UnknownValue(login_requirement::UnknownValue(
11903 wkt::internal::UnknownEnumValue::String(value.to_string()),
11904 )),
11905 }
11906 }
11907}
11908
11909impl serde::ser::Serialize for LoginRequirement {
11910 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11911 where
11912 S: serde::Serializer,
11913 {
11914 match self {
11915 Self::LoginUnspecified => serializer.serialize_i32(0),
11916 Self::LoginOptional => serializer.serialize_i32(1),
11917 Self::LoginAdmin => serializer.serialize_i32(2),
11918 Self::LoginRequired => serializer.serialize_i32(3),
11919 Self::UnknownValue(u) => u.0.serialize(serializer),
11920 }
11921 }
11922}
11923
11924impl<'de> serde::de::Deserialize<'de> for LoginRequirement {
11925 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11926 where
11927 D: serde::Deserializer<'de>,
11928 {
11929 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoginRequirement>::new(
11930 ".google.appengine.v1.LoginRequirement",
11931 ))
11932 }
11933}
11934
11935/// Methods to enforce security (HTTPS) on a URL.
11936///
11937/// # Working with unknown values
11938///
11939/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11940/// additional enum variants at any time. Adding new variants is not considered
11941/// a breaking change. Applications should write their code in anticipation of:
11942///
11943/// - New values appearing in future releases of the client library, **and**
11944/// - New values received dynamically, without application changes.
11945///
11946/// Please consult the [Working with enums] section in the user guide for some
11947/// guidelines.
11948///
11949/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11950#[derive(Clone, Debug, PartialEq)]
11951#[non_exhaustive]
11952pub enum SecurityLevel {
11953 /// Not specified.
11954 SecureUnspecified,
11955 /// Both HTTP and HTTPS requests with URLs that match the handler succeed
11956 /// without redirects. The application can examine the request to determine
11957 /// which protocol was used, and respond accordingly.
11958 SecureDefault,
11959 /// Requests for a URL that match this handler that use HTTPS are automatically
11960 /// redirected to the HTTP equivalent URL.
11961 SecureNever,
11962 /// Both HTTP and HTTPS requests with URLs that match the handler succeed
11963 /// without redirects. The application can examine the request to determine
11964 /// which protocol was used and respond accordingly.
11965 SecureOptional,
11966 /// Requests for a URL that match this handler that do not use HTTPS are
11967 /// automatically redirected to the HTTPS URL with the same path. Query
11968 /// parameters are reserved for the redirect.
11969 SecureAlways,
11970 /// If set, the enum was initialized with an unknown value.
11971 ///
11972 /// Applications can examine the value using [SecurityLevel::value] or
11973 /// [SecurityLevel::name].
11974 UnknownValue(security_level::UnknownValue),
11975}
11976
11977#[doc(hidden)]
11978pub mod security_level {
11979 #[allow(unused_imports)]
11980 use super::*;
11981 #[derive(Clone, Debug, PartialEq)]
11982 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11983}
11984
11985impl SecurityLevel {
11986 /// Gets the enum value.
11987 ///
11988 /// Returns `None` if the enum contains an unknown value deserialized from
11989 /// the string representation of enums.
11990 pub fn value(&self) -> std::option::Option<i32> {
11991 match self {
11992 Self::SecureUnspecified => std::option::Option::Some(0),
11993 Self::SecureDefault => std::option::Option::Some(0),
11994 Self::SecureNever => std::option::Option::Some(1),
11995 Self::SecureOptional => std::option::Option::Some(2),
11996 Self::SecureAlways => std::option::Option::Some(3),
11997 Self::UnknownValue(u) => u.0.value(),
11998 }
11999 }
12000
12001 /// Gets the enum value as a string.
12002 ///
12003 /// Returns `None` if the enum contains an unknown value deserialized from
12004 /// the integer representation of enums.
12005 pub fn name(&self) -> std::option::Option<&str> {
12006 match self {
12007 Self::SecureUnspecified => std::option::Option::Some("SECURE_UNSPECIFIED"),
12008 Self::SecureDefault => std::option::Option::Some("SECURE_DEFAULT"),
12009 Self::SecureNever => std::option::Option::Some("SECURE_NEVER"),
12010 Self::SecureOptional => std::option::Option::Some("SECURE_OPTIONAL"),
12011 Self::SecureAlways => std::option::Option::Some("SECURE_ALWAYS"),
12012 Self::UnknownValue(u) => u.0.name(),
12013 }
12014 }
12015}
12016
12017impl std::default::Default for SecurityLevel {
12018 fn default() -> Self {
12019 use std::convert::From;
12020 Self::from(0)
12021 }
12022}
12023
12024impl std::fmt::Display for SecurityLevel {
12025 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12026 wkt::internal::display_enum(f, self.name(), self.value())
12027 }
12028}
12029
12030impl std::convert::From<i32> for SecurityLevel {
12031 fn from(value: i32) -> Self {
12032 match value {
12033 0 => Self::SecureDefault,
12034 1 => Self::SecureNever,
12035 2 => Self::SecureOptional,
12036 3 => Self::SecureAlways,
12037 _ => Self::UnknownValue(security_level::UnknownValue(
12038 wkt::internal::UnknownEnumValue::Integer(value),
12039 )),
12040 }
12041 }
12042}
12043
12044impl std::convert::From<&str> for SecurityLevel {
12045 fn from(value: &str) -> Self {
12046 use std::string::ToString;
12047 match value {
12048 "SECURE_UNSPECIFIED" => Self::SecureUnspecified,
12049 "SECURE_DEFAULT" => Self::SecureDefault,
12050 "SECURE_NEVER" => Self::SecureNever,
12051 "SECURE_OPTIONAL" => Self::SecureOptional,
12052 "SECURE_ALWAYS" => Self::SecureAlways,
12053 _ => Self::UnknownValue(security_level::UnknownValue(
12054 wkt::internal::UnknownEnumValue::String(value.to_string()),
12055 )),
12056 }
12057 }
12058}
12059
12060impl serde::ser::Serialize for SecurityLevel {
12061 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12062 where
12063 S: serde::Serializer,
12064 {
12065 match self {
12066 Self::SecureUnspecified => serializer.serialize_i32(0),
12067 Self::SecureDefault => serializer.serialize_i32(0),
12068 Self::SecureNever => serializer.serialize_i32(1),
12069 Self::SecureOptional => serializer.serialize_i32(2),
12070 Self::SecureAlways => serializer.serialize_i32(3),
12071 Self::UnknownValue(u) => u.0.serialize(serializer),
12072 }
12073 }
12074}
12075
12076impl<'de> serde::de::Deserialize<'de> for SecurityLevel {
12077 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12078 where
12079 D: serde::Deserializer<'de>,
12080 {
12081 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityLevel>::new(
12082 ".google.appengine.v1.SecurityLevel",
12083 ))
12084 }
12085}
12086
12087/// Fields that should be returned when [Version][google.appengine.v1.Version] resources
12088/// are retrieved.
12089///
12090/// [google.appengine.v1.Version]: crate::model::Version
12091///
12092/// # Working with unknown values
12093///
12094/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12095/// additional enum variants at any time. Adding new variants is not considered
12096/// a breaking change. Applications should write their code in anticipation of:
12097///
12098/// - New values appearing in future releases of the client library, **and**
12099/// - New values received dynamically, without application changes.
12100///
12101/// Please consult the [Working with enums] section in the user guide for some
12102/// guidelines.
12103///
12104/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12105#[derive(Clone, Debug, PartialEq)]
12106#[non_exhaustive]
12107pub enum VersionView {
12108 /// Basic version information including scaling and inbound services,
12109 /// but not detailed deployment information.
12110 Basic,
12111 /// The information from `BASIC`, plus detailed information about the
12112 /// deployment. This format is required when creating resources, but
12113 /// is not returned in `Get` or `List` by default.
12114 Full,
12115 /// If set, the enum was initialized with an unknown value.
12116 ///
12117 /// Applications can examine the value using [VersionView::value] or
12118 /// [VersionView::name].
12119 UnknownValue(version_view::UnknownValue),
12120}
12121
12122#[doc(hidden)]
12123pub mod version_view {
12124 #[allow(unused_imports)]
12125 use super::*;
12126 #[derive(Clone, Debug, PartialEq)]
12127 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12128}
12129
12130impl VersionView {
12131 /// Gets the enum value.
12132 ///
12133 /// Returns `None` if the enum contains an unknown value deserialized from
12134 /// the string representation of enums.
12135 pub fn value(&self) -> std::option::Option<i32> {
12136 match self {
12137 Self::Basic => std::option::Option::Some(0),
12138 Self::Full => std::option::Option::Some(1),
12139 Self::UnknownValue(u) => u.0.value(),
12140 }
12141 }
12142
12143 /// Gets the enum value as a string.
12144 ///
12145 /// Returns `None` if the enum contains an unknown value deserialized from
12146 /// the integer representation of enums.
12147 pub fn name(&self) -> std::option::Option<&str> {
12148 match self {
12149 Self::Basic => std::option::Option::Some("BASIC"),
12150 Self::Full => std::option::Option::Some("FULL"),
12151 Self::UnknownValue(u) => u.0.name(),
12152 }
12153 }
12154}
12155
12156impl std::default::Default for VersionView {
12157 fn default() -> Self {
12158 use std::convert::From;
12159 Self::from(0)
12160 }
12161}
12162
12163impl std::fmt::Display for VersionView {
12164 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12165 wkt::internal::display_enum(f, self.name(), self.value())
12166 }
12167}
12168
12169impl std::convert::From<i32> for VersionView {
12170 fn from(value: i32) -> Self {
12171 match value {
12172 0 => Self::Basic,
12173 1 => Self::Full,
12174 _ => Self::UnknownValue(version_view::UnknownValue(
12175 wkt::internal::UnknownEnumValue::Integer(value),
12176 )),
12177 }
12178 }
12179}
12180
12181impl std::convert::From<&str> for VersionView {
12182 fn from(value: &str) -> Self {
12183 use std::string::ToString;
12184 match value {
12185 "BASIC" => Self::Basic,
12186 "FULL" => Self::Full,
12187 _ => Self::UnknownValue(version_view::UnknownValue(
12188 wkt::internal::UnknownEnumValue::String(value.to_string()),
12189 )),
12190 }
12191 }
12192}
12193
12194impl serde::ser::Serialize for VersionView {
12195 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12196 where
12197 S: serde::Serializer,
12198 {
12199 match self {
12200 Self::Basic => serializer.serialize_i32(0),
12201 Self::Full => serializer.serialize_i32(1),
12202 Self::UnknownValue(u) => u.0.serialize(serializer),
12203 }
12204 }
12205}
12206
12207impl<'de> serde::de::Deserialize<'de> for VersionView {
12208 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12209 where
12210 D: serde::Deserializer<'de>,
12211 {
12212 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VersionView>::new(
12213 ".google.appengine.v1.VersionView",
12214 ))
12215 }
12216}
12217
12218/// Fields that should be returned when an AuthorizedCertificate resource is
12219/// retrieved.
12220///
12221/// # Working with unknown values
12222///
12223/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12224/// additional enum variants at any time. Adding new variants is not considered
12225/// a breaking change. Applications should write their code in anticipation of:
12226///
12227/// - New values appearing in future releases of the client library, **and**
12228/// - New values received dynamically, without application changes.
12229///
12230/// Please consult the [Working with enums] section in the user guide for some
12231/// guidelines.
12232///
12233/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12234#[derive(Clone, Debug, PartialEq)]
12235#[non_exhaustive]
12236pub enum AuthorizedCertificateView {
12237 /// Basic certificate information, including applicable domains and expiration
12238 /// date.
12239 BasicCertificate,
12240 /// The information from `BASIC_CERTIFICATE`, plus detailed information on the
12241 /// domain mappings that have this certificate mapped.
12242 FullCertificate,
12243 /// If set, the enum was initialized with an unknown value.
12244 ///
12245 /// Applications can examine the value using [AuthorizedCertificateView::value] or
12246 /// [AuthorizedCertificateView::name].
12247 UnknownValue(authorized_certificate_view::UnknownValue),
12248}
12249
12250#[doc(hidden)]
12251pub mod authorized_certificate_view {
12252 #[allow(unused_imports)]
12253 use super::*;
12254 #[derive(Clone, Debug, PartialEq)]
12255 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12256}
12257
12258impl AuthorizedCertificateView {
12259 /// Gets the enum value.
12260 ///
12261 /// Returns `None` if the enum contains an unknown value deserialized from
12262 /// the string representation of enums.
12263 pub fn value(&self) -> std::option::Option<i32> {
12264 match self {
12265 Self::BasicCertificate => std::option::Option::Some(0),
12266 Self::FullCertificate => std::option::Option::Some(1),
12267 Self::UnknownValue(u) => u.0.value(),
12268 }
12269 }
12270
12271 /// Gets the enum value as a string.
12272 ///
12273 /// Returns `None` if the enum contains an unknown value deserialized from
12274 /// the integer representation of enums.
12275 pub fn name(&self) -> std::option::Option<&str> {
12276 match self {
12277 Self::BasicCertificate => std::option::Option::Some("BASIC_CERTIFICATE"),
12278 Self::FullCertificate => std::option::Option::Some("FULL_CERTIFICATE"),
12279 Self::UnknownValue(u) => u.0.name(),
12280 }
12281 }
12282}
12283
12284impl std::default::Default for AuthorizedCertificateView {
12285 fn default() -> Self {
12286 use std::convert::From;
12287 Self::from(0)
12288 }
12289}
12290
12291impl std::fmt::Display for AuthorizedCertificateView {
12292 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12293 wkt::internal::display_enum(f, self.name(), self.value())
12294 }
12295}
12296
12297impl std::convert::From<i32> for AuthorizedCertificateView {
12298 fn from(value: i32) -> Self {
12299 match value {
12300 0 => Self::BasicCertificate,
12301 1 => Self::FullCertificate,
12302 _ => Self::UnknownValue(authorized_certificate_view::UnknownValue(
12303 wkt::internal::UnknownEnumValue::Integer(value),
12304 )),
12305 }
12306 }
12307}
12308
12309impl std::convert::From<&str> for AuthorizedCertificateView {
12310 fn from(value: &str) -> Self {
12311 use std::string::ToString;
12312 match value {
12313 "BASIC_CERTIFICATE" => Self::BasicCertificate,
12314 "FULL_CERTIFICATE" => Self::FullCertificate,
12315 _ => Self::UnknownValue(authorized_certificate_view::UnknownValue(
12316 wkt::internal::UnknownEnumValue::String(value.to_string()),
12317 )),
12318 }
12319 }
12320}
12321
12322impl serde::ser::Serialize for AuthorizedCertificateView {
12323 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12324 where
12325 S: serde::Serializer,
12326 {
12327 match self {
12328 Self::BasicCertificate => serializer.serialize_i32(0),
12329 Self::FullCertificate => serializer.serialize_i32(1),
12330 Self::UnknownValue(u) => u.0.serialize(serializer),
12331 }
12332 }
12333}
12334
12335impl<'de> serde::de::Deserialize<'de> for AuthorizedCertificateView {
12336 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12337 where
12338 D: serde::Deserializer<'de>,
12339 {
12340 deserializer.deserialize_any(
12341 wkt::internal::EnumVisitor::<AuthorizedCertificateView>::new(
12342 ".google.appengine.v1.AuthorizedCertificateView",
12343 ),
12344 )
12345 }
12346}
12347
12348/// Override strategy for mutating an existing mapping.
12349///
12350/// # Working with unknown values
12351///
12352/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12353/// additional enum variants at any time. Adding new variants is not considered
12354/// a breaking change. Applications should write their code in anticipation of:
12355///
12356/// - New values appearing in future releases of the client library, **and**
12357/// - New values received dynamically, without application changes.
12358///
12359/// Please consult the [Working with enums] section in the user guide for some
12360/// guidelines.
12361///
12362/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12363#[derive(Clone, Debug, PartialEq)]
12364#[non_exhaustive]
12365pub enum DomainOverrideStrategy {
12366 /// Strategy unspecified. Defaults to `STRICT`.
12367 UnspecifiedDomainOverrideStrategy,
12368 /// Overrides not allowed. If a mapping already exists for the
12369 /// specified domain, the request will return an ALREADY_EXISTS (409).
12370 Strict,
12371 /// Overrides allowed. If a mapping already exists for the specified domain,
12372 /// the request will overwrite it. Note that this might stop another
12373 /// Google product from serving. For example, if the domain is
12374 /// mapped to another App Engine application, that app will no
12375 /// longer serve from that domain.
12376 Override,
12377 /// If set, the enum was initialized with an unknown value.
12378 ///
12379 /// Applications can examine the value using [DomainOverrideStrategy::value] or
12380 /// [DomainOverrideStrategy::name].
12381 UnknownValue(domain_override_strategy::UnknownValue),
12382}
12383
12384#[doc(hidden)]
12385pub mod domain_override_strategy {
12386 #[allow(unused_imports)]
12387 use super::*;
12388 #[derive(Clone, Debug, PartialEq)]
12389 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12390}
12391
12392impl DomainOverrideStrategy {
12393 /// Gets the enum value.
12394 ///
12395 /// Returns `None` if the enum contains an unknown value deserialized from
12396 /// the string representation of enums.
12397 pub fn value(&self) -> std::option::Option<i32> {
12398 match self {
12399 Self::UnspecifiedDomainOverrideStrategy => std::option::Option::Some(0),
12400 Self::Strict => std::option::Option::Some(1),
12401 Self::Override => std::option::Option::Some(2),
12402 Self::UnknownValue(u) => u.0.value(),
12403 }
12404 }
12405
12406 /// Gets the enum value as a string.
12407 ///
12408 /// Returns `None` if the enum contains an unknown value deserialized from
12409 /// the integer representation of enums.
12410 pub fn name(&self) -> std::option::Option<&str> {
12411 match self {
12412 Self::UnspecifiedDomainOverrideStrategy => {
12413 std::option::Option::Some("UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY")
12414 }
12415 Self::Strict => std::option::Option::Some("STRICT"),
12416 Self::Override => std::option::Option::Some("OVERRIDE"),
12417 Self::UnknownValue(u) => u.0.name(),
12418 }
12419 }
12420}
12421
12422impl std::default::Default for DomainOverrideStrategy {
12423 fn default() -> Self {
12424 use std::convert::From;
12425 Self::from(0)
12426 }
12427}
12428
12429impl std::fmt::Display for DomainOverrideStrategy {
12430 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12431 wkt::internal::display_enum(f, self.name(), self.value())
12432 }
12433}
12434
12435impl std::convert::From<i32> for DomainOverrideStrategy {
12436 fn from(value: i32) -> Self {
12437 match value {
12438 0 => Self::UnspecifiedDomainOverrideStrategy,
12439 1 => Self::Strict,
12440 2 => Self::Override,
12441 _ => Self::UnknownValue(domain_override_strategy::UnknownValue(
12442 wkt::internal::UnknownEnumValue::Integer(value),
12443 )),
12444 }
12445 }
12446}
12447
12448impl std::convert::From<&str> for DomainOverrideStrategy {
12449 fn from(value: &str) -> Self {
12450 use std::string::ToString;
12451 match value {
12452 "UNSPECIFIED_DOMAIN_OVERRIDE_STRATEGY" => Self::UnspecifiedDomainOverrideStrategy,
12453 "STRICT" => Self::Strict,
12454 "OVERRIDE" => Self::Override,
12455 _ => Self::UnknownValue(domain_override_strategy::UnknownValue(
12456 wkt::internal::UnknownEnumValue::String(value.to_string()),
12457 )),
12458 }
12459 }
12460}
12461
12462impl serde::ser::Serialize for DomainOverrideStrategy {
12463 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12464 where
12465 S: serde::Serializer,
12466 {
12467 match self {
12468 Self::UnspecifiedDomainOverrideStrategy => serializer.serialize_i32(0),
12469 Self::Strict => serializer.serialize_i32(1),
12470 Self::Override => serializer.serialize_i32(2),
12471 Self::UnknownValue(u) => u.0.serialize(serializer),
12472 }
12473 }
12474}
12475
12476impl<'de> serde::de::Deserialize<'de> for DomainOverrideStrategy {
12477 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12478 where
12479 D: serde::Deserializer<'de>,
12480 {
12481 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DomainOverrideStrategy>::new(
12482 ".google.appengine.v1.DomainOverrideStrategy",
12483 ))
12484 }
12485}
12486
12487/// State of certificate management. Refers to the most recent certificate
12488/// acquisition or renewal attempt.
12489///
12490/// # Working with unknown values
12491///
12492/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12493/// additional enum variants at any time. Adding new variants is not considered
12494/// a breaking change. Applications should write their code in anticipation of:
12495///
12496/// - New values appearing in future releases of the client library, **and**
12497/// - New values received dynamically, without application changes.
12498///
12499/// Please consult the [Working with enums] section in the user guide for some
12500/// guidelines.
12501///
12502/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12503#[derive(Clone, Debug, PartialEq)]
12504#[non_exhaustive]
12505pub enum ManagementStatus {
12506 Unspecified,
12507 /// Certificate was successfully obtained and inserted into the serving
12508 /// system.
12509 Ok,
12510 /// Certificate is under active attempts to acquire or renew.
12511 Pending,
12512 /// Most recent renewal failed due to an invalid DNS setup and will be
12513 /// retried. Renewal attempts will continue to fail until the certificate
12514 /// domain's DNS configuration is fixed. The last successfully provisioned
12515 /// certificate may still be serving.
12516 FailedRetryingNotVisible,
12517 /// All renewal attempts have been exhausted, likely due to an invalid DNS
12518 /// setup.
12519 FailedPermanent,
12520 /// Most recent renewal failed due to an explicit CAA record that does not
12521 /// include one of the in-use CAs (Google CA and Let's Encrypt). Renewals will
12522 /// continue to fail until the CAA is reconfigured. The last successfully
12523 /// provisioned certificate may still be serving.
12524 FailedRetryingCaaForbidden,
12525 /// Most recent renewal failed due to a CAA retrieval failure. This means that
12526 /// the domain's DNS provider does not properly handle CAA records, failing
12527 /// requests for CAA records when no CAA records are defined. Renewals will
12528 /// continue to fail until the DNS provider is changed or a CAA record is
12529 /// added for the given domain. The last successfully provisioned certificate
12530 /// may still be serving.
12531 FailedRetryingCaaChecking,
12532 /// If set, the enum was initialized with an unknown value.
12533 ///
12534 /// Applications can examine the value using [ManagementStatus::value] or
12535 /// [ManagementStatus::name].
12536 UnknownValue(management_status::UnknownValue),
12537}
12538
12539#[doc(hidden)]
12540pub mod management_status {
12541 #[allow(unused_imports)]
12542 use super::*;
12543 #[derive(Clone, Debug, PartialEq)]
12544 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12545}
12546
12547impl ManagementStatus {
12548 /// Gets the enum value.
12549 ///
12550 /// Returns `None` if the enum contains an unknown value deserialized from
12551 /// the string representation of enums.
12552 pub fn value(&self) -> std::option::Option<i32> {
12553 match self {
12554 Self::Unspecified => std::option::Option::Some(0),
12555 Self::Ok => std::option::Option::Some(1),
12556 Self::Pending => std::option::Option::Some(2),
12557 Self::FailedRetryingNotVisible => std::option::Option::Some(4),
12558 Self::FailedPermanent => std::option::Option::Some(6),
12559 Self::FailedRetryingCaaForbidden => std::option::Option::Some(7),
12560 Self::FailedRetryingCaaChecking => std::option::Option::Some(8),
12561 Self::UnknownValue(u) => u.0.value(),
12562 }
12563 }
12564
12565 /// Gets the enum value as a string.
12566 ///
12567 /// Returns `None` if the enum contains an unknown value deserialized from
12568 /// the integer representation of enums.
12569 pub fn name(&self) -> std::option::Option<&str> {
12570 match self {
12571 Self::Unspecified => std::option::Option::Some("MANAGEMENT_STATUS_UNSPECIFIED"),
12572 Self::Ok => std::option::Option::Some("OK"),
12573 Self::Pending => std::option::Option::Some("PENDING"),
12574 Self::FailedRetryingNotVisible => {
12575 std::option::Option::Some("FAILED_RETRYING_NOT_VISIBLE")
12576 }
12577 Self::FailedPermanent => std::option::Option::Some("FAILED_PERMANENT"),
12578 Self::FailedRetryingCaaForbidden => {
12579 std::option::Option::Some("FAILED_RETRYING_CAA_FORBIDDEN")
12580 }
12581 Self::FailedRetryingCaaChecking => {
12582 std::option::Option::Some("FAILED_RETRYING_CAA_CHECKING")
12583 }
12584 Self::UnknownValue(u) => u.0.name(),
12585 }
12586 }
12587}
12588
12589impl std::default::Default for ManagementStatus {
12590 fn default() -> Self {
12591 use std::convert::From;
12592 Self::from(0)
12593 }
12594}
12595
12596impl std::fmt::Display for ManagementStatus {
12597 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12598 wkt::internal::display_enum(f, self.name(), self.value())
12599 }
12600}
12601
12602impl std::convert::From<i32> for ManagementStatus {
12603 fn from(value: i32) -> Self {
12604 match value {
12605 0 => Self::Unspecified,
12606 1 => Self::Ok,
12607 2 => Self::Pending,
12608 4 => Self::FailedRetryingNotVisible,
12609 6 => Self::FailedPermanent,
12610 7 => Self::FailedRetryingCaaForbidden,
12611 8 => Self::FailedRetryingCaaChecking,
12612 _ => Self::UnknownValue(management_status::UnknownValue(
12613 wkt::internal::UnknownEnumValue::Integer(value),
12614 )),
12615 }
12616 }
12617}
12618
12619impl std::convert::From<&str> for ManagementStatus {
12620 fn from(value: &str) -> Self {
12621 use std::string::ToString;
12622 match value {
12623 "MANAGEMENT_STATUS_UNSPECIFIED" => Self::Unspecified,
12624 "OK" => Self::Ok,
12625 "PENDING" => Self::Pending,
12626 "FAILED_RETRYING_NOT_VISIBLE" => Self::FailedRetryingNotVisible,
12627 "FAILED_PERMANENT" => Self::FailedPermanent,
12628 "FAILED_RETRYING_CAA_FORBIDDEN" => Self::FailedRetryingCaaForbidden,
12629 "FAILED_RETRYING_CAA_CHECKING" => Self::FailedRetryingCaaChecking,
12630 _ => Self::UnknownValue(management_status::UnknownValue(
12631 wkt::internal::UnknownEnumValue::String(value.to_string()),
12632 )),
12633 }
12634 }
12635}
12636
12637impl serde::ser::Serialize for ManagementStatus {
12638 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12639 where
12640 S: serde::Serializer,
12641 {
12642 match self {
12643 Self::Unspecified => serializer.serialize_i32(0),
12644 Self::Ok => serializer.serialize_i32(1),
12645 Self::Pending => serializer.serialize_i32(2),
12646 Self::FailedRetryingNotVisible => serializer.serialize_i32(4),
12647 Self::FailedPermanent => serializer.serialize_i32(6),
12648 Self::FailedRetryingCaaForbidden => serializer.serialize_i32(7),
12649 Self::FailedRetryingCaaChecking => serializer.serialize_i32(8),
12650 Self::UnknownValue(u) => u.0.serialize(serializer),
12651 }
12652 }
12653}
12654
12655impl<'de> serde::de::Deserialize<'de> for ManagementStatus {
12656 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12657 where
12658 D: serde::Deserializer<'de>,
12659 {
12660 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManagementStatus>::new(
12661 ".google.appengine.v1.ManagementStatus",
12662 ))
12663 }
12664}
12665
12666/// Available inbound services.
12667///
12668/// # Working with unknown values
12669///
12670/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12671/// additional enum variants at any time. Adding new variants is not considered
12672/// a breaking change. Applications should write their code in anticipation of:
12673///
12674/// - New values appearing in future releases of the client library, **and**
12675/// - New values received dynamically, without application changes.
12676///
12677/// Please consult the [Working with enums] section in the user guide for some
12678/// guidelines.
12679///
12680/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12681#[derive(Clone, Debug, PartialEq)]
12682#[non_exhaustive]
12683pub enum InboundServiceType {
12684 /// Not specified.
12685 InboundServiceUnspecified,
12686 /// Allows an application to receive mail.
12687 InboundServiceMail,
12688 /// Allows an application to receive email-bound notifications.
12689 InboundServiceMailBounce,
12690 /// Allows an application to receive error stanzas.
12691 InboundServiceXmppError,
12692 /// Allows an application to receive instant messages.
12693 InboundServiceXmppMessage,
12694 /// Allows an application to receive user subscription POSTs.
12695 InboundServiceXmppSubscribe,
12696 /// Allows an application to receive a user's chat presence.
12697 InboundServiceXmppPresence,
12698 /// Registers an application for notifications when a client connects or
12699 /// disconnects from a channel.
12700 InboundServiceChannelPresence,
12701 /// Enables warmup requests.
12702 InboundServiceWarmup,
12703 /// If set, the enum was initialized with an unknown value.
12704 ///
12705 /// Applications can examine the value using [InboundServiceType::value] or
12706 /// [InboundServiceType::name].
12707 UnknownValue(inbound_service_type::UnknownValue),
12708}
12709
12710#[doc(hidden)]
12711pub mod inbound_service_type {
12712 #[allow(unused_imports)]
12713 use super::*;
12714 #[derive(Clone, Debug, PartialEq)]
12715 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12716}
12717
12718impl InboundServiceType {
12719 /// Gets the enum value.
12720 ///
12721 /// Returns `None` if the enum contains an unknown value deserialized from
12722 /// the string representation of enums.
12723 pub fn value(&self) -> std::option::Option<i32> {
12724 match self {
12725 Self::InboundServiceUnspecified => std::option::Option::Some(0),
12726 Self::InboundServiceMail => std::option::Option::Some(1),
12727 Self::InboundServiceMailBounce => std::option::Option::Some(2),
12728 Self::InboundServiceXmppError => std::option::Option::Some(3),
12729 Self::InboundServiceXmppMessage => std::option::Option::Some(4),
12730 Self::InboundServiceXmppSubscribe => std::option::Option::Some(5),
12731 Self::InboundServiceXmppPresence => std::option::Option::Some(6),
12732 Self::InboundServiceChannelPresence => std::option::Option::Some(7),
12733 Self::InboundServiceWarmup => std::option::Option::Some(9),
12734 Self::UnknownValue(u) => u.0.value(),
12735 }
12736 }
12737
12738 /// Gets the enum value as a string.
12739 ///
12740 /// Returns `None` if the enum contains an unknown value deserialized from
12741 /// the integer representation of enums.
12742 pub fn name(&self) -> std::option::Option<&str> {
12743 match self {
12744 Self::InboundServiceUnspecified => {
12745 std::option::Option::Some("INBOUND_SERVICE_UNSPECIFIED")
12746 }
12747 Self::InboundServiceMail => std::option::Option::Some("INBOUND_SERVICE_MAIL"),
12748 Self::InboundServiceMailBounce => {
12749 std::option::Option::Some("INBOUND_SERVICE_MAIL_BOUNCE")
12750 }
12751 Self::InboundServiceXmppError => {
12752 std::option::Option::Some("INBOUND_SERVICE_XMPP_ERROR")
12753 }
12754 Self::InboundServiceXmppMessage => {
12755 std::option::Option::Some("INBOUND_SERVICE_XMPP_MESSAGE")
12756 }
12757 Self::InboundServiceXmppSubscribe => {
12758 std::option::Option::Some("INBOUND_SERVICE_XMPP_SUBSCRIBE")
12759 }
12760 Self::InboundServiceXmppPresence => {
12761 std::option::Option::Some("INBOUND_SERVICE_XMPP_PRESENCE")
12762 }
12763 Self::InboundServiceChannelPresence => {
12764 std::option::Option::Some("INBOUND_SERVICE_CHANNEL_PRESENCE")
12765 }
12766 Self::InboundServiceWarmup => std::option::Option::Some("INBOUND_SERVICE_WARMUP"),
12767 Self::UnknownValue(u) => u.0.name(),
12768 }
12769 }
12770}
12771
12772impl std::default::Default for InboundServiceType {
12773 fn default() -> Self {
12774 use std::convert::From;
12775 Self::from(0)
12776 }
12777}
12778
12779impl std::fmt::Display for InboundServiceType {
12780 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12781 wkt::internal::display_enum(f, self.name(), self.value())
12782 }
12783}
12784
12785impl std::convert::From<i32> for InboundServiceType {
12786 fn from(value: i32) -> Self {
12787 match value {
12788 0 => Self::InboundServiceUnspecified,
12789 1 => Self::InboundServiceMail,
12790 2 => Self::InboundServiceMailBounce,
12791 3 => Self::InboundServiceXmppError,
12792 4 => Self::InboundServiceXmppMessage,
12793 5 => Self::InboundServiceXmppSubscribe,
12794 6 => Self::InboundServiceXmppPresence,
12795 7 => Self::InboundServiceChannelPresence,
12796 9 => Self::InboundServiceWarmup,
12797 _ => Self::UnknownValue(inbound_service_type::UnknownValue(
12798 wkt::internal::UnknownEnumValue::Integer(value),
12799 )),
12800 }
12801 }
12802}
12803
12804impl std::convert::From<&str> for InboundServiceType {
12805 fn from(value: &str) -> Self {
12806 use std::string::ToString;
12807 match value {
12808 "INBOUND_SERVICE_UNSPECIFIED" => Self::InboundServiceUnspecified,
12809 "INBOUND_SERVICE_MAIL" => Self::InboundServiceMail,
12810 "INBOUND_SERVICE_MAIL_BOUNCE" => Self::InboundServiceMailBounce,
12811 "INBOUND_SERVICE_XMPP_ERROR" => Self::InboundServiceXmppError,
12812 "INBOUND_SERVICE_XMPP_MESSAGE" => Self::InboundServiceXmppMessage,
12813 "INBOUND_SERVICE_XMPP_SUBSCRIBE" => Self::InboundServiceXmppSubscribe,
12814 "INBOUND_SERVICE_XMPP_PRESENCE" => Self::InboundServiceXmppPresence,
12815 "INBOUND_SERVICE_CHANNEL_PRESENCE" => Self::InboundServiceChannelPresence,
12816 "INBOUND_SERVICE_WARMUP" => Self::InboundServiceWarmup,
12817 _ => Self::UnknownValue(inbound_service_type::UnknownValue(
12818 wkt::internal::UnknownEnumValue::String(value.to_string()),
12819 )),
12820 }
12821 }
12822}
12823
12824impl serde::ser::Serialize for InboundServiceType {
12825 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12826 where
12827 S: serde::Serializer,
12828 {
12829 match self {
12830 Self::InboundServiceUnspecified => serializer.serialize_i32(0),
12831 Self::InboundServiceMail => serializer.serialize_i32(1),
12832 Self::InboundServiceMailBounce => serializer.serialize_i32(2),
12833 Self::InboundServiceXmppError => serializer.serialize_i32(3),
12834 Self::InboundServiceXmppMessage => serializer.serialize_i32(4),
12835 Self::InboundServiceXmppSubscribe => serializer.serialize_i32(5),
12836 Self::InboundServiceXmppPresence => serializer.serialize_i32(6),
12837 Self::InboundServiceChannelPresence => serializer.serialize_i32(7),
12838 Self::InboundServiceWarmup => serializer.serialize_i32(9),
12839 Self::UnknownValue(u) => u.0.serialize(serializer),
12840 }
12841 }
12842}
12843
12844impl<'de> serde::de::Deserialize<'de> for InboundServiceType {
12845 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12846 where
12847 D: serde::Deserializer<'de>,
12848 {
12849 deserializer.deserialize_any(wkt::internal::EnumVisitor::<InboundServiceType>::new(
12850 ".google.appengine.v1.InboundServiceType",
12851 ))
12852 }
12853}
12854
12855/// Run states of a version.
12856///
12857/// # Working with unknown values
12858///
12859/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12860/// additional enum variants at any time. Adding new variants is not considered
12861/// a breaking change. Applications should write their code in anticipation of:
12862///
12863/// - New values appearing in future releases of the client library, **and**
12864/// - New values received dynamically, without application changes.
12865///
12866/// Please consult the [Working with enums] section in the user guide for some
12867/// guidelines.
12868///
12869/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12870#[derive(Clone, Debug, PartialEq)]
12871#[non_exhaustive]
12872pub enum ServingStatus {
12873 /// Not specified.
12874 Unspecified,
12875 /// Currently serving. Instances are created according to the
12876 /// scaling settings of the version.
12877 Serving,
12878 /// Disabled. No instances will be created and the scaling
12879 /// settings are ignored until the state of the version changes
12880 /// to `SERVING`.
12881 Stopped,
12882 /// If set, the enum was initialized with an unknown value.
12883 ///
12884 /// Applications can examine the value using [ServingStatus::value] or
12885 /// [ServingStatus::name].
12886 UnknownValue(serving_status::UnknownValue),
12887}
12888
12889#[doc(hidden)]
12890pub mod serving_status {
12891 #[allow(unused_imports)]
12892 use super::*;
12893 #[derive(Clone, Debug, PartialEq)]
12894 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12895}
12896
12897impl ServingStatus {
12898 /// Gets the enum value.
12899 ///
12900 /// Returns `None` if the enum contains an unknown value deserialized from
12901 /// the string representation of enums.
12902 pub fn value(&self) -> std::option::Option<i32> {
12903 match self {
12904 Self::Unspecified => std::option::Option::Some(0),
12905 Self::Serving => std::option::Option::Some(1),
12906 Self::Stopped => std::option::Option::Some(2),
12907 Self::UnknownValue(u) => u.0.value(),
12908 }
12909 }
12910
12911 /// Gets the enum value as a string.
12912 ///
12913 /// Returns `None` if the enum contains an unknown value deserialized from
12914 /// the integer representation of enums.
12915 pub fn name(&self) -> std::option::Option<&str> {
12916 match self {
12917 Self::Unspecified => std::option::Option::Some("SERVING_STATUS_UNSPECIFIED"),
12918 Self::Serving => std::option::Option::Some("SERVING"),
12919 Self::Stopped => std::option::Option::Some("STOPPED"),
12920 Self::UnknownValue(u) => u.0.name(),
12921 }
12922 }
12923}
12924
12925impl std::default::Default for ServingStatus {
12926 fn default() -> Self {
12927 use std::convert::From;
12928 Self::from(0)
12929 }
12930}
12931
12932impl std::fmt::Display for ServingStatus {
12933 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12934 wkt::internal::display_enum(f, self.name(), self.value())
12935 }
12936}
12937
12938impl std::convert::From<i32> for ServingStatus {
12939 fn from(value: i32) -> Self {
12940 match value {
12941 0 => Self::Unspecified,
12942 1 => Self::Serving,
12943 2 => Self::Stopped,
12944 _ => Self::UnknownValue(serving_status::UnknownValue(
12945 wkt::internal::UnknownEnumValue::Integer(value),
12946 )),
12947 }
12948 }
12949}
12950
12951impl std::convert::From<&str> for ServingStatus {
12952 fn from(value: &str) -> Self {
12953 use std::string::ToString;
12954 match value {
12955 "SERVING_STATUS_UNSPECIFIED" => Self::Unspecified,
12956 "SERVING" => Self::Serving,
12957 "STOPPED" => Self::Stopped,
12958 _ => Self::UnknownValue(serving_status::UnknownValue(
12959 wkt::internal::UnknownEnumValue::String(value.to_string()),
12960 )),
12961 }
12962 }
12963}
12964
12965impl serde::ser::Serialize for ServingStatus {
12966 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12967 where
12968 S: serde::Serializer,
12969 {
12970 match self {
12971 Self::Unspecified => serializer.serialize_i32(0),
12972 Self::Serving => serializer.serialize_i32(1),
12973 Self::Stopped => serializer.serialize_i32(2),
12974 Self::UnknownValue(u) => u.0.serialize(serializer),
12975 }
12976 }
12977}
12978
12979impl<'de> serde::de::Deserialize<'de> for ServingStatus {
12980 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12981 where
12982 D: serde::Deserializer<'de>,
12983 {
12984 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServingStatus>::new(
12985 ".google.appengine.v1.ServingStatus",
12986 ))
12987 }
12988}